/* BENDAHARA: graphite + ember (dark default, after the Lumix AI concept), white-grey light theme */
/* Self-hosted Latin woff2 (~220 KB total). Chinese uses the device's own CJK font: every phone and PC ships one. */
@font-face { font-family: 'DM Sans'; src: url('fonts/dm-sans-400_600-normal.woff2') format('woff2'); font-weight: 400 600; font-display: swap; 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: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-400_500-normal.woff2') format('woff2'); font-weight: 400 500; font-display: swap; 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: 'Newsreader'; src: url('fonts/newsreader-400_500-normal.woff2') format('woff2'); font-weight: 400 500; font-display: swap; 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; }
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } } /* soft cross-fade between pages */
:root {
  --bg: #f3f3f1; --surface: #ffffff; --surface-2: #ebebe8; --line: #d9d9d5; --line-strong: #b9b9b4;
  --text: #1c1c1e; --muted: #67676b; --accent: #d43d0b; --accent-soft: #d43d0b1f;
  --warn: #9a5b00; --warn-soft: #f4e6cf; --ok: #2f6b4f;
  --dot: #00000012; --shadow: 0 1px 0 #0000000a, 0 8px 24px -12px #00000026;
  --ember: #d43d0b12; --glow: #d43d0b0d; --edge: #d43d0b26;
  --cta: #d43d0b; --on-cta: #ffffff; /* 4.7:1, passes AA for normal text in both themes */
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC";
  --serif: "Newsreader", "Songti SC", "SimSun", "Noto Serif CJK SC", Georgia, serif;
  --sans: "DM Sans", var(--cjk), system-ui, sans-serif;
  --mono: "JetBrains Mono", var(--cjk), ui-monospace, monospace;
  --ui: var(--sans); --display: var(--sans);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r: 16px;
  interpolate-size: allow-keywords; /* lets the prompt accordion animate to height: auto */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0b; --surface: #131315; --surface-2: #1c1c1f; --line: #26262a; --line-strong: #3d3d43;
    --text: #f2f2f3; --muted: #8e8e95; --accent: #ff5a1f; --accent-soft: #ff5a1f26;
    --warn: #f0c07a; --warn-soft: #2e2416; --ok: #7cc4a0;
    --dot: transparent; --shadow: 0 1px 0 #ffffff08, 0 14px 40px -16px #000000cc;
    --ember: #ff4d1a3d; --glow: #ff5a1f24; --edge: #ff5a1f59;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0b; --surface: #131315; --surface-2: #1c1c1f; --line: #26262a; --line-strong: #3d3d43;
  --text: #f2f2f3; --muted: #8e8e95; --accent: #ff5a1f; --accent-soft: #ff5a1f26;
  --warn: #f0c07a; --warn-soft: #2e2416; --ok: #7cc4a0;
  --dot: transparent; --shadow: 0 1px 0 #ffffff08, 0 14px 40px -16px #000000cc;
  --ember: #ff4d1a3d; --glow: #ff5a1f24; --edge: #ff5a1f59;
  color-scheme: dark;
}
:root[data-font="serif"] { --ui: var(--serif); --display: var(--serif); }
:root[data-font="mono"] { --ui: var(--mono); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text); font: 16px/1.55 var(--ui);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 70vh; pointer-events: none; z-index: -1; background: radial-gradient(70% 90% at 50% -10%, var(--ember), transparent 70%); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── Top bar ── */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.mark { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 500; letter-spacing: .28em; font-size: 13px; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); transition: transform .2s var(--ease), border-color .2s;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.94); }
.pill {
  height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: transparent; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.pill[data-level="max"], .pill[data-level="ultra"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 9px; border-radius: 8px; font-size: 12px; color: var(--muted); transition: background .25s var(--ease), color .25s; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* Nine-bar meter: one bar per letter of B-E-N-D-A-H-A-R-A */
.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.meter i { width: 3px; height: 40%; background: var(--text); border-radius: 1px; transition: height .5s var(--spring); }
.meter i:nth-child(3n+1) { height: 70%; } .meter i:nth-child(4) { height: 100%; background: var(--accent); }
.meter.big { height: 34px; gap: 4px; } .meter.big i { width: 6px; border-radius: 2px; }
.meter i { transform-origin: bottom; }
body.thinking .meter i { animation: tick .9s var(--ease) infinite alternate; }
body.thinking .meter i:nth-child(odd) { animation-delay: -.45s; }
/* scaleY, not height: stays on the compositor while the page re-renders */
@keyframes tick { from { transform: scaleY(.3); } to { transform: scaleY(1.4); } }

/* ── Drawer (slider menu) ── */
.drawer {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(88vw, 400px);
  display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .4s var(--ease-drawer); box-shadow: var(--shadow);
  padding-top: env(safe-area-inset-top); touch-action: pan-y;
}
.drawer.dragging { transition: none; }
/* Upgrade card pinned to the drawer foot (the concept's "Upgrade to Premium") */
.upgrade { margin: 0 12px calc(12px + env(safe-area-inset-bottom)); padding: 16px; border-radius: var(--r); border: 1px solid var(--edge); text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2); box-shadow: inset 0 1px 0 var(--edge); }
.upgrade:empty { display: none; }
.upgrade .gem { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--cta); color: var(--on-cta); box-shadow: 0 8px 20px -8px var(--cta); }
.upgrade b { display: block; margin: 10px 0 2px; font: 500 17px/1.3 var(--display); }
.upgrade p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.upgrade .btn { width: 100%; min-height: 40px; border-radius: 99px; }
/* Wide screens: the drawer becomes a fixed sidebar, as in the concept */
@media (min-width: 1100px) {
  body { padding-left: 300px; }
  .drawer { width: 300px; transform: none; transition: none; box-shadow: none; }
  .nav-close, .bar .mark { display: none; } /* the sidebar already carries the brand */
  #menuBtn, .scrim { display: none !important; }
}
/* Touch: 44px targets */
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } .send { height: 44px; } }
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 30; background: #00000073; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
/* iOS-style navigation bar: brand + close at the root, back + centred title on a pushed page */
.drawer-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 56px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.drawer-nav.root { display: flex; gap: 10px; padding-left: 18px; }
.nav-title { font: 600 15px/1.2 var(--ui); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-nav.root .nav-title { font: 500 13px/1 var(--mono); letter-spacing: .28em; }
.nav-close { margin-left: auto; border-radius: 99px; }
.nav-back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 2px; border: 0; background: none; color: var(--accent); font-size: 15px; transition: opacity .15s ease; }
.nav-back:active { opacity: .5; } /* iOS dims text buttons on press rather than scaling them */
.panel { overflow-y: auto; padding: 16px 16px 32px; }
.panel h3 { font: 600 12px/1.3 var(--ui); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; padding-left: 16px; }
.panel h3:first-child { margin-top: 0; }
.panel .note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.panel > .btn.dark { width: 100%; min-height: 44px; border-radius: 12px; margin-bottom: 16px; }
/* Grouped inset lists: one rounded surface, hairline separators inset past the icon */
.list, .group { list-style: none; margin: 0; padding: 0; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.list li + li, .group li + li { box-shadow: inset 0 1px 0 var(--line); }
.group li + li { box-shadow: none; position: relative; }
.group li + li::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; border-top: 1px solid var(--line); }
.list button, .list a, .row-btn {
  width: 100%; min-height: 44px; text-align: left; display: block; padding: 11px 16px; border: 0; background: transparent;
  font-size: 15px; text-decoration: none; overflow-wrap: anywhere; transition: background-color .15s ease;
}
.row-btn { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 12px; }
.row-btn .tile { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.row-btn .row-label { flex: 1; }
.row-btn .row-value { color: var(--muted); font-size: 14px; }
.row-btn .chev { color: var(--muted); flex: none; transition: transform .2s var(--ease-out), color .2s ease; }
.list button:active, .list a:active, .row-btn:active { background: color-mix(in srgb, var(--text) 8%, transparent); } /* highlight on touch-down, as iOS rows do */
.list small { display: block; color: var(--muted); font-family: var(--mono); font-size: 11px; margin-top: 2px; }
.btn {
  border: 1px solid var(--line-strong); background: var(--surface); padding: 9px 14px; border-radius: 10px; font-size: 14px;
  transition: transform .15s var(--ease), translate .2s var(--ease-out), background .2s, border-color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.97); }
.btn.dark { background: var(--cta); color: var(--on-cta); border-color: var(--cta); font-weight: 600; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font: 600 12px/1.3 var(--ui); letter-spacing: .04em; padding-left: 4px; text-transform: uppercase; color: var(--muted); }
.field input[type="text"] { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-row label { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; cursor: pointer; }
.radio-row label:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.radio-row input { accent-color: var(--accent); margin: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.switch input { accent-color: var(--accent); width: 18px; height: 18px; }
.tier-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; background: var(--bg); transition: border-color .2s ease; }
.tier-card.on { box-shadow: inset 0 1px 0 var(--edge); background: radial-gradient(90% 110% at 100% 0%, var(--glow), transparent 60%), var(--bg); }
.tier-card.on { border-color: var(--text); }
.tier-card header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.tier-card b { font: 500 20px/1.1 var(--display); }
.tier-card ul { margin: 0 0 10px; padding-left: 18px; font-size: 14px; color: var(--muted); }

/* ── Main column ── */
main { max-width: 780px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; min-height: calc(100dvh - 60px); }
.hero { padding: 13vh 0 28px; }
body.has-thread .hero { padding: 28px 0 8px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; color: var(--muted); margin: 0 0 14px; }
.hero h1 { font: 500 clamp(34px, 6vw, 54px)/1.06 var(--display); letter-spacing: -.02em; margin: 0 0 12px; overflow-wrap: anywhere; }
body.has-thread .hero h1 { font-size: clamp(24px, 4vw, 30px); }
.sub { color: var(--muted); margin: 0; max-width: 56ch; }
.greet { color: var(--muted); margin: 0 0 6px; font-size: 15px; }
body.has-thread .greet { display: none; }
.share-opt { display: flex; gap: 8px; align-items: flex-start; justify-content: center; max-width: 34rem; margin: 12px auto 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; cursor: pointer; }
.share-opt a { color: var(--text); }
.share-opt input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.trust { color: var(--muted); font-size: 12.5px; text-align: center; margin: 10px 0 0; }
.trust a { color: var(--text); display: inline-block; padding: 6px 2px; } /* 28px tall tap target */
/* Privacy / Terms / 404 pages */
.legal { max-width: 68ch; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.6; }
.legal .back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font: 500 13px/1 var(--mono); letter-spacing: .28em; transition: color .2s ease; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--cta); color: var(--on-cta); font-weight: 600; }
.skip-link:focus { top: 12px; }
/* Privacy promise, visible where people type */
.shield { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; align-self: center; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--edge); background: var(--accent-soft); color: var(--text); font: 500 11px/1.2 var(--mono); letter-spacing: .06em; }
.shield svg { color: var(--accent); flex: none; }
.legal h1 { font: 500 34px/1.1 var(--display); margin: 0 0 6px; }
.legal h2 { font: 500 20px/1.3 var(--display); margin: 28px 0 6px; }
.legal p, .legal li { color: var(--muted); }
.legal a { color: var(--text); }
body.has-thread .sub, body.has-thread .starters { display: none; }
/* Starter cards (the concept's three feature cards): first-visit surface, so a short 60ms stagger */
.starters { display: grid; gap: 10px; margin: 28px 0 0; }
.start-card {
  display: grid; gap: 10px; align-content: start; text-align: left; padding: 14px 16px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r); color: var(--text);
  background: radial-gradient(90% 110% at 100% 0%, var(--glow), transparent 60%), var(--surface);
  box-shadow: inset 0 1px 0 var(--edge); animation: rise .5s var(--ease-out) both;
  transition: border-color .2s ease, transform .16s var(--ease-out), translate .25s var(--ease-out), box-shadow .25s ease;
}
.start-card:nth-child(2) { animation-delay: 60ms; } .start-card:nth-child(3) { animation-delay: 120ms; }
.start-card:active { transform: scale(.98); }
.start-card .tag-glow { justify-self: start; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); padding: 5px 9px; border-radius: 99px; border: 1px solid var(--edge); background: var(--accent-soft); }
.start-card b { font-weight: 500; font-size: 15px; line-height: 1.4; }
/* Hover, one treatment per role. `translate` (not transform) so the :active scale still applies on press. */
@media (hover: hover) and (pointer: fine) {
  .start-card:hover { translate: 0 -3px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 0 1px 0 var(--edge), 0 16px 32px -18px var(--cta); }
  .send:not(:disabled):hover, .btn.dark:not(:disabled):hover { translate: 0 -1px; background: color-mix(in srgb, var(--cta) 86%, #fff); box-shadow: 0 10px 26px -8px var(--cta); }
  .btn:not(.dark):not(:disabled):hover { border-color: var(--text); }
  .row-btn:hover, .list button:hover, .list a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
  .row-btn:hover .chev { transform: translateX(3px); color: var(--text); }
  .seg button:not([aria-pressed="true"]):hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
  .pill:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
  .legal a:not(.send):hover, .trust a:hover { color: var(--accent); }
}
@media (min-width: 720px) { .starters { grid-template-columns: repeat(3, 1fr); } .start-card { min-height: 128px; } .start-card b { align-self: end; } }

/* ── Composer ── */
.composer {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin-top: auto;
  background: radial-gradient(80% 120% at 100% 0%, var(--glow), transparent 60%), var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 12px 12px 10px;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow); transition: border-color .2s ease, box-shadow .2s ease;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 0 1px 0 var(--edge), 0 0 0 4px var(--accent-soft), var(--shadow); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; min-height: 52px; max-height: 40vh; padding: 4px 6px; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer-actions { margin-left: auto; display: flex; gap: 8px; }
.send {
  height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--cta); background: var(--cta); color: var(--on-cta);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: transform .16s var(--ease-out), translate .2s var(--ease-out), background-color .2s ease, box-shadow .2s ease, opacity .2s ease;
  box-shadow: 0 6px 18px -8px var(--cta);
}
.send:active { transform: scale(.96); }
.send:disabled { opacity: .5; }
#voiceBtn { border-radius: 99px; }
#voiceBtn.rec { border-color: var(--cta); background: var(--cta); color: var(--on-cta); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--bg); padding: 6px 11px; border-radius: 99px;
  font-size: 13px; color: var(--muted); transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .16s var(--ease-out);
}
/* Press feedback on everything tappable: instant on pointer-down, subtle because these are hit often */
.chip:active, .link-chip:active, .seg button:active { transform: scale(.97); }
.link-chip { transition: border-color .2s ease, transform .16s var(--ease-out); }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Thread ── */
.thread { display: grid; gap: 18px; padding: 8px 0 24px; }
.msg.user { justify-self: end; max-width: 85%; background: var(--surface-2); border-radius: 16px 16px 4px 16px; padding: 10px 14px; overflow-wrap: anywhere; }
.msg.user p { margin: 0; white-space: pre-wrap; }
.msg.bot { display: grid; gap: 12px; }
.enter > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tag { border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.tag.cat { color: var(--text); border-color: var(--line-strong); }
.tag.stakes { color: var(--warn); border-color: currentColor; }
.alert { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.alert b { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--warn); display: block; margin-bottom: 2px; }
.tag.live { color: var(--ok); border-color: currentColor; }
body.thinking .tag.live { animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
.summary { margin: 0; font: 400 19px/1.4 var(--display); }
.followup { margin: 0; display: grid; gap: 4px; font-size: 15px; }
.community { color: var(--muted); font-size: 13px; margin: 0; }
.intro { margin: 0; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.choice {
  position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 14px;
  background: radial-gradient(70% 90% at 100% 0%, var(--glow), transparent 55%), var(--surface);
  box-shadow: inset 0 1px 0 var(--edge); transition: border-color .2s ease;
}
.choice:hover { border-color: var(--line-strong); }
.choice.picked { border-color: var(--text); }
.choice.picked::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--accent); }
.choice-head { display: flex; align-items: baseline; gap: 10px; }
.idx { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.choice h3 { font: 500 19px/1.25 var(--display); margin: 0; }
.why { color: var(--muted); margin: 6px 0 10px; font-size: 15px; }
.label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.link-chip { font-size: 13px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; background: var(--bg); overflow-wrap: anywhere; }
.link-chip:hover { border-color: var(--line-strong); }
.link-chip.repo { font-family: var(--mono); font-size: 12px; }
.steps { margin: 8px 0; padding-left: 20px; font-size: 15px; }
.steps li { margin: 2px 0; }
details.prompt { border: 1px dashed var(--line-strong); border-radius: 10px; margin: 10px 0; background: var(--bg); }
details.prompt summary { cursor: pointer; padding: 8px 12px; font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); list-style: none; display: flex; justify-content: space-between; }
details.prompt summary::after { content: "+"; transition: transform .3s var(--ease); }
details.prompt[open] summary::after { transform: rotate(45deg); }
details.prompt pre { margin: 0; padding: 0 12px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 var(--mono); }
details.prompt .btn { margin: 0 12px 12px; font-size: 13px; padding: 6px 12px; transition: color .2s ease, border-color .2s ease, transform .16s var(--ease-out); }
details.prompt .btn.ok { color: var(--ok); border-color: var(--ok); }
/* Prompt opens instead of teleporting (accordion: height is the one sanctioned layout animation) */
@supports selector(::details-content) {
  details.prompt::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size .25s var(--ease-out), opacity .2s ease, content-visibility .25s allow-discrete; }
  details.prompt[open]::details-content { block-size: auto; opacity: 1; }
}
.choice-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
/* ── Ask first: quick tap questions before any advice ── */
.ask { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: radial-gradient(90% 110% at 100% 0%, var(--glow), transparent 60%), var(--surface); box-shadow: inset 0 1px 0 var(--edge); }
.q { display: grid; gap: 8px; }
.q > span { font-size: 15px; font-weight: 500; }
.q .chips, .follow .chips { flex-wrap: wrap; overflow: visible; }
.chip { min-height: 36px; }
.qs { display: grid; gap: 16px; }
.anything { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.anything textarea, .reply input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; resize: vertical; }
.anything textarea:focus, .reply input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ask-actions .btn.dark { min-height: 44px; padding: 0 20px; border-radius: 99px; }
.link-btn { border: 0; background: none; padding: 10px 4px; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; transition: opacity .15s ease; }
.link-btn:active { opacity: .5; }
/* Loading line: a slow sweep of light, not a spinner (calm, and stops under reduced motion) */
.shimmer { margin: 0; color: transparent; background: linear-gradient(90deg, var(--muted) 0%, var(--text) 50%, var(--muted) 100%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; animation: shimmer 1.6s linear infinite; }
.answered { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.answered li { font-size: 12.5px; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--text); }

/* ── One clear pick, the rest folded ── */
.choice.top { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); padding: 16px 18px; }
.choice.top h3 { font-size: 22px; }
.choice-foot { flex-wrap: wrap; gap: 8px; }
details.more > summary, details.builders > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--surface-2); font-size: 15px; font-weight: 500; }
details.more > summary::after, details.builders > summary::after { content: "+"; color: var(--muted); transition: transform .25s var(--ease-out); }
details.more[open] > summary::after, details.builders[open] > summary::after { transform: rotate(45deg); }
details.more > .choices { margin-top: 10px; }
details.builders { margin: 10px 0 0; }
details.builders > summary { font-size: 13px; color: var(--accent); background: var(--accent-soft); }
details.builders ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
details.builders li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
details.builders li a { font-size: 13px; text-decoration: none; color: var(--text); }
details.builders li span { font-size: 13px; color: var(--muted); }
@supports selector(::details-content) {
  details.more::details-content, details.builders::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size .25s var(--ease-out), opacity .2s ease, content-visibility .25s allow-discrete; }
  details.more[open]::details-content, details.builders[open]::details-content { block-size: auto; opacity: 1; }
}
.sample { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--bg); animation: rise .35s var(--ease-out) both; }
.sample b { display: block; font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.sample p { margin: 0 0 8px; white-space: pre-wrap; font-size: 15px; }
.sample small { color: var(--muted); font-size: 12px; }

/* ── Follow-up you can answer ── */
.follow { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); }
.reply { display: flex; gap: 8px; }
.reply .btn { flex: none; border-radius: 12px; }
.upsell { font-size: 13px; color: var(--muted); }
.upsell button { border: 0; background: none; padding: 0; text-decoration: underline; color: var(--text); font-size: 13px; }
.plan { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r); padding: 14px 16px; background: radial-gradient(100% 120% at 100% 0%, var(--accent-soft), transparent 65%), var(--surface); box-shadow: inset 0 1px 0 var(--edge), var(--shadow); }
.plan p { margin: 0 0 8px; font: 500 18px/1.3 var(--display); }
.plan ol { margin: 0 0 10px; padding-left: 20px; }
.plan .row a { border-color: var(--edge); background: var(--accent-soft); }
.plan.pop { animation: rise .35s var(--ease-out) both; } /* completion moment: only on the pick */
.plan .hint { font: 13px/1.45 var(--ui); opacity: .7; margin: 8px 0 0; }
.btn.ghost { margin-top: 10px; background: transparent; }
.skeleton { height: 92px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Onboarding ── */
.onboard { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); padding: 28px 24px; width: min(92vw, 420px); box-shadow: var(--shadow); }
.onboard::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.onboard h2 { font: 500 28px/1.15 var(--display); margin: 18px 0 8px; }
.onboard p { color: var(--muted); margin: 0 0 18px; }
.onboard input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; margin-bottom: 14px; }
.onboard .send { width: 100%; height: 44px; }
.onboard .skip { display: block; margin: 10px auto 0; border: 0; background: none; color: var(--muted); font-size: 14px; padding: 6px 10px; }
/* Modal enters centred (no trigger to grow from), exits faster than it enters */
.onboard { transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), overlay .2s allow-discrete, display .2s allow-discrete; }
.onboard[open] { transition-duration: .35s; }
.onboard:not([open]) { opacity: 0; transform: scale(.97); }
@starting-style { .onboard[open] { opacity: 0; transform: scale(.96) translateY(8px); } }
.onboard::backdrop { transition: opacity .3s ease, overlay .3s allow-discrete, display .3s allow-discrete; }
@starting-style { .onboard[open]::backdrop { opacity: 0; } }

/* ── Minimalist mode ── */
body.minimal { background-image: none; }
body.minimal .eyebrow, body.minimal .meta .tag:not(.cat):not(.stakes), body.minimal .why, body.minimal .starters, body.minimal .community { display: none; }
body.minimal .choice { padding: 12px 14px; }
body.minimal .hero { padding-top: 8vh; }

@media (max-width: 560px) {
  .mark-word { display: none; }
  .bar { background: var(--bg); backdrop-filter: none; } /* solid: scrolled text no longer ghosts through */
  .hero { padding-top: 7vh; }
  .composer-row { flex-wrap: wrap; }
  .chips { width: 100%; order: 2; }
  .composer-actions { order: 1; width: 100%; justify-content: flex-end; }
}
@media (hover: none) { .chip:hover, .icon-btn:hover, .choice:hover { border-color: var(--line); } }
/* Reduced motion = gentler, not zero: movement goes, short fades stay */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .enter > *, .start-card, .plan.pop, .sample { animation-name: fade !important; animation-duration: .2s !important; }
  .shimmer { animation: none; color: var(--muted); background: none; }
  body.thinking .meter i { animation: none; }
  .start-card, .send, .btn { translate: none !important; }
}
/* Apple materials: solid chrome when transparency is reduced, hard edges when contrast is raised */
@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--bg); backdrop-filter: none; }
  .onboard::backdrop { backdrop-filter: none; background: color-mix(in srgb, var(--bg) 92%, transparent); }
}
@media (prefers-contrast: more) {
  :root { --line: var(--line-strong); --muted: var(--text); }
}
.legal .bm-title { font-size: 28px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
