/* Odigos — shared styles and design tokens. Fonts are self-hosted (no external requests).
   Palette: cool paper, indigo ink, ultramarine for action, lilac for live surfaces,
   lemon highlighter for "picked from the talk". */

@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(/fonts/bricolage-grotesque-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(/fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson';
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2) format('woff2-variations');
}

:root {
  --paper: #f5f6fb;
  --ink: #17153b;
  --ultra: #3b3be8;
  --lilac: #e7e6fd;
  --lemon: #eef26b;

  --bg: var(--paper);
  --surface: #ffffff;
  --surface-2: #ecebf8;
  --text: var(--ink);
  --muted: #5f5d80;
  --border: #d9d8ec;
  --accent: var(--ultra);
  --accent-text: #ffffff;
  --accent-soft: var(--lilac);
  --good: #1f8a4c;
  --warn: #a96500;
  --bad: #c62a4a;
  --bar: var(--ultra);
  --bar-mine: #1f8a4c;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(23 21 59 / 0.06), 0 8px 24px rgb(23 21 59 / 0.06);
  --display: 'Bricolage', system-ui, sans-serif;
  --font: 'Atkinson', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #100f26;
    --ink: #ecebff;
    --ultra: #8f8fff;
    --lilac: #1f1d4a;
    --lemon: #e2e65a;

    --surface: #18173a;
    --surface-2: #232152;
    --muted: #a8a6cf;
    --border: #2f2d62;
    --accent-text: #0e0d24;
    --good: #5fd08e;
    --warn: #f0b54a;
    --bad: #ff7d95;
    --bar-mine: #5fd08e;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
[hidden] { display: none !important; }

a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.75em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); }

.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 480px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card[hidden]:first-child + .card { margin-top: 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

.brand { font-family: var(--display); font-weight: 750; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand small { font-weight: 450; color: var(--muted); margin-left: 6px; }

/* Controls */
button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:hover, .btn:hover { filter: brightness(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); }
button:focus-visible, input:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input[type="text"], input[type="password"], input[type="email"], input:not([type]) {
  font: inherit;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
}
label { display: block; font-weight: 600; margin-bottom: 6px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; }

.code-input {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-align: center;
}
.code-input::placeholder { letter-spacing: 0.12em; opacity: 0.45; }

/* Status pill */
.status { font-size: 0.8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.status.ok { color: var(--good); }
.status.warn { color: var(--warn); }
.status.bad { color: var(--bad); }

/* Results bars */
.bars { display: grid; gap: 10px; }
.bars + p { margin-top: 4px; }
.bar { position: relative; border-radius: 10px; background: var(--surface-2); overflow: hidden; min-height: 44px; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar); opacity: 0.28; width: 0; transition: width 300ms ease; }
.bar.mine .bar-fill { background: var(--bar-mine); opacity: 0.35; }
.bar-label { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-weight: 600; }
.bar-label .n { font-variant-numeric: tabular-nums; color: var(--muted); }

/* Attendee option buttons */
.options { display: grid; gap: 10px; }
.option {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  font-size: 1.05rem;
  padding: 14px 16px;
  min-height: 56px;
  background: var(--surface);
}
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* Host layout */
.host-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .host-grid { grid-template-columns: 320px 1fr; align-items: start; } }
.room-code { font-family: var(--display); font-stretch: 85%; font-size: 2rem; font-weight: 700; letter-spacing: 0.12em; }
.qr { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.option-row { display: flex; gap: 8px; }
.option-row input:not([type="radio"]) { flex: 1; }
.option-row button { min-width: 44px; padding: 0 12px; }

/* Stage (projected) */
body.stage { font-size: clamp(16px, 1.6vw, 28px); }
.stage-wrap { min-height: 100dvh; display: flex; flex-direction: column; padding: 4vh 5vw; gap: 3vh; }
.stage-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.stage .bars + p { margin-top: 1em; }
.stage-question { font-family: var(--display); font-size: 2.4em; font-weight: 750; line-height: 1.15; margin-bottom: 0.8em; }
.stage .bars { gap: 0.6em; }
.stage .bar { min-height: 2.6em; border-radius: 0.5em; }
.stage .bar-label { padding: 0.6em 0.9em; font-size: 1.2em; }
.stage-idle { display: flex; align-items: center; justify-content: center; gap: 6vw; flex-wrap: wrap; text-align: left; }
.stage-idle .qr { width: min(34vh, 40vw); }
.stage-join-big { font-size: 1.6em; }
.stage-join-big .room-code { font-size: 2.6em; display: block; margin: 0.1em 0; }
.stage-join-big .small { font-size: 0.7em; }
.stage-join-big .room-code.is-slug { letter-spacing: 0.02em; font-size: 2.2em; word-break: break-all; }
.slug-prefix { align-self: center; white-space: nowrap; }
.stage-footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 0.9em; }
.stage-footer .qr { width: 5em; padding: 0.3em; }

.center { text-align: center; }
.big-emoji { font-size: 2.5rem; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; z-index: 10; }

/* Account and presenter pages */
.stage-title { font-size: 1.1em; font-weight: 700; margin-bottom: 0.4em; color: var(--text); }
.room-list { display: grid; gap: 10px; }
.room-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.room-item .meta { min-width: 0; }
.room-item .meta strong { display: block; }
.room-item .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.room-item a.mono { word-break: break-all; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.handle-big { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.01em; }
a.room-item { color: inherit; text-decoration: none; }
a.room-item:hover { border-color: var(--accent); }
a.brand { color: inherit; text-decoration: none; }
/* The host sidebar is narrow: put the link prefix above the name input. */
.host-grid aside .option-row { flex-direction: column; align-items: stretch; gap: 4px; }
.host-grid aside .slug-prefix { align-self: flex-start; }

/* ---------- interactions ---------- */

/* Type picker: a segmented control built from radios (keyboard-accessible for free). */
.kinds { border: 0; padding: 4px; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--surface-2); border-radius: 12px; }
.kind { margin: 0; position: relative; }
.kind input { position: absolute; opacity: 0; inset: 0; }
.kind span { display: block; text-align: center; padding: 9px 6px; border-radius: 9px; font-weight: 700; font-size: 0.92rem; cursor: pointer; color: var(--muted); }
.kind input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(23 21 59 / 0.12); }
.kind input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.setting { font-weight: 600; font-size: 0.9rem; margin: 0; }
.setting select, select { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 500; padding: 9px 10px; min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

.correct-pick { display: none; width: 22px; height: 22px; align-self: center; accent-color: var(--good); flex: none; }
#compose[data-kind="quiz"] .correct-pick { display: block; }

.kind-tag { font-size: 0.8rem; font-weight: 700; color: var(--accent); }

.bar.correct .bar-fill { background: var(--good); opacity: 0.35; }
.bar.correct .label::after { content: ' ✓'; color: var(--good); }
.bar.dim { opacity: 0.55; }

/* Word cloud */
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.15em 0.6em; padding: 0.6em 0.4em; min-height: 6em; line-height: 1.05; }
.cloud .word { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; transition: font-size 400ms cubic-bezier(.2,.7,.2,1); border: 0; background: none; padding: 0.05em 0.1em; min-height: 0; color: var(--ultra); border-radius: 6px; }
.cloud .word[data-tone="1"] { color: var(--ink); }
.cloud .word[data-tone="2"] { color: color-mix(in srgb, var(--ultra) 65%, var(--ink)); }
.cloud .word[data-tone="3"] { color: color-mix(in srgb, var(--ultra) 50%, var(--muted)); }
.cloud button.word:hover { text-decoration: line-through; cursor: pointer; filter: none; }
.cloud .empty, .wall .empty { width: 100%; text-align: center; }

/* Open-text wall */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.note { position: relative; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-weight: 600; line-height: 1.35; display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.note .hide { min-height: 0; padding: 2px 8px; font-size: 0.8rem; color: var(--muted); }

.pop { animation: pop 520ms cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Attendee answer bits */
.text-row { display: flex; gap: 8px; }
.text-row input { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--lilac); color: var(--text); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 0.95rem; }
.feedback { font-family: var(--display); font-weight: 750; font-size: 1.3rem; margin: 0; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }

/* Leaderboard */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: rank; }
.board li { counter-increment: rank; display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 600; }
.board li span::before { content: counter(rank) '. '; color: var(--muted); }
.board li:first-child { background: var(--lemon); color: #17153b; }
.board li:first-child span::before { color: #17153b; }

/* Stage additions */
.stage-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4em; font-size: 1.1em; }
.stage-timer { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 2.2em; line-height: 1; color: var(--ultra); font-variant-numeric: tabular-nums; }
.stage-timer.urgent { color: var(--bad); }
.stage-body { display: grid; gap: 2em; grid-template-columns: 1fr; align-items: start; }
.stage-body:has(.stage-board:not([hidden])) { grid-template-columns: 1fr minmax(14em, 0.4fr); }
.stage .cloud { font-size: 1.6em; min-height: 40vh; }
.stage .wall { grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); }
.stage .note { font-size: 1.05em; }
.stage-board li { font-size: 1.1em; padding: 0.5em 0.8em; }

@media (prefers-reduced-motion: reduce) {
  .pop { animation: none; }
  .cloud .word { transition: none; }
}
.stage .kind-tag { font-size: 1em; }

/* ---------- Q&A ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 12px; }
.tab { border: 0; background: transparent; color: var(--muted); min-height: 42px; border-radius: 9px; }
.tab[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(23 21 59 / 0.12); }
.tab .count { display: inline-block; min-width: 1.5em; padding: 0 0.4em; border-radius: 999px; background: var(--ultra); color: #fff; font-size: 0.8rem; line-height: 1.5; }
.tab .count:empty { display: none; }

textarea { font: inherit; width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; min-height: 84px; }
.qa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qa-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.qa-item.answered { opacity: 0.6; }
.qa-item.highlighted { background: var(--lemon); color: #17153b; }
.qa-item.flagged { outline: 2px dashed var(--bad); outline-offset: -2px; }
.qa-body { min-width: 0; }
.qa-text { margin: 0 0 4px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.qa-meta { margin: 0; font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qa-item.highlighted .qa-meta { color: #3a3870; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--lilac); color: var(--text); }
.badge.good { color: var(--good); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }
.upvote { flex: none; flex-direction: column; gap: 0; min-width: 52px; min-height: 52px; padding: 4px 8px; background: var(--surface); line-height: 1.1; }
.upvote .arrow { font-size: 0.8rem; color: var(--muted); }
.upvote.on { background: var(--ultra); border-color: var(--ultra); color: #fff; }
.upvote.on .arrow { color: #fff; }
.qa-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; max-width: 55%; }
.small-btn { min-height: 34px; padding: 4px 10px; font-size: 0.85rem; border-radius: 8px; }
.small-h { font-size: 0.95rem; margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 4px 0; }

/* Stage: highlighted audience question */
.stage-qa { position: fixed; left: 5vw; right: 5vw; bottom: 4vh; z-index: 10; background: var(--lemon); color: #17153b; border-radius: 0.8em; padding: 1em 1.4em; box-shadow: 0 30px 60px -30px rgb(23 21 59 / 0.5); animation: rise 420ms cubic-bezier(.2,.8,.2,1); }
.stage-qa-label { margin: 0 0 0.3em; font-weight: 700; font-size: 0.85em; opacity: 0.7; }
.stage-qa-text { margin: 0; font-family: var(--display); font-weight: 750; font-size: 1.9em; line-height: 1.15; letter-spacing: -0.01em; }
.stage-qa-meta { margin: 0.4em 0 0; font-size: 0.9em; opacity: 0.75; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stage-qa { animation: none; } }
body.stage:has(#qa-hl:not([hidden])) .stage-footer { visibility: hidden; }
#qa-form + #qa-closed, #qa-form ~ .qa-list { margin-top: 8px; }

/* ---------- AI ---------- */
.ai-draft { border: 1px dashed color-mix(in srgb, var(--ultra) 45%, var(--border)); border-radius: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--lilac) 45%, transparent); }
.ai-draft summary { color: var(--ultra); font-weight: 700; }
.ai-draft[open] summary { margin-bottom: 10px; }
#compose.drafted #question, #compose.drafted #options input:not([type=radio]) { animation: drafted 1.6s ease-out; }
@keyframes drafted { 0% { background: var(--lemon); } 100% { background: var(--surface); } }
#ai-settings label { font-weight: 600; font-size: 0.92rem; }
#ai-settings input, #ai-settings select { margin-top: 6px; font-weight: 400; }
.themes { display: grid; gap: 10px; }
.theme { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.theme-title { margin: 0 0 6px; font-family: var(--display); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.theme ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.92rem; }
@media (prefers-reduced-motion: reduce) { #compose.drafted #question, #compose.drafted #options input:not([type=radio]) { animation: none; } }

/* ---------- prose pages (privacy) and 404 ---------- */
.prose { max-width: 720px; }
.prose article { padding: clamp(20px, 5vw, 44px); }
.prose h1 { font-size: clamp(2rem, 6vw, 3rem); font-stretch: 88%; letter-spacing: -0.02em; }
.prose h2 { font-size: 1.2rem; margin-top: 1.4em; }
.prose p, .prose li, .prose dd { line-height: 1.6; }
.prose ul { padding-left: 1.2em; margin: 0; }
.prose li + li { margin-top: 6px; }
.kicker { font-family: var(--display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.lede { font-size: 1.1rem; color: var(--muted); }
.facts { display: grid; grid-template-columns: minmax(8em, max-content) 1fr; gap: 12px 20px; margin: 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 12px; } }

.lost { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.lost .brand { color: var(--text); text-decoration: none; margin-bottom: 24px; }
.lost-code { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: clamp(6rem, 30vw, 10rem); line-height: 0.85; letter-spacing: -0.04em; margin: 0; color: var(--text); }
.lost-code span { color: var(--ultra); display: inline-block; animation: lost-bob 2.4s ease-in-out infinite; }
@keyframes lost-bob { 50% { transform: translateY(-0.08em) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .lost-code span { animation: none; } }

/* ---------- free on-device model ---------- */
.kinds.two { grid-template-columns: repeat(2, 1fr); }
.kind small { display: block; font-weight: 500; font-size: 0.78rem; opacity: 0.8; margin-top: 2px; }
.model-progress .meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.model-progress .meter span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--ultra), color-mix(in srgb, var(--ultra) 55%, var(--lilac)));
  transition: width 300ms ease;
}
.model-progress:not(.done):not(.failed) .meter span { background-size: 200% 100%; animation: meter-flow 1.4s linear infinite; background-image: linear-gradient(90deg, var(--ultra), color-mix(in srgb, var(--ultra) 50%, var(--lilac)), var(--ultra)); }
.model-progress.done .meter span { background: var(--good); }
.model-progress.failed .meter span { background: var(--bad); width: 100% !important; opacity: 0.35; }
.model-progress p { margin-top: 6px; }
@keyframes meter-flow { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .model-progress .meter span { animation: none !important; transition: none; } }
button.linkish { all: unset; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
button.linkish:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--bad); }
.danger-zone form { margin-top: 12px; }

.beta {
  display: inline-block; vertical-align: 0.35em; margin-left: 6px; padding: 2px 7px 1px;
  font-family: var(--text-font, inherit); font-size: 0.55em; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; background: var(--lemon); color: #17153b; line-height: 1.4;
}

/* ---------- shortcuts ---------- */
.row.tight { gap: 8px; }
.keys-help { position: fixed; z-index: 20; top: 64px; right: max(16px, calc(50vw - 480px + 16px)); width: min(420px, calc(100vw - 32px)); box-shadow: 0 18px 48px rgb(23 21 59 / 0.22); }
.keys-list { display: grid; gap: 8px; }
.key-row { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; align-items: baseline; font-size: 0.92rem; }
kbd { font-family: var(--mono, ui-monospace, monospace); font-size: 0.82rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; white-space: nowrap; justify-self: start; }

/* ---------- phone remote ---------- */
.remote-box { padding: 14px; border-radius: 14px; background: var(--lemon); color: #17153b; }
.remote-box .qr { background: #fff; padding: 8px; border-radius: 10px; }
/* On a phone the host console is a remote: the live item and composer come first. */
@media (max-width: 859px) {
  .host-grid > aside { order: 2; }
  .host-grid > div { order: 1; display: flex; flex-direction: column; gap: 16px; }
  .host-grid > div > .card { margin-top: 0; }
  .host-grid #active { order: -1; }
}
#poll-result.live-results { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
#poll-result.live-results::before { content: 'Live results'; display: block; font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
