/* Fonts are self-hosted (no requests to Google): Inter and Bricolage Grotesque, SIL Open Font License. */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/fonts/bricolage-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/fonts/bricolage-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Sabha, design D: saffron for actions, indigo for agreement, orange for disagreement.
   Shared by the app, /admin, /privacy and /terms (they use --bg, --panel, --ink, --muted, --line, --accent, --good, --warn, --bad). */
:root {
  color-scheme: light;
  --bg: #F7F6F2; --panel: #FFFFFF; --ink: #14132B; --ink2: #2C2B45; --muted: #5C5A78; --line: #E8E6EF; --line2: #DDDAE8;
  --accent: #C2410C; --accent-ink: #FFFFFF;
  --indigo: #2E2A86; --indigo-ink: #FFFFFF; --indigo-soft: #EEEDF7; --indigo-text: #2E2A86; --indigo-sub: #CFCDF0; --gold: #FFB347;
  --diff: #9A3409; --diff-soft: #FFF6EF; --diff-line: #F4C9AE; --diff-mark: #C2410C; --diff-mark-ink: #FFFFFF;
  --good: #15803d; --warn: #b45309; --bad: #b91c1c;
  --code: #F1EFF7; --pre: #14132B; --pre-ink: #ECEBF5;
  --q: #14132B; --q-ink: #FFFFFF; --tag-ink: #FFFFFF;
  --shadow: 0 1px 2px rgba(20,19,43,.04), 0 12px 32px rgba(46,42,134,.07);
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
}
/* Light is the default; dark mode is opt-in with the moon button (saved per device). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0C1C; --panel: #17162E; --ink: #ECEBF5; --ink2: #D4D2E6; --muted: #A3A1BF; --line: #2A2850; --line2: #34315E;
  --accent: #FF8A3D; --accent-ink: #0D0C1C;
  --indigo: #4A44C9; --indigo-ink: #FFFFFF; --indigo-soft: #1E1C3D; --indigo-text: #B8B4FF; --indigo-sub: #DCDAFF; --gold: #FFB347;
  --diff: #FFB27D; --diff-soft: #241812; --diff-line: #5A3220; --diff-mark: #FF8A3D; --diff-mark-ink: #0D0C1C;
  --good: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --code: #0D0C1C; --pre: #0A0916; --pre-ink: #ECEBF5;
  --q: #ECEBF5; --q-ink: #0D0C1C; --tag-ink: #0D0C1C;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, select, textarea, input { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); margin-top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons */
.primary { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 0 18px; min-height: 44px; font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: .5; cursor: default; }
.ghost, select { border: 1px solid var(--line2); background: var(--panel); border-radius: 10px; padding: 0 12px; min-height: 40px; cursor: pointer; color: var(--ink2); }
select { max-width: 170px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--indigo-soft); }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.danger { border: 1px solid var(--bad); background: none; color: var(--bad); border-radius: 10px; padding: 0 14px; min-height: 40px; font-weight: 600; cursor: pointer; }
.danger:disabled { opacity: .5; cursor: default; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; background: var(--warn); color: var(--tag-ink); border-radius: 4px; padding: 1px 6px; }

/* the Sabha mark */
.mark .m-ring { fill: var(--indigo); } .mark .m-dot { fill: var(--gold); } .mark .m-core { fill: #fff; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 272px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.03em; }
.new { display: flex; align-items: center; justify-content: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search:focus-within { border-color: var(--indigo); }
.adv { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; color: var(--muted); }
.adv summary { cursor: pointer; font-weight: 600; color: var(--ink2); padding: 4px 6px; }
.adv p { margin: 6px 6px 8px; line-height: 1.5; }
.adv select, .adv .ghost { width: 100%; max-width: none; margin-top: 6px; }
.mode-hint { margin: 0 0 6px; text-align: center; font-size: 13px; color: var(--muted); }
.mode-hint b { color: var(--ink2); }
.hist { flex: 1; display: flex; flex-direction: column; gap: 2px; min-height: 60px; }
.hist h4 { margin: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.hist-item { display: flex; align-items: center; border-radius: 9px; }
.hist-item:hover, .hist-item:focus-within { background: var(--indigo-soft); }
.hist-item > button[data-chat] { flex: 1; min-width: 0; }
.hist .hdel { flex: none; width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; color: var(--muted); font-size: 18px; opacity: 0; }
.hist-item:hover .hdel, .hdel:focus-visible { opacity: 1; }
@media (hover: none) { .hist .hdel { opacity: .6; } }
.hist button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink2); font-size: 14px; cursor: pointer; }
.hist button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist button:hover { background: var(--indigo-soft); }
.hist button[aria-current="true"] { background: var(--indigo-soft); color: var(--ink); font-weight: 600; }
.hist .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); flex: none; }
.hist .dot.diff { background: var(--diff-mark); }
.hist .empty, .hist .legend { font-size: 12px; color: var(--muted); padding: 6px 10px; line-height: 1.5; }
.plan-card { border-radius: 14px; padding: 14px; background: var(--indigo); color: var(--indigo-ink); }
.plan-card .plan-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--indigo-sub); }
.plan-card .plan-top b { font-family: var(--display); font-size: 22px; color: var(--indigo-ink); }
.plan-card p { margin: 6px 0 0; font-size: 13px; color: var(--indigo-sub); }
.me { display: flex; align-items: center; gap: 6px; }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px; border-radius: 10px; cursor: pointer; text-align: left; }
.me-btn:hover { background: var(--indigo-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; text-transform: uppercase; }
.me-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.me-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-legal { margin: 0; font-size: 12px; color: var(--muted); padding: 0 6px; }
.side-legal a { color: var(--muted); }
.scrim { position: fixed; inset: 0; background: rgba(13,12,28,.45); z-index: 19; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .menu { display: none; }
@media (min-width: 901px) { .top { display: none; } } /* nothing in it on desktop; phones use it for the menu */
.top-brand { display: none; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.fast-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.fast-btn[aria-pressed="true"] { background: var(--diff-soft); border-color: var(--accent); color: var(--diff); }
.vtabs { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 12px; background: var(--indigo-soft); gap: 2px; }
.vtabs button { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 0 14px; min-height: 36px; font-weight: 500; font-size: 14px; cursor: pointer; }
.vtabs button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20,19,43,.1); }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--indigo-soft); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 0 14px; min-height: 36px; font-weight: 500; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20,19,43,.1); }
.banner { margin: 0; padding: 8px 16px; text-align: center; font-size: 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.banner.paused { color: var(--bad); font-weight: 600; }

#thread { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 24px 24px 12px; }
#thread.wide, #thread.wide ~ .composer { max-width: 1240px; }

/* ---------- home ---------- */
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 6vh 0 24px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo-text); font-size: 13px; font-weight: 600; }
.kdots { display: inline-flex; gap: 3px; } .kdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.welcome h1 { margin: 0; font-family: var(--display); font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -.035em; }
.welcome .lead { margin: 0; max-width: 600px; font-size: 17px; color: var(--muted); }
.examples { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.examples button { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--ink); line-height: 1.45; }
.examples button span { font-size: 12px; font-weight: 700; color: var(--diff); text-transform: uppercase; letter-spacing: .05em; }
.examples button:hover { border-color: var(--indigo); }
.how { margin: 18px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; text-align: left; width: 100%; font-size: 14px; color: var(--muted); counter-reset: how; }
.how li { counter-increment: how; } .how li::before { content: counter(how) ". "; font-weight: 700; color: var(--accent); }
.how b { color: var(--ink); }

/* ---------- a turn ---------- */
.turn { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.q { align-self: flex-end; max-width: 80%; background: var(--q); color: var(--q-ink); padding: 12px 16px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 20px 22px; overflow-wrap: anywhere; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 8px; }
.meta { font-size: 13px; color: var(--muted); }

/* deliberating */
.delib .card-title .mark { width: 30px; height: 30px; }
.delib .sub { font-size: 13px; color: var(--muted); }
.delib-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.delib-row .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.delib-row .lbl span { color: var(--muted); }
.delib-row .lbl span.done { color: var(--indigo-text); font-weight: 600; }
.delib-row .lbl span.fail { color: var(--bad); }
.bar { height: 6px; border-radius: 3px; background: var(--indigo-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--indigo); transition: width .4s ease; }
.delib .note { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* panel strip */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.strip > b { font-size: 13px; font-weight: 600; color: var(--muted); }
.strip .meta { margin-left: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo-text); font-size: 13px; font-weight: 600; }
.chip.differs, .chip.split { background: var(--diff-soft); color: var(--diff); }
.chip.none { background: var(--code); color: var(--muted); }

/* agreement badge */
.agree { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--indigo); color: var(--indigo-ink); font-size: 13px; font-weight: 600; }
.agree .dots { display: inline-flex; gap: 3px; }
.agree .dots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--gold); }
.agree .dots i.on { background: var(--gold); }
.agree.low { background: var(--diff-mark); color: var(--diff-mark-ink); }
.agree.low .dots i { border-color: currentColor; } .agree.low .dots i.on { background: currentColor; }

/* answer text */
.md { font-size: 16px; line-height: 1.7; color: var(--ink2); }
.md p { margin: 0 0 .8em; } .md p:last-child { margin-bottom: 0; }
.md strong { color: var(--ink); }
.md h1, .md h2, .md h3, .md h4 { margin: 1em 0 .4em; line-height: 1.3; color: var(--ink); font-family: var(--display); }
.md h1 { font-size: 1.3em; } .md h2 { font-size: 1.2em; } .md h3, .md h4 { font-size: 1.07em; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.4em; } .md li { margin: .2em 0; }
.md code { background: var(--code); border-radius: 5px; padding: 1px 5px; font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.md pre { background: var(--pre); color: var(--pre-ink); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.md pre code { background: none; padding: 0; color: inherit; }
.md a { color: var(--accent); }
.md table { border-collapse: collapse; }
.typing::after { content: ""; display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.thinking { color: var(--muted); }

/* disagreements */
.diffs { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.diff-card { border-radius: 14px; background: var(--diff-soft); border: 1px solid var(--diff-line); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.diff-card .dh { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 15px; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--diff-mark); color: var(--diff-mark-ink); font-size: 12px; font-weight: 700; flex: none; }
.diff-card ul { margin: 0; padding-left: 18px; }
.diff-card .call { color: var(--muted); } .diff-card .call b { color: var(--indigo-text); }
.note-line { margin: 10px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }

/* actions */
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.acts .spacer { flex: 1; }
.btn { min-height: 38px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); color: var(--ink2); font-weight: 500; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--indigo); }
.btn.sq { width: 38px; padding: 0; justify-content: center; }
.btn[aria-pressed="true"] { border-color: var(--indigo); background: var(--indigo-soft); color: var(--indigo-text); }
.thanks { font-size: 13px; color: var(--muted); }

/* quick: get it checked */
.check { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--indigo); color: var(--indigo-ink); border: 0; width: 100%; text-align: left; cursor: pointer; }
.check b { display: block; font-size: 15px; } .check span { font-size: 13px; color: var(--indigo-sub); }
.check .mark .m-ring { fill: rgba(255,255,255,.12); }
.check > svg:last-child { margin-left: auto; color: var(--gold); flex: none; }

/* each model / compare */
details.each > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; list-style: none; }
details.each > summary::-webkit-details-marker { display: none; }
details.each > summary::before { content: "▸ "; } details.each[open] > summary::before { content: "▾ "; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; align-items: start; }
.model { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.model.differs, .model.split { border-color: var(--diff-line); }
.model header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.model header b { font-size: 15px; }
.model .mmeta { font-size: 12px; color: var(--muted); }
.model .md { font-size: 14px; line-height: 1.6; }
.model .err { color: var(--bad); font-size: 14px; }

/* composer */
.composer { position: sticky; bottom: 0; width: 100%; max-width: 880px; margin: 0 auto; padding: 10px 24px 18px; background: var(--bg); border-top: 1px solid var(--line); }
.composer-box { display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 16px; background: var(--panel); border: 1.5px solid var(--line2); border-radius: 18px; box-shadow: 0 8px 24px rgba(46,42,134,.08); }
.composer-box:focus-within { border-color: var(--indigo); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; padding: 10px 0; max-height: 200px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line, never cut in half */
.composer .fine { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); padding: 18px 20px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(13,12,28,.45); }
dialog h3 { margin: 0 0 4px; font-family: var(--display); }
.row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.row small { color: var(--muted); }
#modelList { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
#modelList.off { opacity: .45; pointer-events: none; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#acctDlg hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
#acctDlg a { color: var(--accent); }

/* sign-in */
.signin { width: 100%; max-width: 560px; margin: 6vh auto 40px; padding: 0 16px; text-align: center; }
.signin .eyebrow { display: inline-block; margin: 6px 0 10px; padding: 6px 12px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo-text); font-weight: 600; font-size: 13px; }
.signin .lede { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 6px auto 16px; max-width: 480px; }
.signin .feats { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; text-align: left; }
.signin .feats li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--muted); }
.signin .feats b { color: var(--ink); font-size: 14.5px; }
.signin .signin-h { font-family: var(--display); font-size: 20px; margin: 4px 0 4px; }
.signin .mark.big { display: block; margin: 0 auto 8px; }
.signin h1 { font-family: var(--display); font-size: clamp(30px, 7vw, 40px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 6px; }
.signin form { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.signin input { flex: 1 1 220px; min-width: 0; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); color: var(--ink); }
#code { letter-spacing: .2em; text-align: center; font-size: 18px; }
#code::placeholder { letter-spacing: normal; font-size: 15px; }
.signin .small { flex-basis: 100%; margin: 6px 0 0; }
.consent { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13px; color: var(--muted); }
.signin .consent input { flex: none; width: auto; min-height: 0; margin: 3px 0 0; padding: 0; border: revert; background: revert; }
.signin .consent span { flex: 1; min-width: 0; }
.consent a, .legal a { color: var(--accent); }
.turnstile { display: flex; justify-content: center; margin-top: 14px; }
body.signed-out #thread, body.signed-out #composer, body.signed-out .controls, body.signed-out .side, body.signed-out .top .menu { display: none !important; }

/* privacy / terms pages */
.legal { margin-top: 28px; text-align: center; }
.doc { max-width: 760px; width: 100%; margin: 0 auto; padding: 20px 16px 60px; }
.doc h1 { font-family: var(--display); font-size: 30px; margin: 8px 0 2px; }
.doc h2 { font-family: var(--display); font-size: 20px; margin: 28px 0 6px; }
.doc a { color: var(--accent); }
.doc .table-wrap { overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--panel); }

/* ---------- phones and small tablets ---------- */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: 0 0 40px rgba(13,12,28,.25); }
  .side.open { transform: none; visibility: visible; }
  .top { padding: 8px 12px; }
  .top .menu { display: inline-flex; }
  .top-brand { display: inline; }
  #thread { padding: 16px 14px 8px; }
  .composer { padding: 8px 12px 14px; }
  .q { max-width: 88%; }
  .card { padding: 16px; border-radius: 18px; }
}
.tabs { display: none; }
@media (max-width: 560px) {
  .tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .tabs button { flex: none; min-height: 44px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
  .tabs button:focus-visible { border-bottom-color: var(--indigo); }
  .tabs button.differs, .tabs button.split { color: var(--diff); }
  .turn.compare .strip { display: none; }
  .cols.swipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 6px; }
  .cols.swipe .model { flex: 0 0 88%; scroll-snap-align: start; }
  .examples { grid-template-columns: 1fr; }
  .controls { gap: 6px; }
  .seg button { padding: 0 10px; font-size: 14px; }
  .composer .fine { display: none; }
  .mode-hint { font-size: 12px; }
  .md { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .pulse, .typing::after { animation: none; } .side { transition: none; } }

/* ---- design step 2: number cards, ① markers, at a glance ---- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 2px 0 14px; }
.fig { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--indigo-soft); min-width: 0; }
.fig .fl { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fig .fv { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--indigo-text); letter-spacing: -0.01em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fig .fh { font-size: 12.5px; color: var(--muted); }
.mk { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 2px 0 3px; border: 0; border-radius: 9px; background: var(--diff-mark); color: var(--diff-mark-ink); font: 700 11px/1 Inter, system-ui, sans-serif; vertical-align: 0.15em; cursor: pointer; position: relative; }
.mk::after { content: ""; position: absolute; inset: -12px -8px; } /* bigger tap target */
.mk:hover { filter: brightness(1.08); }
.mk:focus-visible { outline: 2px solid var(--indigo-text); outline-offset: 2px; }
.diff-card:focus { outline: none; }
.diff-card:focus-visible { outline: 2px solid var(--diff-mark); outline-offset: 2px; }
.diff-card.flash { animation: diffFlash 1.2s ease-out; }
@keyframes diffFlash { 0% { box-shadow: 0 0 0 3px var(--diff-mark); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .diff-card.flash { animation: none; outline: 2px solid var(--diff-mark); } }
.glance { display: flex; flex-direction: column; gap: 0; padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.glance .gt { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.gl-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink2); }
.gl-row:first-of-type { border-top: 0; }
.gl-row .gp { flex: 1 1 180px; }
.gl-row .gv { display: flex; flex-wrap: wrap; gap: 6px; }
.gm { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: var(--indigo-soft); color: var(--ink2); }
.gm .gn { font-weight: 500; color: var(--muted); }
.gm.yes { color: var(--good); }
.gm.no { background: var(--diff-soft); color: var(--diff); }

/* ---- sharing ---- */
.share-link { display: flex; gap: 6px; margin: 12px 0 8px; }
.share-link input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); color: var(--ink); font: 14px Inter, system-ui, sans-serif; }
.btn.wa { display: inline-flex; align-items: center; text-decoration: none; background: #0E7A3F; border-color: #0E7A3F; color: #fff; }
.btn.wa:hover { filter: brightness(1.08); }
dialog .err { color: var(--bad); }
.share-page { min-height: 100vh; }
.share-wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.share-wrap .q { align-self: flex-end; }
.share-gone { font-family: var(--display); font-size: 22px; margin: 0 0 6px; }
.share-cta { text-decoration: none; }
.share-fine { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 0; }

/* ---- images ---- */
.img-btn[aria-pressed="true"] { background: var(--indigo-soft); border-color: var(--indigo); color: var(--indigo-text); }
.mode-hint select { height: 30px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--ink); font: 500 13px Inter, system-ui, sans-serif; padding: 0 6px; margin: 0 4px 4px 0; }
.img-card { display: flex; flex-direction: column; gap: 10px; }
.img-fig { position: relative; margin: 0; width: 100%; max-width: 560px; border-radius: 14px; overflow: hidden; background: var(--indigo-soft); }
.img-fig img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; } /* save with Download, which stamps the AI label */
.ai-tag { position: absolute; right: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(13,12,28,.62); color: #fff; font-size: 12px; font-weight: 600; }
.img-wait { width: 100%; max-width: 560px; border-radius: 14px; background: var(--indigo-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--indigo-text); font-weight: 600; text-align: center; padding: 16px; }
.img-wait small { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) {
  .composer-box .fast-btn .lbl { display: none; } /* icons only on phones, so the input keeps its room */
  .composer-box .fast-btn { padding: 0 10px; }
}
@media (max-width: 560px) {
  .signin .feats { grid-template-columns: 1fr; gap: 8px; }
  .signin .feats li { flex-direction: row; align-items: baseline; gap: 8px; padding: 10px 12px; }
  .signin .feats b { flex: none; }
}
