:root {
  --bg: #09090b;
  --surface: #111114;
  --raised: #18181c;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #6b6b74;
  --accent: #7c6cff;
  --accent-hover: #8f82ff;
  --ok: #3ecf8e;
  --bad: #f87171;
  --radius: 12px;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(124, 108, 255, .10), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Frame ---------- */
/* The nav carries Start, so it follows you down the page and steps aside when you scroll away.
   Scrolling up, or reaching the top, brings it straight back. */
.top { position: sticky; top: 0; z-index: 30; max-width: none; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(9, 9, 11, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); transition: transform .22s ease; }
body.nav-away .top { transform: translateY(-100%); }
.top-right .primary, .top-right .danger { height: 36px; padding: 0 22px; font-size: 14px; }
.top-right .live-line { margin: 0; white-space: nowrap; }
.brand { font-weight: 600; letter-spacing: -.01em; font-size: 16px; }
.app { max-width: 1100px; margin: 0 auto; padding: 8px 24px 64px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 60px rgba(0, 0, 0, .35); }

/* The console: what a stream is run from, split by who it belongs to. */
.console { display: grid; gap: 18px; }
.console > .metrics { margin: 0; }
.console > .msg { margin: 0; }
.done-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 2px 4px; font-size: 13.5px; color: var(--faint); }
.done-title { display: flex; align-items: center; gap: 9px; }
.tick { width: 15px; height: 15px; border-radius: 50%; background: rgba(62, 207, 142, .16); position: relative; flex: none; }
.tick::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 3.5px; height: 7px;
  border-right: 1.5px solid var(--ok); border-bottom: 1.5px solid var(--ok); transform: rotate(45deg); }
.done-bar .small { margin: 0; }


.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.who { padding: 18px 20px 20px; display: grid; }
.who-name { color: var(--text); font-weight: 600; font-size: 14px; }
.who .strip { margin-top: 14px; }
@media (max-width: 900px) { .pair { grid-template-columns: 1fr; } }

/* Caption look slides in over the console, so the previews keep updating behind it. */
.look { position: fixed; top: 74px; right: 20px; width: min(340px, calc(100vw - 32px)); z-index: 40;
  max-height: calc(100vh - 96px); overflow: auto; padding: 16px 20px 20px; animation: slide .18s ease-out; }
@keyframes slide { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.look-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.look .field { margin-bottom: 14px; }
.look select { width: 100%; }
.look .fold { position: static; }
body.look-open #open-look { color: var(--text); background: var(--raised); border-color: var(--line-strong); }

/* ---------- Stepper ---------- */
.stepper { list-style: none; margin: 0 0 36px; padding: 0; display: flex; gap: 8px; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 2px solid var(--line-strong); color: var(--faint); font-size: 13px; font-weight: 500; cursor: default; }
.stepper .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; background: var(--raised); border: 1px solid var(--line-strong); color: var(--muted); flex: none; }
.stepper li.done { border-top-color: var(--accent); color: var(--muted); cursor: pointer; }
.stepper li { cursor: pointer; }
.stepper li:hover { color: var(--text); }
.stepper li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.active { border-top-color: var(--accent); color: var(--text); }
.stepper li.active .dot { border-color: var(--accent); color: var(--text); }

/* ---------- Screens ---------- */
h1 { font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; margin: 0 0 24px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; margin: 0 0 20px; }
.screen { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.steps { list-style: none; counter-reset: step; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 0 40px; min-height: 26px; line-height: 1.9; color: var(--muted); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; line-height: 1; background: var(--raised); border: 1px solid var(--line-strong); color: var(--text); font-size: 12px; font-weight: 600; }
kbd { font: 500 12.5px/1 var(--mono); color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; white-space: nowrap; }
kbd:empty { display: none; }

/* ---------- Controls ---------- */
input, select, button { font: inherit; color: var(--text); }
input, select {
  height: 44px; min-width: 0; width: 100%; padding: 0 14px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
select { cursor: pointer; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 108, 255, .22); }
button {
  height: 44px; padding: 0 18px; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
  background: var(--raised); border: 1px solid var(--line-strong); font-weight: 500;
  transition: background .15s, border-color .15s, opacity .15s;
}
button:hover { border-color: rgba(255, 255, 255, .22); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { background: transparent; border-color: rgba(248, 113, 113, .5); color: var(--bad); font-weight: 600; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 0 10px; }
/* Links that sit among ghost buttons, like Admin in the nav, look like them rather than like browser links. */
a.ghost { display: inline-flex; align-items: center; height: 44px; padding: 0 10px; border-radius: var(--radius);
  color: var(--muted); font-weight: 500; text-decoration: none; transition: color .15s; }
a.ghost:hover { color: var(--text); }
button.ghost:hover:not(:disabled) { color: var(--text); }
button.big { width: 100%; height: 52px; font-size: 16px; }
button.small { height: 34px; font-size: 13.5px; margin-top: 10px; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field-row { display: flex; gap: 10px; }
.field-row > button { flex: none; }
#type-row { margin-top: 12px; }

.msg { margin: 12px 0 0; font-size: 14px; }
.msg:empty { display: none; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--ok); }
.steps.after { margin: 18px 0 0; }

.option { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.toggle-title { display: block; font-weight: 500; }
.toggle-sub { display: block; font-size: 13px; color: var(--faint); }
#guest-body { margin-top: 22px; }
#vcam { margin-top: 22px; }
#vcam .steps { margin-bottom: 18px; }

.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .18s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }
.nav .primary { height: 46px; min-width: 132px; font-size: 15px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 20px 0 0; }
.metrics div { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.metrics dt { font-size: 12px; color: var(--faint); }
.metrics dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Preview ---------- */
.preview-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 500; margin: 2px 2px 10px; }
#guest-preview { margin-top: 18px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #16161a, #0c0c0e); border: 1px solid var(--line);
  container-type: inline-size;
}
.cap {
  position: absolute; left: 8%; right: 8%; bottom: 7%; text-align: center;
  font-weight: 700; font-size: clamp(14px, 4.6cqw, 30px); line-height: 1.25; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 2px 4px #000;
}
.cap:empty::before { content: attr(data-empty); color: var(--faint); font-weight: 500; font-size: clamp(12px, 2.6cqw, 15px); text-shadow: none; }
.cap .nf { opacity: .6; }

/* ---------- Settings dialog ---------- */
dialog { width: min(440px, calc(100vw - 32px)); padding: 28px; color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
dialog .nav { margin-top: 8px; }

@media (max-width: 900px) {
  .top, .app { padding-left: 16px; padding-right: 16px; }
}

/* Short screens: tighten the wizard so a step still fits without scrolling. */
@media (max-height: 860px) {
  h1 { font-size: 25px; margin-bottom: 18px; }
  .steps { gap: 10px; margin-bottom: 22px; }
  .nav { margin-top: 22px; }
  #screen-guest .toggle { margin-bottom: 18px; }
}

/* Narrow: one thing per line, and every control big enough to hit. */
@media (max-width: 600px) {
  .stepper { gap: 6px; }
  .stepper li { font-size: 12px; gap: 7px; }
  .audio-row { flex-wrap: wrap; row-gap: 10px; }
  .audio-row > span:first-child { flex: 1 0 100%; }
  .audio-row select { max-width: none; flex: 1; }
  .voice-ctl { flex: 1; justify-content: space-between; }
  .look-grid { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav .primary { flex: 1; height: 48px; }
  .checks input { width: 18px; height: 18px; }
  .colors input[type="color"] { width: 40px; height: 34px; }
}
@media (max-width: 520px) {
  .field-row { flex-direction: column; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .stepper li { font-size: 12px; }
  h1 { font-size: 24px; }
}

/* ---------- Overlay links + OBS status ---------- */
.link-box { display: flex; gap: 8px; margin: 10px 0 4px; }
.link-box input { font: 500 12.5px var(--mono); color: var(--muted); height: 40px; }
.link-box button { height: 40px; min-width: 84px; }
.wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.badge.on { color: var(--ok); }
.badge.on::before { background: var(--ok); }
.preview-head .live + .badge { margin-left: 12px; }
#screen-guest .toggle { margin-bottom: 24px; }

.live-line { display: flex; align-items: center; gap: 10px; margin: -8px 0 24px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(62, 207, 142, .15); animation: pulse 1.6s infinite; }

/* Caption strips in the preview: same 960 × 260 shape as the OBS sources */
.strip {
  position: relative; aspect-ratio: 960 / 260; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #16161a, #0c0c0e); border: 1px solid var(--line); container-type: inline-size;
}
.strip .cap { inset: 0; left: 0; right: 0; bottom: auto; padding: 1.2cqw 1.5cqw; font-size: 5.2cqw; line-height: 1.5; font-weight: 600; text-shadow: none; }
.strip .cap { font-family: var(--font, "Geist", "IBM Plex Sans Arabic", "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif); }
/* Same variables the OBS overlay uses, set by look.js */
.strip .cap .box {
  color: var(--fg, #fff); text-shadow: var(--shadow, none); font-weight: var(--weight, 600); font-style: var(--italic, normal);
  paint-order: stroke fill; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.strip .cap[data-style="box"] .box { background: var(--box, #0c0c0e); padding: .06em .4em; border-radius: .22em; }
.strip .cap .new { color: var(--hl, #ffd54a); }
.strip .cap .draft { opacity: .55; }
.strip { background: repeating-conic-gradient(#1b1b20 0 25%, #141418 0 50%) 0 0 / 22px 22px; }
.strip .cap:empty::before { font-size: 3cqw; }

/* Private room badge */
.top-right { display: flex; align-items: center; gap: 14px; }
.room { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 99px; padding: 5px 12px 5px 10px; }
.room-code { font: 500 12px var(--mono); color: var(--text); letter-spacing: .04em; }
.lock { width: 9px; height: 7px; background: var(--ok); border-radius: 2px; position: relative; margin-top: 4px; }
.lock::before { content: ""; position: absolute; left: 1.5px; bottom: 6px; width: 6px; height: 5px; border: 1.5px solid var(--ok); border-bottom: 0; border-radius: 4px 4px 0 0; box-sizing: border-box; }
#new-room { justify-self: start; }
@media (max-width: 520px) { .room { display: none; } }

/* Drag-into-OBS chips */
.drag {
  display: flex; align-items: center; gap: 10px; width: fit-content; margin: 10px 0 4px; padding: 10px 14px 10px 10px;
  background: var(--raised); border: 1px solid var(--accent); border-radius: var(--radius); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: grab; user-select: none; box-shadow: 0 0 0 4px rgba(124, 108, 255, .12);
}
.drag:active { cursor: grabbing; }
.drag .room-code { color: var(--faint); font-size: 11.5px; margin-left: 4px; }
.grip { width: 10px; height: 16px; background-image: radial-gradient(var(--muted) 1.2px, transparent 1.3px); background-size: 5px 5px; }
.manual { margin: 4px 0 8px; }
.manual summary { cursor: pointer; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.manual[open] summary { color: var(--text); }

/* Audio panel */
.audio { display: grid; gap: 4px; margin: -4px -4px 18px; padding: 4px 4px 16px; border-bottom: 1px solid var(--line); }
.audio-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 2px; }
.audio-row > span:first-child { display: grid; min-width: 0; }
label.audio-row { cursor: pointer; }
.a-title { font-weight: 500; font-size: 14px; }
.a-sub { font-size: 12.5px; color: var(--faint); }
/* A percentage here resolves against a shrink-to-fit parent, which clamps the box to nothing. */
.audio-row select { width: auto; max-width: 280px; height: 36px; font-size: 13.5px; }
.voice-ctl select { min-width: 176px; } /* fits "Match the stranger" */
.small-btn { height: 34px; font-size: 13px; padding: 0 12px; flex: none; }
.voice-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.colors, .checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.colors label, .checks label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.colors input[type="color"] { width: 34px; height: 28px; padding: 2px; border-radius: 7px; cursor: pointer; }
.checks input { accent-color: var(--accent); width: 15px; height: 15px; }
.strip .cap { overflow: hidden; }
.drag.copied::after { content: "Link copied"; font-weight: 500; font-size: 12px; color: var(--ok); margin-left: 6px; }

textarea { font: inherit; color: var(--text); width: 100%; min-height: 110px; padding: 10px 14px; resize: vertical;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius); outline: none; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 108, 255, .22); }
.field-note { font-size: 12.5px; color: var(--faint); }
dialog { max-height: calc(100vh - 32px); overflow: auto; }

/* Each audio source: what it is now, and the one button that changes it */
.src-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.src-ctl select { max-width: 280px; }
/* A source that is set reads as set, rather than as another grey line */
.a-sub.set { color: var(--muted); }
/* Live-only audio controls */
.live-only { display: flex; align-items: center; gap: 10px; }
.audio-row.live-only { display: none; }
body.is-live .audio-row.live-only { display: flex; }

/* Recent sessions: date, length, size, download */
.logs { margin-top: 22px; border-top: 1px solid var(--line); }
.admin .logs { margin-top: 0; border-top: 0; }
.log { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 14px; padding: 9px 2px; font-size: 13.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.log span:nth-child(2), .log span:nth-child(3) { font: 500 12.5px var(--mono); color: var(--faint); }
@media (max-width: 600px) { .log { grid-template-columns: 1fr auto; gap: 6px 12px; } }

.learned { font-size: 13.5px; color: var(--muted); }
.learned .small { margin: 0 0 0 8px; height: 28px; }

/* ---------- Account: sign in, balance, top-ups ---------- */
/* The setup page hides itself until sign in resolves. The admin page has its own gate,
   a 403 from /api/admin, and never sets this class, so it must be excluded. */
body:not(.signed-in):not(.admin-page):not(.doc-page) .app,
body:not(.signed-in):not(.admin-page):not(.doc-page) .top-right { display: none; }
body:not(.is-admin) #open-admin { display: none; }
body:not(.can-buy) #open-buy { display: none; }

.signin { display: grid; place-items: center; padding: 8vh 16px; }
.signin .panel { width: 100%; max-width: 420px; display: grid; gap: 18px; padding: 28px 28px 24px; }
.signin h1 { margin: 0; }
.signin .big { width: 100%; }
.signin #in-again { width: 100%; margin-top: 10px; }
.signin .fine { margin: 0; font-size: 13px; color: var(--faint); text-align: center; }
.signin .field { margin-bottom: 14px; }
#in-code { font: 500 22px/1.2 var(--mono); letter-spacing: .32em; text-align: center; }

.chip { height: auto; font: 500 13px var(--mono); color: var(--muted); background: var(--raised);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 13px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.low { color: var(--bad); border-color: var(--bad); }

#buy { min-width: 340px; }
.packs { display: grid; gap: 10px; margin: 6px 0 4px; }
.pack { display: block; width: 100%; text-align: left; padding: 13px 16px 14px;
  background: var(--raised); color: var(--text); height: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.pack:hover { border-color: var(--accent); }
.pack-in { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; }
.pack-h { font-size: 17px; font-weight: 600; }
.pack-p { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pack-r { grid-column: 1 / -1; margin-top: 3px; font-size: 12.5px; color: var(--faint); }

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 1fr; gap: 20px; }
.invites { display: flex; flex-wrap: wrap; gap: 8px; }
.invite { font: 500 13px var(--mono); background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.invite:hover { border-color: var(--accent); }
.invite.copied { color: var(--ok); border-color: var(--ok); }
table.users { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.users th { text-align: left; font-weight: 500; color: var(--faint); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
table.users td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
table.users td:first-child { color: var(--text); }
table.users tr.off td { opacity: .45; }
table.users select { height: 30px; padding: 0 6px; font-size: 13px; }
table.users .acts { display: flex; gap: 6px; justify-content: flex-end; }
table.users .acts .small { height: 28px; margin: 0; }
@media (max-width: 720px) { table.users th:nth-child(6), table.users td:nth-child(6) { display: none; } }
body.legacy #balance, body.legacy #open-buy { display: none; }

/* ---------- Admin dashboard ---------- */
.admin { max-width: 1460px; display: grid; grid-template-columns: 1fr; gap: 20px; }
/* .panel carries no padding of its own; every page sets its own rhythm. */
.admin .panel { padding: 18px 22px 22px; }
.admin .preview-head { margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-label { display: block; font-size: 13px; color: var(--faint); }
.stat-big { display: block; font: 600 30px/1.2 var(--sans); margin: 4px 0 12px; }
.stat-rows { margin: 0; display: grid; gap: 4px; font-size: 13px; }
.stat-rows div { display: flex; justify-content: space-between; }
.stat-rows dt { color: var(--faint); }
.stat-rows dd { margin: 0; font: 500 13px var(--mono); }
.good { color: var(--ok); }
.bad { color: var(--bad); }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 4px; }
.chart .bar { flex: 1; min-height: 3px; height: var(--h); background: var(--accent); border-radius: 3px 3px 0 0; opacity: .8; }
.chart .bar[style*="--h:0%"] { background: var(--line-strong); }
.chart .bar:hover { opacity: 1; }

.scroll { overflow-x: auto; }
table.users .live-dot { margin-right: 7px; }
table.users code { font: 500 12px var(--mono); color: var(--muted); }


.who .preview-head { margin-bottom: 14px; }


.admin .field-row { align-items: flex-end; gap: 12px; }
.admin .field-row .field { margin-bottom: 0; }
.admin .field-row button { flex: none; }
table.users .name { height: 30px; padding: 0 8px; font-size: 13.5px; width: 100%; max-width: 190px;
  background: transparent; border-color: transparent; }
table.users .name:hover { border-color: var(--line-strong); }
table.users .name:focus { background: var(--raised); border-color: var(--accent); }
#sx-out .log { grid-template-columns: auto 1fr auto 1fr; }

/* The look panel's close button, and room for it beside the console on a wide screen. */
.fold { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 7px;
  background: transparent; border: 0; color: var(--faint); cursor: pointer; }
.fold::before { content: "\00d7"; font-size: 19px; line-height: 1; }
.fold:hover { color: var(--text); background: var(--raised); }
@media (min-width: 1240px) {
  body.look-open .app { margin-right: 372px; transition: margin-right .18s ease-out; }
}

/* Which streaming app: every OBS fork has a Browser Source, so only the OBS Studio extras differ. */
.apps { display: flex; gap: 6px; margin: 0 0 22px; padding: 4px; width: fit-content;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 999px; }
.apps button { height: 32px; padding: 0 16px; font-size: 13px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); }
.apps button.on { background: var(--accent); color: #fff; font-weight: 600; }
.apps button:hover:not(.on) { color: var(--text); }
.slobs-only { display: none; }
body.slobs .obs-only { display: none; }
body.slobs .slobs-only { display: grid; }

/* ---------- Console polish ---------- */
/* Both halves end on the same line, and each caption strip sits at the bottom of its panel,
   so the two previews line up however many controls are above them. */
.pair { align-items: stretch; }
.who { display: flex; flex-direction: column; }
.who .strip, .who #guest-preview { margin-top: auto; }
.who #guest-preview .strip { margin-top: 14px; }

/* Start is one control, not a banner. */

.done-acts { display: flex; gap: 4px; }

/* Recent sessions: header, rows, nothing floating. */


/* ---------- A setup card per column ---------- */
/* Each side's instructions sit above the panel they are about, and fold away on their own
   once that overlay is in the scene. */
.col { display: grid; gap: 18px; align-content: start; }
.card { overflow: hidden; }
.setup-bar { display: flex; align-items: center; justify-content: space-between; width: 100%;
  height: auto; padding: 13px 18px; background: transparent; border: 0; border-radius: 18px;
  font-size: 13px; color: var(--faint); cursor: pointer; text-align: left; }
.setup-bar:hover { color: var(--muted); }
.setup-bar .tick { background: var(--line-strong); flex: none; }
.setup-bar .tick::after { border-color: var(--faint); }
.card.ready .setup-bar .tick { background: rgba(62, 207, 142, .16); }
.card.ready .setup-bar .tick::after { border-color: var(--ok); }
.chev { width: 7px; height: 7px; flex: none; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-bottom: 3px; transition: transform .18s; }
.card.open .chev { transform: rotate(-135deg); margin: 3px 0 0; }
.card-body { padding: 4px 20px 20px; }
.card-body .steps { margin-bottom: 18px; }
.card-body .steps:last-child, .card-body .manual:last-child { margin-bottom: 0; }
.card-body .apps { margin-bottom: 18px; }
.card-body .wait { margin-bottom: 0; }
/* The columns no longer stretch as one block; each stacks its own cards. */
.pair { align-items: start; }
.who { flex: 1; }

/* ---------- Columns that line up ---------- */
/* Two independent stacks meant nothing matched across them. One grid, with each card placed in
   a named row, so the setup cards share a row and the live panels start on the same line. */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.col { display: contents; }
.col:first-child > .card { grid-column: 1; grid-row: 1; }
.col:first-child > .who { grid-column: 1; grid-row: 2; }
.col:last-child > .card { grid-column: 2; grid-row: 1; }
.col:last-child > .who { grid-column: 2; grid-row: 2; }
/* A folded card is a bar, so it keeps its own height; two open ones match each other. */
.card { align-self: start; }
.card.open { align-self: stretch; }
@media (max-width: 900px) {
  .pair { grid-template-columns: 1fr; }
  .col > .card, .col > .who { grid-column: 1 !important; grid-row: auto !important; }
}

/* ---------- Recent sessions ---------- */
.history { padding: 16px 20px 18px; }
.history .preview-head { margin-bottom: 4px; }
.history .preview-head .small { margin: 0; }
.history .logs { margin-top: 0; border-top: 0; }
.log { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px;
  padding: 10px 0; font-size: 13.5px; color: var(--text); border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: 0; padding-bottom: 0; }
.log-when { color: var(--text); }
.log-meta { font: 500 12.5px var(--mono); color: var(--faint); }
.log .small { margin: 0; height: 30px; padding: 0 12px; }
@media (max-width: 600px) { .log { grid-template-columns: 1fr auto; gap: 4px 12px; } .log .small { grid-row: 1 / 3; } }

/* The colour row keeps its reset out of the way until a colour has actually been changed. */
.colors #reset-colors { margin: 0; height: 28px; padding: 0 10px; font-size: 12.5px; }

/* ---------- Toast ---------- */
/* Status floats in the middle, below the nav, and fades on its own. Click to dismiss early. */
.toast { position: fixed; top: 84px; left: 50%; z-index: 60; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 12px; font-size: 14px; line-height: 1.45; color: var(--text);
  background: rgba(24, 24, 28, .96); border: 1px solid rgba(248, 113, 113, .45);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .55); backdrop-filter: blur(8px); cursor: pointer;
  opacity: 0; pointer-events: none; transform: translate(-50%, -8px); transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }

/* A setup card holding up the stream pulses until its source arrives. */
.card.needs { border-color: rgba(248, 113, 113, .55); animation: needs 1.6s ease-in-out infinite; }
.card.needs .setup-bar { color: var(--text); }
@keyframes needs { 0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .0); } 50% { box-shadow: 0 0 0 5px rgba(248, 113, 113, .16); } }

/* ---------- A tighter captions rail ---------- */
.look { padding: 12px 16px 16px; }
.look .preview-head { margin-bottom: 8px; }
.look-grid { grid-template-columns: 1fr 1fr; gap: 0 10px; }
.look .field { gap: 5px; margin-bottom: 10px; }
.look .label { font-size: 12px; }
.look select { height: 36px; padding: 0 10px; font-size: 13.5px; }
.look .colors { gap: 8px 14px; margin-top: 2px; }
.look .colors input[type="color"] { width: 30px; height: 24px; }
.look .checks { gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.look .checks label { font-size: 13px; }

/* ---------- Admin: switches, room rows, side by side ---------- */
.toggle-mini { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.toggle-mini .switch { width: 34px; height: 20px; }
.toggle-mini .switch span::after { width: 14px; height: 14px; }
.toggle-mini .switch input:checked + span::after { transform: translateX(14px); }
table.users .acts { align-items: center; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }

.room-row { display: grid; grid-template-columns: 1.1fr 1.1fr .7fr .8fr .6fr .9fr; gap: 12px; align-items: center;
  padding: 10px 0; font-size: 13.5px; color: var(--text); border-bottom: 1px solid var(--line); }
.room-row:last-child { border-bottom: 0; }
.room-row.head { padding-top: 0; font-size: 12px; color: var(--faint); }
.room-row code { font: 500 12.5px var(--mono); color: var(--muted); }
@media (max-width: 720px) { .room-row { grid-template-columns: 1fr 1fr 1fr; } .room-row > :nth-child(n+4) { display: none; } }

/* ---------- Plain document pages (privacy) ---------- */
.doc { max-width: 640px; margin: 0 auto; padding: 40px 24px 96px; }
.doc h1 { font-size: 34px; margin-bottom: 10px; }
.doc .lead { font-size: 17px; color: var(--muted); margin: 0 0 36px; }
.doc section { padding: 22px 0; border-top: 1px solid var(--line); }
.doc h2 { font-size: 16px; margin: 0 0 8px; }
.doc p { margin: 0 0 10px; color: var(--muted); line-height: 1.65; }
.doc p:last-child { margin-bottom: 0; }
.doc a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--accent); }
a.brand { color: var(--text); text-decoration: none; }

/* Links inside small print read as links, without shouting. */
.fine a, .learned a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.fine a:hover, .learned a:hover { color: var(--text); }

/* On a phone the nav wraps rather than pushing Admin and Settings off the edge. */
.brand { white-space: nowrap; }
@media (max-width: 600px) {
  .top { flex-wrap: wrap; row-gap: 8px; padding: 10px 14px; }
  .top-right { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; column-gap: 4px; }
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.brand .mark { width: 24px; height: 24px; flex: none; }
.brand-sub { color: var(--faint); font-weight: 500; }

/* ---------- FAQ ---------- */
/* Below the console when signed in, under the sign in card when not. Plain details elements, so the
   answers are in the page for crawlers that run no JavaScript. */
.faq { max-width: 760px; margin: 0 auto; padding: 24px 24px 96px; }
.faq h2 { font-size: 20px; margin: 0 0 14px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 28px 16px 2px; position: relative;
  font-weight: 500; color: var(--text); font-size: 15px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 20px; font-weight: 400; transition: transform .18s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item summary:hover { color: var(--accent-hover); }
.faq-item p { margin: 0 2px 18px; color: var(--muted); line-height: 1.65; font-size: 14.5px; }
.faq-item a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
@media (max-width: 600px) { .faq { padding: 16px 16px 72px; } }
