/* Goodhart's design system.
   One stylesheet, no framework. Tokens first, then base, then components.
   Class names are deliberately not Bootstrap's (fork_audit's mixed-framework check). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); }

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 18px;
  --fs-xl: 21px; --fs-2xl: 26px; --fs-3xl: 34px; --fs-4xl: 44px;
  --fs-hero: clamp(36px, 6.4vw, 68px);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;
  --w-page: 1200px; --w-text: 720px; --gutter: 24px;
  --nav-h: 60px;

  --bg: #fbfbfa; --bg-subtle: #f4f4f2; --surface: #ffffff; --surface-2: #f7f7f5;
  --border: #e6e6e2; --border-strong: #d4d4cf;
  --text: #111318; --text-2: #4a505c; --text-3: #7a808b;
  --accent: #0e7a55; --accent-hover: #0b6646; --accent-fg: #ffffff; --accent-soft: #e6f4ee; --accent-ink: #0b5e42;
  --amber: #a3620a; --amber-soft: #fbf1df;
  --violet: #6b46c1; --violet-soft: #f0ebfb;
  --red: #c2352b; --red-soft: #fcebea;
  --code-bg: #f6f6f3;
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, .05);
  --shadow: 0 1px 2px rgba(17, 19, 24, .04), 0 4px 16px rgba(17, 19, 24, .06);
  --shadow-lg: 0 2px 6px rgba(17, 19, 24, .05), 0 18px 48px rgba(17, 19, 24, .12);
  --ring: 0 0 0 3px rgba(14, 122, 85, .22);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0e; --bg-subtle: #101114; --surface: #131519; --surface-2: #181b20;
    --border: #23262c; --border-strong: #31353d;
    --text: #eceef2; --text-2: #a5abb6; --text-3: #737a86;
    --accent: #38d394; --accent-hover: #5fe0ab; --accent-fg: #06140e; --accent-soft: rgba(56, 211, 148, .12); --accent-ink: #6fe6b6;
    --amber: #f0b24a; --amber-soft: rgba(240, 178, 74, .12);
    --violet: #a98bfa; --violet-soft: rgba(169, 139, 250, .14);
    --red: #f2716a; --red-soft: rgba(242, 113, 106, .12);
    --code-bg: #0f1114;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .5);
    --ring: 0 0 0 3px rgba(56, 211, 148, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c0e; --bg-subtle: #101114; --surface: #131519; --surface-2: #181b20;
  --border: #23262c; --border-strong: #31353d;
  --text: #eceef2; --text-2: #a5abb6; --text-3: #737a86;
  --accent: #38d394; --accent-hover: #5fe0ab; --accent-fg: #06140e; --accent-soft: rgba(56, 211, 148, .12); --accent-ink: #6fe6b6;
  --amber: #f0b24a; --amber-soft: rgba(240, 178, 74, .12);
  --violet: #a98bfa; --violet-soft: rgba(169, 139, 250, .14);
  --red: #f2716a; --red-soft: rgba(242, 113, 106, .12);
  --code-bg: #0f1114;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .5);
  --ring: 0 0 0 3px rgba(56, 211, 148, .25);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: var(--fs-base); line-height: 1.55; font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
main { flex: 1 0 auto; }
img, svg, iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
p { margin: 0 0 var(--s-4); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--code-bg); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-8) 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--text { max-width: calc(var(--w-text) + 2 * var(--gutter)); }
.wrap--narrow { max-width: calc(460px + 2 * var(--gutter)); }
.section { padding: var(--s-16) 0; }
.section--tight { padding: var(--s-10) 0; }
.section + .section { border-top: 1px solid var(--border); }
.stack > * + * { margin-top: var(--s-4); }
.stack-sm > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.cluster--lg { gap: var(--s-4); }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-10); align-items: start; }
.sticky { position: sticky; top: calc(var(--nav-h) + 20px); }
.center { text-align: center; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0 !important; }

/* ---------- type ---------- */
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kicker--plain::before { display: none; }
.h-hero { font-size: var(--fs-hero); font-weight: 820; letter-spacing: -.038em; line-height: 1.02; text-wrap: balance; }
.h1 { font-size: var(--fs-4xl); font-weight: 780; letter-spacing: -.032em; text-wrap: balance; }
.h2 { font-size: var(--fs-3xl); font-weight: 750; letter-spacing: -.028em; text-wrap: balance; }
.h3 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.018em; }
.h4 { font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; }
.lede { font-size: var(--fs-lg); color: var(--text-2); line-height: 1.6; max-width: 640px; text-wrap: pretty; }
.prose { font-size: var(--fs-md); line-height: 1.72; color: var(--text); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose h2 { font-size: var(--fs-2xl); margin: 2em 0 .6em; letter-spacing: -.022em; }
.prose h3 { font-size: var(--fs-lg); margin: 1.6em 0 .5em; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose li { margin: .35em 0; }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--accent); color: var(--text-2); }
.prose .cite { font-size: var(--fs-sm); color: var(--text-3); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.section-head p { margin: 6px 0 0; color: var(--text-2); }

/* ---------- header ---------- */
.nav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: var(--s-6); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16.5px; letter-spacing: -.02em; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { padding: 6px 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--text-2); }
.nav-links a:hover { color: var(--text); background: var(--bg-subtle); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-ico-dark { display: none; }
[data-theme="dark"] .theme-ico-dark { display: block; } [data-theme="dark"] .theme-ico-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-ico-dark { display: block; } :root:not([data-theme="light"]) .theme-ico-light { display: none; } }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 50; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg-subtle); color: var(--text); }
.menu-panel .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-panel .meta { padding: 8px 10px 6px; font-size: var(--fs-xs); color: var(--text-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; border: 1px solid var(--border); }
.nav-mobile { display: none; }

/* ---------- buttons ---------- */
.btn { --h: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); letter-spacing: -.005em; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s, transform .06s; text-decoration: none; }
.btn:hover { border-color: var(--text-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-solid:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); color: var(--bg); border-color: transparent; }
.btn-accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); border-color: transparent; }
.btn-destroy { color: var(--red); }
.btn-destroy:hover { border-color: var(--red); color: var(--red); }
.btn-sm { --h: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { --h: 44px; padding: 0 20px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }
.link { color: var(--accent-ink); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.arrow::after { content: " \2192"; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: var(--s-6); }
.panel-head { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.panel-head h2, .panel-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -.005em; }
.panel-body { padding: var(--s-5); }
.panel--flat { box-shadow: none; }
.panel--inset { background: var(--surface-2); box-shadow: none; }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); border-radius: var(--r); padding: var(--s-4) var(--s-5); }
.callout--amber { border-left-color: var(--amber); }
.callout--violet { border-left-color: var(--violet); }
.notice { padding: 11px 14px; border-radius: var(--r); font-size: 14px; border: 1px solid var(--border); background: var(--surface); }
.notice--error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.notice--ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-ink); }
.notice ul { margin: 0; padding-left: 18px; }
.toasts { position: fixed; top: calc(var(--nav-h) + 12px); right: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: var(--r); font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; }
.toast--error { background: var(--red); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; line-height: 1; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); white-space: nowrap; }
.chip svg { width: 12px; height: 12px; }
.chip--unseen { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.chip--seen { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.chip--sealed { color: var(--violet); background: var(--violet-soft); border-color: transparent; }
.chip--retired { color: var(--text-3); background: var(--bg-subtle); }
.chip--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.type-tag { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--s-5); }
.label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.hint { font-size: var(--fs-sm); color: var(--text-3); }
.input, .textarea, .select, .field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=datetime-local], .field textarea, .field select {
  width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 400 15px/1.45 var(--font); transition: border-color .12s, box-shadow .12s; }
.field textarea, .textarea { min-height: 110px; resize: vertical; }
.field textarea.mono, .textarea.mono { font-family: var(--mono); font-size: 14px; }
.input:focus, .textarea:focus, .select:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.field .errorlist, .errorlist { list-style: none; margin: 0; padding: 0; color: var(--red); font-size: var(--fs-sm); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.choices ul, .choices div { display: contents; }
.choices label, .choice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; }
.choices label:has(input:checked), .choice:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.choices input { accent-color: var(--accent); }
.captcha-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.captcha-row img { border-radius: var(--r-sm); border: 1px solid var(--border); background: #fff; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---------- segmented control / tabs ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r); }
.seg a { padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.seg a:hover { color: var(--text); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin: -1px; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin-bottom: var(--s-6); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills a { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--r-full); border: 1px solid var(--border); font-size: 13px; font-weight: 550; color: var(--text-2); background: var(--surface); }
.pills a:hover { border-color: var(--border-strong); color: var(--text); }
.pills a[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- hero ---------- */
.hero { position: relative; padding: var(--s-20) 0 var(--s-16); text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 640px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); opacity: .9; }
.hero > * { position: relative; }
.hero .kicker { margin: 0 auto var(--s-5); }
.hero h1 { max-width: 920px; margin: 0 auto; }
.hero .lede { margin: var(--s-5) auto 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: var(--s-8); }
.law { margin: var(--s-10) auto 0; max-width: 620px; font-size: var(--fs-sm); color: var(--text-3); }
.law q { color: var(--text-2); font-style: italic; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s-10); margin-top: var(--s-12); }
.stat b { display: block; font-size: var(--fs-2xl); font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--fs-sm); color: var(--text-3); }

/* ---------- output tiles ---------- */
.ogrid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ogrid--lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.otile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); min-width: 0; }
.otile-stage { position: relative; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--border); }
.otile-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.otile-stage--dark { background: #0e1014; }
.otile-text { padding: var(--s-4); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; border-bottom: 1px solid var(--border); flex: 1; }
.otile-code { padding: var(--s-4); background: var(--code-bg); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; max-height: 320px; overflow: auto; border-bottom: 1px solid var(--border); white-space: pre; flex: 1; }
.otile-foot { padding: 10px var(--s-4); display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.otile-model { font-weight: 650; font-size: 14px; letter-spacing: -.01em; line-height: 1.25; }
.otile-meta { font-size: var(--fs-xs); color: var(--text-3); }
.otile-blind .otile-foot { justify-content: center; }
details.source summary { cursor: pointer; font-size: var(--fs-xs); color: var(--text-3); padding: 0 var(--s-4) 10px; list-style: none; }
details.source summary::-webkit-details-marker { display: none; }
details.source pre { margin: 0 var(--s-4) var(--s-4); padding: var(--s-3); max-height: 240px; overflow: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 11.5px; white-space: pre-wrap; }

/* ---------- test cards ---------- */
.tlist { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.tcard { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.tcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.tcard-title { font-size: 16px; font-weight: 650; letter-spacing: -.012em; line-height: 1.3; }
.tcard-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tcard-prompt { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--fs-xs); color: var(--text-3); }
.tcard-thumb { margin-top: 14px; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: #fff; position: relative; }
.tcard-thumb iframe { width: 100%; height: 100%; border: 0; pointer-events: none; display: block; }
.tcard-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tcard .vote, .tcard .chip, .tcard-meta a { position: relative; z-index: 2; }
.rows { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.rows .trow + .trow { border-top: 1px solid var(--border); }
.trow { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: 14px var(--s-5); }
.trow:hover { background: var(--surface-2); }
.trow .tcard-title a::after { content: ""; position: absolute; inset: 0; }
.trow .vote, .trow .chip, .trow .tcard-meta a { position: relative; z-index: 2; }
.trow-rank { font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- vote ---------- */
.vote { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 52px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; font: 650 14px/1 var(--font); font-variant-numeric: tabular-nums; gap: 3px; transition: border-color .12s, color .12s, background .12s; padding: 0; }
.vote svg { width: 14px; height: 14px; }
.vote:hover { border-color: var(--accent); color: var(--accent-ink); }
.vote.is-on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.vote-form { margin: 0; }
.vote--lg { width: 64px; height: 68px; font-size: 17px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table .rank { width: 44px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.model-cell { display: flex; flex-direction: column; }
.model-cell b { font-weight: 650; }
.model-cell span { font-size: var(--fs-xs); color: var(--text-3); }
.rating { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ci { color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }
.gap-pos { color: var(--amber); font-weight: 650; }
.gap-neg { color: var(--accent-ink); font-weight: 650; }
.bar { height: 6px; border-radius: 3px; background: var(--bg-subtle); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- arena ---------- */
.arena-stage { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.arena-label { position: absolute; top: 10px; left: 10px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--text); color: var(--bg); font-weight: 750; font-size: 14px; }
.verdicts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: var(--s-5); }
.verdicts .btn { --h: 48px; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--text-3); }
.winner { box-shadow: 0 0 0 2px var(--accent), var(--shadow); border-color: transparent; }

/* ---------- prompt block ---------- */
.prompt { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5) var(--s-5) var(--s-4); font-family: var(--mono); font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.prompt-label { position: absolute; top: -9px; left: 14px; padding: 0 6px; background: var(--bg); font: 600 11px/18px var(--font); color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.sealed-box { border: 1px dashed color-mix(in srgb, var(--violet) 50%, transparent); background: var(--violet-soft); border-radius: var(--r-lg); padding: var(--s-6); text-align: center; color: var(--violet); }
.sealed-box b { display: block; font-size: var(--fs-lg); color: var(--text); margin: 8px 0 4px; }

/* ---------- freshness list ---------- */
.fresh-list { list-style: none; margin: 0; padding: 0; }
.fresh-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fresh-list li:last-child { border-bottom: 0; }
.meter { position: relative; height: 8px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; }

/* ---------- share ---------- */
.share { display: flex; flex-wrap: wrap; gap: 6px; }
.embed-code { width: 100%; font-family: var(--mono); font-size: 12px; padding: 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--code-bg); color: var(--text-2); resize: none; }

/* ---------- steps / features ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); counter-reset: step; }
.step { padding: var(--s-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; font: 600 12px var(--mono); color: var(--accent-ink); margin-bottom: 14px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--text-2); font-size: 14px; }
.feature-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 14px; }
.feature-ico svg { width: 18px; height: 18px; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); align-items: stretch; }
.price { display: flex; flex-direction: column; padding: var(--s-6); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.price--featured { border-color: var(--text); box-shadow: var(--shadow-lg); }
.price h3 { font-size: 15px; font-weight: 650; }
.price-amount { font-size: 40px; font-weight: 780; letter-spacing: -.035em; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.price-amount small { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.price ul { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; align-content: start; gap: 9px; font-size: 14px; color: var(--text-2); flex: 1; }
.price li { display: flex; gap: 9px; }
.price li::before { content: ""; flex: 0 0 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%230e7a55' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.pack-list { display: grid; gap: 8px; }
.pack { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; }
.pack:hover { border-color: var(--text-3); }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - var(--nav-h) - 220px); display: grid; place-items: center; padding: var(--s-16) var(--gutter); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-2); margin: 8px 0 var(--s-8); font-size: 14.5px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--text-2); margin-top: var(--s-6); }
.code-input { text-align: center; font-family: var(--mono) !important; font-size: 26px !important; letter-spacing: .4em; padding-left: .4em !important; }
.oauth { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: var(--s-5) 0; }
.oauth::before, .oauth::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- empty / error ---------- */
.empty { text-align: center; padding: var(--s-12) var(--s-6); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-2); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 16px; }
.errpage { text-align: center; padding: var(--s-24) var(--gutter); }
.errpage .code { font: 700 13px var(--mono); color: var(--accent-ink); letter-spacing: .1em; }
.errpage h1 { margin: 12px auto 10px; max-width: 640px; }

/* ---------- ranking editor ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-item { display: grid; grid-template-columns: 30px 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); cursor: grab; user-select: none; }
.rank-item.is-dragging { opacity: .5; }
.rank-item.is-over { border-color: var(--accent); box-shadow: var(--ring); }
.rank-num { font: 650 14px var(--mono); color: var(--text-3); text-align: right; }
.grip { color: var(--text-3); display: grid; place-items: center; }
.rank-move { display: flex; gap: 4px; }
.rank-move button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.rank-move button:hover { color: var(--text); border-color: var(--border-strong); }
.rank-card ol { list-style: none; margin: 0; padding: 0; counter-reset: rk; }
.rank-card li { counter-increment: rk; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.rank-card li::before { content: counter(rk); font: 750 22px var(--font); letter-spacing: -.03em; color: var(--text-3); text-align: right; }
.rank-card li:first-child::before { color: var(--accent-ink); }

/* ---------- chart ---------- */
.chart-frame { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-3); overflow: hidden; }
.chart-frame svg, .chart-frame img { display: block; width: 100%; height: auto; }

/* ---------- footer ---------- */
.footer { margin-top: var(--s-20); border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: 14px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: var(--s-8); padding: var(--s-12) 0 var(--s-10); }
.footer h4 { font-size: 12.5px; font-weight: 650; color: var(--text); margin-bottom: 12px; letter-spacing: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--text); }
.footer-blurb { color: var(--text-2); max-width: 300px; margin-top: 12px; font-size: 13.5px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; align-items: center; padding: var(--s-5) 0 var(--s-8); border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.footer-bottom a { color: var(--text-2); }
.lang-select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font: 500 13px var(--font); }
.canary { font-family: var(--mono); font-size: 11px; color: var(--text-3); word-break: break-all; }

/* ---------- feedback pill (desktop + tablet only) ---------- */
.fb-pill { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 600 13px var(--font); box-shadow: var(--shadow); cursor: pointer; }
.fb-pill:hover { color: var(--text); border-color: var(--border-strong); }
.fb-dialog { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.fb-dialog::backdrop { background: rgba(10, 12, 16, .45); }
@media (max-width: 767px) { .fb-pill { display: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .nav-links a.opt { display: none; }
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .grid-3, .grid-4, .steps, .price-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; --nav-h: 56px; }
  .nav .nav-links, .nav-right .hide-sm { display: none; }
  .nav-mobile { display: block; }
  .section { padding: var(--s-12) 0; }
  .hero { padding: var(--s-12) 0 var(--s-10); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .arena-stage { grid-template-columns: minmax(0, 1fr); }
  .verdicts { grid-template-columns: 1fr 1fr; }
  .h1 { font-size: 32px; }
  .h2 { font-size: 27px; }
  .tlist { grid-template-columns: minmax(0, 1fr); }
  .trow { grid-template-columns: minmax(0, 1fr) auto; padding: 14px var(--s-4); }
  .trow-rank { display: none; }
  .stats { gap: var(--s-6); }
  .table th, .table td { padding: 10px; }
  .hide-sm { display: none !important; }
  .ogrid, .ogrid--lg { grid-template-columns: minmax(0, 1fr); }
  .panel-pad { padding: var(--s-5); }
}
@media (min-width: 761px) { .show-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- fixes from the screenshot pass ---------- */
.grid > *, .layout-side > *, .stack > * { min-width: 0; }
.kv dt, .kv dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6) var(--s-4); max-width: 360px; margin-left: auto; margin-right: auto; }
  .hero-actions .btn { flex: 1 1 auto; }
}

.footer .brand { color: var(--text); }
.otile-foot .cluster { flex-wrap: nowrap; }
