/* Engage Aha — one stylesheet for every page. Component names follow
   Financial Manager (.panel, .btn-primary, .kpi-tile, .badge, .notice,
   .tabs, modal); DESIGN.md lists them. Colours are tokens on :root; never
   a raw colour in a page module. */
:root {
  --navy: #23214f;
  --navy-2: #2f2c66;
  --gold: #e9a822;
  --gold-text: #1f1600;
  --teal: #2f8f83;

  --bg: #f7f7fa;
  --ink: #1e1b3a;
  --muted: #5d6178;
  --faint: #9497aa;
  --border: #e3e3ec;
  --surface: #ffffff;
  --surface-alt: #f2f2f7;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 3px rgba(20, 18, 60, 0.06);
  --focus: #e9a822;

  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn: #9a5b00;
  --warn-bg: #fff8e6;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --info: #2f2c66;
  --info-bg: #eef0fb;

  /* Charts and results: one palette for every chart (charts.js reads these). */
  --chart-1: #23214f;
  --chart-2: #e9a822;
  --chart-3: #2f8f83;
  --chart-4: #c2410c;
  --chart-5: #6d5bd0;
  --chart-6: #0e7490;
  --chart-7: #a16207;
  --chart-8: #be185d;
  /* Rating levels, low to high (diverging: red, grey, green). */
  --level-1: #c2410c;
  --level-2: #f59e0b;
  --level-3: #b8bac6;
  --level-4: #5fb49c;
  --level-5: #1d7a5f;

  /* The big screen. */
  --stage-bg: #1b1940;
  --stage-ink: #ffffff;
  --stage-muted: #c3c2dd;
  --stage-panel: #262358;
  --stage-line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; color: var(--ink); }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 12px; }
a { color: var(--navy-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header and footer (page.js draws them) */
.site-header { background: var(--navy); color: #fff; }
.site-header .inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 750; font-size: 18px; letter-spacing: -0.01em; }
.brand span { color: var(--gold); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.site-nav a, .site-nav button {
  color: #fff; text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0;
  padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer;
}
.site-nav a[aria-current="page"], .site-nav a:hover, .site-nav button:hover { background: rgba(255, 255, 255, 0.12); }
.site-nav select { font: inherit; font-size: 14px; border-radius: var(--radius-sm); border: 0; padding: 5px 8px; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
main.narrow { max-width: 560px; }
main.wide { max-width: 1480px; }
.site-footer { max-width: 1100px; margin: 0 auto; padding: 16px; color: var(--faint); font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-footer .aha-logo { width: 96px; height: auto; opacity: 0.85; flex: none; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 16px; }
.panel-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-flush { padding: 0; overflow: hidden; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 15px; border-radius: 10px; padding: 10px 16px;
  cursor: pointer; text-decoration: none; border: 1px solid transparent; min-height: 44px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--gold-text); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f3c2bd; }
.btn-danger.solid { background: var(--danger); color: #fff; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-2); text-decoration: underline; cursor: pointer; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 12px; }
label .hint, .field-hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; background: #fff; min-height: 42px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; width: 18px; height: 18px; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 12px; }
fieldset.plain legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.error-text { color: var(--danger); font-size: 14px; }

/* Messages and labels */
.notice { border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 12px; background: var(--info-bg); color: var(--info); font-size: 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.error { background: var(--danger-bg); color: var(--danger); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 650; background: var(--surface-alt); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.gold { background: var(--gold); color: var(--gold-text); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.segmented button { font: inherit; font-size: 14px; background: var(--surface); border: 0; padding: 8px 12px; cursor: pointer; color: var(--ink); }
.segmented button + button { border-left: 1px solid var(--border); }
/* The Display row under a chart's views (displayControls.js) */
.display-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 12px 0 4px; }
.display-choice { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.display-choice .segmented button { padding: 6px 10px; font-size: 13px; }
.check.inline { display: inline-flex; margin: 0; align-items: center; }
.view-groups { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.view-group { display: inline-flex; flex-direction: column; gap: 4px; }
.check.inline input { margin-top: 0; }
.segmented button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi-tile .label { color: var(--muted); font-size: 13px; }
.kpi-tile .value { font-size: 26px; font-weight: 750; }
.kpi-tile .hint { color: var(--faint); font-size: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 650; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row td { color: var(--muted); text-align: center; padding: 20px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Lists you can edit (criteria, options) */
.edit-list { list-style: none; margin: 0 0 12px; padding: 0; }
.edit-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.edit-list li .meta { color: var(--muted); font-size: 13px; }
.edit-list.stacked li { grid-template-columns: 1fr; }
.edit-list.stacked .row-actions { justify-content: flex-start; }

/* Modal (ui.js) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 50, 0.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.modal.small { width: min(420px, 100%); }
.modal.large { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.modal-head h3 { margin: 0; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal-body { padding: 8px 20px 12px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.icon-button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); font-size: 14px; }

/* Home and join (phones first) */
.hero { text-align: center; padding: 20px 0 8px; }
.hero h1 { font-size: 30px; }
.code-input { font-size: 30px !important; letter-spacing: 0.3em; text-align: center; text-transform: uppercase; font-weight: 700; min-height: 60px !important; }
.join-head { margin-bottom: 16px; }
.join-head .eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rate-block { padding: 14px 0; border-bottom: 1px solid var(--border); }
.rate-block:last-child { border-bottom: 0; }
.rate-block .rate-label { font-weight: 650; margin-bottom: 8px; }
.rate-block .rate-label .muted { font-weight: 400; font-size: 13px; display: block; }
.levels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.levels button {
  font: inherit; font-size: 13px; line-height: 1.2; min-height: 52px; padding: 6px 4px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer;
}
.levels button .n { display: block; font-weight: 750; font-size: 16px; }
.levels button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.levels button.unsure { border-style: dashed; color: var(--muted); }
.levels button.unsure[aria-pressed="true"] { background: var(--muted); color: #fff; }
.progress { height: 6px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; margin: 8px 0 16px; }
.progress span { display: block; height: 100%; background: var(--gold); }
.step-nav { display: flex; gap: 8px; justify-content: space-between; margin-top: 16px; }
.points-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.points-total { font-weight: 700; text-align: right; margin-top: 8px; }

/* Results (resultsView.js) shared by presenter, console and phones */
.chart { width: 100%; height: 420px; }
.chart.short { height: 300px; }
.heatmap { width: 100%; border-collapse: separate; border-spacing: 4px; }
.heatmap th { border: 0; font-size: 13px; color: var(--muted); text-align: center; vertical-align: bottom; }
.heatmap th.row { text-align: left; color: var(--ink); font-size: 14px; }
.heatmap td { border: 0; border-radius: 8px; text-align: center; font-weight: 700; font-size: 16px; padding: 12px 6px; }
.heatmap td .sub { display: block; font-weight: 500; font-size: 11px; opacity: 0.85; }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 52px; gap: 10px; align-items: center; padding: 6px 0; }
.bar-list .track { background: var(--surface-alt); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-list .fill { display: block; background: var(--navy); height: 100%; border-radius: 999px; }
.bar-list .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 8px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.weights-sliders .points-row { grid-template-columns: 1fr 160px 48px; }

/* Positions and option profile (resultsView.js): SVG drawn at 1000 wide
   and scaled to fit. Agree side navy, disagree side gold, as in Joel's
   reports. */
/* Below 620px the text would be too small to read: the chart scrolls sideways in its .table-wrap instead. */
svg.positions { width: 100%; min-width: 620px; height: auto; display: block; font-family: inherit; }
.pos-frame { fill: var(--surface); stroke: var(--border); }
.pos-label { font-size: 17px; font-weight: 700; fill: var(--ink); }
.pos-track { stroke: #dcdde8; stroke-width: 10; stroke-linecap: round; }
.pos-neutral { stroke: #9a9cb5; stroke-dasharray: 5 5; }
.pos-avg, .pos-dot-key { fill: #7a7a86; }
.pos-dot circle { fill: var(--navy); stroke: #fff; stroke-width: 2; }
.pos-dot.disagree circle { fill: #c2930c; }
.pos-dot text { fill: #fff; font-size: 13px; font-weight: 700; text-anchor: middle; }
.pos-dot.big text { font-size: 14px; }
.pos-tick { font-size: 15px; fill: var(--muted); text-anchor: middle; }
.pos-tick.end { font-weight: 700; fill: var(--ink); }
.pos-tick.start { text-anchor: start; }
.pos-tick.finish { text-anchor: end; }
.prof-curve { fill: rgba(98, 108, 196, 0.28); }
.prof-bar { stroke-width: 8; stroke-linecap: round; }
.prof-bar.agree { stroke: var(--navy); }
.prof-bar.disagree { stroke: #c2930c; }
.prof-all { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.prof-all.end { text-anchor: end; }
.pos-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.pos-key b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; margin-right: 4px; }
.pos-key-item { display: inline-flex; align-items: center; gap: 6px; }
[data-pick-option].pickable { cursor: pointer; }
th[data-pick-option].pickable:hover, td[data-pick-option].pickable:hover { outline: 2px solid var(--gold); outline-offset: -2px; }
g[data-pick-option].pickable:hover circle, g[data-pick-option].pickable:focus circle { stroke: var(--gold); stroke-width: 3; }
.heatmap tr.all-options td, .heatmap tr.all-options th { font-style: italic; }
.stage .pos-frame { fill: var(--stage-panel); stroke: rgba(255, 255, 255, 0.12); }
.stage .pos-label { fill: var(--stage-ink); }
.stage .pos-track { stroke: var(--stage-line); stroke-width: 10; }
.stage .pos-dot circle { fill: #8f8cf0; stroke: var(--stage-bg); }
.stage .pos-dot.disagree circle { fill: var(--gold); }
.stage .pos-avg { fill: #d0d0dc; }
.stage .pos-tick { fill: var(--stage-muted); }
.stage .pos-tick.end { fill: var(--stage-ink); }
.stage .prof-curve { fill: rgba(170, 168, 255, 0.25); }
.stage .prof-bar.agree { stroke: #8f8cf0; }
.stage .prof-all { fill: var(--stage-muted); }
.stage .pos-key { color: var(--stage-muted); font-size: clamp(14px, 1.1vw, 18px); }

/* The big screen (present.html) */
body.stage { background: var(--stage-bg); color: var(--stage-ink); }
.stage h1, .stage h2, .stage h3 { color: var(--stage-ink); }
.stage-wrap { min-height: 100vh; display: flex; flex-direction: column; padding: 28px 40px; gap: 18px; }
.stage-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.stage-title { font-size: clamp(26px, 3.4vw, 52px); font-weight: 750; letter-spacing: -0.015em; margin: 0; }
.stage-question { font-size: clamp(16px, 1.6vw, 26px); color: var(--stage-muted); margin: 6px 0 0; }
.stage-join { text-align: right; color: var(--stage-muted); font-size: clamp(14px, 1.2vw, 20px); white-space: nowrap; }
.stage-join strong { display: block; color: var(--gold); font-size: clamp(26px, 3vw, 48px); letter-spacing: 0.18em; }
.stage-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.stage-lobby { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; justify-content: center; }
.stage-lobby .qr { background: #fff; padding: 18px; border-radius: 18px; }
.stage-lobby .big-code { font-size: clamp(56px, 9vw, 150px); font-weight: 800; letter-spacing: 0.12em; color: var(--gold); line-height: 1; }
.stage-lobby .url { font-size: clamp(18px, 2vw, 34px); color: var(--stage-muted); }
.stage-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--stage-muted); font-size: 15px; flex-wrap: wrap; }
.stage-foot-end { display: flex; align-items: center; gap: 16px; }
.stage-logo img { display: block; width: clamp(80px, 7vw, 120px); height: auto; opacity: 0.9; }
.stage-logo .on-light, .stage-light .stage-logo .on-dark { display: none; }
.stage-light .stage-logo .on-light { display: block; }
.stage .segmented { border-color: rgba(255, 255, 255, 0.2); }
.stage .segmented button { background: transparent; color: var(--stage-ink); }
.stage .segmented button + button { border-left-color: rgba(255, 255, 255, 0.2); }
.stage .segmented button[aria-pressed="true"] { background: var(--gold); color: var(--gold-text); }
.stage .chart { height: min(64vh, 720px); }
.stage .heatmap th { color: var(--stage-muted); font-size: clamp(13px, 1.1vw, 18px); }
.stage .heatmap th.row { color: var(--stage-ink); }
.stage .heatmap td { font-size: clamp(16px, 1.6vw, 28px); }
.stage table th, .stage table td { font-size: clamp(16px, 1.4vw, 26px); color: var(--stage-ink); border-bottom-color: var(--stage-line); padding: 14px 12px; }
.stage table thead th { color: var(--stage-muted); }
.stage .badge { font-size: clamp(14px, 1.3vw, 22px); padding: 4px 14px; }
.stage .legend, .stage p.small { font-size: clamp(14px, 1.1vw, 19px); color: var(--stage-muted); }
.stage .spread-title { font-size: clamp(22px, 2.2vw, 38px); margin-bottom: 4px; }
.stage .bar-list li { grid-template-columns: minmax(120px, 30%) 1fr 90px; font-size: clamp(18px, 1.6vw, 30px); padding: 10px 0; }
.stage .bar-list .track { height: 26px; background: var(--stage-panel); }
.stage .bar-list .fill { background: var(--gold); }
.stage .count-big { font-size: clamp(48px, 7vw, 120px); font-weight: 800; color: var(--gold); }
.stage .muted { color: var(--stage-muted); }
.stage .notice { background: var(--stage-panel); color: var(--stage-ink); }

/* Sessions: room card, projects and folders */
.room-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.room-card #room-qr { background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.library { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.library-nav { padding: 12px; }
.library-nav h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }
.nav-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 4px; }
.nav-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 14px; background: none; border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--ink); }
.nav-item:hover { background: var(--surface-alt); }
.nav-item[aria-current="true"] { background: var(--navy); color: #fff; }
.nav-item[aria-current="true"] .muted { color: #d8d8ec; }
.nav-sub { display: block; font-size: 12px; opacity: 0.75; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 2px 10px; cursor: pointer; color: var(--ink); }
.tag[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-text); }
.tag.static { cursor: default; background: var(--surface-alt); }
@media (max-width: 800px) { .library { grid-template-columns: 1fr; } }

/* Settings: templates */
.criteria-list { margin: 0; padding-left: 18px; }
.criteria-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 6px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.criteria-row input { margin-top: 0; }
.criteria-row .wide { grid-column: 1 / -1; }

/* Session console and presenter view */
.activity-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
.activity-bar select { display: inline-block; width: auto; max-width: 100%; margin: 0 0 0 6px; }
.control-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
/* Side panels that fold away (ui.js foldable(): review notes 4 and 5) */
.fold-btn { margin-left: auto; font-size: 18px; border: 1px solid var(--border); background: var(--surface); padding: 2px 9px; }
.control-side > .fold-btn { display: block; margin: 0 0 8px auto; }
/* Only on screens wide enough for side panels; narrower ones stack them. */
@media (min-width: 901px) {
  .control-grid.side-folded { grid-template-columns: minmax(0, 1fr) 44px; }
  .control-grid.side-folded .control-side > :not(.fold-btn) { display: none; }
}
@media (min-width: 861px) {
  .workspace.slides-folded { grid-template-columns: 52px minmax(0, 1fr); }
  .workspace.slides-folded .slides { padding: 8px 4px; }
  .workspace.slides-folded .slides > :not(.panel-head), .workspace.slides-folded .slides .panel-head > :not(.fold-btn) { display: none; }
}
@media (min-width: 1201px) {
  .editor.settings-folded { grid-template-columns: minmax(0, 1fr) 52px; }
  .editor.settings-folded .editor-settings { padding: 8px 4px; }
  .editor.settings-folded .editor-settings > :not(.settings-head), .editor.settings-folded .settings-head > :not(.fold-btn) { display: none; }
}
@media (max-width: 900px) { .control-side > .fold-btn { display: none; } }
@media (max-width: 860px) { .slides .fold-btn { display: none; } }
@media (max-width: 1200px) { .settings-head .fold-btn { display: none; } }
.screen-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; min-height: 220px; overflow: hidden; }
.screen-preview .chart { height: 320px; }
.screen-preview .big-code { color: var(--navy); font-weight: 800; letter-spacing: 0.12em; }
.code-inline { letter-spacing: 0.12em; }
blockquote.spotlight {
  margin: 16px auto 0; max-width: 1100px; background: #fff; color: var(--ink); border-left: 8px solid var(--gold);
  border-radius: var(--radius); padding: 18px 24px; font-size: clamp(18px, 2.2vw, 40px); line-height: 1.3; font-weight: 600;
}
blockquote.spotlight cite { display: block; margin-top: 8px; font-size: 0.5em; font-style: normal; color: var(--muted); font-weight: 600; }
/* On the big screen a comment floats over the chart rather than pushing it
   off the bottom. */
.stage-wrap > #spotlight blockquote.spotlight {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); width: min(1100px, 90vw);
  margin: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); z-index: 5;
}
.screen-preview blockquote.spotlight { font-size: 18px; box-shadow: none; border: 1px solid var(--border); }
.stage-blank { background: #000 !important; }
.stage-wrap { background: var(--stage-bg); color: var(--stage-ink); }
.stage .chart-title, .chart-title { font-size: clamp(22px, 2.2vw, 38px); margin: 0; color: var(--stage-ink); }
.chart-title.console { font-size: 20px; color: var(--ink); margin: 8px 0 4px; }
.stage .data p { font-size: clamp(14px, 1.1vw, 19px); color: var(--stage-muted); }

@media (max-width: 900px) {
  .control-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  main { padding: 16px 16px 40px; }
  h1 { font-size: 23px; }
  .panel { padding: 16px; }
  .levels { grid-auto-flow: row; grid-template-columns: 1fr; }
  .levels button { display: flex; gap: 10px; align-items: center; text-align: left; min-height: 48px; padding: 8px 12px; }
  .levels button .n { font-size: 15px; min-width: 18px; }
  .bar-list li { grid-template-columns: 1fr 52px; }
  .bar-list li .track { grid-column: 1 / -1; grid-row: 2; }
  .stage-wrap { padding: 16px; }
  .stage-lobby { grid-template-columns: 1fr; text-align: center; }
  .stage-top { flex-direction: column; }
  .stage-join { text-align: left; }
}

/* Activity kinds: icons (activityKinds.js) */
.kind-icon { display: block; width: 22px; height: 22px; }
.slide-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--info-bg); color: var(--navy); flex: none; }
.activity-line { display: inline-flex; gap: 8px; align-items: center; }
.activity-line .slide-icon { width: 28px; height: 28px; }

/* Session editor: slides on the left, the slide in the middle, settings on
   the right (Joel, 29 October 2026). */
.workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.slides { padding: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.slides .panel-head { margin-bottom: 8px; }
.slides h2 { font-size: 16px; }
.slide-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.slide-item { position: relative; }
.slide { display: grid; grid-template-columns: 18px 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.slide:hover { border-color: var(--gold); }
.slide[aria-current="true"] { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--gold); background: var(--surface-alt); }
.slide-n { font-weight: 700; color: var(--muted); font-size: 13px; text-align: right; }
.slide-text { min-width: 0; }
.slide-kind { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.slide-title { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-move { position: absolute; right: 6px; bottom: -2px; display: none; gap: 2px; }
.slide-item:hover .slide-move, .slide-item:focus-within .slide-move { display: flex; }
.icon-button.small { font-size: 14px; padding: 2px 6px; background: var(--surface); border: 1px solid var(--border); }
.picker-group { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 12px 0 6px; }
.kind-list { display: grid; gap: 6px; }
.kind-card { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; text-align: left; font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; color: var(--ink); }
.kind-card:hover, .kind-card:focus-visible { border-color: var(--gold); background: var(--surface-alt); }
.kind-icon-box { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: #fff; }
.kind-blurb { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.empty-state { text-align: center; padding: 48px 20px; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.editor-settings { padding: 16px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.settings-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.editor-settings > .segmented { margin-bottom: 14px; }
.settings-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.settings-section .panel-head { margin-bottom: 6px; }
.form-grid.tight { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0 10px; }
.field-title { font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.slide-frame { position: relative; width: 100%; overflow: hidden; border-radius: 12px; box-shadow: 0 6px 24px rgba(20, 18, 60, 0.18); background: var(--stage-bg); }
.slide-canvas { position: absolute; top: 0; left: 0; width: 1600px; height: 900px; transform-origin: 0 0; }
.preview-stage { min-height: 0; height: 900px; }
.example-badge { position: absolute; left: 40px; bottom: 22px; background: var(--gold); color: var(--gold-text); font-weight: 700; font-size: 18px; border-radius: 999px; padding: 6px 16px; }
.preview-empty { font-size: 36px; color: var(--stage-muted); text-align: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--gold); outline-offset: 1px; }
.swatch-pick { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; font-size: 13px; margin: 0 0 0 6px; }
.swatch-pick input, .item-colours input { width: 34px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.file-pick input { margin-top: 6px; font: inherit; font-weight: 400; font-size: 14px; }
.palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette { font: inherit; font-size: 13px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--ink); }
.palette[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px var(--gold); }
.palette-strip { display: flex; height: 12px; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.palette-strip i { flex: 1; }
.item-colours { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.item-colours li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-colours .check { margin: 0; align-items: center; }
@media (max-width: 1200px) { .editor { grid-template-columns: 1fr; } .editor-settings { position: static; max-height: none; } }
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .slides { position: static; max-height: none; }
  .slide-list { grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; padding-bottom: 4px; }
  .slide-move { display: flex; position: static; justify-content: flex-end; margin-top: 2px; }
}

/* Phones: the other kinds (pollPhone.js) */
.choice-list { display: grid; gap: 8px; }
.choice { display: block; width: 100%; text-align: left; font: inherit; font-weight: 600; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; }
.choice .muted { display: block; font-weight: 400; font-size: 13px; }
.choice[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.choice[aria-pressed="true"] .muted { color: #d8d8ec; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice.ranked { display: flex; gap: 10px; align-items: center; background: var(--info-bg); border-color: var(--navy-2); }
.rank-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 14px; flex: none; }
.slider-block { padding: 14px 0; border-bottom: 1px solid var(--border); }
.slider-block:last-child { border-bottom: 0; }
.slider-row { display: grid; grid-template-columns: 1fr 48px; gap: 12px; align-items: center; }
.slider-row input[type="range"] { width: 100%; height: 32px; accent-color: var(--navy); }
.slider-row input[data-untouched] { opacity: 0.55; }
.slider-row output { font-weight: 750; font-size: 20px; text-align: right; }
.slider-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.slider-dot { stroke: var(--surface); stroke-width: 1.5; }
.stage .slider-dot { stroke: var(--stage-bg); }

/* Words, ideas and questions (pollViews.js) */
.cloud-wrap svg { display: block; width: 100%; height: auto; }
.cloud text { font-family: inherit; }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 650; background: var(--surface-alt); color: var(--muted); }
.chip.theme { background: var(--info-bg); color: var(--info); }
.wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.wall-card { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent, var(--gold)); border-radius: 10px; padding: 12px 14px; }
.wall-card p { margin: 0 0 6px; }
.wall-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wall.stage { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.stage .wall-card { background: var(--stage-panel); border-color: var(--stage-line); color: var(--stage-ink); }
.wall.stage .wall-card p { font-size: clamp(16px, 1.5vw, 26px); font-weight: 600; line-height: 1.3; }
.stage .chip { background: var(--stage-line); color: var(--stage-ink); font-size: clamp(12px, 1vw, 16px); }
.theme-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 24px; }
.theme-list h3 { margin: 0 0 6px; font-size: 16px; border-left: 4px solid var(--accent, var(--gold)); padding-left: 8px; }
.theme-list .count { color: var(--muted); font-weight: 600; }
.theme-list ul { margin: 0; padding-left: 18px; }
.theme-list li { margin-bottom: 4px; }
.theme-list.stage h3 { font-size: clamp(18px, 1.7vw, 30px); }
.theme-list.stage li { font-size: clamp(15px, 1.3vw, 22px); }
.stage .theme-list .count { color: var(--stage-muted); }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.q-list li.answered { opacity: 0.6; }
.q-votes { font-weight: 750; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; border-radius: 999px; padding: 2px 8px; background: var(--accent, var(--navy)); color: var(--accent-ink, #fff); }
.q-list.stage { gap: 12px; }
.q-list.stage li { background: var(--stage-panel); border-color: var(--stage-line); }
.q-list.stage .q-body { font-size: clamp(18px, 1.9vw, 34px); font-weight: 650; line-height: 1.25; }
.q-list.stage .q-votes { font-size: clamp(18px, 1.7vw, 30px); }

/* Phones: sending words, ideas and questions (pollPhone.js) */
.entry-form textarea, .entry-form input[type="text"] { width: 100%; }
.entry-form .char-count { text-align: right; }
.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entry-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.entry-list li.answered { opacity: 0.65; }
.entry-list .meta { color: var(--muted); font-size: 13px; }
.vote-button { min-width: 64px; min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 750; color: var(--navy); cursor: pointer; }
.vote-button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.vote-button:disabled { cursor: default; opacity: 0.6; }

/* Reactions: the bar on phones, and on the screen as they arrive */
body.has-react-bar { padding-bottom: 76px; }
.react-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(20, 18, 60, 0.08); z-index: 20; overflow-x: auto; }
.react-bar button { flex: none; min-width: 44px; min-height: 48px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.react-bar button .label { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.react-bar button.sent { background: var(--info-bg); }
.react-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.react-float { position: absolute; bottom: -60px; font-size: clamp(36px, 4vw, 64px); animation: react-rise 3.2s ease-out forwards; }
@keyframes react-rise {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-70vh) scale(1.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .react-float { animation: react-fade 3.2s linear forwards; bottom: 24px; }
  @keyframes react-fade { 0% { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
}
.reaction-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.reaction-counts span { white-space: nowrap; }

/* Prioritising: the 2×2 matrix, the radar and pins (pollViews.js) */
.matrix-wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.matrix-plot { width: min(100%, 520px); height: auto; flex: none; }
.matrix-wrap.stage .matrix-plot { width: min(100%, 60vh); }
.matrix-wrap.phone .matrix-plot { width: 100%; }
.matrix-axis { stroke: var(--border); stroke-width: 2; }
.matrix-mean { stroke: var(--surface); stroke-width: 3; }
.matrix-n { fill: #fff; font-weight: 800; font-size: 18px; }
.matrix-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; flex: 1 1 220px; }
.matrix-key li { display: flex; gap: 10px; align-items: baseline; }
.matrix-key .key-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 14px; }
.matrix-wrap.stage .matrix-key li { font-size: clamp(16px, 1.5vw, 26px); color: var(--stage-ink); }
.stage .matrix-axis { stroke: var(--stage-line); }
.stage .matrix-mean { stroke: var(--stage-bg); }
.radar-wrap svg { display: block; width: min(100%, 860px); height: auto; margin: 0 auto; }
.stage .radar-wrap svg { width: min(100%, 100vh); max-height: 64vh; }
.radar-grid { fill: none; stroke: var(--border); stroke-width: 1.5; }
.stage .radar-grid { stroke: var(--stage-line); }
.pin-stage { display: flex; justify-content: center; }
.pin-board { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.pin-board img { display: block; max-width: 100%; max-height: 70vh; border-radius: 8px; }
.pin-stage.stage .pin-board img { max-height: 62vh; }
.pin { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--accent, #e9a822); opacity: 0.9; border: 2px solid #1e1b3a; line-height: 16px; text-align: center; font-size: 11px; font-weight: 800; color: var(--accent-ink, #1e1b3a); pointer-events: auto; }
.pin.noted { width: 26px; height: 26px; margin: -13px 0 0 -13px; line-height: 22px; opacity: 1; }
.pin.mine { background: #23214f; color: #fff; border-color: #fff; }
.pin-stage.stage .pin { transform: scale(1.3); }

/* Phones: dots, the matrix and pins (pollPhone.js) */
.dot-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dot-row:last-child { border-bottom: 0; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 22px; font-weight: 700; color: var(--navy); cursor: pointer; }
.stepper button:disabled { opacity: 0.4; cursor: default; }
.stepper output { min-width: 2.2em; text-align: center; font-weight: 750; font-size: 20px; }
.dots-left { position: sticky; top: 0; background: var(--bg); padding: 8px 0; font-weight: 700; z-index: 1; }
.matrix-block { padding: 14px 0; border-bottom: 1px solid var(--border); }
.matrix-block:last-child { border-bottom: 0; }
.matrix-pad { position: relative; width: 140px; height: 140px; border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(var(--border), var(--border)) center / 1px 100% no-repeat, linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat, var(--surface); flex: none; }
.matrix-pad .pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.matrix-pad.untouched .pin { opacity: 0.3; }
.matrix-row { display: flex; gap: 14px; align-items: center; }
.matrix-row .sliders { flex: 1; min-width: 0; }
.pin-pick { cursor: crosshair; touch-action: manipulation; }
.pin-pick:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The storyboard: picking pictures on phones, and the results gallery */
.picture-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.picture-grid li { position: relative; min-width: 0; }
.picture-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--surface-alt); }
.picture-grid.pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pic { display: block; width: 100%; padding: 4px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.pic .pic-cap { display: block; padding: 6px 4px 2px; font-size: 13px; font-weight: 600; line-height: 1.25; }
.pic .tick { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); border: 2px solid var(--navy); color: transparent; display: grid; place-items: center; font-weight: 800; }
.pic[aria-pressed="true"] { border-color: var(--navy); background: var(--info-bg); }
.pic[aria-pressed="true"] .tick { background: var(--navy); color: #fff; }
.pic-zoom { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 8px; border: 0; background: rgba(35, 33, 79, 0.75); color: #fff; font-size: 18px; cursor: pointer; }
.story-tabs { display: flex; margin-bottom: 8px; width: 100%; }
.story-tabs button { flex: 1; }
.picture-grid.mini { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-bottom: 12px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(15, 12, 40, 0.92); display: grid; place-items: center; padding: 16px; }
.lightbox-inner { width: min(100%, 720px); text-align: center; color: #fff; }
.lightbox-inner img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 10px; background: #000; }
.lightbox-cap { font-weight: 700; font-size: 18px; margin: 10px 0 2px; }
.lightbox-cap .muted, .lightbox .muted { display: block; color: #c3c2dd; font-weight: 400; font-size: 14px; }
.lightbox-nav { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.lightbox-nav [data-lb="prev"], .lightbox-nav [data-lb="next"] { min-width: 52px; font-size: 22px; }
.lightbox .link-button { color: #fff; }
.picture-grid.results figure { margin: 0; }
.picture-grid.results figcaption { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: baseline; padding: 6px 2px; font-size: 13px; }
.pic-count { font-weight: 800; font-size: 16px; border-radius: 999px; padding: 0 8px; background: var(--accent, var(--navy)); color: var(--accent-ink, #fff); }
.picture-grid.results li.top img { outline: 3px solid var(--accent, var(--gold)); outline-offset: 2px; }
.picture-grid.results.stage { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.picture-grid.results.stage figcaption { color: var(--stage-ink); font-size: clamp(12px, 1vw, 18px); }
.picture-grid.results.stage .pic-count { background: none; padding: 0; color: var(--accent, var(--gold)); font-size: clamp(18px, 1.6vw, 30px); }
.picture-grid.results.phone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.picture-cards { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.picture-cards li { border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface); display: grid; gap: 6px; }
.picture-cards img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.picture-cards .cap { font-size: 13px; font-weight: 600; }
.picture-cards .row-actions { justify-content: flex-start; }

/* Survey mode on phones (join.js) */
.survey-bar { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.survey-progress { height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.survey-progress span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.survey-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.survey-intro p:last-child, .survey-thanks p:last-of-type { margin-bottom: 0; }
.survey-thanks .btn-secondary { margin-top: 12px; }
.plain-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.stats-table td:first-child { min-width: 14em; }
.stats-table caption { text-align: left; caption-side: top; padding: 0 0 6px; }

/* Dot voting as stickers (review note 15) */
.dot-wall { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dot-wall li { display: grid; grid-template-columns: minmax(8em, 16em) 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.dot-wall-name { font-weight: 650; }
.dot-wall-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dot-wall-dots i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.dot-wall-n { font-weight: 800; font-variant-numeric: tabular-nums; }
.stage .dot-wall li { background: var(--stage-panel); border-color: var(--stage-line); }
.dot-wall.stage .dot-wall-name { font-size: clamp(18px, 1.7vw, 30px); }
.dot-wall.stage .dot-wall-dots i { width: clamp(20px, 1.8vw, 32px); height: clamp(20px, 1.8vw, 32px); }
.dot-wall.stage .dot-wall-n { font-size: clamp(20px, 1.9vw, 34px); color: var(--accent, var(--gold)); }
/* Phones: tap an option to place a dot; the dots left as a row */
.dot-pool { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; min-height: 18px; }
.dot-pool i, .dot-placed i { width: 18px; height: 18px; border-radius: 50%; background: var(--accent, var(--gold)); display: inline-block; }
.dot-pool i { background: var(--surface-alt); border: 2px dashed var(--border); }
.dot-option { width: 100%; text-align: left; min-height: 48px; }
.dot-placed { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; background: none; border: 0; padding: 4px 0; cursor: pointer; min-height: 30px; }
/* An idea's score, and the up and down buttons on phones (review note 13) */
.idea-score { float: right; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: 999px; padding: 0 8px; margin-left: 8px; background: var(--accent, var(--navy)); color: var(--accent-ink, #fff); }
.idea-votes { display: inline-flex; gap: 6px; align-items: center; flex: none; }
.idea-votes .score { min-width: 2.2em; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
/* Ranking: drag to reorder, or the arrows */
.rank-list li { display: flex; gap: 6px; align-items: stretch; }
.rank-list .ranked { flex: 1; }
.drag-handle { cursor: grab; touch-action: none; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 0 10px; font-size: 18px; color: var(--muted); }
.rank-list li.dragging { opacity: 0.6; }
.rank-moves { display: flex; flex-direction: column; gap: 2px; }
.rank-moves button { min-height: 22px; padding: 0 8px; }
/* Slider step names */
.step-names { position: relative; height: 1.6em; font-size: 12px; color: var(--muted); margin: 2px 9px 0; }
.step-names span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.step-names span.first { transform: translateX(-9px); } .step-names span.last { transform: translateX(calc(-100% + 9px)); }
/* Storyboard on phones: grid, list or one at a time (review note 19) */
.picture-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.picture-list button { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 6px; min-height: 64px; }
.picture-list img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.picture-list button[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.picture-one { text-align: center; touch-action: pan-y; }
.picture-one img { width: 100%; border-radius: 12px; }
.picture-one .pic-cap { display: block; margin: 8px 0; font-weight: 650; }
.qa-part { font-size: 15px; margin: 14px 0 6px; }
.step-now { margin: 4px 0 0; text-align: center; font-weight: 650; color: var(--navy); min-height: 1.4em; }
