/* Inter and JetBrains Mono, served from web/fonts (variable fonts, latin, SIL Open Font License: see the LICENSE
   files there) instead of Google Fonts, so no third party sees our visitors and the CSP can stay 'self'. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e8ebf0;
  --text: #111827; --text-2: #374151; --muted: #6b7280; --border: #e5e7eb; --border-strong: #d1d5db;
  --accent: #0f9d74; --accent-strong: #0b7d5c; --accent-soft: #e6f6f0; --on-accent: #ffffff;
  --accent-button: #0b7d5c;   /* white text on --accent is only 3.4:1; this is 5.1:1 (WCAG AA) */
  --you: #1d4ed8; --you-soft: #eef3ff; --you-border: #d6e2ff;
  --warn: #b45309; --warn-soft: #fef3e2; --bad: #b91c1c; --bad-soft: #fdecec; --good: #047857; --good-soft: #e3f5ec;
  --code-bg: #0f141b; --code-text: #dbe2ea;
  --shadow-sm: 0 1px 2px rgba(17,24,39,.05);
  --shadow: 0 1px 3px rgba(17,24,39,.06), 0 8px 24px rgba(17,24,39,.06);
  --radius: 16px; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1016; --surface: #131922; --surface-2: #19212c; --surface-3: #212b38;
    --text: #eef2f7; --text-2: #cfd6e0; --muted: #8e9aab; --border: #232d3a; --border-strong: #2f3b4b;
    --accent: #34d399; --accent-strong: #6ee7b7; --accent-soft: #10302a; --on-accent: #052e22;
    --accent-button: #34d399;
    --you: #93b4ff; --you-soft: #172238; --you-border: #233457;
    --warn: #fbbf24; --warn-soft: #33270f; --bad: #f87171; --bad-soft: #3a1717; --good: #34d399; --good-soft: #10302a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 3px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #0c1016; --surface: #131922; --surface-2: #19212c; --surface-3: #212b38;
  --text: #eef2f7; --text-2: #cfd6e0; --muted: #8e9aab; --border: #232d3a; --border-strong: #2f3b4b;
  --accent: #34d399; --accent-strong: #6ee7b7; --accent-soft: #10302a; --on-accent: #052e22;
  --accent-button: #34d399;
  --you: #93b4ff; --you-soft: #172238; --you-border: #233457;
  --warn: #fbbf24; --warn-soft: #33270f; --bad: #f87171; --bad-soft: #3a1717; --good: #34d399; --good-soft: #10302a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow: 0 1px 3px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 Inter, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { height: 100%; display: flex; flex-direction: column; }
.page { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }   /* nothing on a page scrolls sideways (hidden tooltips, glows) */
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { height: 64px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.02rem; letter-spacing: -0.01em; white-space: nowrap; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 .8rem/1 var(--mono); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.crumbs button:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; }
.round-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.round-title small { color: var(--muted); font-size: .78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-title b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.grow { flex: 1; min-width: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.timer { display: inline-flex; align-items: center; gap: 8px; font: 600 1.05rem/1 var(--mono); padding: 9px 13px; border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.timer.low { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.timer.out { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.stepper { display: flex; align-items: center; gap: 6px; justify-content: safe center; overflow: hidden; }
.step { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 .72rem/1 var(--mono); font-style: normal; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.step.done i { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.step.active { color: var(--text); font-weight: 600; }
.step.active i { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-line { width: 18px; height: 2px; background: var(--border); border-radius: 2px; flex: none; }
.step-line.done { background: var(--accent); }
.stepper.compact .step:not(.active) span { display: none; }
@media (max-width: 1250px) { .step:not(.active) span { display: none; } }
@media (max-width: 860px) { .stepper, .status-text, .round-title, .crumbs { display: none; } }
.views { display: none; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.views button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.views button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 11px; padding: 9px 15px; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; color: var(--text); text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent-button, var(--accent)); border-color: var(--accent-button, var(--accent)); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.lg { padding: 14px 24px; font-size: 1.02rem; border-radius: 13px; }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 9px; }
.field { display: grid; gap: 8px; }
.label { font-weight: 600; font-size: .92rem; color: var(--text-2); }
.help { color: var(--muted); font-size: .85rem; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 11px; padding: 11px 13px; outline: none; }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.55; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .84rem; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip small { color: var(--muted); margin-left: 4px; }
.tag { display: inline-block; font: 500 .74rem/1 var(--mono); padding: 6px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.diff-easy { background: var(--good-soft); color: var(--good); } .diff-medium { background: var(--warn-soft); color: var(--warn); } .diff-hard { background: var(--bad-soft); color: var(--bad); }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 11px; padding: 12px 14px; font-size: .92rem; white-space: pre-wrap; }

/* ---------- landing / pickers ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 72px 0 40px; text-align: center; position: relative; isolation: isolate; overflow-x: clip; }   /* the glow is wider than the page */
.hero::before { content: ""; position: absolute; inset: 10px -10% auto; height: 380px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 75%); filter: blur(8px); }
.hero-facts { display: flex; gap: 10px 22px; justify-content: center; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.hero-facts span { display: inline-flex; align-items: center; gap: 6px; }
.hero-facts svg { color: var(--accent); }
.hero .pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .85rem; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.8rem); letter-spacing: -0.035em; line-height: 1.05; margin: 20px auto 16px; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 0 auto 30px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); padding: 24px 0 64px; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.feature .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feature b { display: block; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.page-head { padding: 44px 0 26px; }
.page-head .back { margin-bottom: 18px; }
.page-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 8px; }
.page-head p { color: var(--muted); margin: 0; font-size: 1.04rem; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); padding-bottom: 56px; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card { position: relative; text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 22px; cursor: pointer; display: grid; gap: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; color: var(--text); }
.card:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card:disabled { cursor: not-allowed; opacity: .6; }
.card .top { display: flex; align-items: center; gap: 12px; }
.card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.card .kicker { font: 600 .74rem/1 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.card b { font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.55; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.card .soon { position: absolute; top: 18px; right: 18px; }
.setup { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) 320px; padding-bottom: 56px; align-items: start; }
@media (max-width: 900px) { .setup { grid-template-columns: 1fr; } }
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); display: grid; gap: 22px; }
.summary { position: sticky; top: 20px; }
.summary h3 { margin: 0; font-size: 1rem; }
.summary ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.summary li span { color: var(--muted); }
.summary li b { text-align: right; }
.flow { margin: 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.flow li { margin-bottom: 8px; padding-left: 4px; }
.flow li::marker { color: var(--accent); font-weight: 700; }

/* history */
.hist { display: grid; gap: 10px; padding-bottom: 56px; }
.hist-row { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 8px 6px 6px; transition: border-color .15s, box-shadow .15s; }
.hist-row:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.hist-row.incomplete { border-style: dashed; }
.hist-main { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; background: none; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; color: var(--text); }
.hist-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main > div { min-width: 0; }
.hist-row small { color: var(--muted); display: block; }
.hist-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.hist-row.incomplete .hist-ic { background: var(--surface-2); color: var(--muted); }
.hist-row .del { border-color: transparent; color: var(--muted); }
.hist-row .del:hover { color: var(--bad); background: var(--bad-soft); }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 12px; }
.hist-head .section-title { margin: 0; }
.hist-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hist-filters .seg button { padding: 6px 12px; font-size: .85rem; }
.input.sm { width: auto; padding: 8px 12px; font-size: .88rem; }
.tag.warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
@media (max-width: 640px) {
  .hist-main { grid-template-columns: auto 1fr auto; gap: 10px; padding: 8px 6px; }
  .hist-main .score-badge { min-width: 0; font-size: .88rem; }
  .hist-main > .verdict, .hist-main > .tag, .hist-main > span:empty { display: none; }
}
.score-badge { font: 700 1rem/1 var(--mono); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); min-width: 64px; text-align: center; }
.score-badge.good { background: var(--good-soft); color: var(--good); }
.score-badge.mid { background: var(--warn-soft); color: var(--warn); }
.score-badge.bad { background: var(--bad-soft); color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: .85rem; }

/* ---------- room ---------- */
.room { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 42%); }
.room.wide { grid-template-columns: minmax(0, 1fr) minmax(460px, 52%); }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.feed { flex: 1; overflow-y: auto; }
.feed-inner { max-width: 760px; margin: 0 auto; padding: 28px 24px 16px; display: grid; gap: 20px; }
.m { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--accent-soft); color: var(--accent); }
.m .head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.m .head b { font-size: .92rem; }
.m .head span { font-size: .78rem; color: var(--muted); }
.m .text { color: var(--text); font-size: 1rem; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; }
.m.ai .text { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.m.you { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.m.you > div { display: flex; flex-direction: column; align-items: flex-end; max-width: 86%; min-width: 0; }
.m.you .head { justify-content: flex-end; }
.m.you .head b { color: var(--you); }
.m.you .text { background: var(--you-soft); border: 1px solid var(--you-border); border-radius: 16px 4px 16px 16px; padding: 12px 16px; max-width: 100%; }
.chip-msg { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.code-msg { width: min(100%, 640px); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.code-msg .bar, .out .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface-2); font-size: .8rem; color: var(--muted); font-weight: 600; }
.code-msg pre, .out pre { margin: 0; padding: 14px; background: var(--code-bg); color: var(--code-text); font: 13px/1.6 var(--mono); overflow-x: auto; max-height: 380px; white-space: pre; }
.out { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.out pre { white-space: pre-wrap; max-height: 320px; }
.note { justify-self: center; text-align: center; color: var(--muted); font-size: .86rem; background: var(--surface-2); padding: 7px 14px; border-radius: 999px; max-width: 92%; }
.note.warn { color: var(--warn); background: var(--warn-soft); font-weight: 600; border-radius: 12px; }
.note.error { color: var(--bad); background: var(--bad-soft); font-weight: 600; border-radius: 12px; white-space: pre-wrap; text-align: left; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } .card { transition: none; } }
.judge-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.judge-card b { font-size: .95rem; }

.composer { padding: 6px 24px 18px; background: var(--bg); }
.composer-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .btn { border-radius: 999px; padding: 8px 14px; font-size: .88rem; }
.inline-ask { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 8px; }
.inline-ask label { font-size: .85rem; font-weight: 600; color: var(--muted); padding-left: 6px; white-space: nowrap; }
.inline-ask input { flex: 1; border: 0; background: transparent; outline: none; font-family: var(--mono); font-size: .9rem; min-width: 0; }
.box { display: flex; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); }
.box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.box textarea { flex: 1; border: 0; outline: none; background: transparent; resize: none; min-height: 28px; max-height: 220px; padding: 7px 0; line-height: 1.55; }
/* admin dashboard (chart colors from the dataviz reference palette, slot 1) */
:root { --series-1: #2a78d6; --viz-grid: #e1e0d9; --viz-base: #c3c2b7; --viz-muted: #898781; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --viz-grid: #2c2c2a; --viz-base: #383835; } }
:root[data-theme="dark"] { --series-1: #3987e5; --viz-grid: #2c2c2a; --viz-base: #383835; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, calc(50% - 6px)), 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis .stat { display: grid; gap: 2px; }
.kpis .stat span { font-size: .82rem; color: var(--muted); }
.kpis .stat b { font-size: 1.8rem; letter-spacing: -0.02em; }
.kpis .stat small { font-size: .78rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }
.viz-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.admin-grid .viz-card { margin-bottom: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; font-size: .95rem; }
.viz-head span { font-size: .82rem; }
.viz-plot { position: relative; }
.viz-plot svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-tick { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-bar { fill: var(--series-1); }
.viz-bar.on { fill: var(--accent); }
.viz-tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: .8rem; display: grid; gap: 2px; pointer-events: none; white-space: nowrap; z-index: 2; color: var(--text); }
@media (max-width: 600px) { .viz-tick { font-size: 20px; } }   /* the chart is scaled to ~half width on phones */
.viz-tip.end { transform: translate(calc(-100% + 12px), calc(-100% - 10px)); }   /* near the right edge: open leftwards */
.viz-tip.start { transform: translate(-12px, calc(-100% - 10px)); }
.viz-table summary { cursor: pointer; color: var(--muted); font-size: .82rem; margin-top: 8px; }
.viz-table table, .admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
.viz-table th, .viz-table td, .admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table th, .viz-table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table td { font-variant-numeric: tabular-nums; }
.viz-card:has(.admin-table) { overflow-x: auto; }
.barlist { display: grid; gap: 10px; }
.barlist-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto auto; gap: 10px; align-items: center; font-size: .88rem; }
.barlist-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.barlist-fill { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.barlist-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.barlist-extra { color: var(--muted); font-size: .8rem; min-width: 0; }
.menu-item { background: none; border: 0; text-align: left; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: .9rem; color: var(--text); }
.menu-item:hover { background: var(--surface-2); }

.account { position: relative; flex: none; }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--you-soft); color: var(--you); font-weight: 700; cursor: pointer; }
.account-menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 4px; min-width: 220px; z-index: 20; }
.account-menu small { color: var(--muted); margin-bottom: 8px; word-break: break-all; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.btn.google { width: 100%; background: var(--surface); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.mic { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.mic:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.mic.on { background: var(--bad-soft); color: var(--bad); border-color: transparent; animation: pulse 1.4s infinite; }
.mic:disabled { opacity: .45; cursor: not-allowed; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--bad-soft); } 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.hint { color: var(--muted); font-size: .8rem; padding-left: 4px; }

/* ---- voice call: answer out loud ---- */
.call { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.caption { min-height: 48px; max-height: 140px; overflow-y: auto; color: var(--muted); font-size: .95rem; line-height: 1.55; text-align: center; display: grid; place-items: center; }
.caption.you { color: var(--text); text-align: left; place-items: start; }
.caption .interim { color: var(--muted); }
.call-controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.call-controls .btn { min-width: 96px; justify-content: center; }
.mic-big { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .15s; }
.mic-big:hover:not(:disabled) { transform: scale(1.05); }
.mic-big:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.mic-big.on { background: var(--bad); color: #fff; }
.mic-big.busy:not(:disabled) { background: var(--surface-3); color: var(--text); }
.mic-big .pulse { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--bad); opacity: .5; animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mic-big .pulse { animation: none; } }
.voice-warn { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 9px 13px; font-size: .85rem; }
.voice-warn code { font-family: var(--mono); }

/* ---- loading: a moving bar and a message at the top while things start ---- */
.toploader { position: fixed; top: 0; left: 0; right: 0; z-index: 50; pointer-events: none; display: grid; justify-items: center; }
.toploader .bar { width: 100%; height: 3px; background: var(--accent-soft); overflow: hidden; position: relative; }
.toploader .bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--accent); animation: toploader 1.2s ease-in-out infinite; }
@keyframes toploader { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.toploader span { margin-top: 70px; background: var(--surface); color: var(--text-2); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 999px; padding: 7px 16px; font-size: .88rem; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .toploader .bar::after { animation: none; width: 100%; opacity: .5; } }

/* ---- profile ---- */
.btn.google.off { opacity: .6; }
.ok-msg { background: var(--good-soft); color: var(--good); border-radius: 12px; padding: 9px 13px; font-size: .9rem; margin-bottom: 14px; }
.profile-form { display: grid; gap: 16px; margin-bottom: 18px; }
.profile-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .profile-form .two { grid-template-columns: 1fr; } }
.resume-card { display: grid; gap: 12px; }
.resume-card h3 { margin: 0; font-size: 1.05rem; }
.resume-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.resume-row div { display: grid; }
.resume-row small { color: var(--muted); }

/* ---- progress ---- */
.progress { display: grid; gap: 16px; margin-bottom: 26px; }
.progress .kpis { margin-bottom: 0; }
.progress .kpis small { color: var(--muted); }
.section-title { font-size: 1.1rem; margin: 6px 0 12px; }
.speech { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .speech { grid-template-columns: 1fr; } }
.speech > div { display: grid; gap: 3px; align-content: start; }
.speech span { font-size: .82rem; color: var(--muted); }
.speech b { font-size: 1.5rem; letter-spacing: -0.02em; }
.speech b small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.speech > div > small { font-size: .78rem; color: var(--muted); }
.speech em { font-style: normal; font-size: .78rem; font-weight: 600; justify-self: start; padding: 2px 8px; border-radius: 999px; }
.speech em.good { background: var(--good-soft); color: var(--good); }
.speech em.warn { background: var(--warn-soft); color: var(--warn); }
.speech em.bad { background: var(--bad-soft); color: var(--bad); }
.grammar { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .9rem; }
.grammar li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.grammar li:last-child { border-bottom: 0; }
.grammar s { color: var(--muted); }
.grammar span::before { content: "→ "; color: var(--good); font-weight: 700; }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: .9rem; }

/* listen-only: the interviewer's words are heard, not shown, during the round */
.text.spoken { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.text.spoken .wave { display: none; align-items: center; gap: 3px; height: 16px; }
.text.spoken.live { color: var(--accent); }
.text.spoken.live .wave { display: inline-flex; }
.text.spoken .wave b { width: 3px; height: 6px; border-radius: 2px; background: var(--accent); animation: wave 1s ease-in-out infinite; }
.text.spoken .wave b:nth-child(2) { animation-delay: .15s; }
.text.spoken .wave b:nth-child(3) { animation-delay: .3s; }
.text.spoken .wave b:nth-child(4) { animation-delay: .45s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 15px; } }
@media (prefers-reduced-motion: reduce) { .text.spoken .wave b { animation: none; height: 10px; } }

/* the "sending when you stop talking" countdown */
.autosend { display: grid; gap: 4px; }
.autosend > span { display: block; height: 4px; border-radius: 4px; background: var(--accent); transition: width .25s linear; }
.autosend small { color: var(--muted); font-size: .78rem; text-align: center; }

/* ---- the lobby: check mic and speaker, then join ---- */
.lobby { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.lobby .check { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.lobby .check .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.lobby .check.ok .ic { background: var(--good-soft); color: var(--good); }
.lobby .check.bad .ic { background: var(--bad-soft); color: var(--bad); }
.lobby .check div { display: grid; gap: 2px; flex: 1; }
.lobby .check small { color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--good); transition: width .1s linear; }
.lobby ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; display: grid; gap: 4px; }

/* ---- choosing the interviewer's voice ---- */
.voices { display: grid; gap: 10px; }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.voice-card { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.voice-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.voice-card .play { width: 40px; border: 0; border-right: 1px solid var(--border); background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.voice-card .play:hover { color: var(--accent); }
.voice-card .pick { flex: 1; border: 0; background: transparent; text-align: left; padding: 8px 11px; cursor: pointer; color: var(--text); display: grid; gap: 2px; font: inherit; }
.voice-card .pick small { color: var(--muted); font-size: .78rem; }
.voice-card.locked .pick b, .voice-card.locked .pick small { opacity: .62; }
.voice-card .voice-lock { display: flex; align-items: center; gap: 4px; padding: 0 12px; color: var(--muted); font-size: .8rem; font-weight: 600; flex: none; }
.voice-card .voice-lock .coin, .voice-card .voice-lock svg:last-of-type { color: #f59e0b; }
.voice-free { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 2px 6px; border-radius: 999px; vertical-align: 2px; margin-left: 4px; }
.mixer { display: grid; gap: 10px; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px; }
.mix-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mix-row select { flex: 1; min-width: 130px; }
.mix-row input[type=range] { flex: 1; min-width: 100px; accent-color: var(--accent); }

.side { border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; gap: 4px; padding: 12px 16px 0; border-bottom: 1px solid var(--border); flex: none; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tab-body { flex: 1; overflow-y: auto; min-height: 0; }
.pad { padding: 22px 24px 32px; }
.empty { color: var(--muted); text-align: center; padding: 48px 24px; }
.empty .ic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; }

.md { font-size: .96rem; line-height: 1.7; color: var(--text-2); }
.md h1 { font-size: 1.4rem; color: var(--text); margin: 0 0 12px; letter-spacing: -0.015em; }
.md h2 { font-size: 1.12rem; color: var(--text); margin: 26px 0 10px; letter-spacing: -0.01em; }
.md h3 { font-size: 1rem; color: var(--text); margin: 20px 0 8px; }
.md p { margin: 0 0 12px; }
.md table { border-collapse: collapse; width: 100%; margin: 6px 0 16px; font-size: .9rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.md code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.md pre { background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: .85rem; }
.md pre code { background: none; padding: 0; color: inherit; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 12px; }
.md li { margin: 4px 0; }
.md strong { color: var(--text); }
.ws-path { font: 13px/1.5 var(--mono); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; word-break: break-all; margin: 10px 0 14px; }
.ws-list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ws-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--text-2); font-size: .93rem; }
.ws-list li i { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 .75rem/1 var(--mono); font-style: normal; }

/* editor + tests */
.editor-wrap { display: flex; flex-direction: column; height: 100%; }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap; }
.editor-bar select { width: auto; padding: 7px 10px; border-radius: 9px; font-size: .88rem; }
.editor-host { flex: 1; min-height: 160px; position: relative; }
.editor-host .CodeMirror, .editor-host textarea.fallback { position: absolute; inset: 0; height: 100%; font: 14px/1.6 var(--mono); }
.editor-host textarea.fallback { width: 100%; border: 0; padding: 14px; background: var(--code-bg); color: var(--code-text); resize: none; outline: none; }
.CodeMirror { background: var(--surface); color: var(--text); }
.CodeMirror, pre, code, .ws-path, .timer { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.CodeMirror-gutters { background: var(--surface-2); border-right: 1px solid var(--border); }
.tests { flex: none; max-height: 42%; overflow-y: auto; border-top: 1px solid var(--border); background: var(--bg); }
.tests-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.tests-head b { font-size: .92rem; }
.pass { color: var(--good); } .fail { color: var(--bad); }
.test-row { border-bottom: 1px solid var(--border); }
.test-row > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: none; border: 0; cursor: pointer; text-align: left; font-size: .9rem; color: var(--text); }
.test-row > button:hover { background: var(--surface-2); }
.test-row .ms { margin-left: auto; color: var(--muted); font: 12px/1 var(--mono); }
.test-detail { padding: 4px 16px 14px; display: grid; gap: 8px; }
.test-detail .lbl { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.test-detail pre { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 8px; padding: 8px 10px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; max-height: 160px; overflow: auto; }
.compile-err { margin: 12px 16px; background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; }
.editor-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; flex: none; }
.editor-foot small { color: var(--muted); }

/* report */
.report { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.report-hero { display: flex; align-items: center; gap: 22px; padding: 24px 26px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .num b { font-size: 1.7rem; letter-spacing: -0.02em; }
.ring .num small { display: block; color: var(--muted); font-size: .72rem; margin-top: 3px; }
.report-hero h3 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 8px 14px; border-radius: 999px; font-size: 1rem; background: var(--surface-2); }
.v-good { background: var(--good-soft); color: var(--good); }
.v-mid { background: var(--warn-soft); color: var(--warn); }
.v-bad { background: var(--bad-soft); color: var(--bad); }
.report-body { padding: 8px 26px 24px; }
.report-body .md h2 { border-top: 1px solid var(--border); padding-top: 20px; }
.report-body .md h2:first-child { border-top: 0; padding-top: 8px; }
.report-writing { color: var(--muted); font-size: .9rem; display: flex; gap: 10px; align-items: center; padding: 16px 26px; }
.finish { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.finish code { font: 12px/1.4 var(--mono); color: var(--muted); word-break: break-all; }

@media (max-width: 1100px) {
  .room, .room.wide { grid-template-columns: 1fr; }
  .room .side { border-left: 0; }
  .room:not(.show-side) .side { display: none; }
  .room.show-side .chat { display: none; }
  .views { display: inline-flex; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 10px; } .brand-name { display: none; }
  .feed-inner { padding: 20px 14px 12px; } .composer { padding: 6px 12px 14px; }
  .timer { font-size: .92rem; padding: 7px 10px; }
  .hero { padding-top: 48px; }
}

/* ---------- home: quick start, how it works, your week ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
@media (max-width: 900px) { .quick { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .quick { grid-template-columns: 1fr; } }
.quick-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 40px 14px 14px; cursor: pointer; color: var(--text);
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.quick-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-card .ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.quick-card small { color: var(--muted); font-size: .82rem; }
.quick-card .go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); transition: color .15s, transform .15s; }
.quick-card:hover .go { color: var(--accent); transform: translate(3px, -50%); }
.how { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: none; }
@media (max-width: 820px) { .how { grid-template-columns: 1fr; } }
.how li { background: var(--surface-2); border-radius: var(--radius); padding: 20px; }
.how .n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 .9rem/1 var(--mono); margin-bottom: 12px; }
.how b { display: block; margin-bottom: 4px; }
.how p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.your-week { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-bottom: 26px; }
@media (max-width: 960px) { .your-week { grid-template-columns: 1fr 1fr; } .your-week .habit { grid-column: 1 / -1; } }
@media (max-width: 600px) { .your-week { grid-template-columns: 1fr; } }
.your-week .viz-card { margin-bottom: 0; }
.viz-head b { display: inline-flex; align-items: center; gap: 7px; }
.focus .focus-area { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.focus .focus-area span { font-weight: 600; text-transform: capitalize; }
.focus .focus-area b { font: 700 1.5rem/1 var(--mono); color: var(--warn); }
.focus .focus-area small { font-size: .85rem; color: var(--muted); }
.focus p { margin: 0; font-size: .9rem; }
.md.inline p { margin: 0; }
.last-round { text-align: left; cursor: pointer; color: var(--text); font: inherit; display: grid; gap: 10px; align-content: start; transition: border-color .15s; }
.last-round:hover { border-color: var(--accent); }
.last-round .viz-head { margin-bottom: 0; }
.last-body { display: flex; gap: 12px; align-items: center; min-width: 0; }
.last-body b { display: block; font-size: .95rem; line-height: 1.35; margin-bottom: 4px; }
.last-round .linkish { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; }

/* ---------- practice habit ---------- */
.habit { display: grid; gap: 16px; }
.habit-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.streak { display: flex; align-items: center; gap: 12px; }
.streak .flame { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.streak.on .flame { background: var(--warn-soft); color: #f97316; }
.streak b { display: block; font-size: 1.7rem; line-height: 1; letter-spacing: -0.02em; }
.streak span { color: var(--muted); font-size: .85rem; }
.week { display: flex; gap: 6px; }
.week .day { display: grid; justify-items: center; gap: 4px; }
.week .day i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--on-accent); }
.week .day.on i { background: var(--accent); border-color: var(--accent); }
.week .day.today i { border-color: var(--accent); }
.week .day.future i { opacity: .5; }
.week .day small { font-size: .7rem; color: var(--muted); }
.goal { display: grid; gap: 7px; }
.goal-head { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.goal-head span:first-child { color: var(--text-2); font-weight: 600; }
.goal-head b { font-family: var(--mono); margin-left: auto; }
.goal-adj { display: inline-flex; gap: 4px; }
.goal-adj button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; line-height: 1; color: var(--text-2); }
.goal-adj button:hover:not(:disabled) { background: var(--surface-2); }
.goal-adj button:disabled { opacity: .4; cursor: not-allowed; }
.goal-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.goal-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.goal small { font-size: .82rem; }

/* ---------- banners, dialogs, toasts ---------- */
.info-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--you-soft); color: var(--text-2); border: 1px solid var(--you-border); border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin-bottom: 14px; line-height: 1.5; }
.info-banner svg { color: var(--you); margin-top: 1px; }
.info-banner.trial-over { text-align: left; margin-top: 18px; }
.info-banner.trial-over > div { flex: 1; min-width: 0; }
.hero .info-banner.trial-over p, .info-banner.trial-over p { margin: 4px 0 0; font-size: inherit; line-height: inherit; color: inherit; max-width: none; }
.info-banner.trial-over form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.info-banner.trial-over form .input { flex: 1 1 220px; min-width: 0; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover:not(:disabled) { filter: brightness(.92); background: var(--bad); }
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(8, 12, 18, .5); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); padding: 22px; animation: pop .18s ease; }
.modal h3 { margin: 0 0 8px; font-size: 1.15rem; }
.modal-body p { margin: 0 0 10px; color: var(--text-2); font-size: .94rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 110; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); padding: 11px 15px; border-radius: 12px; box-shadow: var(--shadow); font-size: .9rem; font-weight: 600; animation: pop .2s ease; max-width: min(380px, calc(100vw - 32px)); }
.toast.ok svg { color: var(--accent); }
.toast.bad svg { color: var(--bad); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .modal-back, .modal, .toast { animation: none; } .quick-card, .goal-track span { transition: none; } }

/* ---------- printing a report ---------- */
@media print {
  .topbar, .report-actions, .back, .toasts, details { display: none !important; }
  html, body, #root, .app, .page { height: auto !important; overflow: visible !important; background: #fff; }
}
.hist-main .verdict, .last-body .verdict { font-size: .8rem; padding: 5px 11px; }

/* =================================================================
   Modern pass: softer depth, gradient accents and a few purposeful
   animations (page entrance, staggered cards, loading states).
   Everything that moves stops under prefers-reduced-motion.
   ================================================================= */
:root { --accent-2: #0ea5e9; --ease: cubic-bezier(.2, .7, .2, 1); --glow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
body { background:
  radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 60%),
  radial-gradient(900px 500px at -10% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%), var(--bg);
  background-attachment: fixed; }
.page, .app { background: transparent; }
.topbar { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); }
.logo { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }

/* buttons: gradient primary, lift on hover, press feedback */
.btn { transition: background .15s, border-color .15s, box-shadow .2s, transform .15s var(--ease), filter .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2))); border-color: transparent; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  filter: brightness(1.06); box-shadow: var(--glow); transform: translateY(-1px); border-color: transparent; }
.btn.lg { border-radius: 14px; }
.input, .seg button, .chip, .icon-btn { transition: border-color .15s, box-shadow .15s, background .15s, color .15s; }
.seg button.on { box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05); }

/* cards: a soft glow ring on hover */
.card, .feature, .quick-card, .viz-card, .panel-card, .stat, .hist-row { border-radius: 18px; }
.card:hover:not(:disabled), .quick-card:hover { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.feature { transition: transform .2s var(--ease), box-shadow .2s; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature .ic, .card .ic, .quick-card .ic, .hist-ic { background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, var(--surface))); }

/* hero: gradient headline */
.hero h1 em { background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 8s linear infinite; }
@keyframes sheen { to { background-position: 200% center; } }

/* page entrance and staggered lists */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.page > .wrap { animation: rise .45s var(--ease) backwards; }
.cards > *, .quick > *, .features > *, .kpis > *, .how > *, .your-week > *, .hist > *, .admin-grid > * { animation: rise .5s var(--ease) backwards; }
:is(.cards, .quick, .features, .kpis, .how, .your-week, .hist, .admin-grid) > :nth-child(2) { animation-delay: .05s; }
:is(.cards, .quick, .features, .kpis, .how, .your-week, .hist, .admin-grid) > :nth-child(3) { animation-delay: .1s; }
:is(.cards, .quick, .features, .kpis, .how, .your-week, .hist, .admin-grid) > :nth-child(4) { animation-delay: .15s; }
:is(.cards, .quick, .features, .kpis, .how, .your-week, .hist, .admin-grid) > :nth-child(5) { animation-delay: .2s; }
:is(.cards, .quick, .features, .kpis, .how, .your-week, .hist, .admin-grid) > :nth-child(n+6) { animation-delay: .25s; }
.barlist-fill, .goal-track span { animation: grow .8s var(--ease) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* skeleton loading blocks */
.skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton-list { display: grid; gap: 12px; padding: 8px 0 40px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- resume choice on the setup page ---------- */
.resume-choice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer;
  background: var(--surface); transition: border-color .2s, background .2s; }
.resume-choice.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.resume-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.resume-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.resume-choice.on .switch { background: var(--accent); }
.resume-choice.on .switch::after { transform: translateX(18px); }
.rc-text { display: grid; gap: 2px; min-width: 0; }
.rc-text small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .84rem; }
.resume-empty { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--border-strong); border-radius: 14px; }
.resume-empty .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.resume-empty div { flex: 1; min-width: 0; }
.resume-empty small { display: block; color: var(--muted); font-size: .84rem; }
@media (max-width: 520px) { .resume-empty { flex-wrap: wrap; } .resume-empty .btn { width: 100%; } }

/* ---------- starting screen (Join → interviewer's first words) ---------- */
.starting-screen { position: fixed; inset: 64px 0 0; z-index: 9; display: grid; place-items: center; padding: 20px 16px; overflow-y: auto;
  background: radial-gradient(700px 420px at 50% 30%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); animation: fade .3s ease both; }
.starting-screen.leaving { animation: fade-out .6s ease forwards; }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }
.start-card { width: min(460px, 100%); text-align: center; display: grid; justify-items: center; gap: 14px; }
.orb { position: relative; width: 116px; height: 116px; display: grid; place-items: center; margin-bottom: 6px; }
.orb span { position: relative; z-index: 1; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  font: 800 2rem/1 Inter, system-ui, sans-serif; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent); animation: breathe 2.4s ease-in-out infinite; }
.orb i { position: absolute; inset: 20px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ripple 2.4s ease-out infinite; }
.orb i:nth-child(2) { animation-delay: .8s; }
.orb i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ripple { 0% { transform: scale(.9); opacity: .55; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.05); } }
.start-msg { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.02em; animation: msg-in .45s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.start-sub { margin: 0; color: var(--muted); min-height: 1.6em; }
.start-bar { width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.start-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .5s var(--ease); position: relative; overflow: hidden; }
.start-bar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 1.4s linear infinite; background-size: 200% 100%; }
.start-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 7px; justify-items: start; width: 100%; font-size: .9rem; color: var(--muted); }
.start-steps li { display: flex; align-items: center; gap: 10px; transition: color .3s; }
.start-steps li span { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: var(--on-accent); transition: background .3s, border-color .3s; }
.start-steps li.now { color: var(--text); font-weight: 600; }
.start-steps li.now span { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.start-steps li.done { color: var(--text-2); }
.start-steps li.done span { background: var(--accent); border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.start-tip { margin-top: 10px; width: 100%; display: flex; gap: 10px; align-items: baseline; text-align: left; font-size: .88rem; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.start-tip b { font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.start-tip span { animation: msg-in .4s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .page > .wrap, .cards > *, .quick > *, .features > *, .kpis > *, .how > *, .your-week > *, .hist > *, .admin-grid > *,
  .barlist-fill, .goal-track span, .hero h1 em, .skeleton, .orb span, .orb i, .start-msg, .start-tip span, .start-bar span::after,
  .start-steps li.now span, .starting-screen { animation: none !important; }
  .starting-screen.leaving { display: none; }
  .btn, .feature, .switch::after { transition: none; }
}

/* ---------- coins, wallet, plans ---------- */
.coin-chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font: 600 .86rem/1 Inter, system-ui, sans-serif; color: var(--text); flex: none; transition: border-color .2s, box-shadow .2s; }
.coin-chip:hover { border-color: #f59e0b; box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 18%, transparent); }
.coin-chip .coin { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #fbbf24, #f97316); }
.coin-chip.nudge .coin { animation: wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
.chip-sep { width: 1px; height: 16px; background: var(--border); }
.chip-time { color: var(--muted); font-weight: 500; }
@media (max-width: 640px) { .chip-sep, .chip-time { display: none; } }
.checkin { display: flex; align-items: center; gap: 14px; }
.checkin.compact { margin-bottom: 16px; }
.checkin-coin { position: relative; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, #fbbf24, #f97316); box-shadow: 0 8px 20px color-mix(in srgb, #f97316 30%, transparent); }
.checkin-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.checkin-text small { color: var(--muted); }
.ok-tag { display: inline-flex; gap: 5px; align-items: center; background: var(--good-soft); color: var(--good); font-weight: 600; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: #fbbf24; animation: burst .9s ease-out forwards; }
.burst i:first-child { width: auto; height: auto; background: none; color: #f97316; font: 800 1rem/1 Inter, sans-serif; font-style: normal; animation: float-up 1s ease-out forwards; }
.burst i:nth-child(2) { --dx: -26px; } .burst i:nth-child(3) { --dx: 26px; } .burst i:nth-child(4) { --dx: 0px; }
@keyframes burst { to { transform: translate(var(--dx), -38px) scale(.4); opacity: 0; } }
@keyframes float-up { from { transform: translate(-50%, -50%); } to { transform: translate(-50%, -70px); opacity: 0; } }
.rewards-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.rewards-grid .time-card { grid-column: 1 / -1; }
@media (max-width: 820px) { .rewards-grid { grid-template-columns: 1fr; } }
.rewards-grid .viz-card { margin: 0; }
.coins-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.coin-ring { position: relative; width: 130px; height: 130px; }
.coin-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.coin-ring b { font-size: 2rem; letter-spacing: -0.03em; line-height: 1; }
.coin-ring small { color: var(--muted); }
.coins-side { display: grid; gap: 8px; flex: 1; min-width: 200px; justify-items: start; }
.time-card { display: grid; gap: 12px; justify-items: start; }
.time-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; }
.time-row > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.time-row.free > span { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); color: #f97316; }
.time-row div { display: grid; gap: 3px; flex: 1; }
.time-row small { color: var(--muted); }
.earn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .earn { grid-template-columns: 1fr; } }
.earn > div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: grid; gap: 4px; }
.earn .coin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #fbbf24, #f97316); margin-bottom: 6px; }
.earn small { color: var(--muted); }
.ledger { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.ledger-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: .9rem; align-items: center; }
.ledger-row:first-child { border-top: 0; }
.ledger-row small { color: var(--muted); }
.ledger-row .plus { color: var(--good); } .ledger-row .minus { color: var(--muted); }
@media (max-width: 600px) { .ledger-row { grid-template-columns: 1fr auto; } .ledger-row > .muted { display: none; } }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: stretch; }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; padding: 22px; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.plan-badge { position: absolute; top: -12px; left: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font: 700 .72rem/1 var(--mono); padding: 6px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.plan-name { font: 700 .8rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.plan-price { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; }
.plan-price small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.plan-sum { margin: 0; color: var(--text-2); font-size: .92rem; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; font-size: .9rem; flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; } .plan li svg { color: var(--accent); margin-top: 3px; }
.info-banner.gift { background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 35%, transparent); }
.info-banner.gift svg { color: #f97316; }
.allow-note { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.allow-note svg { margin-top: 2px; color: var(--accent); }
.allow-note.empty { background: var(--warn-soft); color: var(--warn); }
.allow-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.start-err { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.err-actions { display: inline-flex; gap: 8px; }
.turnstile { display: flex; justify-content: flex-end; min-height: 0; }

/* ---------- help desk ---------- */
.help-modal, .share-modal { width: min(540px, 100%); display: grid; gap: 14px; max-height: calc(100vh - 32px); overflow-y: auto; }
.help-head { display: flex; justify-content: space-between; align-items: center; }
.help-head h3 { margin: 0; }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; font-size: .94rem; }
.faq p { margin: 8px 0 2px; color: var(--text-2); font-size: .9rem; }
.contact { display: grid; gap: 12px; }
.sent { display: grid; justify-items: center; gap: 6px; padding: 20px 0; text-align: center; color: var(--good); }
.sent b { color: var(--text); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-2); margin-top: 12px; cursor: pointer; }
.check-line input { margin-top: 3px; accent-color: var(--accent); }
.rate { width: 100%; display: grid; gap: 10px; justify-items: start; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.rate-btns { display: flex; gap: 10px; }
.rate-btn { width: 46px; height: 46px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: transform .15s, border-color .15s, color .15s; }
.rate-btn:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.rate-btn.bad:hover, .rate-btn.bad.on { border-color: var(--bad); color: var(--bad); }
.rate-btn.on { border-color: var(--accent); color: var(--accent); }
.rate-more { display: grid; gap: 10px; width: 100%; }
.sent-rate { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 600; }
.guest-cta { width: 100%; display: grid; gap: 6px; justify-items: start; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.guest-cta span { color: var(--text-2); font-size: .9rem; }
.finish { flex-wrap: wrap; }

/* ---------- admin: help desk ---------- */
.inbox-sum { display: flex; gap: 12px; flex-wrap: wrap; }
.inbox-sum > div { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; min-width: 120px; }
.inbox-sum span { color: var(--muted); font-size: .78rem; }
.inbox-sum b { font-size: 1.3rem; }
.inbox-sum small { color: var(--muted); font-size: .76rem; }
.inbox-sum .complaints { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.tickets { display: grid; gap: 8px; }
.ticket { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ticket.open { border-color: var(--accent); }
.ticket-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface); border: 0; cursor: pointer; text-align: left; color: var(--text); font-size: .9rem; }
.ticket-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk { display: inline-flex; align-items: center; gap: 4px; font: 600 .74rem/1 var(--mono); padding: 5px 8px; border-radius: 8px; background: var(--surface-2); }
.tk-problem { background: var(--bad-soft); color: var(--bad); } .tk-idea { background: var(--you-soft); color: var(--you); } .tk-rating { color: var(--muted); }
.st-open { background: var(--warn-soft); color: var(--warn); } .st-in_progress { background: var(--you-soft); color: var(--you); } .st-resolved { background: var(--good-soft); color: var(--good); }
.ticket-body { padding: 12px; display: grid; gap: 10px; background: var(--surface-2); }
.ticket-body p { margin: 0; white-space: pre-wrap; }
.ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ctx { max-height: 260px; overflow: auto; font: .78rem/1.5 var(--mono); background: var(--code-bg); color: var(--code-text); padding: 10px; border-radius: 10px; }
@media (max-width: 700px) { .ticket-row { grid-template-columns: auto 1fr auto; } .ticket-row > .muted { display: none; } }
.grant { display: grid; grid-template-columns: 1fr 1.2fr .8fr 1.5fr auto; gap: 10px; }
@media (max-width: 900px) { .grant { grid-template-columns: 1fr; } }

/* ---------- share ---------- */
.share-preview { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 10%, var(--surface))); }
.share-preview div { display: grid; gap: 4px; justify-items: start; }
.share-preview small { font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.share-preview .verdict { font-size: .8rem; padding: 4px 10px; }
.share-score { font: 800 18px Inter, sans-serif; fill: var(--text); }
.share-link { display: flex; gap: 8px; }
.share-to { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (prefers-reduced-motion: reduce) { .coin-chip.nudge .coin, .burst i { animation: none !important; } }

/* ---------- "?" info tips ---------- */
.info { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; vertical-align: 1px;
  font: 700 .66rem/1 Inter, system-ui, sans-serif; color: var(--muted); border: 1.3px solid var(--border-strong); cursor: help; text-transform: none; letter-spacing: 0; }
.info:hover, .info:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.info-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(calc(-50% + var(--dx, 0px)), 4px); width: max-content; max-width: min(280px, 78vw); z-index: 40;
  padding: 9px 11px; border-radius: 10px; background: var(--text); color: var(--bg); font: 500 .8rem/1.45 Inter, system-ui, sans-serif; text-align: left;
  white-space: normal; box-shadow: var(--shadow); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, transform .15s, visibility .15s; }
.info-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: calc(-5px - var(--dx, 0px)); border: 5px solid transparent; border-top-color: var(--text); }
.info.end .info-tip { left: auto; right: -8px; transform: translate(var(--dx, 0px), 4px); }
.info.end .info-tip::after { left: auto; right: calc(10px + var(--dx, 0px)); margin-left: 0; }
.info:hover .info-tip, .info:focus .info-tip { opacity: 1; visibility: visible; transform: translate(calc(-50% + var(--dx, 0px)), 0); }
.info.end:hover .info-tip, .info.end:focus .info-tip { transform: translate(var(--dx, 0px), 0); }
.viz-card, .stat, .kpis { overflow: visible; }

/* ---------- disclaimers ---------- */
.site-foot { margin: 40px 0 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; line-height: 1.55; display: grid; gap: 6px; }
.site-foot p { margin: 0; max-width: 820px; }
.site-foot b { color: var(--text-2); }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 6px !important; }
.foot-links .linkish { font-weight: 500; color: var(--muted); }
.report-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 12px 22px 18px; color: var(--muted); font-size: .84rem; }
.report-note svg { margin-top: 2px; flex: none; }
@media print { .site-foot .foot-links { display: none; } }
.info > span.info-tip { color: var(--bg); font-size: .8rem; font-weight: 500; display: block; }
.kpis .stat > span, .stat > span { white-space: nowrap; }

/* ---------- coding and design rounds ---------- */
.editor-host .CodeMirror, .editor-host textarea.fallback { font-size: var(--ed-size, 14px); }
.ed-prefs { display: inline-flex; gap: 6px; align-items: center; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; font: 700 .78rem/1 Inter, system-ui, sans-serif; }
.pinned-problem { border-bottom: 1px solid var(--border); background: var(--surface); }
.pinned-problem summary { display: flex; align-items: baseline; gap: 10px; padding: 9px 16px; cursor: pointer; font-size: .9rem; }
.pinned-problem summary span { font-size: .78rem; }
.pp-body { max-height: 22vh; overflow-y: auto; padding: 0 16px 12px; font-size: .9rem; }
.board { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.board-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.board-text { flex: 1; width: 100%; min-height: 0; border: 0; resize: none; outline: none; padding: 14px 16px; background: var(--surface);
  color: var(--text); font: 13.5px/1.6 var(--mono); }
.board > .board-text { min-height: 300px; }
.board-diagram { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(150px, 40%) 1fr; }
.board-src { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--border); }
.board-src-head { display: flex; gap: 14px; align-items: center; padding: 6px 16px; font-size: .78rem; color: var(--muted); background: var(--surface-2); }
.board-src-head span { margin-right: auto; }
.board-view { overflow: auto; padding: 14px; display: grid; place-items: center; background: var(--surface); }
.board-svg svg { max-width: 100%; height: auto; }

/* ---------- resizable room ---------- */
@media (min-width: 1101px) {   /* below this the room is one column (see max-width: 1100px above) */
  .room.classic, .room.focus { grid-template-columns: minmax(0, 52fr) 8px minmax(340px, 48fr); }
  .room.classic .side { border-left: 0; }
}
.splitter { position: relative; cursor: col-resize; background: var(--border); touch-action: none; outline: none; z-index: 2; }
.splitter i { position: absolute; top: 50%; left: 50%; width: 4px; height: 44px; margin: -22px 0 0 -2px; border-radius: 4px; background: var(--border-strong); transition: background .15s, height .15s; }
.splitter:hover i, .splitter:focus-visible i { background: var(--accent); height: 64px; }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }
body.resizing iframe, body.resizing .CodeMirror { pointer-events: none; }
.layout-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.layout-switch button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font: 600 .8rem/1 Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer; }
.layout-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
@media (max-width: 1250px) { .layout-switch span { display: none; } }

/* focus: problem | code, the interviewer in a floating card */
.room.focus .pane-problem { overflow-y: auto; border-left: 0; }
.room.focus .pane-code { border-left: 0; overflow: hidden; }
.room.focus .pinned-problem { display: none; }
.room.focus.editor-only .pane-problem { display: none; }
.dock { position: fixed; z-index: 30; width: min(380px, calc(100vw - 32px)); height: min(64vh, 560px); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25); overflow: hidden; display: flex; flex-direction: column; background: var(--bg); transition: width .2s, height .2s, border-radius .2s; }
.dock-br { right: 18px; bottom: 18px; } .dock-bl { left: 18px; bottom: 18px; } .dock-tr { right: 18px; top: 82px; } .dock-tl { left: 18px; top: 82px; }
.dock.dragging { transition: none; opacity: .92; cursor: grabbing; }
.dock .feed-inner { padding: 16px 14px 10px; gap: 14px; }
.dock .composer { padding: 6px 12px 12px; }
.dock .hint, .dock .voice-warn { font-size: .78rem; }
.dock-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: grab; touch-action: none; flex: none; }
.dock-title { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.dock-title small { color: var(--muted); font-size: .76rem; }
.dock-avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font: 800 1rem/1 Inter, system-ui, sans-serif; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.dock-avatar.speaking::after, .dock-avatar.your-turn::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); animation: ripple 1.6s ease-out infinite; }
.dock-avatar.your-turn::after { border-color: #f59e0b; }
.dock.collapsed { width: 62px; height: 62px; border-radius: 50%; }
.dock.collapsed > :not(.dock-head) { display: none; }
.dock.collapsed .dock-head { padding: 0; height: 100%; justify-content: center; border: 0; background: transparent; }
.dock.collapsed .dock-title, .dock.collapsed .dock-head .icon-btn { display: none; }
.dock.collapsed .dock-avatar { width: 54px; height: 54px; font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .dock, .splitter i { transition: none; } .dock-avatar::after { animation: none !important; } }

/* ---------- environment badge ---------- */
.env-badge { font: 700 .66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 6px; margin-left: 2px; }
.env-local { background: var(--surface-2); color: var(--muted); }
.env-uat { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
.ai-cost .admin-grid { margin-top: 6px; }
.ai-cost .admin-table { width: 100%; }
.ai-cost .kpis .stat { background: var(--surface-2); border: 0; }

/* ---------- legal pages and account deletion ---------- */
.legal-body { padding: 28px 32px; }
.legal-body .md h1 { font-size: 1.8rem; letter-spacing: -0.02em; margin-top: 0; }
.legal-body .md h2 { font-size: 1.15rem; margin-top: 26px; }
.legal-body .md p, .legal-body .md li { color: var(--text-2); line-height: 1.65; }
@media (max-width: 600px) { .legal-body { padding: 20px 18px; } }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); margin-top: 18px; gap: 10px; }
.danger-zone h3 { margin: 0; color: var(--bad); }
.danger-zone p { margin: 0; }
.btn.danger-outline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger-outline:hover:not(:disabled) { background: var(--bad-soft); }

/* =================== the game layer =================== */
.game-top { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-bottom: 16px; }
.game-top .viz-card { margin: 0; }
@media (max-width: 820px) { .game-top { grid-template-columns: 1fr; } }
.home-game { cursor: pointer; }
.home-game .viz-card { transition: border-color .15s, box-shadow .15s; }
.home-game:hover .viz-card { border-color: var(--accent); }

/* level */
.level-card { display: flex; gap: 16px; align-items: center; }
.level-badge { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.level-badge span { font: 800 1.5rem/1 Inter, system-ui, sans-serif; color: #fff; }
.level-card.compact .level-badge { width: 52px; height: 52px; }
.level-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.level-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.level-name small { font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.level-name b { font-size: 1.15rem; }
.xp-track { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xp-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .8s var(--ease); animation: grow 1s var(--ease) backwards; transform-origin: left; }

/* quests */
.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quests li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.q-check { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: #fff; }
.quests li.done .q-check { background: var(--accent); border-color: var(--accent); }
.quests li.done .q-main span { color: var(--muted); text-decoration: line-through; }
.q-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.q-track { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.q-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.q-reward { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.q-reward b { color: #d97706; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: 14px;
  border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--muted); }
.badge .b-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); filter: grayscale(1); }
.badge b { font-size: .86rem; color: var(--text-2); }
.badge small { font-size: .74rem; line-height: 1.35; }
.badge .b-coins { position: absolute; top: 8px; right: 8px; font: 700 .68rem/1 var(--mono); color: #d97706; }
.badge.earned { border-style: solid; border-color: color-mix(in srgb, #f59e0b 40%, var(--border)); background: var(--surface); }
.badge.earned .b-icon { filter: none; color: #fff; background: linear-gradient(135deg, #fbbf24, #f97316); box-shadow: 0 6px 16px color-mix(in srgb, #f97316 30%, transparent); }
.badge.earned b { color: var(--text); }

/* shop */
.shop-slot { margin-top: 14px; }
.slot-head { display: flex; gap: 7px; align-items: center; font: 700 .76rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.shop-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); }
.shop-item.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.si-preview { width: 40px; height: 40px; border-radius: 11px; flex: none; background: var(--surface-3); }
.si-text { flex: 1; min-width: 0; display: grid; }
.si-text b { font-size: .9rem; }
.si-text small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.preview-streak_freeze .si-preview { background: linear-gradient(135deg, #bae6fd, #38bdf8); }
.shop-item[class*="preview-voice_"] .si-preview { background: radial-gradient(circle at 50% 40%, #a7f3d0 0 18%, transparent 19%), linear-gradient(135deg, #34d399, #0ea5e9); }
.preview-theme_dracula .si-preview { background: linear-gradient(135deg, #282a36 55%, #bd93f9 55%); }
.preview-theme_monokai .si-preview { background: linear-gradient(135deg, #272822 55%, #f92672 55%); }
.preview-theme_solarized .si-preview { background: linear-gradient(135deg, #fdf6e3 55%, #268bd2 55%); }
.preview-accent_ocean .si-preview { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.preview-accent_sunset .si-preview { background: linear-gradient(135deg, #f97316, #ec4899); }
.preview-accent_grape .si-preview { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.preview-frame_gold .si-preview { border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 4px #f59e0b; }
.preview-frame_neon .si-preview { border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 3px #22d3ee, 0 0 10px #22d3ee; }
.preview-card_aurora .si-preview { background: linear-gradient(135deg, #0f766e, #4f46e5, #c026d3); }
.preview-card_midnight .si-preview { background: linear-gradient(135deg, #0b1020 60%, #d4a72c 60%); }

/* streak freezes */
.freeze-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font-size: .76rem; }
.freeze-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-3); }
.freeze-chip i.on { background: linear-gradient(135deg, #7dd3fc, #0ea5e9); }

/* the round's last screen */
.celebrate { position: relative; overflow: hidden; width: 100%; display: grid; gap: 10px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, var(--surface))); border: 1px solid var(--border); }
.cel-xp { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cel-xp b { font-size: 1.6rem; letter-spacing: -0.02em; color: var(--accent); animation: pop .5s var(--ease) backwards; }
.cel-xp span { color: var(--text-2); }
.cel-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cel-chips > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); animation: pop .4s var(--ease) backwards; }
.cel-chips > span:nth-child(2) { animation-delay: .1s; } .cel-chips > span:nth-child(3) { animation-delay: .2s; } .cel-chips > span:nth-child(n+4) { animation-delay: .3s; }
.chip-flame svg { color: #f97316; } .chip-badge svg { color: #d97706; } .chip-quest svg { color: var(--accent); } .chip-coin svg { color: #d97706; }
.cel-best { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; color: var(--text-2); }
.cel-best li { display: flex; gap: 6px; align-items: center; } .cel-best svg { color: var(--accent); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -10px; left: calc(var(--i) * 5.5%); width: 7px; height: 12px; border-radius: 2px;
  background: hsl(calc(var(--i) * 40), 85%, 60%); animation: fall 1.8s calc(var(--i) * 0.05s) ease-in forwards; opacity: .9; }
@keyframes fall { to { transform: translateY(260px) rotate(calc(var(--i) * 70deg)); opacity: 0; } }

/* report highlights */
.highlights { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.highlights span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  background: var(--accent-soft); color: var(--text-2); }
.highlights svg { color: var(--accent); }

/* ---------- cosmetics: app colours and avatar frames ---------- */
:root[data-accent="ocean"] { --accent: #2563eb; --accent-button: #1d4ed8; --accent-strong: #1d4ed8; --accent-soft: #e8efff; --accent-2: #06b6d4; }
:root[data-accent="sunset"] { --accent: #ea580c; --accent-button: #c2410c; --accent-strong: #c2410c; --accent-soft: #fff1e6; --accent-2: #ec4899; }
:root[data-accent="grape"] { --accent: #7c3aed; --accent-button: #6d28d9; --accent-strong: #6d28d9; --accent-soft: #f1ebff; --accent-2: #c026d3; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="ocean"]:not([data-theme="light"]) { --accent: #60a5fa; --accent-button: #93c5fd; --accent-strong: #93c5fd; --accent-soft: #14233f; --on-accent: #08142b; }
  :root[data-accent="sunset"]:not([data-theme="light"]) { --accent: #fb923c; --accent-button: #fdba74; --accent-strong: #fdba74; --accent-soft: #3a1f10; --on-accent: #2b1204; }
  :root[data-accent="grape"]:not([data-theme="light"]) { --accent: #a78bfa; --accent-button: #c4b5fd; --accent-strong: #c4b5fd; --accent-soft: #261a44; --on-accent: #170c33; }
}
:root[data-theme="dark"][data-accent="ocean"] { --accent: #60a5fa; --accent-button: #93c5fd; --accent-strong: #93c5fd; --accent-soft: #14233f; --on-accent: #08142b; }
:root[data-theme="dark"][data-accent="sunset"] { --accent: #fb923c; --accent-button: #fdba74; --accent-strong: #fdba74; --accent-soft: #3a1f10; --on-accent: #2b1204; }
:root[data-theme="dark"][data-accent="grape"] { --accent: #a78bfa; --accent-button: #c4b5fd; --accent-strong: #c4b5fd; --accent-soft: #261a44; --on-accent: #170c33; }
.avatar-btn.frame-gold { box-shadow: 0 0 0 3px #f59e0b; }
.avatar-btn.frame-neon { box-shadow: 0 0 0 2px #22d3ee, 0 0 12px #22d3ee; }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .cel-xp b, .cel-chips > span, .xp-track span { animation: none; } }

/* ---- Friend challenges ---------------------------------------------------------------------------------------- */
.challenge-rules { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.challenge-rules li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: .92rem; line-height: 1.45; }
.challenge-rules li svg { color: var(--good); flex: none; margin-top: 3px; }
.challenge-modal h3 { display: flex; align-items: center; gap: 8px; }
.challenge-modal .share-to { margin-top: 10px; }
.challenge-card { position: relative; margin: 36px 0 24px; padding: 32px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); animation: rise .45s var(--ease, ease) backwards; }
.challenge-card.invite { background: radial-gradient(120% 80% at 0% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.challenge-card h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 6px 0 8px; letter-spacing: -.02em; }
.challenge-card h1 em { font-style: normal; color: var(--accent); }
.challenge-card h2 { margin: 10px 0 6px; }
.challenge-card .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent); font-size: .75rem; display: block; margin-top: 12px; }
.challenge-card .lead { color: var(--text-2); font-size: 1.05rem; max-width: 640px; }
.challenge-card .cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ch-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent-strong))); box-shadow: var(--glow, none); flex: none; }
.challenge-banner { margin-bottom: 18px; }
.ch-news { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.ch-news:hover { filter: brightness(.98); }
.challenges-card { margin: 8px 0 26px; }
.challenges-card .section-title { display: flex; align-items: center; gap: 8px; }
.challenge-list { display: grid; gap: 8px; }
.challenge-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-align: left; width: 100%; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.challenge-row:hover { border-color: var(--accent); transform: translateY(-1px); }
.challenge-row .vs { color: var(--muted); font-size: .85rem; }
.challenge-row .grow { flex: 1; }
.challenge-row .ch-status { font-weight: 600; font-size: .88rem; }
.challenge-row.w-you .ch-status { color: var(--good); }
.challenge-row.w-them .ch-status { color: var(--bad); }
.challenge-row.s-expired { opacity: .65; }
.tag.new { background: var(--accent); color: var(--on-accent); }
.ch-result { display: grid; gap: 18px; margin-bottom: 40px; }
.ch-banner { position: relative; overflow: hidden; display: flex; gap: 16px; align-items: center; padding: 22px 24px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.ch-result.r-you .ch-banner { background: linear-gradient(120deg, color-mix(in srgb, var(--good) 16%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.ch-banner h2 { margin: 0 0 4px; font-size: 1.6rem; }
.ch-banner p { margin: 0; color: var(--text-2); }
.ch-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.ch-vs { align-self: center; font-weight: 800; color: var(--muted); font-size: 1.1rem; }
.ch-side { position: relative; display: grid; gap: 6px; justify-items: start; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ch-side.winner { border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.ch-side small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 700; }
.ch-side .ch-name { font-size: 1.1rem; }
.ch-score { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ch-score small { font-size: 1rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.ch-side ul { list-style: none; padding: 0; margin: 6px 0 0; width: 100%; display: grid; gap: 4px; }
.ch-side li { display: flex; justify-content: space-between; color: var(--text-2); font-size: .9rem; }
.ch-crown { position: absolute; top: 16px; right: 16px; display: inline-flex; gap: 6px; align-items: center; color: var(--good); font-weight: 700; font-size: .85rem; }
.ch-areas { padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.ch-areas h3 { margin: 0 0 12px; font-size: 1rem; }
.ch-area { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.ch-a-name { font-size: .9rem; color: var(--text-2); }
.ch-bars { display: grid; gap: 3px; }
.ch-bars span { display: block; height: 7px; border-radius: 4px; transition: width .6s var(--ease, ease); }
.ch-bars .mine, .ch-legend .mine { background: var(--accent); }
.ch-bars .theirs, .ch-legend .theirs { background: color-mix(in srgb, #f97316 80%, var(--surface)); }
.ch-a-scores { font-size: .88rem; color: var(--muted); min-width: 52px; text-align: right; }
.ch-legend { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.ch-legend span { width: 14px; height: 7px; border-radius: 4px; display: inline-block; margin-left: 6px; }
.ch-finish, .ch-invite { width: 100%; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); }
.ch-finish > div { flex: 1; display: grid; gap: 2px; min-width: 180px; }
.ch-finish span:not(.ch-icon) { color: var(--text-2); font-size: .9rem; }
.ch-finish .ch-icon { width: 42px; height: 42px; border-radius: 12px; }
.ch-finish.r-you { background: color-mix(in srgb, var(--good) 12%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.ch-invite > span { flex: 1; color: var(--text-2); font-size: .92rem; min-width: 180px; }
.ch-invite > svg { color: var(--accent); }
@media (max-width: 640px) {
  .ch-sides { grid-template-columns: 1fr; }
  .ch-vs { justify-self: center; }
  .challenge-card { padding: 22px 18px; }
  .ch-area { grid-template-columns: 1fr auto; }
  .ch-bars { grid-column: 1 / -1; grid-row: 2; }
}

.ai-cost .time-row { margin: 4px 0 14px; }
.ai-cost .time-row.over b { color: var(--bad, #dc2626); }
.reconnect { display: flex; gap: 8px; align-items: center; margin: 8px 16px 0; padding: 9px 12px; border-radius: 10px; font-size: .88rem;
  background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent); }
/* ---- Ads: one quiet unit below the content, clearly labelled ----------------------------------------------------- */
.ad-slot { display: grid; gap: 6px; justify-items: center; margin: 36px auto 8px; padding: 12px; max-width: 760px; min-height: 120px;
  border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); }
.ad-slot > small { justify-self: start; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.ad-slot ins { width: 100%; min-height: 90px; }
.ad-slot .ad-why { color: var(--muted); font-size: .78rem; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
@media print { .ad-slot { display: none; } }
