:root {
  --bg: #0b0f14;
  --panel: #121922;
  --panel-2: #18212c;
  --line: #233040;
  --text: #e6edf3;
  --muted: #8b9bb0;
  --accent: #3ddc97;
  --accent-2: #4aa8ff;
  --warn: #f5b455;
  --danger: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 6px; word-break: break-all; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; }

header.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(11, 15, 20, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
header nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
header nav a { color: var(--muted); padding: 0.35rem 0.7rem; border-radius: 999px; font-size: 0.95rem; }
header nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
header nav a[aria-current="page"] { color: var(--bg); background: var(--accent); }

main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 4rem; }
section { margin: 3rem 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 1rem; }
h2 { font-size: 1.7rem; margin-bottom: 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--accent); margin: 0 0 0.4rem; }

.hero { padding: 4.5rem 0 1.5rem; }
.hero.small { padding: 3rem 0 0.5rem; }
.cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.65rem 1.2rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}
.button:hover, button:hover { border-color: var(--accent); text-decoration: none; }
.button.primary, button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
button.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.card h3 { margin-top: 0; }
.card.muted { opacity: 0.75; }
.card.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.post-card h3 a { color: var(--text); }

.plan .price { font-size: 2.4rem; font-weight: 800; margin: 0.2rem 0; }
.plan .price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.plan ul { padding-left: 1.1rem; color: var(--muted); }
.plan li strong { color: var(--text); }

.notice { background: rgba(245, 180, 85, 0.08); border: 1px solid rgba(245, 180, 85, 0.4); border-radius: var(--radius); padding: 1rem 1.2rem; }
.notice.ok { background: rgba(61, 220, 151, 0.08); border-color: rgba(61, 220, 151, 0.4); }
.notice.err { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.45); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.2rem; }
.prose li { margin: 0.3rem 0; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1rem 0; padding: 0.2rem 1rem; color: var(--muted); }
.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.6rem; }
.back { margin-top: 2.5rem; }

.social { margin: 1.2rem 0; }
.drafts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.drafts h4 { margin: 0 0 0.4rem; display: flex; justify-content: space-between; }
.count { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
textarea, input, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem;
}
textarea { resize: vertical; margin-bottom: 0.5rem; font-size: 0.92rem; }
label { display: block; font-size: 0.9rem; color: var(--muted); margin: 0.8rem 0 0.3rem; }

.split { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.meter { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 0.6rem 0; }
.meter > span { display: block; height: 100%; background: var(--accent); width: 0; }
.meter.low > span { background: var(--warn); }
.meter.empty > span { background: var(--danger); }
.key { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; word-break: break-all; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.hidden { display: none !important; }

.files td code { font-size: 0.78rem; }

.brand small { font-weight: 500; font-size: 0.78rem; color: var(--muted); letter-spacing: 0; margin-left: 0.25rem; }
.lang-switch { display: flex; align-items: center; }
.lang-select {
  width: auto; padding: 0.35rem 2rem 0.35rem 0.75rem; font-size: 0.9rem; border-radius: 999px; cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b9bb0'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
  appearance: none; -webkit-appearance: none;
}
.lang-select:hover, .lang-select:focus { border-color: var(--accent); outline: none; }
header nav.langs a { font-size: 0.8rem; padding: 0.25rem 0.5rem; text-transform: uppercase; letter-spacing: 0.04em; }

.hero-img { display: block; width: 100%; height: auto; margin-top: 2.5rem; border-radius: var(--radius); border: 1px solid var(--line); }
.usecases { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.usecase { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.usecase img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.usecase > div { padding: 1.2rem 1.4rem 1.4rem; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); margin: 1rem 0; }
.prose.wide { max-width: none; }
.prose.wide .table-wrap { margin: 0.5rem 0 1.5rem; }
.prose.wide table td:first-child { white-space: nowrap; }

.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.tabs button { border: none; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--panel); box-shadow: 0 -2px 0 var(--accent) inset; }
.editor .fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.editor textarea.md { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem; min-height: 22rem; }
.check { display: flex; gap: 0.5rem; align-items: center; color: var(--text); }
.check input { width: auto; }
.lang-badge { display: inline-block; font-size: 0.75rem; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 0 0.45rem; margin: 0 0.2rem 0.2rem 0; }
.lang-badge.draft { border-style: dashed; color: var(--warn); }
.lang-list { list-style: none; padding: 0; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.lang-list a { display: inline-block; padding: 0.7rem 1.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); }
.lang-list a:hover { border-color: var(--accent); text-decoration: none; }

.trial-banner { display: inline-block; margin: 0.5rem 0 0; padding: 0.4rem 0.9rem; border-radius: 999px; background: rgba(61, 220, 151, 0.1); border: 1px solid rgba(61, 220, 151, 0.4); color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.interval-toggle { display: inline-flex; gap: 0.25rem; padding: 0.25rem; margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.interval-toggle button { border: none; background: transparent; color: var(--muted); padding: 0.45rem 1rem; }
.interval-toggle button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
.save { font-size: 0.75rem; color: var(--bg); background: var(--accent); border-radius: 999px; padding: 0.05rem 0.45rem; }
.save:empty { display: none; }
.plans4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan .tagline { color: var(--muted); margin: 0 0 0.6rem; }
.plan .billed { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.6rem; }
.plan input[type="number"] { width: 6rem; }

.narrow { max-width: 28rem; }
.muted-text { color: var(--muted); font-size: 0.88rem; margin: 0.3rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { padding: 1.1rem; }
.kpi-value { font-size: 1.8rem; font-weight: 800; margin: 0.1rem 0; letter-spacing: -0.02em; }
.bars { display: grid; gap: 0.45rem; }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr minmax(3rem, auto); gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent-2); border-radius: 999px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: 0.6rem; }
.spark > span { flex: 1; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: 0.85; }
.spark > span:hover { opacity: 1; }
.filters { margin: 0.8rem 0; }
.filters input { flex: 2 1 14rem; width: auto; }
.filters select { flex: 1 1 9rem; width: auto; }
.table-wrap { overflow-x: auto; }
.table-wrap td { font-size: 0.9rem; }
.plan-tag { font-weight: 600; }
.plan-trial { color: var(--warn); }
.plan-max { color: var(--accent-2); }
.plan-pro, .plan-team { color: var(--accent); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; text-align: center; padding: 2rem 1rem; }
footer p { margin: 0.2rem 0; }

/* Models / Applications pages: live catalog (models.js) */
.catalog-live { margin-top: 2.5rem; }
.catalog-live .muted { color: var(--muted); }
.catalog-live .small { font-size: 0.85rem; }

.catalog-switch { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 1.4rem; }
.switch-card {
  display: grid; gap: 0.15rem; padding: 1rem 1.2rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.switch-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.switch-card.active { border-color: var(--accent); background: linear-gradient(135deg, rgba(61, 220, 151, 0.14), rgba(61, 220, 151, 0.03)); }
.switch-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.switch-count { color: var(--accent); font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.switch-card:not(.active) .switch-count { color: var(--muted); }
.switch-hint { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

.catalog-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem 0.9rem; }
.catalog-search { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.9rem; }
.catalog-search .filter-label { min-width: 0; }
.catalog-search input {
  flex: 1 1 18rem; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.9rem; font: inherit;
}
.catalog-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.15); }
.catalog-controls { display: grid; gap: 0.45rem; }
.filter-row { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.6rem; align-items: start; padding: 0.3rem 0; border-top: 1px solid var(--line); }
.filter-row:first-child { border-top: none; }
.filter-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 0.35rem; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.chip { font-size: 0.82rem; font-weight: 500; padding: 0.22rem 0.7rem; border-radius: 999px; background: var(--bg); }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.catalog-advanced { color: var(--muted); font-size: 0.85rem; display: flex; gap: 0.5rem; align-items: center; margin: 0.6rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.catalog-advanced input { width: auto; margin: 0; accent-color: var(--accent); }

.catalog-count { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1.2rem 0 0.8rem; color: var(--text); }
.count-dep { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.6rem; }
.count-dep::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: 0.4rem; background: var(--dep, var(--muted)); vertical-align: 0.05rem; }

.recipe-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); }
.recipe-card { padding: 1.2rem 1.3rem 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; border-left: 3px solid var(--dep, var(--line)); min-width: 0; }
.recipe-card[data-deployment="cloud"], .dep-cloud { --dep: var(--accent-2); }
.recipe-card[data-deployment="docker"], .dep-docker { --dep: var(--accent); }
.recipe-card[data-deployment="native"], .dep-native { --dep: #c792ea; }
.recipe-card[data-deployment="reference"], .dep-reference { --dep: var(--muted); }
.recipe-head { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; }
.recipe-title { min-width: 0; }
.recipe-title h3 { margin: 0 0 0.15rem; font-size: 1.08rem; line-height: 1.3; overflow-wrap: anywhere; }
.recipe-title .small { overflow-wrap: anywhere; }
.stars { color: var(--warn); font-size: 1.05rem; letter-spacing: 0.08em; white-space: nowrap; flex-shrink: 0; }
.stars.none { color: var(--muted); font-size: 0.8rem; letter-spacing: 0; border: 1px dashed var(--line); border-radius: 999px; padding: 0.1rem 0.55rem; }
.badges { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tag.dep { color: var(--dep, var(--muted)); border-color: color-mix(in srgb, var(--dep, var(--muted)) 55%, transparent); font-weight: 600; }
.tag.warn { color: var(--warn); border-color: rgba(245, 180, 85, 0.5); }

.recipe-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 0.5rem; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 0.5rem 0.7rem; display: grid; gap: 0.05rem; min-width: 0; }
.stat-value { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }

.recipe-facts { display: grid; gap: 0.7rem 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); font-size: 0.92rem; }
.fact { min-width: 0; display: grid; gap: 0.15rem; align-content: start; }
.fact-label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.fact code { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 0.78rem; }
.fact a { display: inline-block; }
.recipe-notes { margin: 0; padding-top: 0.6rem; border-top: 1px solid var(--line); line-height: 1.5; }
.recipe-limits { margin: 0; padding-left: 1.1rem; line-height: 1.45; }
.recipe-limits li { margin: 0.15rem 0; }

@media (max-width: 640px) {
  .filter-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .filter-label { padding-top: 0; }
  .catalog-panel { padding: 0.9rem 0.9rem 0.8rem; }
  .recipe-card { padding: 1rem; }
}
