/*
 * css/site.css: the Frodo Agent look on every page. Dark warm page, one orange, hairline boxes with corner studs,
 * dashed rails down the sides of the column, dotted gutters, pill buttons and an orange hero card that glows
 * from the bottom. Geist and Geist Mono (OFL) from /fonts.
 */
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  --bg: #151414;
  --bg-1: #1b1a1a;
  --bg-2: #222020;
  --bg-3: #2b2828;
  --ink: #f0e3de;
  --head: #fffbf5;
  --mute: rgba(240, 227, 222, 0.62);
  --dim: rgba(240, 227, 222, 0.42);
  --line: rgba(240, 227, 222, 0.125);
  --line-2: rgba(240, 227, 222, 0.22);
  --stud: #3a3636;
  --or: #ff5e1f;
  --or-2: #ff7b45;
  --or-3: #ffb08a;
  --or-ink: #1f1f1f;
  --glow: #fff1c9;
  --ok: #4ade80;
  --bad: #ff6b6b;
  --warn: #ffc857;
  --col: 1200px;
  --gut: max(16px, calc((100vw - var(--col)) / 2));
  --r: 16px;
  --r-s: 10px;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
  background-image: radial-gradient(rgba(240, 227, 222, 0.09) 1px, transparent 1.3px);
  background-size: 12px 12px; background-attachment: fixed;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: var(--or); color: #fff; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; color: var(--head); font-weight: 500; letter-spacing: -0.025em; }
p { margin: 0; }
code, kbd, pre, .mono { font-family: var(--mono); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--or); color: #fff; padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- the column: solid page between dashed rails, dots only in the gutters ---------- */
main { position: relative; }
.col {
  position: relative; width: min(var(--col), calc(100% - 32px)); margin: 0 auto; background: var(--bg);
  border-left: 1px dashed var(--line); border-right: 1px dashed var(--line);
}
.full { position: relative; width: 100%; background: var(--bg); }
.dash { height: 0; border-top: 1px dashed var(--line); }
.pad { padding: 96px 48px; }
.pad-s { padding: 64px 48px; }
@media (max-width: 760px) { .pad { padding: 64px 18px; } .pad-s { padding: 48px 18px; } }

/* ---------- type ---------- */
.h-xl { font-size: clamp(40px, 5.6vw, 72px); line-height: 1; letter-spacing: -0.03em; }
.h-l { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -0.028em; }
.h-m { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.05; }
.h-s { font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; }
.lede { font-size: clamp(17px, 1.5vw, 19.2px); line-height: 1.35; letter-spacing: -0.02em; color: var(--mute); }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.eyebrow b { color: var(--or); font-weight: 500; }
.or { color: var(--or); }
.muted { color: var(--mute); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }
.sec-head { display: grid; gap: 14px; max-width: 760px; margin: 0 auto 56px; text-align: center; }
.sec-head.left { margin-left: 0; text-align: left; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); font-weight: 500; font-size: 15px; line-height: 1.2; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { border-color: var(--line-2); background: rgba(240, 227, 222, 0.05); }
.btn-or { background: var(--or); border-color: var(--or); color: var(--head); }
.btn-or:hover { background: var(--or-2); border-color: var(--or-2); }
.btn-cream { background: var(--head); border-color: var(--head); color: var(--or-ink); }
.btn-cream:hover { background: #fff; border-color: #fff; }
.btn-ghost-cream { border-color: rgba(255, 251, 245, 0.5); color: var(--head); }
.btn-ghost-cream:hover { background: rgba(255, 251, 245, 0.12); border-color: var(--head); }
.btn-l { min-height: 48px; padding: 12px 24px; font-size: 16px; }
.btn-s { min-height: 30px; padding: 4px 11px; font-size: 13.5px; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.link { color: var(--or); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .arr { transition: transform .2s var(--ease); }
.link:hover .arr { transform: translateX(3px); }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40; height: 72px; display: flex; align-items: center; gap: 24px; padding: 0 20px;
  background: var(--bg); border-bottom: 1px dashed var(--line); transition: background .25s var(--ease), border-color .25s var(--ease);
}
.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; color: var(--or); }
.brand svg { width: 34px; height: 34px; }
.brand .word { font: 700 15px/1 var(--sans); letter-spacing: 0.22em; color: var(--head); }
.nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav > a, .nav > .nav-dd > button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 16px; color: var(--head);
}
.nav > a:hover, .nav > .nav-dd > button:hover, .nav > a[aria-current='page'] { background: rgba(240, 227, 222, 0.06); }
.nav .chev { width: 9px; height: 13px; opacity: .55; }
.nav-dd { position: relative; }
.nav-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; translate: -50% 0; min-width: 320px; padding: 8px; border-radius: 14px;
  background: var(--bg-1); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.nav-dd:hover .nav-menu, .nav-dd:focus-within .nav-menu, .nav-dd.open .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu a { display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: 10px; }
.nav-menu a:hover { background: rgba(240, 227, 222, 0.06); }
.nav-menu .ic { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 94, 31, .12); color: var(--or); }
.nav-menu .ic svg { width: 16px; height: 16px; }
.nav-menu b { font-weight: 500; color: var(--head); font-size: 15px; }
.nav-menu small { color: var(--mute); font-size: 13px; line-height: 1.35; }
.hdr-r { display: flex; align-items: center; gap: 8px; flex: none; }
.live-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--or-2); padding: 6px 8px; white-space: nowrap; }
.live-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, .15); }
.burger { display: none; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); place-items: center; }
.burger svg { width: 18px; height: 18px; }
/* past the hero the header shrinks to the mark and one orange pill, as the reference does */
.hdr.mini { background: transparent; border-color: transparent; pointer-events: none; }
.hdr.mini .brand, .hdr.mini .hdr-cta { pointer-events: auto; }
.hdr.mini .brand .word, .hdr.mini .nav, .hdr.mini .hdr-r > :not(.hdr-cta) { opacity: 0; visibility: hidden; }
.hdr .brand .word, .hdr .nav, .hdr .hdr-r > * { transition: opacity .2s var(--ease), visibility .2s; }
@media (max-width: 1080px) { .live-chip { display: none; } }
@media (max-width: 920px) {
  .nav, .hdr-r .btn:not(.hdr-cta) { display: none; }
  .burger { display: grid; }
  .hdr { gap: 12px; padding: 0 14px; height: 64px; }
  .hdr-r { margin-left: auto; }
  .brand .word { font-size: 13px; letter-spacing: 0.2em; }
  .brand svg { width: 30px; height: 30px; }
  /* phones keep the full header: a floating pill would sit on top of the text */
  .hdr.mini { background: var(--bg); border-color: var(--line); pointer-events: auto; }
  .hdr.mini .brand .word, .hdr.mini .hdr-r > .burger { opacity: 1; visibility: visible; }
}
/* the two-word wordmark plus the pill and burger fit down to 320px */
.brand .word { white-space: nowrap; }
@media (max-width: 400px) {
  .hdr { gap: 8px; padding: 0 12px; }
  .brand { gap: 8px; }
  .brand .word { font-size: 12px; letter-spacing: 0.12em; }
  .hdr .hdr-cta { padding-inline: 14px; font-size: 14px; }
}
@media (max-width: 340px) { .hdr .hdr-cta { display: none; } }

/* phone sheet */
.sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet.open { display: block; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.sheet-box {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg-1); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
}
.sheet-box a.row { display: flex; justify-content: space-between; align-items: center; padding: 14px 6px; border-bottom: 1px dashed var(--line); font-size: 18px; font-weight: 500; color: var(--head); }
.sheet-box .btns { display: grid; gap: 10px; margin-top: 16px; }
.sheet-box .btns .btn { min-height: 46px; }

/* ---------- the orange hero card ---------- */
.hero-wrap { padding: 8px; background: var(--bg); }
.hero-card {
  position: relative; overflow: hidden; border-radius: var(--r); background: var(--or); color: var(--head); isolation: isolate;
  min-height: min(760px, calc(100svh - 88px)); display: grid; place-items: center; padding: 72px 24px 96px;
}
.hero-card::before { /* dot matrix that fades toward the edges */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 236, 214, 0.22) 0.75px, transparent 1.05px); background-size: 4px 4px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, #000 25%, transparent 80%);
}
.hero-card::after { /* the sunrise at the bottom edge */
  content: ''; position: absolute; left: 50%; bottom: -30%; width: min(1200px, 130%); aspect-ratio: 2.7 / 1; translate: -50% 0; z-index: -1;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, var(--glow) 0%, #ffe39e 18%, rgba(255, 196, 120, 0.85) 34%, rgba(255, 140, 70, 0.5) 52%, rgba(255, 94, 31, 0) 72%);
  filter: blur(6px); animation: sunrise 9s ease-in-out infinite alternate;
}
@keyframes sunrise { from { opacity: .82; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }
.hero-card .vign { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 55%, rgba(170, 45, 0, .28) 100%); pointer-events: none; }
.hero-in { width: min(1000px, 100%); display: grid; gap: 22px; justify-items: center; text-align: center; }
.hero-in h1 { font-size: clamp(38px, 5.2vw, 64px); line-height: 1; letter-spacing: -0.032em; max-width: 920px; text-wrap: balance; }
.hero-in .lede { color: var(--head); opacity: .95; max-width: 640px; }
.hero-in .lede b { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .hero-card::after { animation: none; } }

/* ---------- boxes with corner studs ---------- */
.box { position: relative; border: 1px solid var(--line); background: var(--bg); }
.studs::before, .studs::after {
  content: ''; position: absolute; left: -5px; right: -5px; height: 9px; pointer-events: none; z-index: 2;
  background: linear-gradient(var(--stud), var(--stud)) left / 9px 9px no-repeat, linear-gradient(var(--stud), var(--stud)) right / 9px 9px no-repeat;
}
.studs::before { top: -5px; }
.studs::after { bottom: -5px; }
.grid { display: grid; gap: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cells > * { border-right: 1px solid var(--line); }
.cells > *:last-child { border-right: 0; }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cells > * { border-bottom: 1px solid var(--line); } .cells > *:nth-child(2n) { border-right: 0; } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .cells > * { border-right: 0; } .cells > *:last-child { border-bottom: 0; } }
.cell { padding: 28px; display: grid; gap: 10px; align-content: start; }
.cell .ic { width: 34px; height: 34px; color: var(--ink); margin-bottom: 18px; }
.cell .ic svg { width: 26px; height: 26px; }
.cell h3 { font-size: 17px; letter-spacing: -0.01em; }
.cell p { color: var(--mute); font-size: 15px; line-height: 1.45; }
.cell .k { font: 500 12px/1 var(--mono); color: var(--or); letter-spacing: .06em; }
.box-or { background: var(--or); border-color: var(--or); color: var(--head); }
.box-or p { color: rgba(255, 251, 245, .9); }

/* ---------- stat row (live numbers) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 26px 28px; border-right: 1px solid var(--line); display: grid; gap: 6px; }
.stat:last-child { border-right: 0; }
.stat b { font: 500 clamp(26px, 3vw, 36px)/1 var(--sans); letter-spacing: -0.03em; color: var(--head); font-variant-numeric: tabular-nums; }
.stat span { color: var(--mute); font-size: 14px; }
.stat .live { display: inline-flex; gap: 6px; align-items: center; font: 500 11px/1 var(--mono); letter-spacing: .08em; color: var(--ok); text-transform: uppercase; }
.stat .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* ---------- tabs (pill row) ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); flex-wrap: wrap; justify-content: center; }
.tabs button, .tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 14.5px; color: var(--ink); }
.tabs button:hover, .tabs a:hover { background: rgba(240, 227, 222, 0.06); }
.tabs [aria-selected='true'], .tabs .on { background: var(--or); color: var(--head); }
.tabs img, .tabs svg { width: 16px; height: 16px; }

/* ---------- code / terminal ---------- */
.term { border: 1px solid var(--line); border-radius: 12px; background: #0f0e0e; overflow: hidden; }
.term-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--mono); color: var(--mute); }
.term pre { margin: 0; padding: 16px 18px; overflow: auto; font: 400 13.5px/1.65 var(--mono); color: var(--ink); white-space: pre; }
.term .c { color: var(--dim); }
.term .s { color: #ffb08a; }
.term .k { color: var(--or-2); }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); font: 500 11.5px/1 var(--mono); color: var(--mute); }
.copy-btn:hover { color: var(--head); border-color: var(--line-2); }
code.inl { font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.addr { font: 400 13px/1.4 var(--mono); color: var(--mute); word-break: break-all; }
.addr:hover { color: var(--head); }

/* ---------- logo strip / marquee ---------- */
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-in { display: flex; gap: 56px; width: max-content; animation: marq 40s linear infinite; padding: 6px 0; }
.marquee:hover .marquee-in { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(-50%); } }
.lab { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 18px; color: var(--mute); white-space: nowrap; }
.lab img { width: 24px; height: 24px; filter: grayscale(1) brightness(1.6); opacity: .8; }
@media (prefers-reduced-motion: reduce) { .marquee-in { animation: none; } }

/* ---------- model chips and icons ---------- */
.mi { width: 18px; height: 18px; border-radius: 5px; flex: none; object-fit: contain; }
.mi-t { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--bg-3); color: var(--head); font: 600 10px/1 var(--mono); flex: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; font: 600 11px/1 var(--mono); letter-spacing: .04em; white-space: nowrap; }
.badge-or { background: var(--or); color: var(--head); }
.badge-soft { background: rgba(255, 94, 31, .14); color: var(--or-2); }
.badge-line { border: 1px solid var(--line); color: var(--mute); }

/* ---------- CTA band (orange, bottom of pages) ---------- */
.cta-card { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r); background: var(--or); color: var(--head); padding: 110px 24px 0; text-align: center; }
.cta-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 236, 214, 0.2) .75px, transparent 1.05px); background-size: 4px 4px; -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 60%, #000 20%, transparent 80%); mask-image: radial-gradient(ellipse 70% 70% at 50% 60%, #000 20%, transparent 80%); }
.cta-card::after { content: ''; position: absolute; left: 50%; bottom: -40%; width: min(900px, 130%); aspect-ratio: 2.4 / 1; translate: -50% 0; z-index: -1; background: radial-gradient(ellipse 50% 50% at 50% 50%, var(--glow) 0%, #ffe39e 20%, rgba(255, 180, 110, .7) 40%, rgba(255, 94, 31, 0) 70%); filter: blur(6px); }
.cta-card h2 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1; }
.cta-card .lede { color: var(--head); margin: 18px auto 30px; max-width: 620px; }
.cta-card .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 96px; }
.cta-card .float { position: absolute; width: 58px; height: 58px; border-radius: 14px; border: 1px solid rgba(255, 251, 245, .45); display: grid; place-items: center; color: rgba(255, 251, 245, .8); z-index: -1; }
.cta-card .float svg { width: 24px; height: 24px; }
.ticker { position: relative; display: flex; overflow: hidden; border-top: 1px solid rgba(255, 251, 245, .28); background: rgba(160, 40, 0, .12); }
.ticker-in { display: flex; gap: 48px; width: max-content; padding: 14px 0; animation: marq 46s linear infinite; }
.ticker span { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; font-size: 14.5px; color: var(--head); }
.ticker svg { width: 15px; height: 15px; }
@media (max-width: 760px) { .cta-card .float { display: none; } .cta-card { padding-top: 72px; } .cta-card .btns { margin-bottom: 64px; } }

/* ---------- footer ---------- */
.ftr { border-top: 1px dashed var(--line); background: var(--bg); }
.ftr-in { width: min(var(--col), calc(100% - 32px)); margin: 0 auto; padding: 56px 0 28px; }
.ftr-top { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.ftr .brand { align-self: start; }
.ftr-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; }
.ftr-cols p { font-size: 13px; color: var(--dim); margin-bottom: 12px; }
.ftr-cols a { display: block; padding: 4px 0; font-size: 15px; color: var(--ink); }
.ftr-cols a:hover { color: var(--or-2); }
.ftr-base { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; margin-top: 48px; padding-top: 20px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--dim); }
.ftr-base nav { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.ftr-base a:hover { color: var(--head); }
.ftr-social a { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); }
.ftr-social svg { width: 14px; height: 14px; fill: currentColor; }
@media (max-width: 860px) { .ftr-top { grid-template-columns: 1fr; } .ftr-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- toast, dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 90; translate: -50% 12px; opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--head); color: var(--or-ink); font-weight: 500; font-size: 14.5px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .6); transition: opacity .2s, translate .2s;
}
.toast.on { opacity: 1; translate: -50% 0; }
.dlg { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); }
.dlg-box { width: min(420px, 100%); max-height: 86vh; overflow: auto; padding: 22px; border-radius: 16px; background: var(--bg-1); border: 1px solid var(--line); display: grid; gap: 14px; }
.dlg-box h3 { font-size: 20px; }
.dlg-box p { color: var(--mute); font-size: 14.5px; }
.dlg-list { display: grid; gap: 8px; }
.dlg-list button { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); text-align: left; font-weight: 500; }
.dlg-list button:hover { border-color: var(--or); }
.dlg-list img { width: 24px; height: 24px; border-radius: 6px; }
.dlg-close { justify-self: end; color: var(--mute); padding: 6px 10px; border-radius: 999px; }
.dlg-close:hover { color: var(--head); background: rgba(240, 227, 222, .06); }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--mute); }
.input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-1); color: var(--head); outline: none; }
.input:focus { border-color: var(--or); }
.input::placeholder { color: var(--dim); }

/* ---------- simple pages (terms, privacy, 404, docs prose) ---------- */
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(36px, 4.4vw, 52px); line-height: 1.04; margin-bottom: 16px; }
.prose h2 { font-size: 26px; margin: 44px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--mute); line-height: 1.65; }
.prose p + p { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 20px; display: grid; gap: 6px; }
.prose a { color: var(--or-2); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--head); font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font: 500 12px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--mute); vertical-align: top; }
.tbl td b, .tbl td strong { color: var(--head); font-weight: 500; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- the composer (home hero and /chat) ---------- */
.cmp { position: relative; width: min(720px, 100%); text-align: left; }
.cmp-tab {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 16px; padding: 7px 12px 6px; border-radius: 10px 10px 0 0;
  background: var(--bg); border: 1px solid var(--line); border-bottom: 0; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); cursor: pointer; user-select: none;
}
.cmp-tab input { appearance: none; width: 12px; height: 12px; margin: 0; border: 1px solid var(--line-2); border-radius: 3px; display: grid; place-items: center; }
.cmp-tab input:checked { background: var(--or); border-color: var(--or); }
.cmp-tab input:checked::after { content: ''; width: 6px; height: 3px; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.cmp-tab:has(input:checked) { color: var(--head); }
.cmp-box {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px; border-radius: 14px; background: var(--bg);
  border: 1px solid var(--line); box-shadow: 0 30px 70px -30px rgba(80, 20, 0, .55);
}
.cmp-box:focus-within { border-color: var(--line-2); }
.cmp-main { display: grid; gap: 12px; min-width: 0; }
.cmp textarea {
  width: 100%; min-height: 52px; max-height: 220px; resize: none; border: 0; outline: none; background: transparent; color: var(--head);
  font: 400 17px/1.45 var(--sans); padding: 4px 4px 0;
}
.cmp textarea::placeholder { color: var(--dim); }
.cmp-row { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.cmp-plus { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--mute); flex: none; }
.cmp-plus:hover { color: var(--head); border-color: var(--line-2); }
.cmp-plus svg { width: 14px; height: 14px; }
.cmp-model {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; height: 34px; padding: 0 4px 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-1); font-weight: 500; font-size: 14.5px; color: var(--head);
}
.cmp-model:hover { border-color: var(--or); }
.cmp-model .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cmp-model .badge { margin-left: 2px; }
.cmp-priv { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 6px 0 10px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); cursor: pointer; user-select: none; }
.cmp-priv input { position: absolute; opacity: 0; pointer-events: none; }
.cmp-priv i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); transition: background .2s; }
.cmp-priv i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .2s var(--ease); }
.cmp-priv input:checked + i { background: var(--or); border-color: var(--or); }
.cmp-priv input:checked + i::after { transform: translateX(16px); background: #fff; }
.cmp-priv input:focus-visible + i { outline: 2px solid var(--or); outline-offset: 2px; }
.cmp-priv:has(input:checked) { color: var(--head); }
.cmp-send {
  position: relative; width: 120px; display: grid; align-content: center; justify-items: center; gap: 2px; padding: 14px 12px 22px; border-radius: 11px;
  background: linear-gradient(180deg, var(--or-2), var(--or)); color: var(--head); font: 600 14px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); transition: filter .15s, transform .15s;
}
.cmp-send:hover { filter: brightness(1.06); }
.cmp-send:active { transform: translateY(1px); }
.cmp-send[disabled] { filter: grayscale(.6) brightness(.8); cursor: default; }
.cmp-send small { position: absolute; left: 10px; right: 10px; bottom: 9px; display: flex; justify-content: space-between; font: 600 9.5px/1 var(--mono); letter-spacing: .06em; opacity: .9; }
.cmp-send .meter { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 3px; background: rgba(0, 0, 0, .28); overflow: hidden; }
.cmp-send .meter b { display: block; height: 100%; width: 100%; background: var(--head); transition: width .3s; }
.cmp-send.busy span:first-child { opacity: .6; }
.cmp-files { display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-file { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 6px 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-1); font-size: 13px; color: var(--ink); }
.cmp-file img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
.cmp-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-file button { width: 18px; height: 18px; border-radius: 4px; color: var(--mute); }
.cmp-file button:hover { color: var(--head); background: var(--bg-3); }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; background: rgba(21, 20, 20, .88); border: 1px solid rgba(240, 227, 222, .14); font: 400 13.5px/1.2 var(--mono); color: var(--ink); }
.chip:hover { border-color: var(--or-3); color: var(--head); }
.cmp-note { margin-top: 14px; font: 400 12px/1.4 var(--mono); color: rgba(255, 251, 245, .78); text-align: center; }
.cmp-note a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 620px) {
  .cmp-box { grid-template-columns: 1fr; padding: 12px; }
  .cmp-send { width: 100%; grid-auto-flow: column; justify-content: center; padding: 13px 12px 19px; }
  .cmp-priv { padding-left: 2px; gap: 6px; font-size: 10px; letter-spacing: .05em; }
  .cmp-row { flex-wrap: nowrap; gap: 6px; }
  .cmp-model { flex: 1 1 auto; min-width: 0; padding-left: 8px; font-size: 14px; }
  .cmp textarea { font-size: 16px; min-height: 40px; }
}

/* ---------- model picker ---------- */
.mp { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); }
.mp-box { width: min(620px, 100%); height: min(680px, 88vh); display: flex; flex-direction: column; border-radius: 16px; background: var(--bg-1); border: 1px solid var(--line); overflow: hidden; }
.mp-box > * { flex: none; }
.mp-box > .mp-list { flex: 1 1 auto; min-height: 0; }
.mp-head { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.mp-head .input { min-height: 40px; }
.mp-x { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--line); color: var(--mute); display: grid; place-items: center; font-size: 18px; }
.mp-x:hover { color: var(--head); }
.mp-labs { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.mp-labs::-webkit-scrollbar { display: none; }
.mp-labs button { flex: none; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--mute); }
.mp-labs button.on { background: var(--or); border-color: var(--or); color: var(--head); }
.mp-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.mp-sec { padding: 12px 10px 6px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mp-row { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px; border-radius: 10px; text-align: left; }
.mp-row:hover, .mp-row:focus-visible { background: rgba(240, 227, 222, .05); }
.mp-row.on { background: rgba(255, 94, 31, .12); }
.mp-row .mi, .mp-row .mi-t { grid-row: span 2; width: 22px; height: 22px; }
.mp-row b { font-weight: 500; color: var(--head); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row small { color: var(--dim); font-size: 12px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row .pr { grid-row: span 2; text-align: right; font: 400 12px/1.35 var(--mono); color: var(--mute); white-space: nowrap; }
.mp-row .pr s { color: var(--dim); }
.mp-row .pr em { font-style: normal; color: var(--or-2); }
.mp-tags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.mp-tags i { font: 500 9.5px/1 var(--mono); font-style: normal; padding: 2px 4px; border-radius: 4px; border: 1px solid var(--line); color: var(--dim); }
.mp-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); }
.mp-empty { padding: 40px 16px; text-align: center; color: var(--dim); }
@media (max-width: 620px) {
  .mp { padding: 0; align-items: end; }
  .mp-box { height: 86vh; border-radius: 16px 16px 0 0; }
  .mp-row .pr { font-size: 11px; }
}
.mp-zdr { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mp-zdr span { display: grid; gap: 2px; }
.mp-zdr b { font-weight: 500; font-size: 14px; color: var(--head); }
.mp-zdr small { font-size: 12.5px; color: var(--dim); }
.mp-zdr input { position: absolute; opacity: 0; pointer-events: none; }
.mp-zdr i { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); }
.mp-zdr i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .2s var(--ease); }
.mp-zdr input:checked + i { background: var(--or); border-color: var(--or); }
.mp-zdr input:checked + i::after { transform: translateX(16px); background: #fff; }
.mp-zdr input:focus-visible + i { outline: 2px solid var(--or); outline-offset: 2px; }
@media (max-width: 440px) { .cmp-model .off-w { display: none; } .cmp-model { gap: 6px; } .cmp-priv { font-size: 9.5px; } }
