/* Editorial pop: the approved redesign, layered over app.css. Ink lines,
   hard shadows, an acid-lime accent, Bricolage Grotesque for display.
   Light and dark follow the system unless the toggle (theme.js) sets
   data-theme on <html>. */
:root {
  --bg: #fafaf8;
  --bg-2: #f2f2ec;
  --panel: #ffffff;
  --fg: #0e0e0e;
  --muted: #5a5a5a;
  --line: #0e0e0e;
  --soft: #efefea;
  --lime: #d4ff3a;
  --hot: #ff3d7f;
  --accent: #0e0e0e;
  --accent-fg: #d4ff3a;
  --cta: #0e0e0e;
  --cta-fg: #d4ff3a;
  --grad: linear-gradient(var(--cta), var(--cta));
  --hard: 4px 4px 0 var(--fg);
  --hard-lg: 6px 6px 0 var(--fg);
  --glass: rgb(250 250 248 / 0.86);
  --tint: 16%;
  --shadow-sm: none;
  --shadow: var(--hard);
  --shadow-lg: var(--hard-lg);
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-2: #151514;
  --panel: #1a1a19;
  --fg: #f4f4ef;
  --muted: #a3a39b;
  --line: #f4f4ef;
  --soft: #262624;
  --accent: #d4ff3a;
  --accent-fg: #0e0e0e;
  --cta: #d4ff3a;
  --cta-fg: #0e0e0e;
  --hard: 4px 4px 0 #d4ff3a;
  --hard-lg: 6px 6px 0 #d4ff3a;
  --glass: rgb(14 14 14 / 0.86);
  --tint: 22%;
  --shadow-sm: none;
  --shadow: var(--hard);
  --shadow-lg: var(--hard-lg);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --bg-2: #151514;
    --panel: #1a1a19;
    --fg: #f4f4ef;
    --muted: #a3a39b;
    --line: #f4f4ef;
    --soft: #262624;
    --accent: #d4ff3a;
    --accent-fg: #0e0e0e;
    --cta: #d4ff3a;
    --cta-fg: #0e0e0e;
    --hard: 4px 4px 0 #d4ff3a;
    --hard-lg: 6px 6px 0 #d4ff3a;
    --glass: rgb(14 14 14 / 0.86);
    --tint: 22%;
    --shadow-sm: none;
    --shadow: var(--hard);
    --shadow-lg: var(--hard-lg);
    color-scheme: dark;
  }
}

body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "PingFang TC", "Noto Sans CJK TC", sans-serif; }
h1, h2, .brand span, .top .topic, .msg.first .bubble, .verdict header h2, .dialog h2 { font-family: var(--display); }
.brand span { font-weight: 800; letter-spacing: -0.04em; }
.brand span::after { content: none; }

/* controls */
.btn, .icon-btn.primary { background: var(--cta); color: var(--cta-fg); box-shadow: none; }
.btn { border: 2px solid var(--fg); font-weight: 800; }
.btn:hover { box-shadow: var(--hard); transform: translate(-2px, -2px); }
.icon-btn.primary:hover { transform: rotate(-6deg) scale(1.05); }
.field:focus { border-color: var(--fg); box-shadow: none; }
[data-tip]:hover::after { border-radius: 999px; font-weight: 700; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

/* avatars ringed in ink */
.av, .av.sm { box-shadow: 0 0 0 2px var(--fg); background: var(--panel); }
.av.human { background: var(--cta); color: var(--cta-fg); box-shadow: 0 0 0 2px var(--fg); }

/* start page */
.start h1 { font-weight: 800; letter-spacing: -0.055em; line-height: 0.92; }
.start h1 em { background: var(--lime); color: #0e0e0e; -webkit-background-clip: border-box; background-clip: border-box; padding: 0 0.18em; border-radius: 0.18em; display: inline-block; transform: rotate(-2deg); }
.ask { border: 2px solid var(--fg); border-radius: 24px; box-shadow: var(--hard-lg); }
.examples button { border: 1.5px solid var(--fg); color: var(--fg); background: transparent; }
.examples button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.cast-pick h2 { color: var(--fg); font-family: "Inter", sans-serif; font-weight: 800; }
.chip { border: 2px solid var(--fg); border-radius: 22px; }
.chip[aria-pressed="true"] { border-color: var(--fg); background: color-mix(in srgb, var(--c) var(--tint), var(--panel)); box-shadow: var(--hard); }
.chip .tick { background: var(--fg); color: var(--bg); }
.demo { border: 2px solid var(--fg); box-shadow: var(--hard-lg); }
.demo .badge { border: 1.5px solid var(--fg); }
.demo .badge i { background: var(--hot); }
.start-top { gap: 12px; }

/* room */
.top { border-bottom: 2px solid var(--fg); }
.top .topic { font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.top .sub i { background: var(--hot); }
.meter .ring { background: conic-gradient(var(--hot) var(--p, 0%), var(--soft) 0); box-shadow: 0 0 0 2px var(--fg); }
.member b { font-weight: 800; }
.member.speaking .av { box-shadow: 0 0 0 2px var(--fg), 0 0 0 5px var(--lime); }
@keyframes talk { 50% { transform: scale(1.07); box-shadow: 0 0 0 2px var(--fg), 0 0 0 8px color-mix(in srgb, var(--lime) 70%, transparent); } }
.bubble { border: 2px solid var(--fg); box-shadow: none; }
.msg.agent .bubble { background: color-mix(in srgb, var(--c) var(--tint), var(--panel)); border-color: var(--fg); }
.msg.mine .bubble { background: var(--cta); color: var(--cta-fg); border: 2px solid var(--fg); box-shadow: none; }
.msg.mine .bubble.md code { background: color-mix(in srgb, var(--cta-fg) 18%, transparent); }
.msg .name b { color: var(--fg); font-weight: 800; }
.msg .name span { color: var(--muted); }
.msg.first .bubble { border: 2px solid var(--fg); border-radius: 24px; box-shadow: var(--hard-lg); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.msg.first .bubble::before { color: var(--hot); font-family: "Inter", sans-serif; letter-spacing: 0.14em; }
.msg.streaming .bubble:empty::before { background: var(--fg); box-shadow: 12px 0 0 var(--fg), 24px 0 0 var(--fg); }
.msg.streaming .bubble.md > :last-child::after { background: var(--fg); }
.hand-card { border: 2px solid var(--fg); box-shadow: var(--hard); }
.hand-card .why b { color: var(--fg); }
.hand-card .go { background: var(--cta); color: var(--cta-fg); }
.composer { border: 2px solid var(--fg); border-radius: 24px; box-shadow: var(--hard); }
.thumb { border: 2px solid var(--fg); box-shadow: none; }
.media { border: 2px solid var(--fg); }
:root[data-theme="dark"] .md-code { border: 1px solid #3a3a36; background: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .md-code { border: 1px solid #3a3a36; background: #000; } }

/* verdict */
.verdict { border: 2px solid var(--fg); border-radius: 26px; box-shadow: var(--hard-lg); }
.verdict header { background: var(--cta); color: var(--cta-fg); }
.verdict header h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.verdict header .beans img { box-shadow: 0 0 0 2px var(--fg); }
.vote .bar { border: 1.5px solid var(--fg); height: 14px; background: var(--panel); }
.vote .bar i { background: var(--fg); }
.vote.win .bar i { background: var(--lime); box-shadow: inset -1.5px 0 0 var(--fg); }
.vote.win .label::after { color: var(--hot); }
.stances .tag { color: var(--fg); }
.verdict dl > div { border: 1.5px solid var(--fg); background: transparent; }
.verdict dl > div:last-child { background: var(--lime); color: #0e0e0e; }
.verdict dl > div:last-child dt { color: #0e0e0e; }
.thinking { border: 2px solid var(--fg); box-shadow: var(--hard); }
.dialog { border: 2px solid var(--fg); box-shadow: var(--hard-lg); }
.toast { border-radius: 999px; font-weight: 600; }
.top [data-tip]:hover::after, .start-top [data-tip]:hover::after { bottom: auto; top: calc(100% + 8px); }

/* phones */
@media (hover: none) { [data-tip]:hover::after { display: none; } }
@media (max-width: 640px) {
  .top { gap: 8px; padding: 8px 12px; }
  .top .topic { font-size: 16px; }
  .top .sub { white-space: nowrap; overflow: hidden; }
  .top .sub span { overflow: hidden; text-overflow: ellipsis; }
  .msg.first .bubble { font-size: 18px; }
  .ask { box-shadow: var(--hard); }
  .verdict header h2 { font-size: 20px; }
  .start .demo { display: none; }
}
a.btn { text-decoration: none; }

/* installable app (pwa.js) */
.install-sheet .dialog { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.install-sheet .app-icon { width: 76px; height: 76px; border-radius: 20px; border: 2px solid var(--fg); box-shadow: var(--hard); margin-bottom: 12px; }
.install-sheet .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; counter-reset: step; }
.install-sheet .steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--bg); }
.install-sheet .step-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--lime); color: #0e0e0e; }
.install-sheet .step-icon svg { width: 20px; height: 20px; }
.install-sheet .step-icon img { width: 30px; height: 30px; border-radius: 8px; }
.install-sheet .pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 24px; border-radius: 999px; background: var(--cta); color: var(--cta-fg); font: inherit; font-weight: 800; border: 2px solid var(--fg); cursor: pointer; }
.standalone .dock { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.start-top .install-btn { margin-left: auto; }
