/* Live sessions · light. The same look as the programme spaces (public/static/platform.css):
   white cards on a soft grey page, one green accent, Inter. The video stays dark because video is dark.
   Built from the old studio.css (class names unchanged, so every page hook and test keeps working). */
@font-face { font-family: "Inter"; src: url(/static/fonts/inter-var.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f3f4f6; --surface-3: #e9ecef;
  --line: #e6e8ec; --line-2: #d9dde3;
  --ink: #1d2127; --muted: #6a717b; --faint: #9aa1aa;
  --accent: #0f6e5c; --accent-fill: #0f6e5c; --accent-ink: #ffffff; --accent-soft: #e6f3f0;
  --live: #d9473a; --good: #1f8a4c; --good-soft: #e5f4ea; --warn: #b7791f; --gold: #f2b84b; --gold-soft: #fff4dc; --bad: #c0392b;
  --stage: #2a3137;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px; --r-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); min-height: 100%; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font: 500 .72rem/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1 { font-size: 1.45rem; font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
@media (max-width: 820px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* icons */
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* forms */
label { display: block; font-size: .82rem; color: var(--muted); margin: 1rem 0 .35rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: .62rem .75rem; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 7rem; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
.radios { display: flex; flex-wrap: wrap; gap: .4rem; }
.radios label { display: inline-flex; gap: .45rem; align-items: center; margin: 0; color: var(--ink); font-size: .9rem;
  padding: .45rem .7rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; }
.radios label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radios input { accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px;
  padding: .5rem 1rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn.accent { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.btn.accent:hover { background: #0c5c4d; }
.btn.secondary { background: transparent; }
.btn.danger { background: transparent; color: var(--bad); border-color: #f0c9c3; }
.btn.stop { background: var(--live); border-color: var(--live); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.msg { color: var(--bad); font-size: .88rem; min-height: 1.3em; margin: .5rem 0 0; }
.ok { color: var(--good); }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; font: 600 .7rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  padding: .38rem .55rem; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.live { background: var(--live); color: #fff; }
.badge.rec { color: var(--bad); }
.badge b { color: var(--ink); font-weight: 600; }

/* simple pages (sessions, builder, sign-in) */
.page { max-width: 1120px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 56px max(20px, env(safe-area-inset-left)); }
.appbar { display: flex; align-items: center; gap: 1rem; height: 64px; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.appbar .brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.appbar .brand img { width: 28px; height: 28px; }
.appbar nav { margin-left: auto; display: flex; align-items: center; gap: 1.1rem; font-size: .9rem; }
.appbar nav a { color: var(--muted); text-decoration: none; }
.appbar nav a:hover { color: var(--ink); }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding: .55rem .6rem; }
table.list td { border-bottom: 1px solid var(--line); padding: .8rem .6rem; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.state { font: 600 .68rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.state.live { color: var(--good); } .state.draft { color: var(--warn); }
.empty { display: grid; justify-items: center; text-align: center; gap: .5rem; padding: 2rem 1rem; color: var(--muted); }
.empty img { width: 180px; height: 135px; object-fit: contain; opacity: .9; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }

.signin { max-width: 380px; margin: 14vh auto 0; padding: 0 20px; }
.signin .mark { width: 48px; height: 48px; margin-bottom: 1rem; }

/* answer rows (phones, control room, big screen) */
.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.answers li { margin: 0; }
.answer { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 52px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; position: relative; overflow: hidden; color: var(--ink); }
.answer:hover:not([disabled]) { border-color: var(--accent); }
.answer .k { font-family: var(--mono); color: var(--muted); width: 1.2ch; flex: none; }
.answer .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.answer .n { font-family: var(--mono); color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.answer .fill { position: absolute; inset: 0 auto 0 0; background: #dfe9f9; width: 0; transition: width .3s ease; }
.answer > :not(.fill) { position: relative; }
.answer.mine { border-color: var(--accent); background: var(--accent-soft); }
.answer.right { border-color: var(--good); }
.answer.right .fill { background: var(--good-soft); }
.answer.right .k { color: var(--good); }
.answer[disabled] { cursor: default; }
.answer .tag { font: 600 .66rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); flex: none; }
.answer.right .tag { color: var(--good); }
.answer.mine .tag { color: var(--accent); }

.bar { height: 3px; background: var(--line); }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s linear; }
.notice { color: var(--muted); margin: 0; }
.notice.good { color: var(--good); }
.board { list-style: none; margin: 0; padding: 0; counter-reset: b; }
.board li { display: flex; justify-content: space-between; gap: 1rem; padding: 7px 0; border-bottom: 1px solid var(--line); counter-increment: b; }
.board li::before { content: counter(b); font-family: var(--mono); color: var(--muted); width: 2ch; flex: none; }
.board li:first-child::before { color: var(--warn); }
.board li .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.board li .pt { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.podium { display: block; width: 40px; height: 30px; object-fit: contain; }
.lbhead { display: flex; align-items: center; gap: .5rem; margin: .9rem 0 .2rem; font: 500 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sendrow { display: flex; gap: 8px; }
.sendrow input { flex: 1; min-width: 0; }
.texts { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.texts li { padding: .5rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.texts li .by { color: var(--muted); font-size: .78rem; }

/* ── Builder ── */
.blocks { list-style: none; margin: 0; padding: 0; }
.blocks > li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .75rem; padding: .9rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.blocks > li:last-child { border-bottom: 0; }
.blocks .pos { font-family: var(--mono); color: var(--muted); padding-top: .1rem; }
.blocks .p { overflow-wrap: anywhere; }
.blocks .opts { margin: .35rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .9rem; }
.blocks .opts li.right { color: var(--good); }
.blocks .acts { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; }
.blocks .acts button { min-height: 34px; padding: .25rem .6rem; font-size: .82rem; font-weight: 500; }
@media (max-width: 560px) { .blocks > li { grid-template-columns: 1.6rem minmax(0, 1fr); } .blocks .acts { grid-column: 2; justify-content: flex-start; } }

/* ── Control room (studio) ── */
body.studio { height: 100%; overflow: hidden; }
.studio-app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 52px minmax(0, 1fr) 76px; }
.strip { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; padding: 0 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.strip .back { color: var(--muted); display: inline-flex; padding: 6px; border-radius: var(--r-sm); }
.strip .back:hover { color: var(--ink); background: var(--surface-2); }
.strip h1 { font-size: .98rem; margin: 0 .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.strip .grow { flex: 1; }
.strip .feed { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.strip a.link { font-size: .85rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.strip a.link:hover { color: var(--ink); }

.stagewrap { position: relative; margin: 12px; border-radius: 10px; overflow: hidden; background: var(--stage); min-width: 0; min-height: 0; }
.stagewrap #studio { position: absolute; inset: 0; aspect-ratio: auto; background: var(--stage); }
.stagewrap #studio video { object-fit: cover; }
.stagewrap .camname { position: absolute; left: 14px; bottom: 14px; z-index: 3; font-size: .8rem; padding: 4px 8px; border-radius: var(--r-sm); background: rgba(0,0,0,.55); }
.qcard { position: absolute; left: 14px; top: 14px; z-index: 3; width: min(560px, calc(100% - 220px)); max-height: calc(100% - 28px);
  display: flex; flex-direction: column; gap: .6rem; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: 0 6px 24px rgba(16,24,40,.12); }
.qcard.min .qbody { display: none; }
.qcard .qhead { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.qcard .q { font-size: 1.12rem; font-weight: 600; line-height: 1.3; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.qcard .answers { gap: 6px; }
.qcard .answer { min-height: 38px; padding: 7px 10px; font-size: .9rem; cursor: default; }
.qcard .texts { max-height: 38vh; }
.qcard .iconbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; display: inline-flex; }
.tiles { position: absolute; right: 14px; top: 14px; z-index: 3; display: flex; flex-direction: column; gap: 8px; width: 180px; }
.tiles .tile { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #3a434b; border: 2px solid #fff; }
.tiles .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tiles .tile span { position: absolute; left: 6px; bottom: 4px; font-size: .72rem; text-shadow: 0 1px 2px #000; color: #fff; }
.stage-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; }

.side { width: 360px; margin: 12px 12px 12px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side[hidden] { display: none !important; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 12px 6px 10px; cursor: pointer; font-weight: 500; font-size: .88rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font: 500 .7rem var(--mono); color: var(--muted); }
.tabs img { width: 18px; height: 18px; }
.tabpanel { padding: 14px 16px; overflow-y: auto; flex: 1; min-height: 0; display: grid; gap: 1rem; align-content: start; }
.sheet { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sheet button { width: 100%; text-align: left; display: flex; gap: .65rem; padding: .6rem .6rem; background: transparent; border: 1px solid transparent;
  border-radius: var(--r-sm); cursor: pointer; align-items: baseline; color: var(--ink); }
.sheet button:hover:not(:disabled) { background: var(--surface-2); }
.sheet button.cur { background: var(--surface-2); border-color: var(--line-2); box-shadow: inset 3px 0 0 var(--accent); }
.sheet button:disabled { cursor: default; }
.sheet .pos { font-family: var(--mono); color: var(--muted); width: 2ch; flex: none; }
.sheet .p { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.sheet .p .kind { display: block; font-size: .75rem; color: var(--muted); }
.sheet .st { font: 600 .64rem var(--mono); text-transform: uppercase; color: var(--muted); flex: none; }
.kbd { font: 500 .72rem var(--mono); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 .3rem; color: var(--muted); }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.person-row .who { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; overflow-wrap: anywhere; }
.person-row .who img { width: 22px; height: 22px; flex: none; }
.person-row .btn { min-height: 34px; padding: .3rem .7rem; font-size: .82rem; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--muted); font-family: var(--mono); }
details.fold[open] > summary::after { content: "–"; }

/* Jethro panel */
.jethro-head { display: flex; align-items: center; gap: .6rem; }
.jethro-head img { width: 34px; height: 34px; }
.jethro-head .t { flex: 1; }
.jethro-head .t b { display: block; font-size: 1rem; }
.brain .mood { font: 600 1.35rem var(--sans); text-transform: capitalize; color: var(--warn); }
.brain .say { margin: .4rem 0; line-height: 1.5; }
.brain .unsure { font-size: .88rem; color: var(--muted); }
.brain .next { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: var(--r-sm); padding: .65rem .8rem; margin: .75rem 0; }
.brain .next .eyebrow { color: var(--accent); }
.brain .themes { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: 4px; font-size: .88rem; }
.brain .themes li { display: flex; justify-content: space-between; gap: .5rem; }

/* bottom toolbar */
.toolbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; padding: 0 14px; border-top: 1px solid var(--line); background: var(--surface); min-width: 0; overflow-x: auto; }
.toolbar .grp { display: flex; align-items: center; gap: 2px; }
.toolbar .sep { width: 1px; height: 40px; background: var(--line); margin: 0 8px; flex: none; }
.toolbar .grow { flex: 1; }
.tb { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 70px; height: 60px; padding: 4px 8px;
  background: none; border: 0; border-radius: var(--r); color: var(--ink); cursor: pointer; font-size: .74rem; white-space: nowrap; position: relative; }
.tb svg.ic { width: 22px; height: 22px; }
.tb:hover:not(:disabled) { background: var(--surface-2); }
.tb:disabled { opacity: .35; cursor: default; }
.tb.on { color: var(--bad); }
.tb.active { background: var(--surface-2); color: var(--accent); }
.tb .dot { position: absolute; top: 6px; right: 14px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warn); color: #fff; font: 600 .62rem/16px var(--mono); background: var(--live); }
.tb.golive { color: #fff; background: var(--accent-fill); min-width: 92px; }
.tb.golive:hover { background: #0c5c4d; }
.tb.golive.stopping { background: var(--live); }
#mainBtns { display: flex; gap: 8px; align-items: center; }
#mainBtns .btn { min-height: 46px; padding: .5rem 1.2rem; font-size: .95rem; }
#mainBtns .btn.secondary { border-color: var(--line-2); }
details.more { position: relative; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more .menu { position: absolute; bottom: 64px; right: 0; z-index: 20; min-width: 220px; display: grid; gap: 4px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 10px 30px rgba(16,24,40,.14); }
details.more .menu .btn { width: 100%; justify-content: flex-start; }
details.more .menu select { margin: 0 0 6px; }
details.more .menu .eyebrow { margin: 4px 2px; }
#studioBar { display: flex; align-items: center; gap: 2px; }
#studioBar [data-k=status] { font-size: .74rem; color: var(--muted); max-width: 170px; line-height: 1.25; white-space: normal; margin-left: 6px; }
#studioNote { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; margin: 0; font-size: .85rem;
  background: rgba(0,0,0,.6); padding: 6px 10px; border-radius: var(--r-sm); }
#studioNote:empty { display: none; }
@media (max-width: 1100px) {
  .side { position: absolute; right: 0; top: 52px; bottom: 76px; z-index: 10; margin: 8px; box-shadow: -10px 0 30px rgba(16,24,40,.12); }
  .tb { min-width: 58px; font-size: .68rem; }
  .qcard { width: calc(100% - 28px); }
  .tiles { display: none; }
}

/* ── Phone room ── */
body.room { min-height: 100%; }
.room-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
#video { aspect-ratio: 16 / 9; background: var(--stage); color: var(--ink); position: relative; display: flex; align-items: flex-end; flex: none; }
#video .live { position: absolute; top: 10px; left: 10px; font: 600 11px/1 var(--mono); letter-spacing: .08em; padding: 5px 7px; background: var(--live); color: #fff; border-radius: 3px; }
#video .who { padding: 10px 12px; font-size: 13px; color: var(--muted); }
#vid { position: relative; flex: none; }
.room-sheet { flex: 1; margin-top: -14px; position: relative; z-index: 2; background: var(--surface); border-radius: 16px 16px 0 0; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.room-sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); align-self: center; margin-bottom: 2px; }
.room-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font: 500 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.room-meta b { color: var(--accent); font-weight: 500; }
#timerBar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.q { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
#stage { display: grid; gap: 12px; }
#stage .lead { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 8px 0; }
#stage .lead img { width: 160px; height: 120px; object-fit: contain; }
.room-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 1rem; font: 500 12px var(--mono); color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.vbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .86rem; }
.vbar .btn { min-height: 38px; padding: .4rem .8rem; font-size: .86rem; }
.vbar .pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 18px; padding: .35rem .75rem; color: var(--ink); cursor: pointer; font-size: .82rem; }
.vbar .pill img { width: 18px; height: 18px; }
.vbar .pill.up { border-color: var(--warn); color: var(--warn); }
#reacts { padding: 0; }

/* ── Join ── */
.join { max-width: 420px; margin: 0 auto; padding: 6vh max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left)); }
.join .hero { display: block; width: 220px; height: 165px; object-fit: contain; margin: 0 auto 1rem; }
.join .code { font: 500 1.7rem var(--mono); letter-spacing: .32em; text-align: center; }

/* ── Big screen ── */
body.screen { overflow: hidden; background-color: var(--bg); background-image: radial-gradient(circle at 1px 1px, #e3e6ea 1px, transparent 0); background-size: 28px 28px; }
.screen-wrap { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 400px); }
.screen-main { padding: 5vh 4vw 4vh; display: flex; flex-direction: column; gap: 3vh; min-width: 0; }
.screen-side { padding: 5vh 2vw; display: flex; flex-direction: column; gap: 2vh; align-items: center; justify-content: center; text-align: center; }
.screen-side .qrcard { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line-2); border-radius: 12px; padding: 2.2vh 1.6vw; display: grid; gap: 1.4vh; justify-items: center; width: 100%; }
.screen-side img { width: 100%; max-width: 320px; aspect-ratio: 1; background: #fff; padding: 10px; border-radius: 8px; }
.screen-side .code { font: 500 clamp(1.6rem, 3vw, 2.8rem) var(--mono); letter-spacing: .18em; }
.screen-side .url { font: 500 clamp(.75rem, .95vw, .95rem) var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.screen-q { font-size: clamp(1.8rem, 3.6vw, 3.8rem); line-height: 1.15; font-weight: 600; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.screen-meta { display: flex; justify-content: space-between; gap: 2rem; font: 500 clamp(.85rem, 1.2vw, 1.2rem) var(--mono); color: var(--muted); letter-spacing: .04em; }
.screen-meta b { color: var(--accent); font-weight: 500; }
.screen .answers { gap: 1.2vh; }
.screen .answer { min-height: 7vh; font-size: clamp(1rem, 1.8vw, 1.9rem); padding: 1.3vh 1.3vw; cursor: default; background: var(--surface); }
.screen .board li { font-size: clamp(1rem, 1.6vw, 1.6rem); }
.screen #timerBar { height: 6px; border-radius: 3px; }
.screen .lead { display: grid; gap: 2vh; justify-items: start; }
.screen .lead img { width: clamp(160px, 18vw, 300px); height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.corner { position: fixed; right: 14px; bottom: 14px; display: flex; gap: 8px; z-index: 6; opacity: .55; }
.corner:hover { opacity: 1; }
.corner .btn { min-height: 36px; padding: .3rem .8rem; font-size: .82rem; background: var(--surface); }
@media (max-width: 800px) { body.screen { overflow: auto; } .screen-wrap { grid-template-columns: minmax(0, 1fr); height: auto; } }

/* ── Guest stage page ── */
.guest { max-width: 900px; margin: 0 auto; padding: 4vh 20px 40px; display: grid; gap: 1rem; }
.guest .stagebox { position: relative; border-radius: 10px; overflow: hidden; background: var(--stage); }
.guest #bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.toolbar #studioBar { flex-wrap: nowrap; }
a.tb { text-decoration: none; }
.stagewrap .tpv .note { color: var(--muted); padding: 0 24px 0 max(24px, 50%); }
.qcard .msg:empty { display: none; }

/* ── Simple trainer flow (sessions list + one-button session page) ── */
.ss { max-width: 720px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 120px max(16px, env(safe-area-inset-right)); }
.ss-top { display: flex; align-items: center; gap: .75rem; padding: 14px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.ss-top a.back { color: var(--muted); text-decoration: none; font-size: 1.4rem; line-height: 1; padding: 4px 8px 4px 0; }
.ss-top .t { flex: 1; min-width: 0; }
.ss-top h1 { font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-top .sub { font-size: .85rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.ss-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: .3rem; vertical-align: 1px; }
.ss-dot.live { background: var(--live); } .ss-dot.ended { background: var(--muted); }
.ss h2 { font-size: .8rem; font-family: var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 1.5rem 0 .6rem; }
.ss-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ss-row { display: flex; align-items: center; gap: 12px; padding: 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; min-height: 56px; }
.ss-row:hover { border-color: var(--line-2); }
.ss-row .n { font-family: var(--mono); color: var(--muted); width: 1.6rem; flex: none; }
.ss-row .m { flex: 1; min-width: 0; }
.ss-row .m b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ss-row .m span { font-size: .82rem; color: var(--muted); }
.ss-row .go { color: var(--faint); font-size: 1.2rem; }
.ss-row .acts { display: flex; gap: 4px; flex: none; }
.ss-row .acts button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: var(--r-sm); width: 36px; height: 36px; cursor: pointer; font: inherit; }
.ss-row .acts button:disabled { opacity: .3; }
.ss-new { display: flex; gap: 8px; flex-wrap: wrap; }
.ss-new input { flex: 1 1 220px; min-height: 48px; }
.ss-new .btn { min-height: 48px; }
.ss-add { width: 100%; min-height: 52px; border: 1px dashed var(--line-2); background: transparent; color: var(--accent); border-radius: var(--r); font: 600 1rem var(--sans); cursor: pointer; margin-top: 10px; }
.ss-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16,24,40,.06);
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.ss-bar .in { max-width: 720px; margin: 0 auto; display: grid; gap: 6px; }
.ss-main { width: 100%; min-height: 56px; border: 0; border-radius: var(--r); background: var(--accent-fill); color: #fff; font: 600 1.1rem var(--sans); cursor: pointer; }
.ss-main.end { background: var(--live); }
.ss-main:disabled { opacity: .45; cursor: default; }
.ss-main.busy { opacity: .7; }
.ss-sec { display: flex; justify-content: space-between; align-items: center; min-height: 28px; font-size: .9rem; color: var(--muted); }
.ss-sec button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 4px 0; }
.ss-hint { font-size: .85rem; color: var(--muted); text-align: center; }
.ss-q { font-size: 1.45rem; line-height: 1.3; font-weight: 600; margin: .4rem 0 1rem; overflow-wrap: anywhere; }
.ss-meta { font: 500 .78rem var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; gap: .5rem; }
.ss-prog { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; margin: .4rem 0 1rem; }
.ss-prog i { display: block; height: 100%; background: var(--accent); }
.ss-ans { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ss-ans li { position: relative; display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ss-ans li .fill { position: absolute; inset: 0 auto 0 0; background: var(--surface-3); z-index: 0; }
.ss-ans li > *:not(.fill) { position: relative; z-index: 1; }
.ss-ans li .k { font-family: var(--mono); color: var(--muted); width: 1.2rem; }
.ss-ans li .t { flex: 1; overflow-wrap: anywhere; }
.ss-ans li .c { font-family: var(--mono); }
.ss-ans li.right { border-color: var(--good); } .ss-ans li.right .fill { background: var(--good-soft); }
.ss-tag { font: 600 .7rem var(--mono); letter-spacing: .06em; color: var(--good); }
.ss-texts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.ss-texts li { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-wrap: anywhere; }
.ss-texts li span { display: block; font-size: .78rem; color: var(--muted); }
.ss-board { list-style: none; margin: .6rem 0 0; padding: 0; }
.ss-board li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ss-board li .p { font-family: var(--mono); color: var(--warn); width: 1.2rem; }
.ss-board li .nm { flex: 1; } .ss-board li .pt { font-family: var(--mono); }
.ss-wait { text-align: center; padding: 1.5rem .5rem; color: var(--muted); }
.ss-wait img { width: 200px; max-width: 70%; height: auto; }
.ss-wait .pv { color: var(--ink); font-size: 1.15rem; font-weight: 600; margin-top: .5rem; overflow-wrap: anywhere; }
.ss details.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 10px; }
.ss details.fold > summary { list-style: none; cursor: pointer; padding: 14px; display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 52px; }
.ss details.fold > summary::-webkit-details-marker { display: none; }
.ss details.fold > summary::after { content: '+'; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 1.2rem; }
.ss details.fold[open] > summary::after { content: '−'; }
.ss details.fold > summary img { width: 24px; height: 24px; }
.ss details.fold > summary .cnt { font: 500 .8rem var(--mono); color: var(--muted); font-weight: 400; }
.ss details.fold .body { padding: 0 14px 14px; display: grid; gap: 10px; }
/* bottom sheets */
.ss-veil { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.ss-veil[hidden] { display: none; }
.ss-pane { width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 14px 14px 0 0; border: 1px solid var(--line-2);
  padding: 16px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: grid; gap: 12px; }
.ss-pane .hd { display: flex; justify-content: space-between; align-items: center; }
.ss-pane .hd b { font-size: 1.05rem; }
.ss-pane .hd button { background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 6px; }
.ss-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ss-types button { min-height: 64px; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); color: var(--ink); font: 600 .95rem var(--sans); cursor: pointer; }
.ss-types button span { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.ss-types button.on { border-color: var(--accent); background: var(--accent-soft); }
.ss-opt { display: flex; gap: 6px; align-items: center; }
.ss-opt input { flex: 1; min-height: 46px; }
.ss-opt .right { width: 46px; height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; color: var(--faint); font-size: 1.1rem; cursor: pointer; }
.ss-opt .right.on { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.ss-opt .x { width: 36px; height: 46px; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 1.1rem; }
.ss-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ss-chips button { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.ss-chips button.on { border-color: var(--accent); background: var(--accent-soft); }
.ss-join { display: grid; justify-items: center; gap: 10px; text-align: center; }
.ss-join img { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 8px; }
.ss-join .code { font: 600 2.2rem/1 var(--mono); letter-spacing: .1em; }
.ss-join .url { font-family: var(--mono); font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.ss .label { font-size: .85rem; color: var(--muted); margin: 0; }
@media (prefers-reduced-motion: reduce) { .ss * { transition: none !important; } }
.ss-rest { display: grid; gap: 12px; }
.ss [hidden], .ss-bar [hidden], .ss-veil [hidden] { display: none !important; }
.ss details.qfold > summary { list-style: none; font: 500 .8rem var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 1.5rem 0 .6rem; cursor: default; }
.ss details.qfold > summary::-webkit-details-marker { display: none; }
.ss details.qfold.live { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 1.25rem; }
.ss details.qfold.live > summary { cursor: pointer; margin: 0; padding: 14px; min-height: 52px; display: flex; align-items: center; gap: .5rem; }
.ss details.qfold.live > summary::after { content: '+'; margin-left: auto; font-size: 1.2rem; }
.ss details.qfold.live[open] > summary::after { content: '−'; }
.ss details.qfold.live > ul, .ss details.qfold.live > .ss-add { margin: 0 14px 14px; width: calc(100% - 28px); }
.ss { padding-bottom: 150px; }

/* chat: unread dot on the phone's Chat button */
.pill { position: relative; }
.pill .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-left: 4px; vertical-align: middle; }
.pill .dot[hidden] { display: none; }
#addLive { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }


/* ── light-look extras ── */
.surface, .qcard, .ss-q, .card { box-shadow: var(--shadow); }
.btn { border-radius: var(--r-sm); }
.btn.accent { background: var(--accent-fill); color: #fff; border-color: var(--accent-fill); }
.ss-main { border-radius: 11px; }
.ss-main:hover:not(:disabled) { background: #0c5c4d; }
.badge { border-radius: 6px; }
.answer { background: var(--surface); }
.answer.right { border-color: var(--good); }
.answer.right .tag { color: var(--good); }
.board li::before { color: var(--muted); }
.board li:first-child::before { color: var(--warn); }
.appbar { background: var(--surface); border-bottom: 1px solid var(--line); }

/* trainer home: programmes + sessions */
.home-sec { margin: 4px 0 22px; }
.home-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.home-head h2, .home-h2 { margin: 0; font-size: 1.1rem; }
.home-h2 { margin: 6px 0 10px; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-form .row { margin-top: 10px; }

/* labels in the same face as the text; uppercase labels a touch lighter */
.eyebrow, .ss h2, .badge { font-weight: 600; letter-spacing: .05em; }
.ss .home-head h2, .ss h2.home-h2 { font: 600 1.1rem/1.3 var(--sans); letter-spacing: -.005em; text-transform: none; color: var(--ink); margin: 0; }
.ss h2.home-h2 { margin: 6px 0 10px; }

/* removed by the trainer */
.room-gone { max-width: 420px; margin: 0 auto; padding: 64px 20px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.room-gone[hidden] { display: none; }
.room-gone h1 { font-size: 1.4rem; margin: 0; }
.room-gone p { margin: 0; color: var(--muted); }

/* a trainer's chat message while the chat is closed */
.room-toast { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; text-align: left; font: inherit; font-size: .95rem; line-height: 1.35;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--gold, #f2b84b); background: var(--gold-soft, #fff4dc); color: var(--ink, #1d2127); box-shadow: 0 8px 24px rgba(16,24,40,.18); cursor: pointer; }
.room-toast[hidden] { display: none; }
.room-toast b { margin-right: 6px; }
.room-leave { width: auto; border: 0; margin-left: auto; padding: 0 0 0 12px; font-size: .85rem; }
