:root {
  --ink: #0a0a0a;
  --ink-2: #111111;
  --ink-3: #191919;
  --paper: #f4f2ee;
  --white: #ffffff;
  --muted: #a09e9a;
  --line: rgba(255,255,255,.14);
  --red: #f04438;
  --red-dark: #c92d24;
  --green: #99e84d;
  --font: Inter, "Helvetica Neue", Arial, sans-serif;
  --max: 1440px;

  /* Editorial Terminal foundation (Stage 6.1) */
  /* Surfaces: --surface for data panels, --surface-2 for skeletons/hover */
  --surface: #101010;
  --surface-2: #181818;
  /* Text contrast scale: meaningful text never darker than --muted-min */
  --muted-min: #8a8a8a;
  --muted-mid: #9a9a9a;
  --muted-strong: #b9b9b9;
  /* Decorative only (never for meaningful text) */
  --faint: #5a5a5a;
  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 14px;
  --space-4: 22px;
  --space-5: 34px;
  --space-6: 56px;
  --space-7: 80px;
  --space-8: 120px;
  /* Density modes: marketing (spacious) vs data (compact) */
  --pad-marketing: clamp(80px, 9vw, 120px);
  --pad-data: var(--space-6);
  --row-data: 88px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--white); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
::selection { background: var(--red); color: white; }

/* Native control styling — scrollbars, checkboxes, radios, selects */
* { scrollbar-width: thin; scrollbar-color: var(--muted-min) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--muted-min); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-strong); background-clip: padding-box; }
input[type="checkbox"], input[type="radio"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-height: 18px; margin: 0; border: 1.5px solid var(--muted-min); border-radius: 4px; background: transparent; cursor: pointer; display: inline-grid; place-content: center; transition: background .12s, border-color .12s; vertical-align: middle; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before { content: ""; width: 11px; height: 11px; transform: scale(0); transition: transform .12s; background: var(--white); clip-path: polygon(14% 44%, 0 60%, 50% 100%, 100% 16%, 86% 0, 50% 70%); }
input[type="radio"]::before { content: ""; width: 8px; height: 8px; transform: scale(0); transition: transform .12s; background: var(--white); border-radius: 50%; }
input[type="checkbox"]:checked, input[type="radio"]:checked { border-color: var(--red); background: var(--red); }
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
select { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8a8a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
select::-ms-expand { display: none; }

.noise { position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }

.site-header { height: 76px; position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 42px; background: rgba(10,10,10,.88); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.1); }
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.brand-logo { display: block; flex: 0 0 auto; width: auto; height: 46px; max-width: 142px; object-fit: contain; }
.brand-wordmark { color: var(--white); font-size: 21px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.main-nav { display: flex; gap: 34px; font-size: 13px; color: #b9b9b9; }
.main-nav a { position: relative; transition: color .2s; }
.main-nav a:hover, .main-nav a.active { color: white; }
.main-nav a.active::after { content: ""; position: absolute; height: 2px; background: var(--red); left: 0; right: 0; bottom: -27px; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 25px; }
.login-link { font-size: 13px; color: #c4c4c4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 52px; padding: 0 22px; border: 1px solid transparent; border-radius: 2px; font-weight: 700; font-size: 13px; letter-spacing: -.01em; cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.button:hover { transform: translateY(-2px); }
.button-small { min-height: 38px; padding: 0 16px; font-size: 12px; }
.button-light { color: #090909; background: white; }
.button-red { background: var(--red); color: white; }
.button-red:hover { background: #ff5347; }
.button-outline { border-color: rgba(255,255,255,.25); background: transparent; color: white; }
.menu-toggle { display: none; background: none; border: 0; padding: 10px; }
.menu-toggle span { display: block; width: 22px; height: 1px; background: white; margin: 5px; }

main { min-height: 70vh; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; color: #aaa; font-size: 11px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--red); }
.display-title { margin: 0; font-size: clamp(58px, 8.8vw, 136px); line-height: .83; letter-spacing: -.075em; font-weight: 750; }
.display-title .outline { color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.88); }
.display-title .red { color: var(--red); }
.section-title { margin: 0; font-size: clamp(38px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; font-weight: 700; }
.section-copy { color: #a2a2a2; font-size: 17px; line-height: 1.65; max-width: 520px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }

/* Home */
.hero { position: relative; min-height: 750px; padding: 64px 5.8% 48px; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; right: 15%; top: 30%; width: 28vw; height: 28vw; border: 1px solid rgba(255,255,255,.12); transform: rotate(45deg); }
.hero::after { content: ""; position: absolute; right: -5%; top: 17%; width: 40vw; height: 40vw; border: 1px solid rgba(240,68,56,.42); border-radius: 50%; }
.hero-content { position: relative; z-index: 2; max-width: var(--max); margin: 0 auto; }
.hero-headline { max-width: 1100px; }
.hero-bottom { margin-top: 72px; display: grid; grid-template-columns: minmax(360px, 1fr) 1fr; gap: 5%; align-items: end; }
.hero-copy { max-width: 550px; margin: 0; color: #a7a7a7; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.55; }
.hero-copy strong { color: white; font-weight: 500; }
.hero-cta { display: flex; align-items: center; gap: 26px; }
.text-link { color: #c2c2c2; font-size: 13px; border-bottom: 1px solid #777; padding-bottom: 3px; }
.hero-proof { position: absolute; right: 5.8%; bottom: 42px; display: flex; gap: 28px; color: #747474; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.hero-proof span { display: flex; gap: 7px; align-items: center; }
.hero-proof i { display: inline-block; width: 5px; height: 5px; background: var(--red); }

.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.ticker-inner { display: flex; width: max-content; animation: ticker 26s linear infinite; padding: 20px 0; }
.ticker span { display: flex; align-items: center; gap: 38px; margin-right: 38px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ticker span::after { content: "✦"; color: var(--red); }
@keyframes ticker { to { transform: translateX(-50%); } }

.value-section { background: var(--paper); color: var(--ink); padding: 64px 5.8%; }
.value-head { display: grid; grid-template-columns: 1.2fr .8fr; gap: 6%; align-items: end; max-width: var(--max); margin: 0 auto 40px; }
.value-head .eyebrow { color: #6e6c69; }
.value-head p { margin: 0; color: #61605d; font-size: 18px; }
.value-grid { max-width: var(--max); margin: auto; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid #c9c6c0; border-left: 1px solid #c9c6c0; }
.value-card { min-height: 360px; padding: 28px; display: flex; flex-direction: column; border-right: 1px solid #c9c6c0; border-bottom: 1px solid #c9c6c0; transition: background .25s, color .25s; }
.value-card:hover { background: var(--ink); color: white; }
.value-index { color: var(--red); font-size: 12px; font-family: monospace; }
.value-icon { margin: auto 0; height: 90px; display: grid; place-items: center; }
.value-icon svg { width: 76px; height: 76px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.value-card h3 { font-size: 24px; letter-spacing: -.04em; margin: 0 0 12px; }
.value-card p { color: #77736e; margin: 0; max-width: 310px; }
.value-card:hover p { color: #aaa; }

.models-preview { padding: 64px 5.8%; border-bottom: 1px solid var(--line); }
.section-head-row { max-width: var(--max); margin: 0 auto 36px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-head-row .text-link { margin-bottom: 8px; }
.model-strip { max-width: var(--max); margin: auto; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.model-mini { position: relative; min-height: 280px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.model-mini::after { content: ""; position: absolute; width: 160px; height: 160px; border: 1px solid var(--model-color, #555); border-radius: 50%; right: -70px; top: -70px; opacity: .45; }
.model-provider { color: #747474; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.model-glyph { margin: auto 0; font-size: 38px; font-weight: 300; color: var(--model-color, white); }
.model-mini h3 { font-size: 20px; margin: 0 0 4px; }
.model-mini p { color: #777; margin: 0; font-size: 12px; }
.model-mini:hover { background: #111; }

.api-section { max-width: var(--max); margin: auto; padding: 64px 5.8%; display: grid; grid-template-columns: .9fr 1.1fr; gap: 5%; align-items: center; }
.api-section > * { min-width: 0; }
.api-section .section-copy { margin: 28px 0 36px; }
.code-window { background: #111; border: 1px solid #292929; box-shadow: 20px 20px 0 var(--red); }
.code-bar { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #292929; }
.code-dots { display: flex; gap: 6px; }.code-dots i { width: 7px; height: 7px; border-radius: 50%; background: #3d3d3d; }.code-dots i:first-child { background: var(--red); }
.code-tabs { display: flex; height: 100%; }.code-tabs button { background: none; border: 0; color: #666; padding: 0 13px; font-size: 11px; cursor: pointer; }.code-tabs button.active { color: white; border-bottom: 2px solid var(--red); }
.copy-button { border: 0; background: none; color: #777; cursor: pointer; font-size: 11px; }
pre { margin: 0; padding: 30px; overflow: auto; font-size: 12px; line-height: 1.8; color: #d0d0d0; }
.code-red { color: #ff6d64; }.code-blue { color: #84b5ff; }.code-green { color: #a9da77; }.code-muted { color: #666; }

.cta-section { position: relative; margin: 32px 5.8% 64px; padding: 40px 6%; background: var(--red); overflow: hidden; }
.cta-section::after { content: "L"; position: absolute; right: -2%; bottom: -45%; color: rgba(0,0,0,.12); font-weight: 800; font-size: 400px; line-height: 1; }
.cta-section h2 { position: relative; z-index: 1; max-width: 800px; margin: 0 0 34px; font-size: clamp(44px,6vw,82px); line-height: .95; letter-spacing: -.06em; }
.cta-section .button { position: relative; z-index: 1; }

/* Shared inner pages */
.inner-hero { padding: 56px 5.8% 48px; border-bottom: 1px solid var(--line); }
.inner-hero-wrap { max-width: var(--max); margin: auto; display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: 7%; }
.inner-title { margin: 0; font-size: clamp(62px, 8vw, 116px); line-height: .88; letter-spacing: -.07em; }
.inner-lede { margin: 0 0 10px; color: #949494; font-size: 18px; line-height: 1.6; max-width: 460px; }
.red-dot { color: var(--red); }

/* Catalog */
.catalog { max-width: var(--max); margin: auto; padding: 38px 5.8% 64px; }
.catalog-toolbar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; margin-bottom: 34px; }
.search-box { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #434343; max-width: 450px; padding: 12px 0; }
.search-box svg { width: 18px; fill: none; stroke: #777; }
.search-box input { width: 100%; background: none; border: 0; outline: 0; color: white; }
.filter-group { display: flex; gap: 7px; flex-wrap: wrap; scrollbar-width: none; }
.filter-group::-webkit-scrollbar { display: none; }
.filter-button { background: none; border: 1px solid #343434; color: #888; padding: 8px 13px; cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.filter-button.active, .filter-button:hover { color: white; border-color: var(--red); background: rgba(240,68,56,.08); }
.catalog-count { color: #666; font-size: 12px; margin-bottom: 14px; }
.model-table { border-top: 1px solid #353535; }
.model-row { display: grid; grid-template-columns: 2.1fr 1fr 1fr 1fr auto; align-items: center; gap: 24px; min-height: 112px; border-bottom: 1px solid #292929; padding: 18px 20px; transition: background .2s; }
.model-row:hover { background: #111; }
.model-main { display: flex; align-items: center; gap: 18px; }
.model-logo { width: 48px; height: 48px; display: grid; place-items: center; background: var(--logo-bg,#222); color: var(--logo-fg,white); font-weight: 800; font-size: 16px; flex: 0 0 auto; }
.model-main h3 { margin: 0 0 4px; font-size: 17px; }.model-main p { margin: 0; color: #666; font-size: 12px; }
.table-cell span { display: block; color: #616161; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }.table-cell strong { font-size: 13px; font-weight: 500; }
.status-live { color: var(--green) !important; }.status-live::before { content:""; display:inline-block; width:5px; height:5px; border-radius:50%; background:currentColor; margin-right:7px; vertical-align:middle; }
.model-arrow { font-size: 18px; color: #555; }
.empty-state { padding: 90px 20px; text-align: center; color: #777; border-bottom: 1px solid #292929; }

/* Docs — F3 real route-per-article architecture */
.docs-page { min-height: calc(100vh - 76px); }
.docs-layout { max-width: var(--max); margin: auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); padding: 0 5.8%; }
.docs-sidebar { position: sticky; top: 76px; align-self: start; height: calc(100vh - 76px); padding: 40px 24px 56px 0; border-right: 1px solid var(--line); overflow-y: auto; }
.docs-sidebar h2 { margin: 30px 0 10px; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }.docs-sidebar h2:first-child { margin-top: 0; }
.docs-sidebar a { position: relative; display: flex; align-items: center; min-height: 36px; color: var(--muted-min); font-size: 13px; transition: color .2s; }
.docs-sidebar a:hover, .docs-sidebar a[aria-current="page"] { color: var(--white); }
.docs-sidebar a[aria-current="page"]::before { content: ""; position: absolute; left: -31px; width: 2px; height: 20px; background: var(--red); }
.docs-sidebar a:focus-visible, .docs-pagination a:focus-visible, .docs-callouts a:focus-visible, .docs-code button:focus-visible, .docs-mobile-nav select:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.docs-mobile-nav { display: none; }
.docs-content { width: min(100%, 880px); padding: 48px 0 64px clamp(40px, 6vw, 80px); }
.docs-content article { min-width: 0; }
.docs-article-head { padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.docs-content h1 { margin: 0 0 22px; font-size: clamp(48px, 6vw, 78px); letter-spacing: -.06em; line-height: .96; }
.docs-content h1:focus { outline: none; }
.docs-content h2 { margin: 0 0 16px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.docs-content h3 { margin: 32px 0 12px; }
.docs-lead { max-width: 680px; margin: 0; color: var(--muted-strong); font-size: 18px; line-height: 1.65; }
.docs-content article > section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.docs-content article p, .docs-content article li { color: var(--muted-strong); line-height: 1.7; }
.docs-content article ul, .docs-content article ol { display: grid; gap: 10px; padding-left: 22px; }
.docs-content article a { color: var(--white); border-bottom: 1px solid var(--muted-min); }
.docs-content code:not(pre code) { color: #ff766e; background: var(--surface-2); padding: 2px 6px; overflow-wrap: anywhere; }
.doc-note { margin: 26px 0; padding: 20px 22px; border-left: 2px solid var(--red); background: var(--surface); color: var(--muted-strong); }.doc-note strong { color: var(--white); }.doc-note p { margin: 8px 0 0; }
.endpoint { display: flex; align-items: center; gap: 12px; margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); font-family: monospace; font-size: 12px; overflow-x: auto; }.method { color: var(--green); font-weight: 700; }.endpoint-url { color: var(--muted-strong); white-space: nowrap; }
.param-table { margin: 24px 0; border-top: 1px solid var(--line); }.param-row { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }.param-row code { align-self: start; color: #ff766e; background: none!important; padding:0!important; }.param-row p { margin:0; font-size:13px; }
.docs-code { min-width: 0; margin: 22px 0; border: 1px solid var(--line); background: var(--surface); }
.docs-code-head { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--muted-min); font: 11px monospace; }
.docs-code button { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted-strong); cursor: pointer; }
.docs-code button:hover { color: var(--white); }
.docs-code pre { max-width: 100%; overflow-x: auto; padding: 24px; }
.docs-code pre[hidden] { display: none; }
.docs-code code { white-space: pre; }
.docs-code-tabs { display: flex; }
.docs-code-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted-min); padding: 0 13px; font: 11px monospace; cursor: pointer; min-height: 36px; }
.docs-code-tabs button:hover { color: var(--white); }
.docs-code-tabs button.active { color: var(--white); border-bottom-color: var(--red); }
.docs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 22px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.docs-facts div { min-width: 0; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.docs-facts dt { margin-bottom: 8px; color: var(--muted-min); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }.docs-facts dd { margin: 0; color: var(--muted-strong); }
.docs-facts-stack { grid-template-columns: 1fr; }
.docs-callouts { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 30px; }
.docs-callouts a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 15px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; }
.docs-callouts a:hover { border-color: var(--red); }
.docs-content p a, .docs-content li a, .docs-content dd a, .docs-content ol a { color: #c2c2c2; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 2px; transition: color .2s ease; }
.docs-content p a:hover, .docs-content li a:hover, .docs-content dd a:hover, .docs-content ol a:hover { color: var(--white); }
.docs-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 62px; padding-top: 24px; border-top: 1px solid var(--line); }
.docs-pagination a { min-height: 82px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 15px; border: 1px solid var(--line); background: var(--surface); }
.docs-pagination a:hover { border-color: var(--red); }.docs-pagination span { color: var(--muted-min); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }.docs-pagination strong { font-size: 13px; }
.docs-pagination-next { text-align: right; }
.docs-not-found { min-height: 460px; }.docs-not-found p { max-width: 560px; }.docs-not-found .text-link { display: inline-block; margin-top: 28px; }

@media (max-width: 760px) {
  .docs-page { padding: 0 20px; }
  .docs-mobile-nav { display: flex; flex-direction: column; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line); }
  .docs-mobile-nav label { color: var(--muted-min); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
  .docs-mobile-nav select { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--white); }
  .docs-layout { display: block; padding: 0; }
  .docs-sidebar { display: none !important; }
  .docs-content { width: 100%; padding: 46px 0 90px; }
  .docs-content h1 { font-size: clamp(42px, 14vw, 62px); }
  .docs-lead { font-size: 16px; }
  .docs-content article > section { padding: 34px 0; }
  .param-row { grid-template-columns: 1fr; gap: 8px; }
  .docs-facts { grid-template-columns: 1fr; }
  .docs-callouts { flex-direction: column; }.docs-callouts a { width: 100%; }
  .docs-pagination { grid-template-columns: 1fr; }.docs-pagination > span:empty { display: none; }
  .docs-pagination-next { text-align: left; }
  .docs-code { max-width: calc(100vw - 40px); }
  .docs-code pre { padding: 20px; }
}

/* Header account link */
.header-signin { color: #9a9a9a; font-size: 12px; }
.header-signin:hover { color: white; }

/* Auth pages (real forms) */
.auth-page { min-height: calc(100vh - 76px); display: flex; justify-content: center; padding: 48px 5.8% 64px; }
.auth-panel { width: 100%; max-width: 440px; }
.auth-panel h1 { font-size: clamp(34px, 5vw, 46px); letter-spacing: -.055em; margin: 8px 0 10px; }
.auth-lede { color: #8a8a8a; margin: 0 0 28px; line-height: 1.55; }
.auth-google { width: 100%; text-align: center; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: #555; font-size: 10px; text-transform: uppercase; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: #282828; flex: 1; }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; font-size: 12px; }
.auth-links a { color: #9a9a9a; border-bottom: 1px solid #3a3a3a; }
.auth-links a:hover { color: white; }
.auth-accepted { border: 1px solid var(--line); background: #101010; padding: 22px; line-height: 1.6; color: #bdbdbd; }
.consent-check { display:flex; gap:10px; align-items:flex-start; margin:16px 0; color:#aaa; font-size:12px; line-height:1.5; }
.consent-check input { margin-top:3px; accent-color:var(--red); flex:0 0 auto; }
.consent-check a { color:var(--paper); text-decoration:underline; text-underline-offset:3px; }
/* Sign-in page: the Google button also registers, so the terms it accepts have
   to be visible next to it (there is no checkbox to tick here). */
.auth-note { margin:10px 0 0; color:#8a8a8a; font-size:12px; line-height:1.5; }
.auth-note a { color:var(--paper); text-decoration:underline; text-underline-offset:3px; }
.legal-sections { border-top:1px solid var(--line); }
.legal-section { display:grid; grid-template-columns:70px 1fr; gap:24px; padding:28px 0; border-bottom:1px solid var(--line); }
.legal-section > span { color:var(--red); font-size:11px; letter-spacing:.14em; }
.legal-section h2 { margin:0 0 8px; font-size:18px; }
.legal-section p { max-width:760px; margin:0; color:#aaa; line-height:1.7; }
.legal-back { margin-top:28px; }
.payment-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:18px; }
.payment-preview { border:1px solid var(--line); background:var(--surface); padding:18px; display:flex; align-items:center; justify-content:space-between; gap:16px; opacity:.72; }
.payment-preview.payment-active { opacity: 1; border-color: #31553a; }
.payment-preview strong,.payment-preview small { display:block; }
.payment-preview small { margin-top:4px; color:#777; font-size:10px; }
.payment-soon { border:1px solid var(--line); padding:5px 8px; color:#999; font-size:9px; text-transform:uppercase; letter-spacing:.12em; }
.payment-live { border: 1px solid #31553a; padding: 5px 8px; color: var(--green); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
@media (max-width: 600px) { .payment-preview-grid { grid-template-columns:1fr; } .legal-section { grid-template-columns:42px 1fr; gap:14px; } }

/* Form fields (auth + dashboard dialogs) */
.form-field { margin: 0 0 18px; }
.form-field label { display: block; margin: 0 0 8px; color: #aaa; font-size: 12px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 48px; background: #101010; border: 1px solid #303030; color: white; padding: 12px 14px; outline: none; font: inherit; font-size: 14px; }
.form-field textarea { resize: vertical; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--red); }
/* iOS Safari zooms the viewport when a focused input is < 16px. Keep the
   14px desktop aesthetic but raise text inputs to 16px on touch widths. */
@media (max-width: 800px) {
  .form-field input, .form-field select, .form-field textarea,
  .crypto-form input, .playground-settings select, .playground-settings textarea,
  .playground-compose textarea, .playground-form textarea, .playground-max input {
    font-size: 16px;
  }
}
.field-desc { margin: 6px 0 0; color: #6f6f6f; font-size: 11px; line-height: 1.5; }
.field-error { margin: 6px 0 0; color: #ff6a5f; font-size: 11px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 74px; }
.password-toggle { position: absolute; top: 0; right: 0; height: 100%; padding: 0 12px; background: none; border: 0; border-left: 1px solid #303030; color: #9a9a9a; font-size: 11px; cursor: pointer; }
.password-toggle:hover { color: white; }
.form-status { margin: 0 0 16px; padding: 12px 14px; font-size: 12px; line-height: 1.5; display: none; border: 1px solid transparent; }
.form-status[data-tone="error"] { display: block; border-color: #5d2420; background: #1d100e; color: #ff8a80; }
.form-status[data-tone="info"] { display: block; border-color: #2c4a2c; background: #0e1a0e; color: #9fd89f; }
.auth-page form .button, .dialog form .button[type="submit"] { width: 100%; margin-top: 8px; }

/* Dashboard (real account) */
.dashboard-page { min-height: calc(100vh - 76px); }
.dash-layout { max-width: var(--max); margin: auto; padding: 36px 5.8% 64px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 90px; }
.dash-nav-title { color: #5f5f5f; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; margin: 0 0 10px; }
.dash-nav a { color: #8a8a8a; padding: 10px 10px; font-size: 13px; }
.dash-nav a:hover { color: white; background: #151515; }
.dash-nav a[aria-current="page"] { color: white; background: #181818; box-shadow: inset 2px 0 0 var(--red); }
.dash-logout { margin-top: 22px; background: none; border: 1px solid #333; color: #9a9a9a; padding: 9px 10px; font-size: 12px; cursor: pointer; text-align: left; }
.dash-logout:hover { color: white; border-color: #555; }
.dash-mobile-nav { display: none; }
.dash-mobile-nav label { display: block; color: #8a8a8a; font-size: 11px; margin-bottom: 8px; }
.dash-mobile-nav select { width: 100%; min-height: 46px; background: #141414; color: white; border: 1px solid #303030; padding: 0 12px; font: inherit; font-size: 13px; }
.dash-content { min-width: 0; }
.dash-identity { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.dash-identity h1 { margin: 6px 0 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.045em; }
.dash-balance-chip { border: 1px solid var(--line); background: #101010; padding: 14px 18px; text-align: right; }
.dash-balance-chip span { display: block; color: #6f6f6f; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.dash-balance-chip strong { font-size: 22px; letter-spacing: -.03em; }
.dash-section { border: 1px solid var(--line); background: #101010; margin-bottom: 22px; }
.dash-subhead { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.dash-subhead h2 { margin: 0; font-size: 14px; }
.dash-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dash-metric { padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dash-metric span { display: block; color: #6f6f6f; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.dash-metric strong { font-size: 22px; letter-spacing: -.03em; }
.dash-metric small { display: block; margin-top: 6px; color: #6f6f6f; font-size: 10px; }
.dash-quicklinks { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 18px; }
.dash-table { list-style: none; margin: 0; padding: 0; }
.dash-row { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #1e1e1e; font-size: 12px; }
.dash-row:last-child { border-bottom: 0; }
.dash-row-head { color: #5f5f5f; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.dash-row-3 { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.dash-row-status[data-status="success"] { color: var(--green); }
.dash-row-status[data-status="error"], .dash-row-status[data-status="revoked"], .dash-row-status[data-status="expired"] { color: #ff8a80; }
.dash-row-button { background: none; border: 1px solid #333; color: #aaa; padding: 6px 10px; font-size: 11px; cursor: pointer; }
.dash-row-button:hover { color: white; border-color: #555; }
.dash-note { padding: 14px 18px; color: #8a8a8a; font-size: 12px; line-height: 1.6; border-top: 1px solid #1e1e1e; margin: 0; }

/* Loyalty ranks. Each row carries its tier colour as --tier-color, set inline
   from the server response, so the palette lives with the tier definition rather
   than being duplicated here. */
.dash-section-loyalty > .status-section-head { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 18px; }
.loyalty-lede { margin: 0; color: var(--muted-min); font-size: 12px; line-height: 1.5; }
.loyalty-progress { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-bottom: 1px solid #1e1e1e; }
.loyalty-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.loyalty-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--tier-color, var(--muted-min)); border-radius: 999px; color: var(--tier-color, var(--muted-strong)); font-size: 13px; font-weight: 600; }
.loyalty-discount { color: var(--white); font-size: 20px; font-variant-numeric: tabular-nums; }
.loyalty-bar { position: relative; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.loyalty-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--tier-color, var(--muted-strong)); transition: width .35s ease; }
.loyalty-caption { color: var(--muted-min); font-size: 12px; line-height: 1.5; }
.loyalty-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .8fr) 28px; }
.loyalty-cell-rank { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.loyalty-cell-rank strong { color: var(--muted-strong); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loyalty-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tier-color, var(--muted-min)); }
.loyalty-cell-discount { color: var(--muted-strong); font-variant-numeric: tabular-nums; }
.loyalty-cell-mark { color: var(--tier-color, var(--muted-min)); text-align: right; }
/* Reached ranks read as earned, the current one is emphasised, and locked ones
   recede without becoming unreadable (kept at --muted-min, the contrast floor). */
.loyalty-row[data-state="reached"] strong { color: var(--white); }
.loyalty-row[data-state="current"] { background: var(--surface-2); }
.loyalty-row[data-state="current"] strong, .loyalty-row[data-state="current"] .loyalty-cell-discount { color: var(--white); }
.loyalty-row[data-state="locked"] strong, .loyalty-row[data-state="locked"] .loyalty-cell-discount { color: var(--muted-min); }
.loyalty-row[data-state="locked"] .loyalty-dot { opacity: .45; }
.loyalty-you { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--tier-color, var(--muted-min)); color: #0a0a0a; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 560px) {
  .loyalty-discount { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .loyalty-bar-fill { transition: none; } }

/* Account surfaces */
.dash-section > .status-section-head { min-height: 56px; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.dash-section > .status-section-head h2 { margin: 0; font-size: 14px; }
.dash-section .status-note { margin: 0; padding: 14px 18px; color: var(--muted-min); line-height: 1.6; }
.dash-section > .status-note { border-bottom: 1px solid #1e1e1e; }
.dash-section .empty-state { min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 18px; }
.dash-section .empty-state p { margin: 0; }
.dash-section > .form-status { margin: 16px 18px; }
.dash-quicklinks a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); color: var(--muted-strong); font-size: 12px; }
.dash-quicklinks a:hover { border-color: var(--red); color: var(--white); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.form-status[hidden] { display: none; }

/* Keys */
.key-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr) minmax(220px, 1.1fr) auto; gap: 14px 20px; align-items: center; padding: 18px; border-bottom: 1px solid #1e1e1e; }
.key-row:last-child { border-bottom: 0; }
.key-row-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.key-label { font-size: 13px; color: white; }
.key-prefix { color: var(--muted-min); font-family: monospace; font-size: 11px; word-break: break-all; }
.key-scope { margin: 0; color: var(--muted-min); font-size: 11px; line-height: 1.5; }
.key-status { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.key-status[data-status="active"] { color: var(--green); }
.key-status[data-status="disabled"], .key-status[data-status="revoked"], .key-status[data-status="expired"] { color: #ff8a80; }
.key-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted-min); font-size: 10px; }
.key-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.key-reveal { border: 1px solid #5d2420; background: #17100f; padding: 14px; margin: 14px 0; }
.key-reveal code { display: block; font-size: 13px; word-break: break-all; color: #ffd9d6; margin-bottom: 12px; }
.key-ack { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-size: 12px; color: #bdbdbd; line-height: 1.5; }
.key-ack input { width: 16px; height: 16px; min-height: 0; margin-top: 2px; }
.key-limits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* Usage chart (no chart library) */
.usage-chart { display: block; height: 140px; padding: 12px 0; border-bottom: 1px solid #1e1e1e; }
.usage-chart svg { width: 100%; height: 100%; display: block; }
.usage-bar-wrap { flex: 1 0 8px; height: 140px; display: flex; align-items: flex-end; }
.usage-bar { width: 100%; min-height: 2px; background: var(--red); }
.usage-table-fallback { padding: 0 18px 18px; overflow-x: auto; }
.usage-table-fallback table { width: 100%; border-collapse: collapse; font-size: 11px; }
.usage-table-fallback th, .usage-table-fallback td { padding: 10px 8px; border-bottom: 1px solid #1e1e1e; text-align: left; white-space: nowrap; }
.usage-table-fallback th { color: var(--muted-min); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }

/* Requests */
.req-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #1e1e1e; }
.req-model-filter { flex: 2 1 240px; }
.req-key-filter { flex: 1 1 180px; }
.req-model-filter input, .req-key-filter select { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #303030; background: #0d0d0d; color: var(--white); outline: none; }
.req-model-filter input:focus, .req-key-filter select:focus { border-color: var(--red); }
.req-pagination { display: flex; justify-content: center; padding: 16px; }
.dash-table-requests .dash-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr) minmax(0, .9fr) minmax(0, 1fr); }
.dash-table-requests .dash-row-button { width: 100%; padding: 14px 18px; border: 0; border-bottom: 1px solid #1e1e1e; border-radius: 0; background: transparent; text-align: left; }
.dash-table-requests .dash-row-button:hover { background: var(--surface-2); }
.request-detail { display: grid; gap: 0; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #1e1e1e; font-size: 12px; }
.detail-row dt { color: var(--muted-min); }
.detail-row dd { margin: 0; text-align: right; word-break: break-all; }

/* Balance */
.crypto-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .6fr) auto; gap: 14px; align-items: end; padding: 18px; border-top: 1px solid #1e1e1e; }
.crypto-form .form-field { margin: 0; }
.crypto-form input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #303030; background: #0d0d0d; color: var(--white); outline: none; }
.crypto-form input:focus { border-color: var(--red); }
.crypto-form .button { min-height: 48px; margin: 0; }
.crypto-quote { min-height: 48px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); padding: 8px 12px; }
.crypto-quote span, .crypto-quote small { color: var(--muted-min); font-size: 10px; }
.crypto-quote strong { margin: 3px 0; font-size: 16px; }
.crypto-link { padding: 0 18px 18px; }
.crypto-link .button { display: inline-flex; }
.gift-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 16px 18px; }
.gift-form > input { min-width: 0; min-height: 48px; padding: 0 14px; border: 1px solid #303030; background: #0d0d0d; color: var(--white); outline: none; }
.gift-form > input:focus { border-color: var(--red); }
.gift-form > .field-desc { grid-column: 1 / -1; }
.gift-form .button { grid-column: 2; grid-row: 1; margin: 0; width: auto; }
.dash-row-ledger { grid-template-columns: minmax(0, 1.4fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(150px, 1fr); }
.dash-row-ledger small { display: block; margin-top: 4px; color: var(--muted-min); font-weight: 400; }
.ledger-credit { color: var(--green); }
.ledger-debit { color: #ff8a80; }

/* Security */
.security-form { padding: 16px 18px; max-width: 460px; }
.security-form > .button { width: 100%; }
.session-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(260px, 1.5fr) auto; gap: 14px 20px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #1e1e1e; }
.session-row:last-child { border-bottom: 0; }
.session-row-main { min-width: 0; }
.session-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted-min); font-size: 11px; word-break: break-word; }
.session-current { display: inline-block; margin-left: 8px; color: var(--green); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

/* Dialogs */
.dialog-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; overflow: auto; background: rgba(0, 0, 0, .72); }
.dialog { min-width: 0; max-width: 520px; width: 100%; max-height: min(84vh, 720px); overflow-x: hidden; overflow-y: auto; border: 1px solid #3a3a3a; background: #111; color: white; padding: 24px; }
.dialog > *, .dialog form, .dialog .form-field, .dialog .key-limits-grid { min-width: 0; max-width: 100%; }
.dialog h2 { margin: 0 0 16px; font-size: 18px; letter-spacing: -.02em; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.dialog-actions .button { width: auto; margin: 0; }

.model-id-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.model-description { max-width: 760px; margin: 14px 0 0; color: var(--muted-strong); font-size: 13px; line-height: 1.65; white-space: pre-line; }

/* Dashboard playground */
.dashboard-playground .dash-subhead p { margin: 4px 0 0; color: var(--muted-min); font-size: 11px; }
.dashboard-playground-grid { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.5fr); min-height: 540px; }
.playground-settings { border-right: 1px solid var(--line); }
.playground-settings summary { cursor: pointer; padding: 16px 18px; color: var(--muted-strong); font-size: 12px; border-bottom: 1px solid #1e1e1e; }
.playground-settings-body { padding: 0 18px 18px; }
.playground-settings label { display: block; margin: 16px 0 8px; color: var(--muted-strong); font-size: 12px; }
.playground-settings select, .playground-settings textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #303030; background: #0d0d0d; color: var(--white); font: inherit; }
.playground-chat { min-width: 0; display: flex; flex-direction: column; }
.playground-history { min-height: 360px; max-height: 620px; overflow-y: auto; padding: 18px; flex: 1; }
.playground-message { border: 1px solid #262626; background: #0d0d0d; margin-bottom: 14px; }
.playground-message[data-role="user"] { border-left: 2px solid var(--red); }
.playground-message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #1e1e1e; font-size: 11px; }
.playground-message pre { margin: 0; padding: 14px; color: #e5e5e5; font: inherit; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.playground-compose { padding: 18px; border-top: 1px solid var(--line); }
.playground-compose textarea { width: 100%; max-height: 320px; padding: 12px 14px; border: 1px solid #303030; background: #0d0d0d; color: var(--white); font: inherit; resize: vertical; }

@media (max-width: 800px) {
  .dashboard-playground-grid { grid-template-columns: 1fr; }
  .playground-settings { border-right: 0; border-bottom: 1px solid var(--line); }
  .playground-settings:not([open]) .playground-settings-body { display: none; }
  .playground-history { min-height: 280px; }
}

/* Model playground */
#model-playground { border: 1px solid var(--line); background: var(--surface); }
#model-playground > .status-section-head { min-height: 56px; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.playground-cta { padding: 22px 18px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.playground-cta p { margin: 0; color: var(--muted-strong); line-height: 1.6; font-size: 13px; }
.playground-form { padding: 20px 18px; }
.playground-model { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 18px; color: var(--muted-min); font-size: 11px; }
.playground-model code { color: var(--muted-strong); word-break: break-all; }
.playground-form > label, .playground-max label { display: block; margin: 16px 0 8px; color: var(--muted-strong); font-size: 12px; }
.playground-options { margin: 4px 0 8px; }
.pg-stream { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 12px; cursor: pointer; }
.pg-stream input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--red); }
.playground-form textarea, .playground-max input { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid #303030; background: #0d0d0d; color: var(--white); outline: none; font: inherit; line-height: 1.5; }
.playground-form textarea { resize: vertical; max-height: 320px; }
.playground-settings textarea { width: 100%; min-width: 0; resize: vertical; max-height: 320px; }
.playground-form textarea:focus, .playground-max input:focus { border-color: var(--red); }
.playground-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.playground-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.playground-actions .button { width: auto; margin: 0; }
.playground-result { border: 1px solid var(--line); background: #0d0d0d; margin-top: 18px; }
.playground-result-actions { display: flex; justify-content: flex-end; padding: 10px 12px; border-bottom: 1px solid #1e1e1e; }
.playground-output { margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.6; color: #e5e5e5; max-height: 380px; overflow-y: auto; }
.playground-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px; border-top: 1px solid #1e1e1e; color: var(--muted-min); font-size: 11px; }
.playground-meta code { color: var(--muted-strong); }

@media (max-width: 1100px) {
  .key-row { grid-template-columns: minmax(0, 1.3fr) minmax(180px, 1fr); }
  .key-actions { justify-content: flex-start; }
  .session-row { grid-template-columns: 1fr 1fr; }
  .session-row .button { justify-self: start; }
}

@media (max-width: 700px) {
  .key-row, .session-row { grid-template-columns: 1fr; }
  .key-actions { justify-content: flex-start; }
  .crypto-form { grid-template-columns: 1fr; }
  .crypto-form .button { width: 100%; }
  .gift-form { grid-template-columns: 1fr; }
  .gift-form > input, .gift-form .button { grid-column: 1; width: 100%; }
  .gift-form .button { grid-row: auto; }
  .gift-form > .field-desc { grid-column: 1; }
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-row dd { text-align: left; }
}

@media (max-width: 900px) {
  .header-signin { display: none; }
  .dash-layout { grid-template-columns: 1fr; gap: 22px; }
  .dash-nav { display: none; }
  .dash-mobile-nav { display: block; }
  .dash-row, .dash-table-requests .dash-row { grid-template-columns: 1fr 1fr; }
  .dash-row-head { display: none; }
  .dash-row > *::before { content: attr(data-label); display: block; color: #5f5f5f; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
  .playground-controls { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-page { padding: 40px 16px 80px; }
  .dash-layout { padding: 28px 16px 80px; }
  .dash-row, .dash-table-requests .dash-row { grid-template-columns: 1fr; }
  .dash-identity { flex-direction: column; align-items: flex-start; }
  .dash-balance-chip { text-align: left; width: 100%; }
  .key-limits-grid { grid-template-columns: 1fr; }
  .dialog-actions .button, .playground-actions .button { width: 100%; }
}

/* The loyalty ladder opts OUT of the generic one-cell-per-line mobile stacking
   above. Those rules assume request/ledger rows, whose cells are long and carry
   a data-label; a rank row is four short values that must stay on one line to be
   comparable — "Cyborg | from 200M | −10% | ✓" reads as a ladder, the stacked
   version reads as five separate cards. Declared after the generic queries
   because both match at the same specificity, so source order decides.
   The spend column stays: a threshold you cannot see is the one number a
   customer actually needs from this table. */
@media (max-width: 900px) {
  .loyalty-row { grid-template-columns: minmax(0, 1.35fr) minmax(0, .8fr) minmax(0, .55fr) 18px; gap: 8px; padding: 13px 16px; }
  .loyalty-row.dash-row-head { display: grid; }
  .loyalty-row > *::before { content: none; }
  .loyalty-cell-rank { gap: 7px; }
}
@media (max-width: 400px) {
  /* Below this width the rank name would truncate to a couple of glyphs, so the
     header is dropped and the threshold shortened by the label instead. */
  .loyalty-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, .75fr) minmax(0, .5fr) 14px; gap: 6px; padding: 12px 14px; font-size: 11px; }
  .loyalty-you { padding: 2px 5px; font-size: 9px; }
}

/* Pricing */
.pricing-grid { max-width:var(--max); margin:auto; padding:48px 5.8% 72px; display:grid; grid-template-columns:repeat(3,1fr); }.price-card { border:1px solid #303030; margin-right:-1px; padding:32px; min-height:520px; display:flex; flex-direction:column; }.price-card.featured { background:var(--paper); color:var(--ink); transform:translateY(-14px); }.price-card .tag { color:var(--red); text-transform:uppercase; letter-spacing:.08em; font-size:10px; }.price-card h2 { font-size:28px; margin:14px 0 4px; }.price-card > p { color:#777; min-height:48px; }.price { font-size:52px; letter-spacing:-.06em; margin:28px 0; }.price small { font-size:13px; color:#777; letter-spacing:0; }.price-card ul { list-style:none; padding:0; margin:0 0 30px; }.price-card li { padding:10px 0; border-bottom:1px solid rgba(127,127,127,.2); font-size:13px; }.price-card li::before { content:"↳"; color:var(--red); margin-right:8px; }.price-card .button { margin-top:auto; }

/* Footer */
.site-footer { border-top:1px solid var(--line); padding:70px 5.8% 28px; background:#080808; }.footer-top { max-width:var(--max); margin:auto; display:grid; grid-template-columns:1fr 1fr 1fr; align-items:start; padding-bottom:50px; }.footer-top p { margin:0; color:#666; font-size:13px; }.footer-status { justify-self:end; color:#777; font-size:11px; }.footer-status span { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--green); margin-right:7px; box-shadow:0 0 10px var(--green); }.footer-grid { max-width:var(--max); margin:auto; display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid #252525; padding:42px 0 60px; gap:40px; }.footer-grid > div { display:flex; flex-direction:column; gap:9px; }.footer-label { color:#535353; font-size:10px; text-transform:uppercase; letter-spacing:.09em; margin-bottom:7px; }.footer-grid a { color:#9a9a9a; font-size:12px; }.footer-grid a:hover { color:white; }.footer-newsletter form { display:flex; border-bottom:1px solid #373737; }.footer-newsletter input { flex:1; padding:10px 0; color:white; background:none; border:0; outline:0; font-size:12px; }.footer-newsletter button { background:none; border:0; color:white; font-size:20px; cursor:pointer; }.footer-bottom { max-width:var(--max); margin:auto; border-top:1px solid #252525; padding-top:24px; display:flex; justify-content:space-between; color:#4f4f4f; font-size:10px; text-transform:uppercase; letter-spacing:.04em; }.footer-bottom div { display:flex; gap:22px; }
.toast { position:fixed; z-index:30; bottom:24px; left:50%; transform:translate(-50%,30px); background:white; color:#111; padding:12px 18px; font-size:12px; font-weight:700; opacity:0; pointer-events:none; transition:.25s; box-shadow:0 10px 40px rgba(0,0,0,.3); }.toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width: 1000px) {
  .site-header { padding:0 22px; grid-template-columns:1fr auto; }.main-nav,.header-actions { display:none; }.menu-toggle { display:block; }.site-header.menu-active .main-nav { display:flex; position:fixed; inset:76px 0 0; background:#0a0a0a; flex-direction:column; padding:50px 24px; gap:0; }.site-header.menu-active .main-nav a { font-size:30px; padding:14px 0; border-bottom:1px solid #252525; }.site-header.menu-active .main-nav a.active::after { display:none; }
  .hero { min-height:700px; padding-top:85px; }.hero-bottom { grid-template-columns:1fr; gap:38px; }.hero-proof { display:none; }.value-head { grid-template-columns:1fr; gap:30px; }.value-grid { grid-template-columns:1fr 1fr; }.model-strip { grid-template-columns:1fr 1fr; }.api-section { grid-template-columns:1fr; }.code-window { margin-top:25px; }
  .model-row { grid-template-columns:2fr 1fr 1fr auto; }.model-row .table-cell:nth-of-type(3){ display:none; }
  .dash-grid { grid-template-columns:1fr; }.auth-page { grid-template-columns:1fr; }.auth-art { display:none; }
}
@media (max-width: 700px) {
  .brand-logo { height: 40px; max-width: 124px; }
  .brand-wordmark { font-size: 18px; }
  .display-title { font-size:15vw; }.hero { padding:70px 20px 50px; min-height:650px; }.hero::before { width:60vw;height:60vw;right:-20%; }.hero::after { width:80vw;height:80vw; }.hero-bottom { margin-top:48px; }.hero-copy { font-size:16px; }.hero-cta { align-items:stretch; flex-direction:column; gap:16px; }.hero-cta .text-link { width:fit-content; }
  .value-section,.models-preview { padding:80px 20px; }.value-grid,.model-strip { grid-template-columns:1fr; }.value-card { min-height:290px; }.section-head-row { align-items:start; flex-direction:column; }.api-section { padding:80px 20px; }.code-window { box-shadow:8px 8px 0 var(--red); }.code-tabs button:nth-child(n+3) { display:none; } pre { padding:20px; font-size:10px; }.cta-section { margin:30px 20px 80px;padding:50px 24px; }
  .inner-hero { padding:65px 20px 50px; }.inner-hero-wrap { grid-template-columns:1fr; gap:28px; }.catalog { padding:30px 20px 80px; }.catalog-toolbar { grid-template-columns:1fr; }.filter-group { overflow-x:auto; flex-wrap:nowrap; }.model-row { grid-template-columns:1fr auto; padding:18px 5px; }.model-row .table-cell { display:none; }.model-row .table-cell.model-total { display:block; text-align:right; }.model-main { gap:12px; }
  .docs-layout { display:block; padding:0 20px; }.docs-sidebar { position:relative; top:0; width:100%; height:auto; padding:20px 0; border-right:0; border-bottom:1px solid #333; display:flex; overflow:auto; gap:22px; }.docs-sidebar h4 { display:none; }.docs-sidebar a { white-space:nowrap; }.docs-sidebar a.active::before { display:none; }.docs-content { padding:55px 0 80px; }.param-row { grid-template-columns:1fr; gap:7px; }
  .dashboard-shell { grid-template-columns:1fr; }.dash-sidebar { display:none; }.dashboard-main { padding:34px 20px 70px; }.dash-welcome { align-items:start; flex-direction:column; gap:20px; }.stat-grid { grid-template-columns:1fr; }.chart { height:220px; }.key-row { grid-template-columns:1fr auto; }.key-meta { display:none; }
  .auth-form-wrap { padding:60px 20px; }.auth-form h1 { font-size:39px; }.pricing-grid { grid-template-columns:1fr; padding:50px 20px 90px; }.price-card.featured { transform:none; }
  .site-footer { padding:55px 20px 25px; }.footer-top { grid-template-columns:1fr; gap:25px; }.footer-status { justify-self:start; }.footer-grid { grid-template-columns:1fr 1fr; }.footer-newsletter { grid-column:1/-1; }.footer-bottom { flex-direction:column; gap:12px; }
}

/* Product expansion: localization and interaction polish */
.login-link, .text-link, .footer-grid a, .footer-bottom a, .docs-sidebar a, .password-head a, .auth-switch a { transition: color .2s ease, border-color .2s ease, opacity .2s ease; }
.login-link:hover, .text-link:hover, .footer-grid a:hover, .footer-bottom a:hover, .password-head a:hover, .auth-switch a:hover { color:#fff; border-color:#fff; }
.lang-toggle { display:flex; align-items:center; gap:6px; padding:6px 0; color:#fff; background:none; border:0; cursor:pointer; font-size:10px; font-weight:700; letter-spacing:.08em; }
.lang-toggle i { color:#4d4d4d; font-style:normal; }.lang-toggle [data-lang-alt] { color:#5f5f5f; transition:color .2s; }.lang-toggle:hover [data-lang-alt] { color:#fff; }
.mobile-lang { display:none; }
.arrow-icon { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:square; stroke-linejoin:miter; flex:0 0 auto; }
.display-title,.inner-title { user-select:none; -webkit-user-select:none; }
.social-login { transition:background .2s,color .2s,border-color .2s,transform .2s; }.social-login:hover { background:#181818; border-color:#555; color:#fff; transform:translateY(-1px); }
.agreement { display:flex!important; align-items:flex-start; gap:10px; color:#777!important; line-height:1.45; cursor:pointer; margin-top:18px!important; }.agreement input { appearance:none; width:16px!important; height:16px!important; padding:0!important; margin:2px 0 0; flex:0 0 auto; display:grid; place-items:center; }.agreement input:checked { background:var(--red); border-color:var(--red); }.agreement input:checked::after { content:"✓"; color:#fff; font-size:10px; font-weight:bold; }.agreement a { color:#bbb; border-bottom:1px solid #555; }
.form-error { color:#ff766e!important; font-size:11px; margin:8px 0 0!important; min-height:16px; }
.copy-button,.icon-button,.model-id-box button { transition:color .2s,background .2s,border-color .2s; }.copy-button:hover,.model-id-box button:hover { color:#fff; }.icon-button:hover { color:#fff; border-color:#666; background:#1a1a1a; }

@media (max-width:1000px) {
  .menu-toggle { display:block!important; position:absolute; right:12px; top:17px; z-index:50; width:44px; height:42px; padding:0; }
  .menu-toggle::before,.menu-toggle::after { content:""; position:absolute; left:11px; width:22px; height:1px; background:#fff; }
  .menu-toggle::before { top:16px; }.menu-toggle::after { top:24px; }.menu-toggle span { display:none; }
  .site-header.menu-active .menu-toggle::before { top:20px; transform:rotate(45deg); }.site-header.menu-active .menu-toggle::after { top:20px; transform:rotate(-45deg); }
  .site-header.menu-active .mobile-lang { display:block; width:100%; text-align:left; margin-top:28px; padding:14px 0; color:#888; background:none; border:0; font-size:12px; letter-spacing:.1em; }
}

/* Dashboard sections */
.dash-page-head { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; margin-bottom:30px; }.dash-page-head h1 { margin:0 0 5px; font-size:36px; letter-spacing:-.045em; }.dash-page-head p { margin:0; color:#707070; }
.dash-kpi-row { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid #303030; border-left:1px solid #303030; margin-bottom:24px; }.dash-kpi { padding:18px; border-right:1px solid #303030; border-bottom:1px solid #303030; }.dash-kpi span { color:#666; text-transform:uppercase; letter-spacing:.07em; font-size:9px; }.dash-kpi strong { display:block; font-size:21px; margin-top:8px; }
.table-scroll { overflow:auto; }.data-table { width:100%; border-collapse:collapse; }.data-table th { color:#555; font-size:9px; text-transform:uppercase; letter-spacing:.08em; text-align:left; font-weight:600; padding:13px 18px; border-bottom:1px solid #292929; white-space:nowrap; }.data-table td { padding:17px 18px; border-bottom:1px solid #242424; color:#aaa; font-size:12px; white-space:nowrap; }.data-table tr:last-child td { border-bottom:0; }.data-table tbody tr { transition:background .2s; }.data-table tbody tr:hover { background:#151515; }.data-table strong { color:#fff; font-weight:600; }.key-code { font-family:monospace; color:#777; }.table-actions { display:flex; justify-content:flex-end; gap:6px; }.status-code { display:inline-flex; align-items:center; gap:6px; font-family:monospace; }.status-code::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; }.status-200 { color:var(--green); }.status-429 { color:#ffb84d; }.status-500 { color:#ff6258; }
.dash-toolbar { display:flex; gap:10px; margin-bottom:18px; }.dash-toolbar .search-box { flex:1; max-width:none; border:1px solid #303030; padding:10px 14px; background:#111; }.dash-toolbar select { background:#111; color:#888; border:1px solid #303030; padding:0 34px 0 12px; }.request-id { color:#666; font-family:monospace; }
.dash-model-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }.dash-model-card { position:relative; min-height:210px; padding:20px; border:1px solid #303030; background:#111; display:flex; flex-direction:column; transition:border-color .2s,transform .2s; }.dash-model-card:hover { border-color:#5a5a5a; transform:translateY(-2px); }.dash-model-card .model-logo { margin-bottom:auto; }.dash-model-card h3 { margin:22px 0 3px; }.dash-model-card p { color:#666; margin:0; font-size:11px; }.dash-model-card .model-arrow { position:absolute; right:18px; top:18px; }
.balance-hero { background:var(--paper); color:var(--ink); padding:34px; display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; }.balance-hero span { color:#777; font-size:10px; text-transform:uppercase; }.balance-hero strong { display:block; font-size:42px; letter-spacing:-.05em; margin-top:4px; }.balance-note { text-align:right; color:#777; font-size:11px; }.payment-method { display:flex; align-items:center; gap:12px; }.card-chip { width:34px; height:24px; border:1px solid #555; display:grid; place-items:center; font-size:8px; color:#777; }

@media (max-width:1000px) { .dash-model-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:700px) {
  .dash-page-head { align-items:flex-start; flex-direction:column; gap:20px; }.dash-kpi-row { grid-template-columns:1fr; }.dash-toolbar { flex-direction:column; }.dash-toolbar select { height:44px; }.data-table { min-width:720px; }.dash-model-grid { grid-template-columns:1fr; }.balance-hero { align-items:flex-start; flex-direction:column; gap:20px; }.balance-note { text-align:left; }
}

/* Model details and playground */
.model-detail-hero { padding:72px 5.8% 58px; border-bottom:1px solid var(--line); }.model-detail-wrap { max-width:var(--max); margin:auto; }.model-breadcrumb { color:#606060; font-size:11px; margin-bottom:38px; }.model-breadcrumb a { transition:color .2s; }.model-breadcrumb a:hover { color:#fff; }.model-identity { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:24px; }.model-identity .model-logo { width:76px; height:76px; font-size:24px; }.model-identity h1 { margin:0; font-size:clamp(42px,5vw,74px); line-height:.95; letter-spacing:-.06em; }.model-identity p { margin:8px 0 0; color:#777; }.model-id-box { display:flex; align-items:center; gap:18px; background:#111; border:1px solid #303030; padding:13px 15px; }.model-id-box code { color:#aaa; font-size:11px; }.model-id-box button { border:0; background:none; color:#fff; cursor:pointer; font-size:11px; }
.model-detail-content { max-width:var(--max); margin:auto; padding:42px 5.8% 120px; }.model-stat-row { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid #303030; border-left:1px solid #303030; margin-bottom:32px; }.model-stat { padding:20px; border-right:1px solid #303030; border-bottom:1px solid #303030; }.model-stat span { color:#5f5f5f; font-size:9px; text-transform:uppercase; letter-spacing:.08em; }.model-stat strong { display:block; margin-top:8px; font-size:18px; }
.model-info-grid { display:grid; grid-template-columns:.7fr 1.3fr; gap:8%; margin-bottom:70px; }.model-description h2,.playground-section h2 { font-size:34px; letter-spacing:-.045em; margin:0 0 18px; }.model-description p { color:#999; line-height:1.75; }.capability-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:24px; }.capability-list span { border:1px solid #303030; padding:7px 10px; color:#888; font-size:10px; text-transform:uppercase; }.model-benchmark { border:1px solid #303030; padding:24px; }.benchmark-head { display:flex; justify-content:space-between; margin-bottom:24px; }.benchmark-head h3 { margin:0; }.benchmark-head span { color:#555; font-size:10px; }.benchmark-row { display:grid; grid-template-columns:120px 1fr 40px; align-items:center; gap:14px; margin:18px 0; font-size:11px; }.benchmark-track { height:3px; background:#292929; }.benchmark-track i { display:block; height:100%; background:var(--red); }.benchmark-row strong { text-align:right; }
.playground-section { border-top:1px solid #303030; padding-top:55px; }.playground-head { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:24px; }.playground-head p { color:#666; margin:0; }.playground { display:grid; grid-template-columns:minmax(0,1fr) 230px minmax(0,1fr); border:1px solid #303030; min-height:470px; background:#0d0d0d; }.play-panel { display:flex; flex-direction:column; min-width:0; }.play-panel + .play-panel,.play-settings { border-left:1px solid #303030; }.play-panel-head { height:52px; display:flex; align-items:center; justify-content:space-between; padding:0 18px; border-bottom:1px solid #292929; color:#aaa; font-size:11px; }.play-panel textarea { flex:1; resize:none; border:0; outline:0; background:#111; color:#ddd; padding:20px; line-height:1.7; }.play-footer { min-height:64px; border-top:1px solid #292929; padding:10px 14px; display:flex; align-items:center; justify-content:space-between; }.play-footer span { color:#555; font-size:10px; }.play-settings { padding:18px; }.play-settings h3 { margin:0 0 24px; font-size:12px; }.setting { margin:20px 0; }.setting-head { display:flex; justify-content:space-between; color:#777; font-size:10px; margin-bottom:9px; }.setting input[type=range] { width:100%; accent-color:var(--red); }.setting select { width:100%; color:#aaa; background:#111; border:1px solid #303030; padding:9px; }.play-output { flex:1; padding:20px; color:#929292; line-height:1.7; white-space:pre-wrap; }.play-output.loading { color:#fff; animation:pulse 1s infinite alternate; } @keyframes pulse { to { opacity:.35; } }

/* Standalone content pages */
.content-page { max-width:var(--max); margin:auto; padding:95px 5.8% 130px; }.content-page-head { display:grid; grid-template-columns:1fr .8fr; gap:8%; align-items:end; padding-bottom:65px; border-bottom:1px solid #303030; }.content-page-head h1 { margin:0; font-size:clamp(60px,8vw,112px); line-height:.88; letter-spacing:-.07em; }.content-page-head p { color:#888; font-size:18px; max-width:520px; }.content-blocks { display:grid; grid-template-columns:repeat(3,1fr); border-left:1px solid #303030; margin-top:60px; }.content-block { padding:28px; min-height:260px; border-right:1px solid #303030; border-top:1px solid #303030; border-bottom:1px solid #303030; }.content-block span { color:var(--red); font-family:monospace; font-size:11px; }.content-block h2 { margin:60px 0 10px; font-size:22px; }.content-block p { color:#777; }.status-list { margin-top:50px; border-top:1px solid #303030; }.status-item { display:grid; grid-template-columns:1fr auto; padding:22px 0; border-bottom:1px solid #292929; }.status-item strong::before { content:""; display:inline-block; width:6px; height:6px; background:var(--green); border-radius:50%; margin-right:8px; }
/* Real /status page (Stage 3) */
.status-toolbar { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-top:45px; flex-wrap:wrap; }
.status-updated { color:#888; font-size:12px; font-family:monospace; }
.status-section { margin-top:55px; }
.status-section-head { display:flex; align-items:center; gap:16px; flex-wrap:wrap; padding-bottom:14px; border-bottom:1px solid #303030; }
.status-section-head h2 { margin:0; font-size:22px; }
.status-section-head h3 { margin:0; font-size:16px; font-family:monospace; }
.status-note { color:#777; font-size:12px; }
.status-metric-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:20px 28px; padding:22px 0; border-bottom:1px solid #292929; }
.status-model { margin-top:30px; }
.status-badge { display:inline-flex; align-items:center; gap:8px; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:#999; }
.status-badge[data-status="operational"] { color:#9fd3a8; }
.status-badge[data-status="degraded"] { color:#e6b566; }
.status-badge[data-status="outage"] { color:#f08a80; }

@media (max-width:1000px) {
  .model-identity { grid-template-columns:auto 1fr; }.model-id-box { grid-column:1/-1; width:fit-content; }.model-info-grid { grid-template-columns:1fr; }.playground { grid-template-columns:1fr 200px; }.play-panel:last-child { grid-column:1/-1; border-left:0; border-top:1px solid #303030; min-height:300px; }
}
@media (max-width:700px) {
  .model-detail-hero { padding:55px 20px 45px; }.model-identity { grid-template-columns:1fr; }.model-identity .model-logo { width:64px;height:64px; }.model-id-box { grid-column:auto; max-width:100%; }.model-id-box code { overflow:hidden; text-overflow:ellipsis; }.model-detail-content { padding:35px 20px 90px; }.model-stat-row { grid-template-columns:1fr 1fr; }.model-info-grid { gap:35px; }.playground-head { align-items:flex-start; flex-direction:column; gap:12px; }.playground { grid-template-columns:1fr; }.play-settings,.play-panel + .play-panel { border-left:0; border-top:1px solid #303030; }.play-settings { min-height:260px; }.content-page { padding:65px 20px 90px; }.content-page-head { grid-template-columns:1fr; gap:28px; }.content-blocks { grid-template-columns:1fr; }
}

/* ==========================================================================
   Stage 6.1 — Editorial Terminal foundation
   Tokens live in :root. This block applies: focus visibility, minimum
   contrast for meaningful text, the --surface level for data panels,
   density modes, the skeleton component and reduced-motion support.
   ========================================================================== */

/* --- Focus visibility (keyboard) --- */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.search-box:focus-within { border-color: var(--red); }
.search-box input:focus { outline: none; } /* ring is carried by the wrapper */

/* --- Contrast: meaningful text >= --muted-min (#8a8a8a) ---
   Decorative/disabled elements may stay darker; everything a user must
   read to complete a task is lifted to the contrast scale. */
.table-cell span,
.model-stat span,
.stat-card span,
.footer-label,
.catalog-count,
.model-main p,
.model-mini p,
.model-provider,
.docs-sidebar a,
.docs-sidebar h4,
.code-tabs button,
.copy-button,
.filter-button,
.status-note,
.model-breadcrumb,
.dash-kpi span { color: var(--muted-min); }
.empty-state,
.doc-note,
.inner-lede,
.status-updated,
.footer-grid a,
.status-badge { color: var(--muted-mid); }
.section-copy, .hero-copy { color: var(--muted-strong); }
.main-nav { color: var(--muted-strong); }
.text-link { color: var(--muted-strong); }
.footer-top p { color: var(--muted-min); }
.footer-bottom { color: var(--muted-min); }

/* --- Surface level for data panels --- */
.code-window,
.doc-note,
.endpoint,
.model-id-box,
.panel { background: var(--surface); }

/* --- Density modes ---
   Marketing surfaces stay spacious; data surfaces (catalog, status, docs
   tables) compact vertical rhythm so more data fits above the fold. */
.density-marketing { --section-pad: var(--pad-marketing); }
.density-data { --section-pad: var(--pad-data); }
.catalog { padding-bottom: 90px; }
.model-row { min-height: var(--row-data); padding: 14px 20px; }
.status-section { margin-top: 44px; }
.status-metric-grid { padding: 18px 0; }

/* --- Skeleton component ---
   <div class="skeleton" aria-hidden="true"></div>; width/height set by
   modifier or inline style. Pulse disabled by prefers-reduced-motion. */
.skeleton {
  position: relative;
  min-height: 14px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  animation: skeletonPulse 1.3s ease-in-out infinite alternate;
}
.skeleton-row { min-height: var(--row-data); margin-bottom: 1px; border-radius: 0; }
.skeleton-text { max-width: 340px; height: 14px; margin: 8px 0; }
@keyframes skeletonPulse { from { opacity: .45; } to { opacity: .9; } }

/* --- Touch targets (mobile) --- */
@media (max-width: 700px) {
  .filter-button { min-height: 44px; }
  .code-tabs button { min-height: 44px; }
  .copy-button { min-height: 44px; padding: 0 10px; }
  .lang-toggle, .mobile-lang { min-height: 44px; }
}

/* --- Reduced motion: disables ALL animation and smooth scroll --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .skeleton { animation: none; opacity: .7; }
  .ticker-inner { animation: none; }
  .button:hover { transform: none; }
}

/* ==========================================================================
   Stage 6.2 — Model detail page (/catalog/:id) + linked catalog rows
   Data-density mode of the Editorial Terminal direction: compact sections,
   mono-dominant values, red reserved for action and status semantics.
   ========================================================================== */

/* Catalog rows are now real links */
a.model-row { color: inherit; text-decoration: none; }
a.model-row:hover { background: var(--surface); }
a.model-row:hover h3 { color: var(--red); }

/* Page frame */
.model-detail-page { padding: 40px 5.8% 64px; }
.model-detail-wrap { max-width: var(--max); margin: auto; }
.model-breadcrumb { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.model-breadcrumb a { color: var(--muted-min); text-decoration: none; }
.model-breadcrumb a:hover { color: var(--white); }
.model-breadcrumb code { font-size: 12px; color: var(--muted-strong); }

/* Identity header */
.model-identity { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; margin-top: 34px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.model-identity .model-logo { width: 72px; height: 72px; font-size: 24px; }
.model-identity-main h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.02em; line-height: 1; }
.model-id-box { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
.model-id-box code { font-size: 13px; color: var(--muted-strong); }
.model-fact { display: block; margin-top: 10px; font-size: 12px; color: var(--muted-min); }
.model-fact code { color: var(--muted-strong); margin-left: 6px; }
.model-example-jump { align-self: start; }

/* Capability / native-format matrix */
.model-matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 22px 0; }
.model-matrix-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-min); margin-bottom: 12px; }
.model-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Read-only chips: no hover accent, visually distinct from filter buttons */
.model-chip { display: inline-flex; align-items: center; padding: 6px 12px; font-size: 12px; font-family: monospace; color: var(--muted-strong); background: var(--surface); border: 1px solid var(--line); }

/* Metrics */
.model-metrics-badge { padding: 16px 0 4px; }
#model-metrics-body .status-note { padding: 4px 0; display: block; }

/* Related navigation */
.model-related { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
  .model-detail-page { padding: 40px 20px 90px; }
  .model-identity { grid-template-columns: 1fr; gap: 16px; }
  .model-identity .model-logo { width: 56px; height: 56px; font-size: 18px; }
  .model-id-box { max-width: 100%; }
  .model-id-box code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .model-matrix { grid-template-columns: 1fr; }
  .model-related { flex-direction: column; gap: 16px; }
}

/* ==========================================================================
   Stage 6.3 — Catalog polish: toolbar hierarchy (search / filters / sort /
   result count), accessible sort control, screen-reader-only labels.
   ========================================================================== */

/* Visually hidden but announced to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Toolbar: search grows, filters center, sort pinned right */
.catalog-toolbar { grid-template-columns: minmax(220px, 1fr) auto auto; }

.sort-control { display: flex; align-items: center; gap: 10px; }
.sort-control label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-min); white-space: nowrap; }
.sort-control select {
  min-height: 40px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted-strong);
  border: 1px solid #303030;
  font-size: 13px;
  cursor: pointer;
}
.sort-control select:hover { border-color: #4a4a4a; }

.catalog-count { min-height: 20px; }

@media (max-width: 700px) {
  .catalog-toolbar { grid-template-columns: 1fr; }
  .sort-control { justify-content: space-between; }
  .sort-control select { min-height: 44px; flex: 1; max-width: 320px; }
  .search-box { min-height: 44px; max-width: none; }
}

/* ==========================================================================
   Stage 6.4 — Status hierarchy: verdict → window → totals → API → models.
   Only contract fields are represented; percentile confidence stays visible.
   ========================================================================== */
.status-page { max-width: none; }
.status-page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line); }
.status-page-head h1 { margin: var(--space-2) 0 0; font-size: clamp(42px, 7vw, 92px); line-height: .92; letter-spacing: -.055em; }
.status-current { flex: none; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; }
.status-badge-large { padding: 10px 14px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
.status-marker { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-min); flex: none; }
.status-badge[data-status="operational"] .status-marker { background: var(--green); }
.status-badge[data-status="degraded"] .status-marker { background: #e8a33d; }
.status-badge[data-status="outage"] .status-marker { background: var(--red); }
.status-badge[data-status="unknown"] { color: var(--muted-min); }
.status-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.status-updated { font-family: monospace; font-size: 11px; color: var(--muted-min); }
.status-loading { padding: var(--space-5) 0; }
.status-token-strip { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, 1fr); gap: 1px; margin-top: var(--space-5); background: var(--line); border: 1px solid var(--line); }
.status-token-strip > * { padding: var(--space-4); background: var(--surface); }
.status-token-strip h2 { margin: 0 0 var(--space-2); font-size: 19px; }
.status-token-strip p { margin: 0; color: var(--muted-min); font-size: 12px; }
.status-api-overall, .status-models { margin-top: var(--space-6); }
.status-section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.status-section-head h2 { margin: var(--space-2) 0 0; font-size: clamp(24px, 3vw, 38px); }
.status-summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.status-summary-metric { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-4); background: var(--surface); }
.status-summary-metric span { color: var(--muted-min); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-summary-metric strong { font-family: monospace; font-size: clamp(16px, 2vw, 24px); font-weight: 500; overflow-wrap: anywhere; }
.status-key-metric strong { color: var(--white); }
.status-timing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, max-content)); gap: 1px; margin-top: 1px; background: var(--line); width: fit-content; max-width: 100%; }
.status-percentiles { padding: var(--space-4); background: var(--surface); }
.status-metric-label { display: block; color: var(--muted-min); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-percentile-values { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-3); }
.status-percentile-values span { display: flex; flex-direction: column; gap: var(--space-1); }
.status-percentile-values small, .status-samples { color: var(--muted-min); font-size: 10px; }
.status-percentile-values strong { font-family: monospace; font-size: 18px; font-weight: 500; }
.status-samples { display: block; margin-top: var(--space-3); }
.status-token-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 1px; background: var(--line); }
.status-model-table { border: 1px solid var(--line); overflow: hidden; }
.status-model-header, .status-model-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) repeat(2, minmax(100px, .75fr)) repeat(3, minmax(145px, 1fr)) minmax(120px, .8fr); }
.status-model-header { background: var(--surface-2); }
.status-model-header span { padding: 12px; color: var(--muted-min); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.status-model-row { border-top: 1px solid var(--line); background: var(--surface); }
.status-model-cell { min-width: 0; padding: 14px 12px; border-left: 1px solid var(--line); }
.status-model-cell:first-child { border-left: 0; }
.status-model-cell > strong { font-family: monospace; font-weight: 500; }
.status-model-cell .status-percentiles { padding: 0; }
.status-model-cell .status-metric-label { display: none; }
.status-model-identity { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.status-model-link { color: var(--white); text-decoration: none; overflow-wrap: anywhere; }
.status-model-link:hover { color: var(--red); }
.status-row-note { display: block; margin-top: var(--space-2); color: var(--muted-min); font-size: 10px; line-height: 1.5; }
.status-note { margin-top: var(--space-3); }
.status-legend { margin-top: var(--space-6); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-legend summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; color: var(--muted-strong); }
.status-legend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); padding: 0 0 var(--space-5); }
.status-legend-grid p { margin: 0; color: var(--muted-min); line-height: 1.6; }
.status-legend-grid strong { color: var(--muted-strong); }

@media (max-width: 1100px) {
  .status-model-header { display: none; }
  .status-model-table { border: 0; overflow: visible; }
  .status-model-row { grid-template-columns: repeat(2, 1fr); margin-bottom: var(--space-3); border: 1px solid var(--line); }
  .status-model-cell { border-left: 0; border-top: 1px solid var(--line); }
  .status-model-cell::before { content: attr(data-label); display: block; margin-bottom: var(--space-2); color: var(--muted-min); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
  .status-model-identity { grid-column: 1 / -1; border-top: 0; }
}

@media (max-width: 700px) {
  .status-page-head { align-items: flex-start; flex-direction: column; }
  .status-toolbar { align-items: flex-start; flex-direction: column; }
  .status-token-strip, .status-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .status-token-strip > div:first-child { grid-column: 1 / -1; }
  .status-timing-grid, .status-token-breakdown, .status-legend-grid { grid-template-columns: 1fr; width: auto; }
  .status-section-head { align-items: flex-start; flex-direction: column; }
  .status-model-row { grid-template-columns: 1fr 1fr; }
  .status-model-cell { padding: var(--space-3); }
}
