@font-face { font-family: Proxima; src: url('./brand/ProximaNova-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Proxima; src: url('./brand/ProximaNova-Semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Suisse; src: url('./brand/SuisseIntl-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
/* One dark room: graphite surfaces, white type, brand red only for "live"
   and the main action. Waiting artwork blends into the same dark surface. */
:root {
  --bg: #111113; --surface: #1b1b1e; --surface-2: #26262a; --surface-3: #313136;
  --ink: #f4f4f6; --muted: #9a9aa5; --dark: #17171b; --red: #e71932; --red-hover: #ff2a45; --live: #ff3d55;
  --glass: #111113a6; --focus: #fff; --radius: 28px; --sidebar: 360px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Proxima, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1,h2,p { margin: 0; }
h1,h2 { font-family: Suisse, Arial, sans-serif; font-weight: 500; letter-spacing: -.03em; }
button,input,textarea { font: inherit; }
button,a,input,textarea { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 600; cursor: pointer; transition: background 160ms, color 160ms, transform 160ms; }
button:hover:not(:disabled) { background: var(--surface-3); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .38; cursor: default; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.operator-health summary { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.operator-health summary span { font-size: 14px; color: var(--muted); }
.operator-health[data-health-state="attention_required"] summary span { color: #ffb0b9; }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.health-grid div { padding: 16px; background: var(--surface-2); border-radius: 16px; }
.health-grid dt { color: var(--muted); font-size: 14px; }
.health-grid dd { margin: 8px 0 0; font-size: 20px; font-weight: 600; }
.operator-health > p, .operator-health > small { display: block; margin-bottom: 12px; }
svg { flex: 0 0 auto; }
button svg, .quiet-button svg, .booking-link svg, .nub svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.primary,.danger { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding-inline: 26px; background: var(--red); color: #fff; }
.primary:hover:not(:disabled) { background: var(--red-hover); }
.primary:has(.nub) { padding: 6px 6px 6px 24px; }
.nub { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--red); }
.danger { background: var(--surface-2); color: var(--live); }
.danger:hover:not(:disabled) { background: #3a1a20; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px; border-radius: 12px; background: #fff; color: var(--dark); transform: translateY(-160%); }
.skip:focus-visible { transform: none; }

/* Top bar: brand · title + state · actions */
.site-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; min-height: 76px; padding: 14px max(24px, calc((100vw - 1568px) / 2)); }
.brand { display: inline-flex; justify-self: start; }
.brand img { width: 150px; height: auto; filter: invert(1) hue-rotate(180deg) saturate(1.4); }
.heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
h1 { font-size: 18px; line-height: 1.25; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heading-note { margin-top: 2px; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; white-space: nowrap; }
.status:before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #6c6c76; }
.status[data-live=true] { color: var(--ink); }
.status[data-live=true]:before { background: var(--live); box-shadow: 0 0 0 4px #ff3d5526; }
.header-actions { display: flex; gap: 8px; align-items: center; justify-self: end; }
.quiet-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; background: var(--surface); border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; }
a.quiet-button:hover { background: var(--surface-2); }
.booking-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 20px; border-radius: 999px; background: #fff; color: var(--dark); text-decoration: none; font-size: 14px; font-weight: 600; transition: background 160ms; }
.booking-link:hover { background: #e4e4ea; }

/* Room: the presentation owns the stage; speaker, chat and people share the column. */
.shell { width: min(1568px, calc(100% - 48px)); margin-inline: auto; }
.room-grid { display: grid; grid-template-columns: minmax(0,1fr) var(--sidebar); gap: 16px; align-items: stretch; }
.stream { position: relative; min-width: 0; padding: 12px; border-radius: var(--radius); background: var(--surface); }
.stage { position: relative; aspect-ratio: 16/9; border-radius: 20px; overflow: hidden; isolation: isolate; background: #0b0b0d; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0b0d; }

/* Static platform artwork; no canvas or GPU render loop in the live room. */
.stage-message { position: absolute; z-index: 6; inset: 0; overflow: hidden; isolation: isolate; background: #121214; color: var(--ink); }
.stage-message::after { content: ''; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg,#121214f5 0%,#121214df 32%,#12121470 60%,#1212140a 100%),linear-gradient(0deg,#121214e6 0%,#12121400 36%,#12121433 78%,#12121480 100%); }
.stage-copy { position: relative; z-index: 2; padding: clamp(24px,3vw,44px); pointer-events: none; }
.stage-label { display: block; margin-bottom: 12px; color: #b2b2bc; font-size: 14px; }
.stage-copy h2 { max-width: 650px; font-size: clamp(28px,3.7vw,54px); line-height: 1.02; letter-spacing: -.045em; }
.stage-copy p { max-width: 440px; margin-top: 12px; color: #b2b2bc; font-size: 15px; line-height: 1.5; }
.stage-copy a { pointer-events: auto; }
.stage-art { position: absolute; z-index: 0; inset: 0 -20% 0 0; pointer-events: none; }
.stage-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: .9; }
.stage-message[data-waiting=true] .stage-copy { max-width: 78%; }
.stage-schedule { margin-top: 20px; }
.stage-schedule #stage-schedule-time { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; }
.stage-schedule #stage-local-time { display: block; margin-top: 2px; color: #b2b2bc; font-size: 12px; }
.stage-schedule #stage-start-status { margin: 16px 0 6px; color: var(--ink); font-size: 16px; }
.stage-message[data-countdown=true] .stage-schedule { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'time status' 'local clock'; column-gap: 24px; max-width: 600px; }
.stage-message[data-countdown=true] #stage-schedule-time { grid-area: time; align-self: end; }
.stage-message[data-countdown=true] #stage-local-time { grid-area: local; }
.stage-message[data-countdown=true] #stage-start-status { grid-area: status; margin: 0 0 6px; font-size: 13px; color: #b2b2bc; }
.stage-message[data-countdown=true] #countdown { grid-area: clock; }
.stage-message[data-waiting=true] .stage-copy h2 { max-width: 680px; font-size: clamp(30px,3.4vw,50px); }
.stage-message[data-waiting=true] #stage-note { max-width: 510px; font-size: 13px; }
.countdown { display: flex; gap: 24px; width: fit-content; }
.countdown span { position: relative; display: grid; justify-items: start; min-width: 60px; }
.countdown span + span:before { content: ':'; position: absolute; top: 1px; left: -16px; color: #e71932; font: 500 clamp(30px,3.6vw,48px)/1 Suisse,Arial,sans-serif; }
.countdown strong { font: 500 clamp(30px,3.6vw,48px)/1 Suisse, Arial, sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.countdown small { margin-top: 4px; color: #b2b2bc; font-size: 11px; }
.webinar-market { position: absolute; inset: 37% 0 0; }
.stage-message[data-waiting=true] .webinar-market { top: 57%; }
.stage-message[data-waiting=true][data-countdown=true] .webinar-market { top: 66%; }
.webinar-market__scene { position: absolute; inset: 0 0 40px; outline-offset: -5px; touch-action: pan-y; cursor: grab; }
.webinar-market__scene.is-dragging { cursor: grabbing; }
.webinar-market__scene canvas, .market-fallback { display: block; width: 100%; height: 100%; object-fit: cover; }
.webinar-market__scene canvas { position: absolute; inset: 0; opacity: 0; }
.webinar-market.is-animated .market-fallback { visibility: hidden; }
.webinar-market.is-animated canvas { opacity: 1; }
.webinar-market__scene.is-pointer-focused:focus { outline: none; }
.market-caption { position: absolute; left: 24px; right: 24px; bottom: 0; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #696974; font-size: 11px; }
.market-caption > span { display: flex; align-items: center; gap: 6px; }
.market-caption svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.webinar-market__pause,.webinar-market__activate { min-height: 44px; padding: 4px 10px; font-size: 11px; font-weight: 400; background: transparent; color: #55555f; border-radius: 10px; }
.webinar-market__pause:hover:not(:disabled),.webinar-market__activate:hover:not(:disabled) { background: #dedee5; }
.stage-message :focus-visible { outline-color: var(--focus); }

/* Playback row under the stage: live time on the left, controls on the right. */
.playback-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 0; font-size: 13px; }
#elapsed { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
body[data-room-state=live] #elapsed { color: var(--ink); }
body[data-room-state=live] #elapsed:before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 2s ease-in-out infinite; }
#media-note { color: var(--muted); font-size: 13px; }
.dock { display: flex; align-items: center; gap: 6px; }
.dock:not(:has(> :not([hidden]))) { display: none; }
.dock #sound,.dock #reconnect { background: #fff; color: var(--dark); }
.icon-button { width: 44px; min-height: 44px; padding: 10px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.stream:has(.stage-message:not([hidden])) #elapsed,.stream:has(.stage-message:not([hidden])) #fullscreen { display: none; }
.stream:has(.stage-message:not([hidden])) .playback-bar:not(:has(#sound:not([hidden]), #reconnect:not([hidden]), #media-note)) { display: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* Speaker card: landscape camera beside the slides, or the host card when the
   camera is off or on the main stage. */
.speaker-card { position: relative; flex: none; overflow: hidden; border-radius: 24px; background: var(--surface); }
.camera-slot { position: relative; aspect-ratio: 16/9; background: #0b0b0d; }
.camera-slot #camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-slot:not(:has(#camera:not([hidden]))) { display: none; }
.speaker-line { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.speaker-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.speaker-line > div { min-width: 0; }
.speaker-line strong { display: block; font-size: 15px; line-height: 1.3; }
.speaker-line p { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speaker-label { margin-left: auto; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.camera-slot:has(#camera:not([hidden])) + .speaker-line { position: absolute; z-index: 2; inset: auto 0 0; padding: 32px 14px 12px; background: linear-gradient(transparent, #000a); }
.camera-slot:has(#camera:not([hidden])) + .speaker-line .speaker-photo { display: none; }
.camera-slot:has(#camera:not([hidden])) + .speaker-line p { color: #ffffffc4; }
.camera-slot:has(#camera:not([hidden])) + .speaker-line .speaker-label { background: #0006; color: #fff; backdrop-filter: blur(8px); }

/* Sidebar: speaker, then Chat / Participants tabs, matched to the stream height. */
.room-sidebar { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 520px; contain: size; }
.sidebar-tabs { display: flex; flex: none; padding: 4px; border-radius: 999px; background: var(--surface); }
.sidebar-tabs button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; flex: 1; background: transparent; color: var(--muted); font-size: 14px; }
.sidebar-tabs button[aria-selected=true] { background: var(--surface-2); color: var(--ink); }
.sidebar-tabs span { font-size: 12px; color: var(--muted); }
body[data-sidebar-tab=chat] .participants,body[data-sidebar-tab=participants] .chat { display: none; }
.side-panel { flex: 1 1 0; min-height: 0; background: var(--surface); border-radius: 24px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 10px; }
.panel-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; letter-spacing: -.02em; }
.panel-heading h2 > span { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-family: Proxima,Arial,sans-serif; font-size: 12px; letter-spacing: 0; }
.panel-heading p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.chat > .panel-heading,.participants > .panel-heading { display: none; }
.participants { display: flex; flex-direction: column; padding-top: 8px; }
.participants-list { min-height: 0; overflow-y: auto; padding: 0 10px 10px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.participants-list:empty { padding-bottom: 0; }
.participant { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 18px; }
.participant + .participant { margin-top: 2px; }
.participant:hover { background: var(--surface-2); }
.participant-copy { min-width: 0; flex: 1; }
.participant strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.participant small { display: block; font-size: 12px; color: var(--muted); }
.participant-dot { width: 6px; height: 6px; border-radius: 50%; background: #3ccf86; }
.participants-empty { padding: 12px 20px 20px; color: var(--muted); font-size: 13px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; color: #d9cfe6; background: #3a3344; font-size: 12px; font-weight: 600; }
.avatar--1 { background: #47362d; color: #f2c9b3; }
.avatar--2 { background: #24413a; color: #a6e3cf; }
.avatar--3 { background: #2c3550; color: #b9c8f2; }
.avatar--host { background: var(--red); color: #fff; }
.chat { display: grid; grid-template-rows: minmax(0,1fr) auto; }
.messages { min-height: 0; overflow-y: auto; overflow-wrap: anywhere; padding: 8px 18px 12px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.chat-empty { display: grid; align-content: center; justify-items: center; min-height: 100%; padding: 24px 8px; text-align: center; }
.chat-empty svg { width: 36px; height: 36px; fill: none; stroke: #5d5d68; stroke-width: 1.4; margin-bottom: 16px; }
.chat-empty strong { font-size: 14px; font-weight: 600; }
.chat-empty p { max-width: 240px; color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.device-settings { margin: 8px 0 16px; color: var(--muted); }
.device-settings summary { cursor: pointer; padding: 8px 0; font-size: 14px; width: fit-content; }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.device-grid label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--ink); }
.device-grid select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px; background: #29292e; color: #fff; font: inherit; color-scheme: dark; }
.device-grid select:disabled { opacity: .55; cursor: not-allowed; }
.device-settings .muted { margin-top: 8px; }
#host-reconnect { background: #fff; color: #17171b; }
.chat-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 8px 8px; }
.chat-tools button, .message-action { min-height: 32px; padding: 4px 12px; font-size: 12px; }
.message-action { margin-top: 8px; color: var(--muted); }
.message-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.message-actions .message-action { min-height: 36px; margin-top: 6px; padding-inline: 8px; background: transparent; }
.message-actions .review-message { color: #b7e9d0; }
.message-origin,.message-review-state { font-size: 10px; line-height: 1.4; color: var(--muted); }
.message[data-source=archive] .message-origin { color: #cbbdde; }
.message[data-source=guide] .message-origin { color: #a5daca; }
body[data-role=host] .message[data-source=archive] p,body[data-role=host] .message[data-source=guide] p { background: #242428; }
.message[data-unreviewed=true] .message-review-state { color: #a8f0cb; font-weight: 600; }
.message[data-unreviewed=true] p { background: #24332d; }
.new-chat-messages { display: block; min-height: 44px; margin: 0 auto 6px; padding: 6px 16px; color: var(--ink); background: var(--surface-3); font-size: 12px; }
body[data-role=host] .chat { grid-template-rows: auto minmax(0,1fr) auto; }
body[data-role=host] .room-sidebar { min-height: 760px; }
.host-chat-toolbar { padding: 12px 12px 8px; }
.host-chat-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.host-chat-filters button { min-height: 40px; padding: 6px 10px; background: transparent; color: var(--muted); font-size: 12px; }
.host-chat-filters button[aria-pressed=true] { color: var(--ink); background: var(--surface-3); }
.host-chat-filters span { margin-left: 4px; font-variant-numeric: tabular-nums; }
.host-chat-filters [data-chat-filter=unreviewed] span { color: #b7e9d0; }
.host-chat-toolbar p { margin: 8px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.host-chat-toolbar .host-program-status { color: #b7e9d0; font-size: 11px; }
.speaker-coach { margin: 0 0 24px; padding: 20px; border-radius: 16px; background: var(--surface-2); }
.speaker-coach-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.speaker-coach-heading h3 { font-size: 16px; }
.speaker-coach-heading span, .speaker-coach small { color: var(--muted); font-size: 12px; }
.speaker-coach .speaker-cue-time { margin: 16px 0 6px; font-size: 12px; color: #b7e9d0; font-variant-numeric: tabular-nums; }
.speaker-coach #speaker-cue-text { font-size: 16px; line-height: 1.5; margin-bottom: 8px; }
.speaker-coach small { display: block; line-height: 1.5; }
.speaker-coach #release-speaker-cue { margin-top: 16px; font-size: 13px; min-height: 44px; background: var(--surface-3); }
.speaker-coach[data-due=true] #release-speaker-cue:not(:disabled) { background: #b7e9d0; color: #173529; }
.speaker-plan-details { margin-top: 16px; }
.speaker-plan-details summary { font-size: 13px; padding: 8px 0; cursor: pointer; }
.speaker-plan-details > p { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.speaker-plan { margin-top: 16px; max-height: 480px; overflow-y: auto; overscroll-behavior: contain; }
.speaker-plan-item { margin-bottom: 24px; }
.speaker-plan-item h4 { font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.speaker-plan-item p { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.speaker-plan-item .speaker-plan-question { color: #b7e9d0; font-size: 13px; margin-top: 8px; }
.speaker-plan-item .speaker-plan-chat-question { margin-top: 8px; color: #b7e9d0; }
.host-chat-actions { display: flex; gap: 8px; }
.host-chat-actions button { min-height: 40px; padding: 6px 8px; background: transparent; color: #b7e9d0; font-size: 12px; }
@media (max-width: 950px) {
  body[data-role=host] .room-sidebar { min-height: 0; }
  body[data-role=host] .chat { min-height: 520px; }
}
@media (max-width: 600px) {
  .message-actions .message-action,.host-chat-filters button,.host-chat-actions button { min-height: 44px; }
  body[data-viewing=true] .message-origin { font-size: 9px; }
}
@media (max-width: 600px) { .device-grid { grid-template-columns: 1fr; } }
.message { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; margin: 14px 0; }
.message .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 11px; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 1px 0 6px; }
.message strong { font-size: 13px; font-weight: 600; }
.message time { color: var(--muted); font-size: 11px; }
.host-tag { padding: 1px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; }
.message p { display: inline-block; max-width: 100%; padding: 10px 14px; border-radius: 4px 18px 18px 18px; background: var(--surface-2); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.message[data-own=true] { grid-template-columns: minmax(0,1fr); margin-left: 40px; text-align: right; }
.message[data-own=true] > .avatar { display: none; }
.message[data-own=true] .message-meta { justify-content: flex-end; }
.message[data-own=true] p { background: #fff; color: var(--dark); border-radius: 18px 4px 18px 18px; text-align: left; }
.chat form { padding: 6px 12px 14px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 8px; background: var(--surface-2); border-radius: 26px; }
.composer:focus-within { box-shadow: 0 0 0 1px #ffffff40; }
.composer textarea { min-height: 40px; height: 40px; max-height: 112px; resize: none; padding: 9px 10px; border-radius: 0; background: transparent; font-size: 14px; line-height: 1.5; }
.composer textarea:focus-visible { outline: none; }
.send-button { display: grid; place-items: center; width: 40px; min-height: 40px; flex: 0 0 40px; padding: 8px; border-radius: 50%; background: #fff; color: var(--dark); }
.send-button:hover:not(:disabled) { background: #e4e4ea; }
.send-button:disabled { color: #6c6c76; background: var(--surface-3); opacity: 1; }
.chat small { display: block; margin: 8px 10px 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.chat-error { margin: 8px 10px 0; color: #ffb5bd; font-size: 13px; line-height: 1.4; }
.mobile-close,.mobile-chat-caption { display: none; }
input,textarea { display: block; width: 100%; min-width: 0; padding: 12px 20px; border: 0; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 16px; }
input::placeholder,textarea::placeholder { color: var(--muted); }
input { min-height: 52px; }
input:focus-visible { outline-offset: 0; }

/* Host studio */
.join-panel { display: grid; grid-template-columns: 1fr minmax(240px, 1.25fr); align-items: center; gap: 24px; margin-top: 12px; padding: 20px 20px 20px 24px; border-radius: 22px; background: var(--surface-2); }
.join-intro h2 { font-size: 22px; line-height: 1.2; }
.join-intro p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.join-row { display: flex; gap: 8px; }
.join-row button { flex-shrink: 0; font-size: 15px; }
.host-controls { padding: 16px 4px 4px; }
.controls-row { display: flex; gap: 8px; flex-wrap: wrap; }
.controls-row button { font-size: 14px; }
#mute[aria-pressed=true] { background: #3a1a20; color: var(--live); }
.screen-controls { margin-top: 8px; }
#stop-share { background: #3a1a20; color: #ffa3b0; }
#toggle-camera[aria-pressed=true] { color: #ffa3b0; }
.stage[data-no-video=true] .webinar-market { display: none; }
.stage[data-no-video=true] .stage-message { background: var(--surface); color: var(--ink); }
.stage[data-no-video=true] .stage-copy { align-self: center; }
.stage[data-no-video=true] .stage-label { display: none; }
.stage[data-no-video=true] .stage-copy p { color: var(--muted); }
.stream:has(.stage[data-no-video=true]) .playback-bar { display: flex; }
.stream:has(.stage[data-no-video=true]) #elapsed { display: inline; }
.go-live-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 12px 12px 12px 20px; border-radius: 22px; background: var(--surface-2); }
.go-live-row p { flex: 1; color: var(--muted); font-size: 14px; }
.go-live-row .primary,.go-live-row .danger { min-width: 148px; }
.go-live-row .danger { background: var(--surface-3); }
.muted { margin: 12px 8px 4px; color: var(--muted); font-size: 12px; }
.notice,.error { padding: 12px 18px; margin-bottom: 16px; border-radius: 18px; background: #352b12; color: #f3d58a; font-size: 14px; }
.error { background: #3b1219; color: #ffa3b0; }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 8px; color: var(--muted); font-size: 11px; }
dialog { max-width: 440px; width: calc(100% - 32px); padding: 28px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #0009; }
dialog::backdrop { background: #000000a6; backdrop-filter: blur(4px); }
dialog h2 { font-size: 26px; }
dialog p { margin: 10px 0 24px; color: var(--muted); }
dialog .controls-row button { flex: 1; }
#stage:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; background: #000; }

@media (max-width: 1100px) {
  :root { --sidebar: 316px; }
  .site-header { grid-template-columns: auto minmax(0,1fr) auto; }
  .heading { justify-content: center; }
  .room-grid { gap: 12px; }
  .stream { padding: 10px; }
  .stage-copy { padding: 24px; }
  .stage-copy h2 { font-size: 36px; }
  .stage-copy p { max-width: 360px; font-size: 13px; }
  .stage-label { font-size: 12px; margin-bottom: 8px; }
  .webinar-market { top: 43%; }
  .join-panel { grid-template-columns: 1fr; gap: 16px; }
}
@media (min-width: 601px) and (max-width: 1100px) {
  .stage:has(.stage-message:not([hidden])) { width: 100%; min-height: 360px; }
  .stage-message[data-waiting=true] .stage-copy { max-width: none; }
  .stage-message[data-countdown=true] .stage-schedule { display: block; }
  .stage-message[data-countdown=true] #stage-start-status { margin-top: 12px; }
}
@media (max-width: 800px) {
  .site-header { grid-template-columns: auto 1fr; grid-template-areas: 'brand actions' 'heading heading'; row-gap: 16px; padding: 14px 16px 18px; }
  .brand { grid-area: brand; }
  .header-actions { grid-area: actions; }
  .heading { grid-area: heading; justify-content: space-between; align-items: flex-start; }
  h1 { font-size: 24px; white-space: normal; }
  .shell { width: calc(100% - 24px); }
  .room-grid { grid-template-columns: minmax(0,1fr); }
  .room-sidebar { min-height: 0; contain: none; }
  .speaker-card:has(.camera-slot #camera:not([hidden])) { display: grid; grid-template-columns: 200px minmax(0,1fr); align-items: center; }
  .camera-slot:has(#camera:not([hidden])) + .speaker-line { position: static; padding: 14px 16px; background: none; }
  .camera-slot:has(#camera:not([hidden])) + .speaker-line p { color: var(--muted); }
  .side-panel { flex: none; height: 520px; }
  .join-panel { grid-template-columns: 1fr 1.3fr; }
  .composer textarea { font-size: 16px; }
}
@media (max-width: 600px) {
  .site-header { padding: 12px 16px 16px; }
  .brand img { width: 124px; }
  .header-actions .quiet-button { width: 44px; padding: 10px; }
  .header-actions .quiet-button span { display: none; }
  .booking-link { padding: 10px 16px; font-size: 13px; }
  .booking-link svg { display: none; }
  .heading { flex-direction: column; gap: 10px; }
  h1 { font-size: 26px; line-height: 1.12; letter-spacing: -.035em; }
  .stream { border-radius: 26px; padding: 8px; }
  .stage { border-radius: 20px; }
  .stage:has(.stage-message:not([hidden])) { aspect-ratio: 4/3.4; }
  .stage:has(.stage-message[data-waiting=true]:not([hidden])) { aspect-ratio: 4/4.4; }
  .stage-copy { padding: 20px 20px 0; }
  .stage-message[data-waiting=true] .stage-copy { max-width: none; }
  .stage-art { inset: 0 -80% 0 -55%; }
  .stage-art img { object-position: center 18%; }
  .stage-message::after { background: linear-gradient(90deg,#121214e6 0%,#121214a6 48%,#12121440 100%),linear-gradient(180deg,#1212148c 0%,#1212141a 45%,#12121400 72%,#121214b3 100%); }
  .stage-label { font-size: 12px; margin-bottom: 10px; }
  .stage-copy h2 { font-size: 27px; }
  .stage-copy p { display: none; }
  .stage-message[data-waiting=true] .stage-copy h2 { font-size: 28px; line-height: 1.08; }
  .stage-schedule { margin-top: 16px; }
  .stage-message[data-countdown=true] .stage-schedule { display: block; }
  .stage-schedule #stage-schedule-time,.stage-schedule #stage-start-status { display: block; font-size: 14px; }
  .stage-schedule #stage-start-status { margin-top: 12px; }
  .stage-schedule #stage-local-time { font-size: 11px; }
  .countdown { gap: 24px; }
  .countdown span { min-width: 52px; }
  .countdown strong,.countdown span + span:before { font-size: 36px; }
  .countdown small { font-size: 10px; margin-top: 4px; }
  .webinar-market { top: 44%; }
  .stage-message[data-waiting=true] .webinar-market { top: 53%; }
  .stage-message[data-countdown=true] #stage-start-status { margin-top: 12px; }
  .stage-message[data-waiting=true][data-countdown=true] .webinar-market { top: 70%; }
  .webinar-market__scene { bottom: 36px; }
  .market-caption { left: 16px; right: 12px; min-height: 24px; font-size: 10px; }
  .market-caption svg { display: none; }
  .speaker-card:has(.camera-slot #camera:not([hidden])) { grid-template-columns: 140px minmax(0,1fr); }
  .join-panel { grid-template-columns: 1fr; gap: 14px; margin-top: 8px; padding: 18px; border-radius: 20px; }
  .join-intro h2 { font-size: 21px; }
  .join-row { flex-direction: column; }
  .join-row .primary { justify-content: space-between; }
  .room-grid { gap: 10px; }
  .messages { padding-inline: 14px; }
  .host-controls { padding: 12px 0 0; }
  .controls-row button { flex: 1; min-width: 140px; font-size: 13px; }
  .go-live-row { align-items: stretch; flex-direction: column; gap: 12px; padding: 16px; }
  .go-live-row button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
html[data-live-theater=true] { overflow: hidden; overscroll-behavior: none; }
@media (max-width: 950px) {
  /* Safari must not auto-zoom the editor even in landscape/waiting layouts. */
  .composer textarea { font-size: 16px; }
}

/* Connected mobile viewer: the presentation leads, the speaker is a compact
   strip under it and the chat fills the rest. Waiting, tablet/desktop and the
   host studio keep the regular layout. */
@media (max-width: 600px) {
  body[data-role=viewer][data-viewing=true] {
    --slide-height: calc((100vw - 16px) * .5625);
    position: fixed; top: var(--room-top, 0px); left: 0; right: 0;
    display: flex; flex-direction: column; height: var(--room-height, 100dvh); overflow: hidden;
  }
  body[data-viewing=true] .site-header { grid-template-columns: auto minmax(0,1fr) auto; grid-template-areas: none; min-height: 0; padding: 8px 12px; row-gap: 0; gap: 10px; }
  body[data-viewing=true] .brand,body[data-viewing=true] .heading,body[data-viewing=true] .header-actions { grid-area: auto; }
  body[data-viewing=true] .brand img { width: 104px; }
  body[data-viewing=true] .heading { flex-direction: row; justify-content: flex-end; }
  body[data-viewing=true] .header-actions { gap: 6px; }
  body[data-viewing=true] .header-actions .quiet-button,body[data-viewing=true] .booking-link { min-height: 40px; }
  body[data-viewing=true] .header-actions .quiet-button { width: 40px; }
  body[data-viewing=true] .booking-link { padding: 8px 14px; font-size: 12px; }
  body[data-viewing=true] h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body[data-viewing=true] .status { display: block; flex-shrink: 1; min-width: 0; min-height: 28px; padding: 2px 10px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  body[data-viewing=true] .status:before { display: inline-block; vertical-align: middle; margin-right: 6px; }
  body[data-viewing=true] main.shell { flex: 1; min-height: 0; width: calc(100% - 16px); display: flex; flex-direction: column; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  body[data-viewing=true] .notice { display: none; }
  body[data-viewing=true] .error { position: absolute; z-index: 20; inset: 64px 12px auto; box-shadow: 0 8px 32px #0008; }
  body[data-viewing=true] .room-grid { display: block; position: relative; flex: 1; min-height: 0; }
  body[data-viewing=true] .stream { position: static; padding: 0; border-radius: 0; background: transparent; }
  body[data-viewing=true] .stage { height: var(--slide-height); aspect-ratio: auto; border-radius: 22px; background: var(--surface); }
  body[data-viewing=true] .stage video { background: var(--surface); }
  body[data-viewing=true] .playback-bar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: var(--slide-height); padding: 0; pointer-events: none; }
  body[data-viewing=true] #elapsed { display: none; }
  body[data-viewing=true] .dock { position: absolute; right: 8px; bottom: 8px; pointer-events: auto; }
  body[data-viewing=true] .dock .icon-button,body[data-viewing=true] #sound { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 10px; border-radius: 50%; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #fff; }
  body[data-viewing=true] #sound[hidden] { display: none; }
  body[data-viewing=true] #sound { display: inline-flex; gap: 8px; width: auto; min-height: 44px; padding: 10px 14px; border-radius: 999px; background: #fff; color: var(--dark); font-size: 12px; white-space: nowrap; }
  body[data-viewing=true] #sound span { display: inline; }
  body[data-viewing=true] #reconnect { white-space: nowrap; }
  body[data-viewing=true] .room-sidebar { position: absolute; z-index: 6; inset: calc(var(--slide-height) + 8px) 0 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; contain: none; }
  body[data-viewing=true] .speaker-card,body[data-viewing=true] .speaker-card:has(.camera-slot #camera:not([hidden])) { display: flex; align-items: center; gap: 0; padding: 6px; border-radius: 20px; }
  body[data-viewing=true] .camera-slot { flex: none; width: 104px; border-radius: 14px; overflow: hidden; }
  body[data-viewing=true] .camera-slot:has(#camera:not([hidden])) + .speaker-line { position: static; padding: 4px 10px 4px 12px; background: none; }
  body[data-viewing=true] .camera-slot:has(#camera:not([hidden])) + .speaker-line p { color: var(--muted); }
  body[data-viewing=true] .speaker-line { flex: 1; min-width: 0; padding: 4px 10px 4px 6px; }
  body[data-viewing=true] .speaker-photo { width: 40px; height: 40px; }
  body[data-viewing=true] .speaker-line strong { font-size: 14px; }
  body[data-viewing=true] .speaker-line p { font-size: 11px; line-height: 1.3; white-space: normal; overflow: visible; text-overflow: clip; }
  body[data-viewing=true] .speaker-label,body[data-viewing=true] .camera-slot:has(#camera:not([hidden])) + .speaker-line .speaker-label { background: var(--red); color: #fff; font-size: 11px; }
  body[data-viewing=true] .sidebar-tabs { display: none; }
  body[data-viewing=true] .chat { display: grid !important; flex: 1 1 0; min-height: 0; height: auto; grid-template-rows: auto minmax(0,1fr) auto; border-radius: 22px; }
  body[data-viewing=true] .chat form { display: block; min-width: 0; padding: 0; }
  body[data-viewing=true] .mobile-chat-caption { display: flex; order: -1; align-items: center; justify-content: space-between; padding: 0 2px 0 4px; }
  body[data-viewing=true] .mobile-chat-caption > button:first-child { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; background: transparent; color: var(--muted); font-size: 13px; }
  body[data-viewing=true] .mobile-chat-caption svg { width: 16px; height: 16px; color: var(--muted); }
  body[data-viewing=true] .mobile-participants { display: flex; align-items: center; min-height: 44px; padding: 0 4px; background: transparent; }
  body[data-viewing=true] .mobile-avatars { display: flex; }
  body[data-viewing=true] .mobile-avatars .avatar { width: 30px; height: 30px; flex-basis: 30px; margin-right: -8px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
  body[data-viewing=true] .mobile-participant-count { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); font-size: 12px; box-shadow: 0 0 0 2px var(--surface); }
  body[data-viewing=true] .mobile-participant-count svg { width: 14px; height: 14px; }
  body[data-viewing=true] .messages { padding: 0 10px 6px; mask-image: linear-gradient(transparent, #000 24px); overscroll-behavior: contain; }
  /* The chat stays secondary to the slide: no card, small quiet bubbles. */
  body[data-viewing=true]:not([data-mobile-panel=chat]) .chat { background: transparent; border-radius: 0; }
  body[data-viewing=true] .message { grid-template-columns: 24px minmax(0,1fr); gap: 8px; margin: 8px 0; }
  body[data-viewing=true] .message .avatar { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; }
  body[data-viewing=true] .message-meta { gap: 6px; padding: 0 0 3px; }
  body[data-viewing=true] .message strong { font-size: 11px; color: var(--muted); }
  body[data-viewing=true] .message time { display: none; }
  body[data-viewing=true] .host-tag { padding: 0 6px; font-size: 9px; line-height: 14px; }
  body[data-viewing=true] .message p { padding: 7px 11px; font-size: 13px; line-height: 1.4; border-radius: 4px 14px 14px 14px; }
  body[data-viewing=true] .message[data-own=true] { grid-template-columns: minmax(0,1fr); margin-left: 56px; }
  body[data-viewing=true] .message[data-own=true] p { background: var(--surface-3); color: var(--ink); border-radius: 14px 4px 14px 14px; }
  body[data-viewing=true] .composer { margin: 0; border-radius: 999px; padding: 3px 3px 3px 8px; align-items: center; background: var(--surface); }
  body[data-viewing=true] .composer textarea { max-height: 80px; padding: 9px 8px; font-size: 16px; }
  body[data-viewing=true] .send-button { width: 44px; min-height: 44px; flex-basis: 44px; }
  body[data-viewing=true] .chat small { margin: 5px 12px 0; font-size: 10px; }
  body[data-viewing=true] .participants { display: none !important; }
  body[data-viewing=true][data-mobile-panel=participants] .participants { display: block !important; position: absolute; z-index: 8; top: 0; right: 0; width: min(290px, 100%); max-height: calc(100% - 8px); overflow: auto; padding-top: 0; border-radius: 22px; background: var(--surface-2); box-shadow: 0 16px 48px #000a; }
  body[data-viewing=true][data-mobile-panel=participants] .participants > .panel-heading { display: flex; }
  body[data-viewing=true][data-mobile-panel=participants] .participants-list { max-height: 240px; }
  body[data-viewing=true] .mobile-close { display: grid; flex-shrink: 0; width: 40px; min-height: 40px; }
  body[data-viewing=true] .panel-heading { padding: 10px 10px 8px 18px; }
  body[data-viewing=true][data-mobile-panel=chat] .chat { position: absolute; inset: 0; z-index: 7; grid-template-rows: auto minmax(0,1fr) auto; box-shadow: 0 8px 40px #0008; }
  body[data-viewing=true][data-mobile-panel=chat] .chat > .panel-heading { display: flex; }
  body[data-viewing=true][data-mobile-panel=chat] .mobile-chat-caption { display: none; }
  body[data-viewing=true] .chat-empty { min-height: 100%; padding: 12px 0; }
  body[data-viewing=true] .chat-empty svg { display: none; }
  body[data-viewing=true] .footer { display: none; }
  body[data-viewing=true][data-keyboard=true] { --slide-height: min(calc((100vw - 16px) * .5625), max(100px, calc(var(--room-height, 100dvh) - 260px))); }
  /* Must override the camera-present :has(#camera) selector, too. */
  body[data-viewing=true][data-keyboard=true] .speaker-card { display: none !important; }
  body[data-viewing=true][data-keyboard=true] .mobile-chat-caption,body[data-viewing=true][data-keyboard=true] .chat small { display: none; }
  body[data-viewing=true][data-keyboard=true] .chat { grid-template-rows: minmax(0,1fr) auto; }
  body[data-viewing=true][data-keyboard=true][data-mobile-panel=chat] .chat { grid-template-rows: auto minmax(0,1fr) auto; }
  body[data-viewing=true][data-keyboard=true] main.shell { padding-bottom: 0; }
  body[data-viewing=true][data-keyboard=true] .composer { margin-top: 8px; margin-bottom: 8px; }
  body[data-viewing=true] #screen:fullscreen,body[data-viewing=true] #camera:fullscreen { inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 0; }
}
@media (max-width: 600px) and (max-height: 560px) {
  body[data-role=viewer][data-viewing=true] { --slide-height: min(calc((100vw - 16px) * .5625), max(100px, calc(var(--room-height, 100dvh) - 260px))); }
  body[data-viewing=true] .speaker-card { display: none !important; }
  body[data-viewing=true] .mobile-chat-caption,body[data-viewing=true] .chat small { display: none; }
  body[data-viewing=true] .chat { grid-template-rows: minmax(0,1fr) auto; }
  body[data-viewing=true][data-mobile-panel=chat] .chat { grid-template-rows: auto minmax(0,1fr) auto; }
}
.login-page { width: min(440px, calc(100% - 32px)); margin: 12vh auto; padding: 32px; border-radius: 24px; background: var(--surface); }
.login-page > img { max-width: 100%; filter: brightness(0) invert(1); margin-bottom: 24px; }
.login-page h1 { white-space: normal; font-size: 28px; margin-bottom: 16px; }
.login-page p { line-height: 1.5; color: var(--muted); margin-bottom: 24px; }
.login-page form { display: grid; gap: 12px; }
.login-page input { width: 100%; min-height: 48px; }
.login-page [role=alert] { color: var(--ink); margin: 0; }
.login-page button { margin-top: 8px; min-height: 48px; }
.calendar-page { width: min(520px, calc(100% - 32px)); margin-block: clamp(24px, 8vh, 80px); }
.calendar-page h2 { font-size: 20px; line-height: 1.4; margin: 0 0 12px; }
.calendar-page .calendar-date { color: var(--ink); font-size: 16px; }
.calendar-options { display: grid; gap: 12px; }
.calendar-options a { min-height: 48px; text-align: center; text-decoration: none; border-radius: 999px; }
.calendar-page .calendar-help { margin: 16px 0; font-size: 14px; }
.calendar-room { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 16px; }
/* A phone rotated sideways keeps the presentation and conversation side by
   side, instead of making the viewer scroll below the broadcast. */
@media (min-width: 601px) and (max-width: 950px) and (max-height: 500px) {
  body[data-role=viewer][data-viewing=true] { position: fixed; top: var(--room-top, 0px); left: 0; right: 0; display: flex; flex-direction: column; height: var(--room-height, 100dvh); overflow: hidden; }
  body[data-viewing=true] .site-header { grid-template-columns: auto minmax(0,1fr) auto; grid-template-areas: none; min-height: 0; padding: 6px 12px; row-gap: 0; }
  body[data-viewing=true] .brand,body[data-viewing=true] .heading,body[data-viewing=true] .header-actions { grid-area: auto; }
  body[data-viewing=true] .brand img { width: 120px; }
  body[data-viewing=true] .heading { justify-content: center; align-items: center; }
  body[data-viewing=true] h1 { font-size: 15px; white-space: nowrap; }
  body[data-viewing=true] main.shell { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: max(8px,env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  body[data-viewing=true] .room-grid { grid-template-columns: minmax(0,1fr) 280px; flex: 1; min-height: 0; gap: 10px; }
  body[data-viewing=true] .stream { display: flex; flex-direction: column; height: 100%; padding: 8px; border-radius: 22px; }
  body[data-viewing=true] .stage { flex: 1; min-height: 0; aspect-ratio: auto; }
  body[data-viewing=true] .playback-bar { padding-top: 8px; }
  body[data-viewing=true] .room-sidebar { height: 100%; min-height: 0; gap: 8px; contain: none; }
  body[data-viewing=true] .speaker-card { display: none !important; }
  body[data-viewing=true] .sidebar-tabs { padding: 3px; }
  body[data-viewing=true] .sidebar-tabs button { min-height: 36px; padding: 4px 8px; font-size: 12px; }
  body[data-viewing=true] .side-panel { flex: 1 1 0; height: auto; border-radius: 20px; }
  body[data-viewing=true] .messages { padding: 4px 12px 8px; }
  body[data-viewing=true] .chat form { padding: 8px 10px 10px; }
  body[data-viewing=true] .chat small { margin-top: 4px; font-size: 10px; }
  body[data-viewing=true] .send-button { width: 44px; min-height: 44px; flex-basis: 44px; }
  body[data-viewing=true] .footer { display: none; }
}
/* Functional preflight uses the existing studio surfaces and spacing. */
.preflight { display: grid; gap: 8px; padding: 16px; background: var(--surface-2); border-radius: 20px; }
.preflight h3 { margin: 0; font-size: 16px; }
.preflight button { justify-self: start; }
.mic-check { display: flex; align-items: center; gap: 16px; }
.mic-check meter { width: min(220px, 40%); height: 20px; accent-color: #65d39a; }
.preflight .muted { margin: 0; }

/* Live captions share the stage, including presentation fullscreen. */
.caption-overlay { position: absolute; z-index: 8; left: 8%; right: 8%; bottom: 24px; width: fit-content; max-width: 84%; margin: 0 auto; padding: 8px 16px; border-radius: 8px; background: rgba(0,0,0,.9); color: #fff; text-align: center; font-size: clamp(16px,1.6vw,24px); line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; }
.caption-control { display: flex; align-items: center; gap: 8px; min-height: 44px; border-radius: 8px; background: var(--surface-2); padding-left: 12px; }
.caption-control label { color: #fff; font-size: 13px; font-weight: 600; }
.caption-control select { max-width: 164px; min-height: 44px; color: #fff; color-scheme: dark; background: transparent; border: 0; padding: 8px; font: inherit; }
.caption-control option { background: #242429; }
.caption-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.caption-settings { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--surface-3); }
.caption-settings h3 { margin-bottom: 12px; font-size: 16px; }
.caption-settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.caption-settings-row > div { display: flex; align-items: center; gap: 8px; }
.caption-settings-row select { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--surface-2); color: #fff; font: inherit; color-scheme: dark; }
.caption-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.caption-toggle input { width: 20px; height: 20px; accent-color: var(--red); }
.caption-settings p { margin-top: 12px; }
.caption-settings small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.caption-control[hidden],.caption-overlay[hidden] { display: none; }
@media (max-width: 600px) {
  .caption-overlay { left: 4%; right: 4%; max-width: 92%; bottom: 56px; padding: 8px 12px; font-size: 14px; }
  body[data-viewing=true] .caption-control { min-height: 40px; background: rgba(0,0,0,.9); padding-left: 8px; }
  body[data-viewing=true] .caption-control select { min-height: 40px; max-width: 124px; font-size: 12px; }
  .caption-settings-row > div { flex-wrap: wrap; }
  .caption-note { font-size: 11px; }
}
@media (max-width: 600px) {
  body[data-viewing=true] .caption-note { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Compact presenter notes: one question/action, details only on demand. */
.speaker-coach .speaker-coach-heading h3 { margin: 0; }
.speaker-coach #speaker-plan-progress { font-variant-numeric: tabular-nums; }
.speaker-coach .speaker-slide-title { margin: 12px 0 20px; font-size: 14px; color: #c8c8d0; }
.speaker-coach .speaker-next-action { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.speaker-coach .speaker-next-action > div { min-width: 0; }
.speaker-coach .speaker-next-action .speaker-cue-time { margin: 0 0 8px; color: #c8c8d0; font-size: 12px; }
.speaker-coach[data-due=true] .speaker-next-action .speaker-cue-time { color: #b7e9d0; font-weight: 600; }
.speaker-coach .speaker-next-action #speaker-cue-text { margin: 0 0 8px; font-size: 20px; line-height: 1.3; max-width: 44ch; }
.speaker-coach .speaker-next-action #speaker-cue-note { color: #b5b5bf; }
.speaker-coach .speaker-next-action #release-speaker-cue { flex-shrink: 0; margin: 0; min-height: 48px; font-size: 14px; padding-inline: 24px; }
.speaker-coach[data-due=true] #release-speaker-cue:hover:not(:disabled) { background: #d1f3e2; }
.speaker-coach .speaker-current-notes { margin-top: 20px; }
.speaker-coach .speaker-current-notes summary, .speaker-coach .speaker-plan-details > summary { min-height: 44px; padding: 12px 0; font-size: 13px; color: #c8c8d0; cursor: pointer; }
.speaker-coach .speaker-current-notes p { margin: 8px 0; font-size: 15px; max-width: 70ch; }
.speaker-coach .speaker-plan-details { margin-top: 0; }
.speaker-coach .speaker-plan { max-height: 400px; padding: 4px; }
.speaker-coach .speaker-plan-item { margin-bottom: 4px; }
.speaker-coach .speaker-plan-item > summary { min-height: 48px; padding: 12px 0; font-size: 14px; cursor: pointer; }
.speaker-coach .speaker-plan-item > p, .speaker-coach .speaker-plan-item > small { margin: 8px 0 12px; }
.speaker-coach .speaker-chat-schedule > summary { min-height: 44px; padding: 12px 0; color: #c8c8d0; font-size: 13px; cursor: pointer; }
.speaker-coach .speaker-chat-schedule > small { margin: 8px 0 16px; }
@media (max-width: 600px) {
  .speaker-coach { padding: 16px; }
  .speaker-coach .speaker-next-action { flex-direction: column; align-items: stretch; gap: 16px; }
  .speaker-coach .speaker-next-action #speaker-cue-text { font-size: 18px; }
  .speaker-coach .speaker-next-action #release-speaker-cue { width: 100%; }
}
/* End compact presenter notes. */

/* Manual chat publishing: select the actual slide, not a timed slide guess. */
.speaker-coach .manual-chat-questions { margin-top: 24px; }
.manual-chat-questions label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.manual-chat-questions select { display: block; width: 100%; max-width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 12px; background: #29292e; color: #f4f4f6; font: inherit; font-size: 16px; }
.manual-chat-hint, .manual-chat-status { color: #b5b5bf; font-size: 13px; margin: 8px 0; }
.manual-chat-status:empty { display: none; }
.manual-chat-question { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; }
.manual-chat-question p { margin: 0; min-width: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.manual-chat-question button { min-height: 44px; flex-shrink: 0; margin: 0; padding: 12px 16px; font-size: 14px; border-radius: 10px; background: #f4f4f6; color: #171719; }
.manual-chat-question button:disabled { background: #29292e; color: #b5b5bf; opacity: 1; }
.manual-chat-questions select:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
@media(max-width: 600px) { .manual-chat-question { align-items: stretch; flex-direction: column; gap: 12px; } .manual-chat-question button { width: 100%; } }
/* End manual chat publishing. */

/* Compact viewer captions: keep the native language picker without a toolbar. */
body[data-role=viewer] .caption-control { position: relative; display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--surface-2); }
body[data-role=viewer] .caption-control[hidden] { display: none; }
body[data-role=viewer] .caption-control label { padding: 0; color: #fff; font-size: 13px; font-weight: 600; line-height: 1; pointer-events: none; }
/* The full-size native select stays operable with touch, keys and VoiceOver.
   16px also avoids Safari's auto-zoom. Only its always-visible text is hidden. */
body[data-role=viewer] .caption-control select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; max-width: none; margin: 0; padding: 0; opacity: 0; font-size: 16px; cursor: pointer; }
body[data-role=viewer] .caption-control:has(select:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
body[data-role=viewer] .caption-control:hover { background: var(--surface-3); }
@media (max-width: 600px) {
  body[data-role=viewer][data-viewing=true] .caption-control { background: var(--glass); }
  body[data-role=viewer][data-viewing=true] .dock .icon-button { width: 44px; height: 44px; min-height: 44px; }
  body[data-role=viewer] .caption-overlay { left: 12px; right: 12px; max-width: calc(100% - 24px); bottom: 64px; padding: 6px 10px; font-size: 14px; line-height: 1.35; }
}
/* End compact viewer captions. */

/* Bounded host conversation: newest first, history scrolls inside the panel. */
body[data-role=host] .room-sidebar { position: sticky; top: 16px; align-self: start; height: clamp(640px, calc(100dvh - 108px), 960px); min-height: 0; }
body[data-role=host] .camera-slot { max-height: 180px; }
body[data-role=host] .chat { min-height: 0; overflow: hidden; }
body[data-role=host] .messages { overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; scroll-behavior: auto; }
.participants-summary { flex: none; margin: 4px 20px 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 800px) {
  body[data-role=host] .room-sidebar { position: static; height: 720px; }
}
@media (max-width: 600px) {
  body[data-role=viewer][data-viewing=true][data-mobile-panel=participants] .participants { height: auto; }
}
/* End bounded host conversation. */

/* Manual recording: host-only, reuses the studio's spacing and controls. */
.studio-recording { margin: 24px 0; padding: 24px 0; border-block: 1px solid #ffffff14; }
.studio-recording h3 { font-size: 20px; margin: 0 0 16px; }
.recording-opt-in { display: flex; align-items: center; gap: 12px; font-size: 16px; min-height: 44px; cursor: pointer; }
.recording-opt-in input { width: 20px; height: 20px; accent-color: #ed143b; flex: 0 0 20px; }
.studio-recording .muted { line-height: 1.5; max-width: 72ch; }
.recording-library { margin-top: 24px; }
.recording-library summary { cursor: pointer; min-height: 44px; padding-block: 12px; }
.recording-items { display: grid; gap: 24px; margin-top: 16px; }
.recording-item { min-width: 0; }
.recording-item video { width: 100%; max-height: 360px; background: #111113; border-radius: 12px; margin-bottom: 12px; }
.recording-item > strong { font-size: 14px; font-weight: 600; }
.studio-recording .controls-row { flex-wrap: wrap; gap: 8px; }
.studio-recording button, .studio-recording a { min-height: 44px; }
.studio-recording :focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
body[data-broadcast-mode=recording] #speaker-coach { display: none; }
@media (max-width: 600px) { .studio-recording { padding-block: 16px; } .studio-recording .controls-row > * { flex: 1 1 160px; } }
/* End manual recording. */
