/*
 * Podcast Rooms — the guest page (resources/views/podcast/guest.blade.php; the .NET port serves a
 * byte-for-byte copy). No inline styles anywhere (strict CSP). Light and warm by default — a calm
 * "green room" — with a refined dark variant from prefers-color-scheme. Contrast checked for WCAG AA
 * in both. Mobile-first: guests mostly join on phones, many inside the iOS app's WKWebView.
 *
 * The centrepiece is the studio light (#on-air): a light box that reads OFF AIR (unlit), STAND BY
 * (amber, the host's countdown) or ON AIR (red, glowing; a slow pulse only without reduced motion).
 */
:root {
  color-scheme: light;
  --bg: #f6f1ea; --bg-glow: #fffaf3; --panel: #ffffff; --panel-2: #faf6f0; --line: #e9e1d6; --line-strong: #d2c7b9;
  --text: #221c18; --muted: #5f564d; --soft: #6e645a;
  --primary: #1d6b57; --primary-hover: #17594a; --primary-ink: #ffffff; --primary-soft: #e5f1ec; --primary-line: #9cc9b9;
  --focus: #1d6b57;
  --ok: #17803d; --warn: #8f5600; --bad: #b42318; --bad-soft: #fdeceb; --bad-line: #e9a8a2;
  --amber-soft: #fff4dc; --amber-line: #e6b24c; --amber-ink: #6b4200;
  --input: #ffffff; --input-line: #b9ad9f;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px rgba(60, 40, 20, .07);
  /* The sign */
  --housing: #2c2521; --housing-line: #463b35;
  --face-off-1: #f2ede6; --face-off-2: #e2dbd1; --ink-off: #625a52;
  --face-on-1: #dc2626; --face-on-2: #b91c1c; --ink-on: #ffffff; --glow: rgba(239, 68, 68, .45);
  --face-sb-1: #fcd34d; --face-sb-2: #f59e0b; --ink-sb: #3b2500;
  --stage: #0b0d12;
  --radius: 18px; --radius-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #171411; --bg-glow: #221d18; --panel: #1f1b17; --panel-2: #26211c; --line: #362f28; --line-strong: #4b4239;
    --text: #f4efe8; --muted: #bdb2a6; --soft: #a69b8f;
    --primary: #5fc7a5; --primary-hover: #7ad3b5; --primary-ink: #0c1f19; --primary-soft: #1c3029; --primary-line: #2f6b58;
    --focus: #7ad3b5;
    --ok: #5ad48a; --warn: #f2c14e; --bad: #ff8a80; --bad-soft: #3a1a17; --bad-line: #7a332c;
    --amber-soft: #2e2412; --amber-line: #8a6420; --amber-ink: #f6d58c;
    --input: #171411; --input-line: #6a5f54;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --housing: #0c0a09; --housing-line: #3d352e;
    --face-off-1: #2c2622; --face-off-2: #231e1a; --ink-off: #aa9e91;
    --glow: rgba(248, 72, 72, .55);
  }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow), var(--bg) 60%) no-repeat, var(--bg);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* iOS Safari keeps the layout height with the keyboard up: room to scroll the composer above it. */
  padding-bottom: var(--pod-kb, 0px);
}
main.pod {
  max-width: 680px; margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}
h1 { font-size: clamp(1.55rem, 5.4vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 750; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 .5em; }
h3 { font-size: 1rem; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
a { color: var(--primary); text-underline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Headings focused by script (screen readers land there) need no ring: they are not controls. */
[tabindex="-1"]:focus { outline: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin: 16px 0; min-width: 0; }
.card.center { text-align: center; }
.card > :last-child, .panel > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- the studio light */
.on-air { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px auto 22px; }
.on-air-sign {
  display: inline-flex; padding: 6px; border-radius: 16px; background: var(--housing);
  border: 1px solid var(--housing-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 6px 16px rgba(30, 20, 10, .18);
  transition: box-shadow .4s ease;
}
.on-air-word {
  display: block; min-width: 11.5rem; padding: 12px 26px; border-radius: 11px; text-align: center;
  font: 800 1.65rem/1.1 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap; color: var(--ink-off);
  background: linear-gradient(180deg, var(--face-off-1), var(--face-off-2));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .12);
  transition: background .4s ease, color .4s ease, text-shadow .4s ease;
}
.on-air[data-state="live"] .on-air-word {
  color: var(--ink-on); background: linear-gradient(180deg, var(--face-on-1), var(--face-on-2));
  text-shadow: 0 0 10px rgba(255, 255, 255, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.on-air[data-state="live"] .on-air-sign { box-shadow: 0 0 0 1px rgba(239, 68, 68, .35), 0 0 30px 6px var(--glow), 0 6px 16px rgba(30, 20, 10, .2); }
.on-air[data-state="countdown"] .on-air-word {
  color: var(--ink-sb); background: linear-gradient(180deg, var(--face-sb-1), var(--face-sb-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.on-air[data-state="countdown"] .on-air-sign { box-shadow: 0 0 22px 2px rgba(245, 158, 11, .35), 0 6px 16px rgba(30, 20, 10, .2); }
.on-air-caption { color: var(--muted); font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.on-air-caption[data-state="live"] { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .on-air[data-state="live"] .on-air-sign { animation: on-air-glow 2.6s ease-in-out infinite; }
}
@keyframes on-air-glow {
  50% { box-shadow: 0 0 0 1px rgba(239, 68, 68, .25), 0 0 16px 2px var(--glow), 0 6px 16px rgba(30, 20, 10, .2); }
}

/* ---------------------------------------------------------------- the show */
.show { display: flex; gap: 16px; align-items: center; }
.show-text { min-width: 0; flex: 1; }
.brand-art { width: 88px; height: 88px; border-radius: 16px; object-fit: cover; flex: none; background: var(--panel-2); box-shadow: 0 4px 14px rgba(60, 40, 20, .15); }
.invite { margin: 0 0 4px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.host-line { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.brand-text { margin: 8px 0 0; color: var(--muted); }
.lede { margin: 8px 0 0; color: var(--muted); }
.scheduled-title { margin: 8px 0 0; font-weight: 650; }
.pod-head { margin-bottom: 4px; }
.pod-foot { margin: 28px 0 0; text-align: center; color: var(--soft); font-size: .8rem; }
@media (max-width: 520px) {
  .show { align-items: flex-start; }
  .brand-art { width: 68px; height: 68px; border-radius: 14px; }
  .on-air-word { min-width: 10rem; padding: 10px 20px; font-size: 1.4rem; }
}

/* ---------------------------------------------------------------- forms */
label { display: block; margin-bottom: 14px; }
label > span { display: block; margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=search], input:not([type]), select {
  font: inherit; font-size: 16px; /* 16 px: iOS does not zoom the page when the field is focused */
  width: 100%; min-height: 48px; border: 1px solid var(--input-line); border-radius: var(--radius-sm); padding: 10px 14px;
  background: var(--input); color: var(--text);
}
input::placeholder { color: var(--soft); opacity: 1; }
input.code { font-size: 1.7rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--primary); }
button, .button {
  font: inherit; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
}
button:hover, .button:hover { background: var(--panel-2); }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.danger { color: var(--bad); border-color: var(--bad-line); }
button.danger:hover { background: var(--bad-soft); }
button.block { display: flex; width: 100%; min-height: 52px; font-size: 1.05rem; }
button:disabled { opacity: .6; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.actions.center { justify-content: center; }
.error { color: var(--bad); font-weight: 600; margin: 0 0 12px; }
.error:empty { display: none; }

.code-form .muted { margin-top: -6px; }

/* Who you are: the live avatar preview beside the name and the photo button. */
.join-you { display: flex; gap: 16px; align-items: flex-start; }
.join-you-fields { flex: 1; min-width: 0; }
.join-you-fields label { margin-bottom: 10px; }
.join-you .avatar { --size: 84px; margin-top: 4px; box-shadow: 0 0 0 4px var(--panel), 0 0 0 5px var(--line-strong); }
.photo-toggle { min-height: 44px; padding: 8px 14px; font-size: .95rem; border-style: dashed; background: var(--panel-2); }
.photo-toggle[aria-expanded="true"] { border-style: solid; }
.photo-field { margin: -6px 0 18px; padding: 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
.photo-pick { position: relative; display: inline-flex; margin: 0; }
.photo-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-pick-text {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong); color: var(--text); font-weight: 600; background: var(--panel-2);
}
.photo-pick:hover .photo-pick-text { border-color: var(--primary); }
.photo-pick:focus-within .photo-pick-text { outline: 3px solid var(--focus); outline-offset: 2px; }
#photo-help { margin: 8px 0 0; }
.join-you { margin-bottom: 18px; }
.pin-field input { max-width: 14rem; letter-spacing: .2em; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.mic-check { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin: 4px 0 16px; }
.mic-check legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-weight: 700; font-size: 1.05rem; }
.mic-check legend + * { clear: both; }
.mic-check .actions { margin-top: 4px; }
#mic-check-body { margin-bottom: 10px; }
.verdict { margin: 6px 0 0; font-weight: 650; min-height: 1.5em; }
.verdict[data-v="mic_check_good"] { color: var(--ok); }
.verdict[data-v="mic_check_silent"], .verdict[data-v="mic_check_loud"] { color: var(--warn); }
#hear-self[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary-line); }
.device-fields { display: grid; gap: 4px; margin-top: 12px; }
.device-fields label { margin-bottom: 8px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { flex: none; margin: 1px 0 0; }
label.check span { margin: 0; font-weight: 400; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: .9rem; font-weight: 600; padding: 10px 0; width: fit-content; min-height: 44px; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; font-size: .8em; transition: transform .15s ease; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more[open] > summary { margin-bottom: 4px; }

.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin: 0 0 16px; border: 1px solid var(--amber-line); border-radius: var(--radius-sm); background: var(--amber-soft); cursor: pointer; }
.consent input { flex: none; margin: 1px 0 0; }
.consent span { margin: 0; font-weight: 500; }
.turnstile { margin: 0 0 14px; min-height: 65px; display: flex; justify-content: center; }
#join-button { margin-bottom: 12px; }

/* Level meters */
.meter { position: relative; height: 14px; border-radius: 7px; background: var(--line); overflow: hidden; margin: 10px 0 6px; }
.meter > span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 7px; background: linear-gradient(90deg, #1d8a5f, #3cc47c 70%, #f2b233 88%, #e5484d); transition: width .06s linear; }

/* Avatar disc: a photo, or initials on a palette colour. */
.avatar { --size: 96px; position: relative; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * .36); color: #fff; overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--ok); opacity: 0; transform: scale(1); transition: opacity .08s linear, transform .08s linear; pointer-events: none; }
.avatar.small { --size: 44px; }
.pal-0 { background: #4353c9; } .pal-1 { background: #c0392b; } .pal-2 { background: #1f7a52; }
.pal-3 { background: #9a5a00; } .pal-4 { background: #7d3c98; } .pal-5 { background: #0f6f78; }

/* ---------------------------------------------------------------- waiting room */
.waiting h2, #waiting h2 { display: flex; align-items: center; gap: 12px; }
.waiting-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
@media (prefers-reduced-motion: no-preference) { .waiting-dot { animation: pod-breathe 2.4s ease-in-out infinite; } }
@keyframes pod-breathe { 50% { box-shadow: 0 0 0 9px transparent; opacity: .55; } }
.welcome { margin: 4px 0 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); border-left: 4px solid var(--primary); }
.welcome-label { margin: 0 0 4px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.welcome #welcome { margin: 0; }
.waiting-row { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; padding: 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
.waiting-row .tiles { flex: 0 0 150px; margin: 0; }
.waiting-row .tile { background: transparent; border: 0; padding: 4px; }
.waiting-meter { flex: 1 1 180px; min-width: 0; }
.waiting-meter p { margin: 0; }
.next { margin: 20px 0 16px; }
.next-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.next-steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; color: var(--muted); }
.next-steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--text); font-weight: 700; font-size: .85rem; border: 1px solid var(--primary-line); }
#waiting .actions { margin-top: 8px; }
/* Waiting while the show is already live: "until the show goes live…" no longer applies. */
.pod:has(.on-air[data-state="live"]) .next-steps li:nth-child(n+2) { display: none; }
/* After the room: no invitation, no "not live yet" — the end screen says what happened. */
.pod[data-view="ended"] .invite, .pod[data-view="ended"] .on-air-caption { display: none; }

/* ---------------------------------------------------------------- tiles (waiting tile, no-JS fallback renderer) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin: 0; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); text-align: center; min-width: 0; }
.tile .name { font-weight: 650; overflow-wrap: anywhere; }
.tile .flag { font-size: .8rem; color: var(--warn); }
.tile.me .avatar { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--primary); }
/* The voice-presence renderer (public/js/podcast-renderer.js): one canvas, the program's own look. */
.tiles.vp-tiles { display: block; }
.vp-room { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--stage); }
.stage .vp-room { max-height: 68vh; box-shadow: 0 10px 30px rgba(30, 20, 10, .18); }
@media (max-width: 600px) and (orientation: portrait) { .stage .vp-room { aspect-ratio: 4 / 5; max-height: 58vh; } }

/* ---------------------------------------------------------------- in the room */
/* The header shrinks to one line so the stage gets the screen: art · title · the sign. */
.pod[data-view="room"] { max-width: 1180px; }
.pod[data-view="room"] .pod-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pod[data-view="room"] .show { flex: 1; min-width: 0; order: 1; }
.pod[data-view="room"] .on-air { order: 2; margin: 0; gap: 4px; flex: none; }
.pod[data-view="room"] .on-air-sign { padding: 4px; border-radius: 11px; }
.pod[data-view="room"] .on-air-word { min-width: 0; padding: 7px 14px; border-radius: 8px; font-size: 1rem; letter-spacing: .12em; }
.pod[data-view="room"] .on-air-caption { font-size: .8rem; }
.pod[data-view="room"] .brand-art { width: 48px; height: 48px; border-radius: 12px; }
.pod[data-view="room"] h1 { font-size: clamp(1.1rem, 3.6vw, 1.5rem); }
.pod[data-view="room"] .invite, .pod[data-view="room"] .brand-text, .pod[data-view="room"] .host-line { display: none; }
.pod[data-view="room"] .show { align-items: center; }
@media (min-width: 960px) {
  .pod[data-view="room"] .on-air-word { padding: 9px 20px; font-size: 1.2rem; }
  .pod[data-view="room"] .on-air-caption { font-size: .85rem; }
}

.room { display: grid; gap: 16px; }
.room-main { min-width: 0; }
.room-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 960px) {
  .room { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}
.room-status { margin: 10px 2px 0; font-size: .9rem; }
.status { font-variant-numeric: tabular-nums; color: var(--muted); }
.status::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--soft); vertical-align: 1px; }
.status[data-state="ok"]::before { background: var(--ok); }
.status[data-state="warn"]::before { background: #e0a100; }
.status[data-state="bad"]::before { background: var(--bad); }
.status[data-state="bad"] { color: var(--bad); }
.notice { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--primary-line); background: var(--primary-soft); color: var(--text); }
.notice.warn { border-color: var(--amber-line); background: var(--amber-soft); color: var(--text); }
.nudge { margin: 10px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); background: #f2c14e; color: #1b1405; font-weight: 700; text-align: center; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0 0; }
.ctl { position: relative; flex-direction: column; gap: 3px; min-width: 84px; min-height: 64px; padding: 8px 12px; font-size: .85rem; font-weight: 650; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.ctl .ctl-icon { font-size: 1.3rem; line-height: 1; min-height: 1.3rem; }
.ctl kbd { position: absolute; top: 5px; right: 7px; font: 700 .65rem/1 system-ui, sans-serif; color: var(--soft); }
.ctl-mute .ctl-icon::before { content: "🎙"; }
.ctl-mute[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.ctl-mute[aria-pressed="true"] kbd { color: #fff; }
.ctl-mute[aria-pressed="true"] .ctl-icon::before { content: "🔇"; }
#hand[aria-pressed="true"] { background: var(--amber-soft); border-color: var(--amber-line); }
.ctl[aria-expanded="true"] { background: var(--primary-soft); border-color: var(--primary-line); }
.ctl.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.ctl.danger { color: var(--bad); border-color: var(--bad-line); }
.ctl.danger .ctl-icon { filter: saturate(.6); }
.badge { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--panel); }
@media (prefers-color-scheme: dark) { .ctl-mute[aria-pressed="true"], .badge { background: #c42b20; border-color: #c42b20; } }
@media (max-width: 600px) {
  .controls {
    position: sticky; bottom: 0; z-index: 5; margin: 12px -16px 0; gap: 6px;
    padding: 10px max(10px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .ctl { min-width: 0; flex: 1 1 0; padding: 6px 2px; font-size: .75rem; box-shadow: none; }
  .ctl kbd { display: none; }
}

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0; min-width: 0; }
.panel h3 { margin: 0 0 4px; font-size: 1.02rem; }
.room-panels { display: grid; gap: 16px; }
.room-panels:not(:has(> :not([hidden]))) { display: none; }
.chat-log { list-style: none; margin: 10px 0; padding: 0; max-height: 300px; overflow-y: auto; display: grid; gap: 8px; }
.chat-log li { padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: var(--panel-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.chat-log li.mine { background: var(--primary-soft); border-color: var(--primary-line); border-radius: 14px 14px 4px 14px; }
.chat-log .who { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); }
.chat-log .who .role { color: var(--primary); font-weight: 700; margin-left: 6px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; }
.chat-form button { min-width: 72px; }

.people-heading { margin: 0 0 10px; }
.people-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.people-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
.people-list li.speaking { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.people-list .who { min-width: 0; }
.people-list .who strong { display: block; overflow-wrap: anywhere; }
/* Status words under a name: plain text separated by dots, not chips. */
.people-list .tags { display: flex; flex-wrap: wrap; gap: 2px 0; margin-top: 1px; font-size: .8rem; color: var(--muted); }
.tag + .tag::before { content: "·"; margin: 0 6px; color: var(--soft); }
.tag.host { color: var(--primary); font-weight: 700; }
.tag.muted { color: var(--bad); }
.tag.hand { color: var(--warn); font-weight: 700; }
.tag.speaking { color: var(--ok); }
.q-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--soft); flex: none; }
.q-dot[data-quality="good"] { background: var(--ok); }
.q-dot[data-quality="fair"] { background: #e0a100; }
.q-dot[data-quality="poor"] { background: var(--bad); }

/* ---------------------------------------------------------------- go-live countdown over the stage */
.stage-wrap { position: relative; }
.count-overlay {
  position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 14px;
  border-radius: var(--radius); background: radial-gradient(circle at 50% 45%, rgba(20, 12, 8, .72), rgba(8, 6, 5, .9)); color: #fff;
  pointer-events: none; container-type: inline-size;
}
.count-num {
  display: grid; place-items: center; width: min(46cqi, 260px); height: min(46cqi, 260px); border-radius: 50%;
  font: 850 min(30cqi, 170px)/1 system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums;
  background: radial-gradient(circle, rgba(245, 158, 11, .22), rgba(245, 158, 11, 0) 70%);
  border: 6px solid #fbbf24; box-shadow: 0 0 0 12px rgba(251, 191, 36, .22), 0 0 40px rgba(251, 191, 36, .35);
}
.count-caption { font-weight: 800; font-size: 1.1rem; letter-spacing: .1em; text-transform: uppercase; color: #fde68a; }
.count-overlay.is-tick .count-num { animation: pod-pop .85s cubic-bezier(.2, .9, .2, 1); }
@keyframes pod-pop { from { transform: scale(1.35); opacity: .2; } 35% { opacity: 1; } to { transform: scale(1); } }

/* ---------------------------------------------------------------- chat on phones (podcast-chat-ui.js) */
/* Wide screens keep the composer under the log; phones put it on top, newest message right under it
   (the log is newest-first there), so the keyboard only ever covers older chat. */
#chat { display: flex; flex-direction: column; }
#chat .chat-form { order: 3; }
#chat .chat-log { order: 2; }
#chat .error { order: 4; }
@media (max-width: 640px) {
  #chat .chat-form { order: 1; margin-top: 6px; }
  #chat .chat-log { order: 2; max-height: 40vh; }
  #chat .error { order: 1; }
  /* The sticky control bar would float over the field on iOS while typing. */
  html.pod-typing .controls { position: static; }
}

/* ---------------------------------------------------------------- ended / small screens */
#ended h2 { font-size: 1.35rem; }
#ended .actions { margin-top: 6px; }
@media (max-width: 520px) {
  main.pod { padding-top: max(18px, env(safe-area-inset-top)); }
  .card { padding: 18px 16px; border-radius: 16px; }
  .join-you .avatar { --size: 68px; }
  .ctl { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .avatar .ring, .meter > span, .on-air-sign, .on-air-word { transition: none; }
  .count-overlay.is-tick .count-num { animation: none; }
}
