/* panel.vote — mobile-first styles. Tokens on :root, dark mode via prefers-color-scheme. */
:root {
  --bg: #f6f6fb; --surface: #ffffff; --surface-2: #f0f0f7; --text: #15152a; --muted: #5d5d78; --border: #dcdcea;
  --primary: #4f46e5; --primary-ink: #ffffff; --primary-soft: #e8e7fd; --accent: #0ea5a4;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --danger: #b91c1c; --danger-soft: #fee2e2;
  --focus: #f59e0b; --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(20,20,50,.06), 0 4px 16px rgba(20,20,50,.06);
  --tab-h: 64px; --header-h: 52px; --touch: 48px; --card-pad: 16px; --gap: 14px; --radius-btn: 10px; --radius-dock: 20px;
  --primary-text: #4f46e5; --primary-deep: #2f2a8a; --accent-ink: #04211f; --font-display: var(--font);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1020; --surface: #181a2e; --surface-2: #22253d; --text: #ececf8; --muted: #a3a4c2; --border: #2e3150;
    --primary: #8b85ff; --primary-ink: #0f1020; --primary-soft: #2a2957; --accent: #2dd4bf;
    --ok: #4ade80; --ok-soft: #14361f; --warn: #fbbf24; --warn-soft: #3a2c0c; --danger: #f87171; --danger-soft: #3d1515;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1020; --surface: #181a2e; --surface-2: #22253d; --text: #ececf8; --muted: #a3a4c2; --border: #2e3150;
  --primary: #8b85ff; --primary-ink: #0f1020; --primary-soft: #2a2957; --accent: #2dd4bf;
  --ok: #4ade80; --ok-soft: #14361f; --warn: #fbbf24; --warn-soft: #3a2c0c; --danger: #f87171; --danger-soft: #3d1515;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background-color: var(--bg); color: var(--text); font: 16px/1.5 var(--font); background-attachment: fixed; min-height: 100dvh; overflow-x: hidden; }
a { color: var(--primary-text); }
h1, h2, h3, .brand, .cc-name, .question-text, .big-code, .stat-n, .screen-title, .screen-qtext, .screen-big, .poster-title, .hero-title { font-family: var(--font-display); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .4em 0 .3em; }
h2 { font-size: 1.1rem; margin: 0 0 .6em; }
h2.inline { display: inline; margin: 0; }
p { margin: .5em 0; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.center-block { display: block; margin: 0 auto; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.ok-text { color: var(--ok-text, var(--ok)); }
.warn-text { color: var(--warn-text, var(--warn)); }
.eyebrow { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* layout */
.page, .narrow { padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.narrow { max-width: 560px; padding-top: 20px; }
.with-tabs .page { padding-bottom: calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); }
.stack > * + * { margin-top: var(--gap); }
form.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }
.row > * { min-width: 0; }
.row.wrap > .field { flex: 1 1 120px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--card-pad); box-shadow: var(--shadow); }
.card.inset { box-shadow: none; background: var(--surface-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; overflow-wrap: anywhere; }
details.card > summary { cursor: pointer; list-style: none; min-height: 32px; display: flex; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
details.card[open] > summary { margin-bottom: 12px; }
details.card[open] > summary::after { content: '▴'; }
.warn-card { border-color: var(--warn); background: var(--warn-soft); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--touch); padding: 10px 16px;
  border-radius: var(--radius-btn); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger-text, var(--danger)); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .875rem; }
.btn.xl { min-height: 58px; font-size: 1.1rem; padding: 12px 20px; }
.btn.block { display: flex; width: 100%; }
.btn.left { justify-content: flex-start; text-align: left; }
.btn.round { width: var(--touch); padding: 0; border-radius: 50%; font-size: 1.4rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-col { display: flex; flex-direction: column; gap: 4px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; }
.label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.hint { font-size: .8rem; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: var(--touch); width: 100%; }
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: var(--touch); cursor: pointer; padding: 6px 0; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .switch { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--border); position: relative; transition: background .15s; }
.toggle .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle input:checked + .switch { background: var(--ok); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--focus); outline-offset: 2px; }
.toggle-text { display: flex; flex-direction: column; }
.word-form { display: flex; gap: 8px; }
.word-form input { flex: 1; }

/* chips & pills */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; font-weight: 600; color: var(--text); }
button.chip { min-height: 38px; cursor: pointer; font: inherit; font-size: .9rem; }
.chip.on, .chip.toggle.on { background: var(--primary-soft); border-color: var(--primary); }
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.code-chip { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill.sm { font-size: .7rem; padding: 1px 8px; }
.pill.open, .pill.approved { background: var(--ok-soft); color: var(--ok-text, var(--ok)); }
.pill.closed, .pill.rejected { background: var(--danger-soft); color: var(--danger-text, var(--danger)); }
.pill.pending, .pill.revealed { background: var(--warn-soft); color: var(--warn-text, var(--warn)); }
.pill.discussion { background: var(--primary-soft); color: var(--primary-text); font-size: .9rem; padding: 6px 14px; }
.pill.big { font-size: 1.4rem; }

/* header */
.room-header { background: var(--surface); position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand-dot { color: var(--primary-text); }
.rh-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--muted); }
.menu-btn { font-size: 1.2rem; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.conn.live { background: var(--ok); }
.conn.reconnecting, .conn.connecting, .conn.polling { background: var(--warn); }
.conn.offline { background: var(--danger); }
.menu-sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); display: flex; justify-content: flex-end; }
.menu-panel { width: min(340px, 88vw); height: 100%; background: var(--bg-solid, var(--bg)); border-left: 1px solid var(--border); padding: calc(20px + env(safe-area-inset-top)) 16px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.menu-group { display: flex; flex-direction: column; gap: 6px; }

/* tab bar (bottom on mobile) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); overflow-x: auto; }
.tab { flex: 1 1 0; min-width: 54px; min-height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; position: relative; padding: 6px 4px; }
.tab-icon { font-size: 1.25rem; line-height: 1; }
.tab.active { color: var(--primary-text); }
.tab.active::before { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.tab-badge { position: absolute; top: 6px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; line-height: 18px; }
@media (min-width: 900px) {
  .tabbar { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); bottom: auto; justify-content: center; border-top: 0; border-bottom: 1px solid var(--border); }
  .with-tabs { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
  .with-tabs .page { padding-bottom: 32px; }
  .tab { flex: 0 0 auto; flex-direction: row; gap: 8px; min-height: 48px; padding: 0 18px; font-size: .9rem; }
  .tab.active::before { top: auto; bottom: 0; border-radius: 3px 3px 0 0; }
}
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); overflow-x: auto; }
.seg-btn { flex: 1 0 auto; min-height: 40px; padding: 6px 12px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* banners */
.site-banner { background: var(--primary-soft); color: var(--text); padding: 10px 16px; text-align: center; font-weight: 600; }
.site-banner.warn { background: var(--warn-soft); color: var(--warn-text, var(--warn)); }
.site-banner.clickable { cursor: pointer; border-radius: var(--radius-sm); margin-bottom: 12px; }
.announcement { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 15; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 12px 16px; text-align: center; font-size: 1.05rem; }
.announcement.inline { position: static; border-radius: var(--radius-sm); flex: 1; font-size: .95rem; padding: 8px 12px; }
.waiting-banner { background: var(--primary-soft); border-radius: var(--radius); padding: 14px 16px; font-weight: 600; }
.waiting-banner .btn { margin-left: 8px; }

/* toasts */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* landing */
.landing { max-width: 520px; margin: 0 auto; padding: 8vh 16px 32px; }
.hero { text-align: center; }
.hero-title { font-size: clamp(2.4rem, 12vw, 3.6rem); margin: 0; }
.hero-title .brand { font-size: inherit; }
.hero-sub { color: var(--muted); font-size: 1.05rem; }
.code-form { display: flex; flex-direction: column; gap: 12px; margin: 24px 0 8px; }
.code-input { text-align: center; font-size: 2rem !important; font-weight: 800; letter-spacing: .3em; min-height: 72px; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
.code-input::placeholder { letter-spacing: .12em; font-size: 1.3rem; font-weight: 600; opacity: .5; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0; }
.landing .card { margin-top: 20px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li + li { margin-top: 6px; }
.room-link { display: flex; align-items: center; gap: 8px; padding: 10px 0; text-decoration: none; color: var(--text); flex-wrap: wrap; }
.site-footer { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 32px; font-size: .85rem; }
.big-code { font-size: 3.2rem; font-weight: 800; letter-spacing: .25em; text-align: center; font-family: ui-monospace, Consolas, monospace; margin: 8px 0; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; min-height: 32px; }
.facts { padding-left: 20px; }
.copy-field { margin: 10px 0; }
.copy-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.copy-value { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); font-size: .85rem; border: 1px solid var(--border); }

/* candidates / stage */
.candidate-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.candidate-card.big { padding: 16px; }
.cc-body { min-width: 0; }
.cc-name { font-weight: 800; font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.candidate-card.big .cc-name { font-size: 1.4rem; }
.cc-slogan { color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.logo { border-radius: var(--logo-radius, 20%); object-fit: cover; aspect-ratio: 1 / 1; flex: none; background: var(--surface-2); }
.logo.placeholder { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary-text); background: var(--primary-soft); }
.stage > * + * { margin-top: 12px; }
.question-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; }
.question-card.is-open { border-color: var(--ok); }
.question-card.focus .question-text { font-size: 1.35rem; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.question-text { font-size: 1.2rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.criteria { margin-top: 8px; color: var(--muted); border-left: 3px solid var(--border); padding-left: 10px; }
.lineup { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lineup li.current .candidate-card { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.question-list { padding-left: 22px; margin: 0; }
.question-list li { margin: 6px 0; }
.question-list li.current { font-weight: 700; }
.links { padding-left: 20px; }
.event-title { margin-top: 0; }

/* timer */
.timer { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.timer-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.timer-fill { height: 100%; background: var(--ok); transition: width .25s linear; }
.timer.warn .timer-fill { background: var(--warn); }
.timer.done .timer-fill { background: var(--danger); }
.timer-text { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.2rem; min-width: 64px; text-align: right; }
.timer.warn .timer-text { color: var(--warn); }
.timer.done .timer-text { color: var(--danger); }
.timer.big .timer-text { font-size: 3rem; }
.timer.big .timer-bar { height: 14px; }

/* scoring */
.score-row { display: grid; gap: 8px; }
.score-row.five { grid-template-columns: repeat(5, 1fr); }
.score-row.wide { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.score-row.many { grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); }
.score-btn { min-height: 72px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; touch-action: manipulation; }
.score-btn .score-main { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.score-btn .score-sub { font-size: .66rem; color: var(--muted); text-align: center; line-height: 1.1; }
.score-btn.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.score-btn.selected .score-sub { color: inherit; opacity: .85; }
.score-btn:disabled { opacity: .5; cursor: not-allowed; }
.note-composer textarea { margin-bottom: 8px; }
.note-composer .btn-row .btn { flex: 1 1 30%; }
.note-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.note-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; }
.note-list li.private { border-style: dashed; }
.note-list.small li { padding: 6px 10px; }
.note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fu-list { padding-left: 22px; margin: 0; }
.fu-list li { margin-bottom: 10px; }
.fu-text { font-weight: 600; overflow-wrap: anywhere; }
.back-live { background: var(--warn-soft); border-color: var(--warn); }

/* audience */
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; text-align: left; }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice .check { margin-left: auto; color: var(--primary-text); font-size: 1.3rem; }
.my-words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.counter-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.counter { display: grid; grid-template-columns: 1fr auto 84px auto; gap: 8px; align-items: center; }
.counter-label { font-weight: 700; overflow-wrap: anywhere; }
.counter-input { text-align: center; font-weight: 800; font-size: 1.2rem !important; }

/* bars & word cloud */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; align-items: center; }
.bar-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; position: relative; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 6px; transition: width .4s; }
.bar-proxy { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(0,0,0,.28) 0 4px, transparent 4px 8px); border-radius: 6px; }
.bar-value { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.wordcloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; padding: 12px; line-height: 1.1; }
.wc-word { font-weight: 800; }
.wc-word.c0 { color: var(--primary-text); } .wc-word.c1 { color: var(--accent); } .wc-word.c2 { color: #db2777; }
.wc-word.c3 { color: #d97706; } .wc-word.c4 { color: #16a34a; } .wc-word.c5 { color: #7c3aed; }

/* organizer */
.deck { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.progress-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.phase-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.phase-step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface); font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; padding: 6px 2px; }
.phase-step.past { color: var(--text); }
.phase-step.current { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.phase-num { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.phase-step.current .phase-num { background: var(--primary); color: var(--primary-ink); }
.edit-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.edit-list > li { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); counter-increment: item; }
.edit-row { display: flex; gap: 10px; align-items: center; }
.edit-row .grow { overflow-wrap: anywhere; }
.logo-review { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.stat-n { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-l { font-size: .75rem; color: var(--muted); }
.mod-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 50vh; overflow-y: auto; }
.mod-list li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.share-item { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.export-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .export-grid { grid-template-columns: 1fr 1fr; } }
.export-btn { justify-content: flex-start; text-align: left; min-height: 72px; gap: 14px; }
.export-btn small { display: block; font-weight: 400; color: var(--muted); }
.export-icon { font-size: 1.6rem; }
.qr { background: #fff; border-radius: 10px; padding: 6px; display: inline-block; }

/* logo editor */
.logo-editor { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
.le-stage { position: relative; margin: 0 auto; border-radius: 12px; overflow: hidden; touch-action: none; }
.le-canvas { display: block; cursor: grab; touch-action: none; background: var(--surface-2); }
.le-canvas:active { cursor: grabbing; }
.le-canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
/* Darkens what the current theme's logo shape will clip. */
.le-mask { position: absolute; inset: 0; border-radius: var(--logo-radius, 20%); box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); pointer-events: none; }
/* Inscribed circle: the part that survives every theme, including circular logos. */
.le-safe { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.le-bg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.le-swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.le-swatch.on { outline: 3px solid var(--primary); outline-offset: 2px; }
.le-swatch.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); display: inline-flex; }
.le-swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; padding: 0; }
.le-previews { display: grid; gap: 8px; }
.le-pv { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px; border-radius: var(--radius-sm); }
.le-pv.light { background: #f6f6fb; color: #333; }
.le-pv.dark { background: #0f1020; color: #ccc; }
.le-pv figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.le-pv figcaption { font-size: .7rem; }
.le-pv .logo { background: transparent; }

/* entrant workspace */
.slot-card { background: var(--primary-soft); border-radius: var(--radius); padding: var(--card-pad); }
.slot-card .eyebrow, .slot-card .muted { color: var(--text); }
.slot-n { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; }
.progress { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 6px 0 10px; }
.progress-fill { height: 100%; background: var(--ok); border-radius: 5px; transition: width .3s; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: var(--touch); cursor: pointer; border-bottom: 1px solid var(--border); }
.check-row:last-of-type { border-bottom: 0; }
.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { width: 26px; height: 26px; flex: none; border-radius: 7px; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--primary-ink); }
.check-row.done .check-box { background: var(--ok); border-color: var(--ok); }
.check-row input:focus-visible + .check-box { outline: 3px solid var(--focus); outline-offset: 2px; }
.check-row input:disabled + .check-box { opacity: .85; }
.board-list, .file-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.board-list li { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.tips { padding-left: 20px; margin: 0; }
.tips li { margin: 6px 0; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.chat-list { max-height: 50vh; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.chat-msg { max-width: 85%; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.chat-msg.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.chat-meta { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.chat-text { overflow-wrap: anywhere; }
.file-list li { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); }
.file-list.compact li { padding: 6px 8px; }
.file-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-ext { flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-text); font-weight: 800; font-size: .72rem; text-transform: uppercase; display: flex; align-items: center; justify-content: center; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.file-actions .field { flex: 1 1 180px; }
.file-actions select { min-height: 38px; padding: 6px 8px; font-size: .9rem; }
.readiness { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.competition li + li { margin-top: 12px; }
.entrant-comms .toggle { border-top: 1px solid var(--border); }

/* accessibility helpers */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 8px; }
.tooltip { position: fixed; z-index: 90; max-width: min(320px, 90vw); background: var(--text); color: var(--bg-solid, var(--bg)); padding: 8px 10px; border-radius: 8px; font-size: .82rem; line-height: 1.35; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); pointer-events: auto; }
.menu-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.practice-banner { background: var(--warn-soft); color: var(--text); display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.practice-roles { display: flex; flex-direction: column; gap: 10px; }
.practice-role { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; text-align: left; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.practice-role:hover { border-color: var(--primary); }
.practice-role.suggested { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.practice-role .grow { display: flex; flex-direction: column; gap: 2px; }
.pr-icon { font-size: 1.8rem; }

/* guided tour */
.tour-layer { position: fixed; inset: 0; z-index: 80; }
.tour-dim { position: absolute; inset: 0; background: rgba(8, 8, 24, .45); }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 4px var(--primary), 0 0 0 9999px rgba(8, 8, 24, .45); transition: all .25s ease; pointer-events: none; }
.tour-layer:has(.tour-spot) .tour-dim { background: transparent; }
.tour-card { position: fixed; z-index: 81; background: var(--bg-solid, var(--surface)); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); width: min(380px, calc(100vw - 24px)); }
.tour-card.docked { left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
.tour-card h2 { margin: 6px 0; font-size: 1.15rem; }
.tour-card h2:focus { outline: none; }
.tour-progress { display: flex; gap: 4px; }
.tour-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); }
.tour-progress span.past { background: var(--primary-soft); }
.tour-progress span.on { background: var(--primary); }
.tour-dont { display: flex; align-items: center; gap: 8px; font-size: .85rem; margin: 10px 0 4px; min-height: 36px; cursor: pointer; }
.tour-dont input { width: 20px; height: 20px; min-height: 0; }
.tour-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-hint { margin: 8px 0 0; }
@media (max-width: 699px) { .tour-hint { display: none; } }

/* scorecard mode */
.sc-layout { display: block; }
.sc-rail { display: none; }
@media (min-width: 900px) {
  .sc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
  .sc-rail { display: flex; flex-direction: column; gap: 6px; position: sticky; top: calc(var(--header-h) + 60px); max-height: calc(100vh - 140px); overflow-y: auto; }
  .with-tabs .page:has(.sc-layout) { max-width: 1100px; }
}
.sc-rail-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: var(--touch); }
.sc-rail-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.sc-rail-item .grow { display: flex; flex-direction: column; min-width: 0; }
.sc-rail-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-dot { color: var(--ok-text, var(--ok)); font-size: 1.1rem; }
.sc-main > * + * { margin-top: 10px; }
.stage-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; background: var(--warn-soft); color: var(--text); border: 2px solid var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; }
.sc-head { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 6; display: flex; align-items: center; gap: 10px; background: var(--bg-solid, var(--bg)); padding: 10px 0; border-bottom: 1px solid var(--border); }
.sc-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.rubric-key { display: flex; flex-wrap: wrap; gap: 4px 12px; background: var(--surface-2); padding: 6px 10px; border-radius: var(--radius-sm); margin: 0; }
.sc-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sc-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.sc-q { font-weight: 600; line-height: 1.35; margin-bottom: 8px; overflow-wrap: anywhere; }
.sc-qn { display: inline-block; min-width: 28px; color: var(--primary-text); font-weight: 800; }
.sc-controls { display: flex; gap: 8px; align-items: stretch; }
.sc-controls .score-row { flex: 1; }
.score-row.compact .score-btn { min-height: 52px; }
.score-row.compact .score-main { font-size: 1.25rem; }
.note-btn { flex: none; min-width: 52px; }
.note-btn.has { border-color: var(--primary); color: var(--primary-text); }
.sc-row.folded { padding: 0; }
.sc-row.folded.todo { opacity: .6; }
.sc-fold { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 48px; }
.sc-fold .sc-q { flex: 1; min-width: 0; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-fold .sc-val { font-size: 1.05rem; font-variant-numeric: tabular-nums; flex: none; }
.sc-row.open { border-color: var(--text); }
.sc-note { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.sc-foot { position: sticky; bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--bg-solid, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); }
@media (min-width: 900px) { .sc-foot { bottom: 12px; } }
@media (min-width: 700px) {
  .sc-row.open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 12px; align-items: center; }
  .sc-q { margin-bottom: 0; }
  .sc-note { grid-column: 1 / -1; }
}
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.stage-card { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.stage-card .grow { display: flex; flex-direction: column; min-width: 0; }
.stage-card.on { border-color: var(--ok); background: var(--ok-soft); }
.stage-card.closed { opacity: .8; }

/* audience interaction */
.audience-live.has-reactions { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.reaction-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 24; display: flex; justify-content: center; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-solid, var(--bg)) 92%, transparent); border-top: 1px solid var(--border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.react-btn { flex: 1 1 0; min-width: 0; max-width: 60px; min-height: 48px; font-size: clamp(1.1rem, 5.2vw, 1.6rem); line-height: 1; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; touch-action: manipulation; }
.react-btn:active { transform: scale(.9); }
.react-btn.sm { flex: 0 0 auto; width: 44px; min-height: 44px; font-size: 1.3rem; }
.react-btn.on { border-color: var(--primary); background: var(--primary-soft); }
.float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.float-emoji { position: absolute; bottom: 70px; animation: float-up 3.5s ease-out forwards; will-change: transform, opacity; }
.float-layer.big .float-emoji { bottom: 0; }
@keyframes float-up { 0% { transform: translateY(0) scale(.6); opacity: 0; } 10% { opacity: 1; transform: translateY(-8vh) scale(1); } 100% { transform: translateY(-75vh) scale(1.1); opacity: 0; } }
.react-tally { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 1.2rem; }
.chat-feed { list-style: none; margin: 0 0 10px; padding: 8px; max-height: 12.5em; min-height: 5em; overflow-y: auto; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 4px; }
.chat-feed.mod { max-height: 50vh; }
.chat-line { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; line-height: 1.35; }
.chat-line.hidden { opacity: .5; text-decoration: line-through; }
.chat-line.staff .cl-text { font-weight: 700; }
.cl-who { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.cl-text { overflow-wrap: anywhere; }
.cl-text.emote { font-size: 1.3rem; }
.cl-actions { margin-left: auto; display: flex; gap: 4px; }
.emote-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qa-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qa-item { display: flex; gap: 8px; align-items: flex-start; }
.vote-btn { flex: none; min-width: 52px; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.vote-btn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.mod-list.tall { max-height: 60vh; }
.mod-q { flex-direction: column; align-items: stretch !important; gap: 6px; }

/* sortable lists */
.sort-row { display: flex; gap: 10px; align-items: flex-start; }
.sort-controls { display: grid; grid-template-columns: 44px; grid-auto-rows: auto; gap: 4px; flex: none; justify-items: center; }
@media (min-width: 560px) { .sort-controls { grid-template-columns: 44px 38px; grid-template-areas: 'handle up' 'pos down'; } .drag-handle { grid-area: handle; } .order-input { grid-area: pos; } .sort-arrows { display: contents !important; } .sort-arrows > :first-child { grid-area: up; } .sort-arrows > :last-child { grid-area: down; } }
.drag-handle { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px dashed var(--border); background: var(--surface-2); color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; display: flex; align-items: center; justify-content: center; }
.drag-handle:active { cursor: grabbing; }
.order-input { width: 44px; min-height: 36px; padding: 4px; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.order-input::-webkit-outer-spin-button, .order-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sort-arrows { display: none; flex-direction: column; gap: 2px; }
@media (min-width: 560px) { .sort-arrows { display: flex; } }
.sortable > li { transition: transform .15s ease; }
.sortable.is-dragging > li:not(.dragging) { transition: transform .15s ease; }
.sortable > li.dragging { transition: none; position: relative; z-index: 10; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45); border-color: var(--primary); }
.sortable.is-dragging { user-select: none; -webkit-user-select: none; }

/* results */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.tied td { background: var(--warn-soft); }
.table.compact th, .table.compact td { padding: 4px; font-size: .82rem; text-align: center; }
.tie-tag { color: var(--warn); font-weight: 800; margin-left: 2px; }
.flag-tag { color: var(--danger); font-size: .8rem; }
.tb-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
@media (min-width: 700px) { .tb-grid { grid-template-columns: repeat(min(var(--cols), 2), 1fr); } }
@media (min-width: 1100px) { .tb-grid { grid-template-columns: repeat(var(--cols), 1fr); } }
.tb-col { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; min-width: 0; overflow-x: auto; }
.tb-total, .tb-aud { margin: 8px 0; font-size: .9rem; }

/* dice */
.roll-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(10,10,30,.6); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.roll-box { background: var(--surface); border-radius: 24px; padding: 28px 40px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.die { font-size: 5rem; font-weight: 900; width: 150px; height: 150px; margin: 10px auto; border-radius: 28px; display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.die.rolling { animation: shake .18s infinite; }
.die.settled { animation: land .4s ease-out; }
.roll-overlay.big .die { width: 300px; height: 300px; font-size: 10rem; }
@keyframes shake { 0% { transform: rotate(-8deg) scale(.96); } 50% { transform: rotate(8deg) scale(1.02); } 100% { transform: rotate(-8deg) scale(.96); } }
@keyframes land { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }

.cc-desc { margin-top: 6px; }
.cc-desc summary { cursor: pointer; color: var(--muted); }

/* printable poster */
.poster { max-width: 800px; margin: 0 auto; padding: 32px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.poster-title { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 900; line-height: 1.1; }
.poster-sub { font-size: 1.3rem; color: var(--muted); }
.poster-cta { font-size: 2rem; font-weight: 800; margin-top: 16px; }
.poster .qr { width: min(420px, 80vw); height: auto; }
.poster-or { color: var(--muted); font-size: 1.2rem; }
.poster-url { font-size: 2.2rem; font-weight: 800; }
.poster-code { font-family: ui-monospace, Consolas, monospace; font-size: clamp(3rem, 14vw, 6rem); font-weight: 900; letter-spacing: .25em; color: var(--primary-text); }
.poster-foot { color: var(--muted); max-width: 520px; }
@media print {
  .no-print, .site-banner, .toasts { display: none !important; }
  body.poster-body { background: #fff; color: #000; }
  .poster { padding: 0; }
  .poster-code { color: #000; }
  .poster-sub, .poster-or, .poster-foot { color: #333; }
}

/* legal */
.legal section { margin: 18px 0; }
.legal-nav { margin: 32px 0; text-align: center; }

/* projector screen */
.screen { min-height: 100dvh; color: var(--text); display: flex; flex-direction: column; padding: 2vh 3vw; font-size: clamp(16px, 1.6vw, 28px); }
.screen .muted { color: var(--muted); }
.screen-top { display: flex; justify-content: space-between; align-items: center; gap: 2vw; }
.screen-title { font-size: 1.4em; font-weight: 800; }
.screen-join { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); padding: 10px 14px; border-radius: 16px; }
.screen-url { font-weight: 700; }
.screen-code { font-family: ui-monospace, Consolas, monospace; font-size: 2em; font-weight: 900; letter-spacing: .2em; color: var(--primary-text); }
.screen-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.screen-center { text-align: center; }
.screen-big { font-size: 3.2em; line-height: 1.1; }
.screen-sub { font-size: 1.4em; }
.screen-stage { display: flex; flex-direction: column; gap: 3vh; }
.screen .candidate-card { color: var(--text); }
.screen .candidate-card .cc-name { font-size: 2.2em; }
.screen .candidate-card .cc-slogan { font-size: 1.2em; color: var(--muted); }
.screen .candidate-card .logo { width: 150px !important; height: 150px !important; font-size: 3.5rem !important; }
.screen .eyebrow { font-size: .8em; color: var(--muted); }
.screen-question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 3vh 2vw; }
.screen-qtext { font-size: 2.4em; font-weight: 800; line-height: 1.2; }
.screen .timer-bar { background: var(--surface-2); }
.screen-poll { max-width: 1200px; margin: 0 auto; width: 100%; }
.screen-poll h2 { font-size: 2em; text-align: center; }
.screen .bar-track { height: 48px; background: var(--surface-2); }
.screen .bar-row { font-size: 1.3em; }
.screen-vote-banner { background: var(--accent); color: var(--accent-ink); padding: 14px 20px; border-radius: 14px; font-weight: 800; font-size: 1.2em; text-align: center; }
.screen .announcement { position: static; font-size: 1.6em; border-radius: 14px; margin: 1vh 0; }
.wordcloud.big { gap: 8px 28px; }
@media (max-width: 700px) { .screen-top { flex-direction: column; } .screen-big { font-size: 2em; } .screen-qtext { font-size: 1.5em; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.practice-role .pill { align-self: flex-start; }

/* Event outline (advanced mode) */
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row .seg-btn { border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 6px 10px; min-height: 36px; background: var(--surface); color: var(--text); }
.chip-row .seg-btn.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip-row .seg-btn:disabled { opacity: .45; }
.row.between { justify-content: space-between; align-items: center; }
.icon.rot90 { transform: rotate(90deg); }
.ol-list { display: flex; flex-direction: column; gap: 8px; }
.ol-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.ol-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.ol-who-panel { border-color: var(--primary); }
.ol-who-entrant { border-color: var(--ok, var(--primary)); }
.ol-who-audience { border-color: var(--accent); }
.ol-review { border-color: var(--accent); }
.ol-bullets { margin: 6px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.ol-card summary, .ol-audience h2 { cursor: pointer; }
.ol-st-pending { background: var(--warn-soft); color: var(--warn-text, var(--text)); }
.ol-st-rejected { background: var(--surface2); color: var(--muted); }
.ol-item.edit-row { align-items: center; }
.ol-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 50%; }
.ol-actions .row { gap: 6px; }

/* Desktop simulator (/simulator) */
.desktop-only { display: none !important; }
@media (min-width: 1100px) { .desktop-only { display: flex !important; } a.btn.desktop-only { display: inline-flex !important; } }
.sim-cta { margin: 8px 0 4px; gap: 8px; justify-content: center; }
.sim { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.sim-bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sim-brand { font-family: var(--font-display); font-size: 1.1rem; color: var(--text); text-decoration: none; text-transform: uppercase; }
.sim-lesson { flex: 1; min-width: 0; }
.sim-step-title { font-weight: 700; font-size: 1.05rem; }
.sim-feed { display: flex; flex-direction: column; gap: 2px; }
.sim-row { flex: 1; min-height: 0; display: flex; gap: 16px; justify-content: center; align-items: flex-start; padding: 12px 16px; }
.sim-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sim-label { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono, inherit); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; height: 22px; }
.sim-here { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sim-phone-wrap { position: relative; }
.sim-phone { position: absolute; top: 0; left: 0; transform-origin: top left; padding: 46px 12px 12px; border-radius: 52px; background: #111114; box-shadow: 0 0 0 2px #2a2a2f, 0 18px 40px rgba(0,0,0,.35); }
.sim-phone::before { content: ''; position: absolute; top: 20px; left: 50%; width: 96px; height: 26px; margin-left: -48px; border-radius: 13px; background: #000; z-index: 2; pointer-events: none; }
.sim-phone iframe { display: block; border: 0; border-radius: 0 0 40px 40px; background: var(--bg); }
.sim-col.target .sim-phone { box-shadow: 0 0 0 4px var(--accent), 0 18px 40px rgba(0,0,0,.35); }
.sim-flash { position: absolute; inset: 0; border-radius: 52px; pointer-events: none; box-shadow: 0 0 0 5px var(--ok, #2e9d5b); opacity: 0; animation: sim-flash 1.6s ease-out; z-index: 3; }
@keyframes sim-flash { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sim-flash { animation: sim-flash-still 1.6s steps(1, end); } @keyframes sim-flash-still { 0% { opacity: 1; } 100% { opacity: 0; } } }
[data-sim] .practice-banner { display: none; }

/* Setup → Entrants rows on phones (#4): wrap instead of squeezing the details column */
.entrant-row { flex-wrap: wrap; align-items: flex-start; }
.entrant-row > .grow { flex: 1 1 180px; }
.file-list.compact .file-main { flex-wrap: wrap; }
.file-main > .grow { flex: 1 1 140px; }
.file-name { overflow-wrap: break-word; word-break: break-word; }
@media (max-width: 560px) {
  .entrant-row > .btn-col { flex-direction: row; flex-basis: 100%; justify-content: flex-end; }
  .file-list.compact .file-main > .btn { margin-left: auto; }
}

/* QA sweep 2026-09-27 */
/* #5: segmented controls wrap instead of hiding options behind an invisible sideways scroll */
.seg { flex-wrap: wrap; overflow-x: visible; }
/* #6: tie-break columns keep a readable width; the grid wraps to more rows instead of squeezing */
.tb-grid, .tb-grid[style] { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important; }
.tb-col table { width: 100%; }
.tb-col { overflow-x: visible; }
/* #7: score-key labels at full text color (muted failed 4.5:1 on the key background) */
.score-btn .score-sub { color: var(--text); }
.score-btn.selected .score-sub { color: inherit; opacity: 1; }

/* Run mode (organizer remote control while Live) */
.rm { padding-bottom: 96px; }
.rm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rm-top .btn { margin-left: auto; }
.rm-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rm-row { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.rm-row.current { border: 2px solid var(--accent); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.rm-row.done .rm-name { color: var(--muted); }
.rm-line { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; width: 100%; background: none; border: 0; font: inherit; color: var(--text); text-align: left; }
.rm-row.current .rm-line { padding: 0; min-height: 0; }
.rm-tap { cursor: pointer; }
.rm-n { flex: none; width: 1.6em; font-family: var(--font-mono, inherit); color: var(--muted); }
.rm-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rm-row.current .rm-name { font-size: 1.2rem; }
.rm-panel { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 12px 12px; }
.rm-row.current .rm-actions { padding: 0; }
.rm-actions .btn.xl { flex: 1 1 100%; }
.rm-extra .rm-n { color: var(--accent); }
.rm-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); justify-content: center; }
.rm-bar .btn { flex: 1 1 0; max-width: 220px; }
.rm-sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.rm-sheet { width: 100%; max-width: 520px; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.rm-back { margin-bottom: 12px; }

/* Show script (Run mode) */
.rm { padding-bottom: 120px; }
.rm-top { justify-content: space-between; }
.rm-now { margin: 0; font-size: 1rem; line-height: 1.4; }
.rm-votes { font-size: 1rem; } .rm-votes b { font-size: 1.6rem; font-family: var(--font-mono, inherit); margin-right: 4px; }
.rm-row.next { border-style: dashed; }
.rm-more { list-style: none; padding: 4px 12px; }
.rm-side { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rm-bar { gap: 10px; }
.rm-bar .rm-back-btn { flex: 0 0 auto; max-width: none; }
.rm-bar .rm-next { flex: 1 1 auto; max-width: 520px; min-height: 64px; justify-content: space-between; text-align: left; }
.rm-next-label { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rm-next-label small { font-size: .68rem; opacity: .8; letter-spacing: .12em; }

/* Features checklist, presenter laptop */
.feat-row.sub { padding-left: 28px; }
.feat-row .toggle-text .hint { color: var(--muted); }
.more-btn { border: 1px dashed var(--border) !important; }
.pres { max-width: 1100px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.pres-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pres-now { border: 2px solid var(--accent); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.pres-name { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.pres-big { min-height: 96px; font-size: 1.4rem !important; letter-spacing: .06em; }
.pres-missing { font-size: 1.2rem; color: var(--warn-text, var(--text)); }
.pres-list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pres-list li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); }
.pres-list li.on { border-color: var(--accent); }

/* Proxy moderation, one question at a time */
.mod-focus { display: flex; flex-direction: column; gap: 10px; }
.mod-focus-q { background: var(--surface); border: 2px solid var(--text); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 6px; }
.mod-focus-text { font-size: 1.2rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.mod-more > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }

/* Audience phone: one card at a time */
.audience-deck { min-height: calc(100dvh - var(--header-h) - 40px); display: flex; flex-direction: column; }
.deck-dots { display: flex; gap: 6px; }
.deck-dot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 0 6px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; min-height: 44px; }
.deck-dot .deck-bar { width: 100%; height: 4px; background: var(--border); border-radius: 2px; }
.deck-dot.past .deck-bar { background: var(--text); }
.deck-dot.on { color: var(--text); }
.deck-dot.on .deck-bar { background: var(--accent); }
.deck-dot .badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; line-height: 18px; text-align: center; }
.deck-card { flex: 1; display: flex; flex-direction: column; gap: 12px; animation: deck-in .18s ease-out; }
@keyframes deck-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .deck-card { animation: none; } }
.deck-nav { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; background: var(--bg-solid, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; box-shadow: var(--shadow); z-index: 5; }
.deck-nav .btn, .deck-nav .deck-gap { flex: 1; }
.reaction-bar.inline { position: static; padding: 8px 0; flex-wrap: wrap; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Entrant setup guide: one step per screen */
.guide { display: flex; flex-direction: column; gap: 10px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.guide-dots { display: flex; gap: 4px; }
.guide-dots span { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.guide-dots span.done { background: var(--text); }
.guide-dots span.cur { background: var(--accent); }
.guide-title { margin: 0; font-family: var(--font-display); line-height: 1.05; overflow-wrap: anywhere; }
.guide-body { display: flex; flex-direction: column; gap: 12px; }
.guide-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg-solid, var(--surface)); border-top: 1px solid var(--border); }
.guide-foot .btn { flex: 1; }
.guide-foot .btn.primary { flex: 1.6; }
