/* REACH Live — "Request to Speak" panel. Uses the site's brand tokens (navy, Inter, white cards on #F5F5F5). */
.speak { max-width: 1200px; margin: 24px auto 0; padding: 0; }
.sp-card { background: #fff; border-radius: 12px; padding: 20px 24px; color: var(--ink); }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sp-title { margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); }
.sp-sub { margin: 4px 0 0; color: var(--faint); font-size: 15px; line-height: 1.5; }
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 800px; padding: 12px 24px; font-weight: 600; font-size: 15px; cursor: pointer; background: var(--navy); color: #fff; min-height: 44px; text-decoration: none; }
.sp-btn:hover { background: #0e3f78; }
.sp-btn:disabled { opacity: .5; cursor: default; }
.sp-btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.sp-btn.ghost:hover { border-color: #adb5bd; background: #fff; }
.sp-btn.danger { background: #fff; color: #b42318; border: 1px solid #f1b8b3; }
.sp-btn.danger:hover { background: #fff5f4; }
.sp-btn svg { width: 18px; height: 18px; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; }
.sp-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.sp-form input, .sp-form select, .sp-chat input, .sp-devices select { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; min-width: 0; width: 100%; }
.sp-form input:focus, .sp-chat input:focus, .sp-devices select:focus { outline: 2px solid var(--navy); outline-offset: 0; }
.sp-modes { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.sp-mode { flex: 1 1 200px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400 !important; }
.sp-mode input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.sp-mode b { display: block; font-weight: 600; }
.sp-mode span { color: var(--faint); font-size: 13px; }
.sp-mode:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }

.sp-media { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; align-items: start; }
.sp-video { position: relative; aspect-ratio: 16 / 9; background: var(--navy-deep); border-radius: 10px; overflow: hidden; }
.sp-video video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.sp-video .sp-novideo { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.75); font-size: 14px; text-align: center; padding: 12px; }
.sp-badge { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 5px 10px; border-radius: 800px; }
.sp-badge.onair { background: #d71920; }
.sp-side { display: flex; flex-direction: column; gap: 12px; }
.sp-meter { height: 8px; background: #e9ecef; border-radius: 8px; overflow: hidden; }
.sp-meter i { display: block; height: 100%; width: 0; background: #198754; transition: width .06s linear; }
.sp-label { font-size: 13px; color: var(--faint); margin: 0 0 6px; }
.sp-devices { display: grid; gap: 8px; }
.sp-devices select { font-size: 14px; padding: 9px 10px; }
.sp-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-tog { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; color: var(--ink); border-radius: 800px; padding: 9px 14px; font-size: 14px; font-weight: 500; cursor: pointer; min-height: 40px; }
.sp-tog[aria-pressed="false"] { background: #fff5f4; border-color: #f1b8b3; color: #b42318; }
.sp-tog svg { width: 16px; height: 16px; }
.sp-tip { font-size: 13px; color: var(--faint); line-height: 1.5; margin: 0; }
.sp-status { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin: 0; }
.sp-dot { width: 10px; height: 10px; border-radius: 50%; background: #adb5bd; flex: none; }
.sp-dot.wait { background: #e0a800; }
.sp-dot.ok { background: #198754; }
.sp-dot.live { background: #d71920; }
.sp-net { font-size: 13px; color: var(--faint); }
.sp-net.poor { color: #b42318; }
.sp-error { color: #b42318; font-size: 14px; margin: 10px 0 0; min-height: 1px; }
.sp-notice { background: #eef4fb; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--ink); margin: 0; }
.sp-notice.warn { background: #fff5f4; color: #b42318; }
.sp-chat { display: flex; flex-direction: column; gap: 8px; }
.sp-msgs { max-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sp-msgs p { margin: 0; padding: 8px 10px; border-radius: 10px; background: #f1f3f5; max-width: 90%; }
.sp-msgs p.me { align-self: flex-end; background: #e7eef8; }
.sp-msgs p b { font-weight: 600; margin-right: 4px; }
.sp-chat form { display: flex; gap: 8px; }
.sp-chat input { font-size: 15px; padding: 9px 12px; }
.sp-chat .sp-btn { padding: 9px 16px; min-height: 40px; }

@media (max-width: 760px) {
  .speak { margin: 16px 12px 0; }
  .sp-card { padding: 18px 16px; }
  .sp-form { grid-template-columns: 1fr; }
  .sp-media { grid-template-columns: 1fr; gap: 14px; }
  .sp-row .sp-btn { width: 100%; }
  .sp-actions .sp-btn { flex: 1 1 auto; }
}
.sp-gap { margin-top: 14px; }
.speak.speak-top { margin: 16px auto; padding: 0 16px; }

/* Speaker panel beside the player while requesting / waiting / live. */
.stage-row { position: relative; z-index: 1; }
.stage-row.with-speak { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 20px; align-items: start; max-width: 1480px; margin: 0 auto; }
.stage-row.with-speak .stage { width: 100%; margin: 0; }
.speak.speak-side { margin: 0; padding: 0; max-width: none; position: sticky; top: 80px; max-height: calc(100svh - 96px); overflow: auto; border-radius: 12px; }
.hero.has-speak { overflow: clip; }
@media (max-width: 999px) {
  .stage-row.with-speak { display: block; }
  /* Phones/tablets: the player stays pinned under the top bar; the panel scrolls underneath it. */
  .stage-row.with-speak .stage { position: sticky; top: 64px; z-index: 5; }
  .speak.speak-side { position: static; max-height: none; overflow: visible; margin-top: 14px; }
}
.speak-side .sp-card { padding: 18px; }
.speak-side .sp-form, .speak-side .sp-media { grid-template-columns: 1fr; gap: 14px; }
.speak-side .sp-actions .sp-btn { flex: 1 1 auto; }
.speak-side .sp-title { font-size: 19px; }
/* Inside the navy hero, restore the light card colours (the hero redefines them for white-on-navy text). */
.speak-side { --text: var(--ink); --muted: #5a607f; --faint: #6c757d; --line: var(--border); color: var(--ink); text-align: left; }
.speak-side .sp-mode { flex-direction: row; }
.speak-side .sp-video { max-height: 190px; aspect-ratio: auto; height: 190px; }
.hero.has-speak { padding-top: 14px; }
.hero.has-speak .speak-side { top: 76px; max-height: calc(100svh - 90px); }
@media (max-width: 999px) { .hero.has-speak .speak-side { max-height: none; } }

/* Fullscreen player: request button and speaker panel as overlays inside it. */
.sp-fs-request { position: absolute; top: 14px; right: 14px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 800px; padding: 10px 18px; background: var(--navy); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.sp-fs-request svg { width: 18px; height: 18px; }
.sp-fs-request[hidden] { display: none; }
.stage.idle .sp-fs-request { opacity: .85; }
.stage > .speak.speak-fs { position: absolute; top: 14px; right: 14px; bottom: 14px; width: min(400px, 92%); margin: 0; padding: 0; max-width: none; overflow: auto; z-index: 31; border-radius: 12px; cursor: auto; --text: var(--ink); --muted: #5a607f; --faint: #6c757d; --line: var(--border); color: var(--ink); text-align: left; }
.stage > .speak.speak-fs .sp-card { padding: 18px; min-height: 100%; }
.speak-fs .sp-form, .speak-fs .sp-media { grid-template-columns: 1fr; gap: 14px; }
.speak-fs .sp-mode { flex-direction: row; }
.speak-fs .sp-video { height: 170px; aspect-ratio: auto; }
.speak-fs .sp-actions .sp-btn { flex: 1 1 auto; }
@media (max-width: 700px), (max-height: 500px) {
  .stage > .speak.speak-fs { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 60%; }
}
@media (max-height: 500px) and (min-width: 701px) {
  .stage > .speak.speak-fs { left: auto; top: 8px; max-height: none; width: min(360px, 50%); }
}
/* iPhone: full-window player instead of native video fullscreen, so overlays can show. */
.hero .stage.pseudo-fs, .stage.pseudo-fs { position: fixed !important; inset: 0; width: 100vw !important; height: 100vh; height: 100dvh; max-width: none; max-height: none; aspect-ratio: auto; margin: 0; z-index: 1000; border-radius: 0; border: 0; box-shadow: none; }
html.sp-pseudo-fs, html.sp-pseudo-fs body { overflow: hidden; }

/* Clean speaker panel (v6): preview, a row of buttons, settings tucked away. */
.speak .sp-media, .speak-side .sp-media, .speak-fs .sp-media { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 14px; }
.sp-video .sp-vmeter { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 5px; background: rgba(255,255,255,.25); border-radius: 5px; }
.sp-video .sp-vmeter i { background: #22c55e; }
.sp-bar { display: flex; gap: 8px; align-items: center; }
.sp-bar .sp-tog { flex: 1 1 auto; justify-content: center; }
.sp-bar .sp-gear { flex: 0 0 auto; width: 44px; padding: 0; justify-content: center; }
.sp-tog svg { width: 18px; height: 18px; flex: none; }
.sp-gear[aria-expanded="true"] { background: #eef4fb; border-color: var(--navy); color: var(--navy); }
.sp-settings { display: grid; gap: 10px; padding: 12px; background: #f6f8fb; border-radius: 10px; }
.sp-settings label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--faint); }
.sp-settings select { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; min-width: 0; width: 100%; }
.sp-net { font-size: 13px; }
.sp-net.good, .sp-net.unknown, .sp-net:empty { display: none; }
.sp-net.fair, .sp-net.poor { display: block; padding: 8px 10px; border-radius: 8px; background: #fff3cd; color: #664d03; }
.sp-link { background: none; border: 0; padding: 4px 0; margin-top: 10px; color: var(--navy); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.sp-label { margin: 0; }

/* Request to Speak in REACH red so nobody misses it. */
.speak [data-act="open"], .sp-fs-request { background: #d71920; border-color: #d71920; color: #fff; }
.speak [data-act="open"]:hover, .sp-fs-request:hover { background: #b5141a; border-color: #b5141a; }
.speak [data-act="open"]:focus-visible, .sp-fs-request:focus-visible { outline: 3px solid rgba(215,25,32,.35); outline-offset: 2px; }

/* Phones: keep the white card and its text, but compact. */
@media (max-width: 760px) {
  .speak.speak-top:has(.sp-idle) { margin: 8px auto; padding: 0 12px; }
  .speak-top .sp-idle { padding: 12px 14px; border-radius: 12px; }
  .speak-top .sp-idle .sp-row { gap: 10px; }
  .speak-top .sp-idle .sp-title { font-size: 16px; line-height: 1.25; margin: 0; }
  .speak-top .sp-idle .sp-sub { font-size: 13px; line-height: 1.35; margin: 2px 0 0; }
  .speak-top .sp-idle .sp-btn { width: 100%; min-height: 40px; padding: 8px 16px; font-size: 15px; }
}

.speak .sp-tip { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: #eef4fb; color: #114B8D; font-size: 13px; font-weight: 600; }
