/* One scene layout, shared tokens and small-screen placement. */
.immersive { --scene-gold: var(--gold); background: var(--bg); }
.theatre { --stage-axis:50%; position: relative; isolation: isolate; height: 100svh; min-height: 1024px; overflow: hidden; background: #071229; }
.scene-art,.scene-vignette { position: absolute; inset: 0 0 194px; z-index: -2; pointer-events: none; overflow: hidden; }
.scene-art { background: #071229; }
.scene-art canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.scene-vignette { z-index: -1; background: linear-gradient(180deg,transparent 52%,#07122938); }
.portrait,.portrait-canvas { display: block; image-rendering: pixelated; flex: none; width: 40px; height: 40px; }
.portrait { background: #15243d; box-shadow: 2px 2px 0 #02091750; }
.scene-masthead { position: absolute; top: 0; left: 0; width: 35%; padding: 22px 24px 18px; background: #080f22f5; border-bottom: 3px solid var(--line); box-shadow: 4px 4px 0 #02071580; z-index: 6; }
.scene-masthead .brand { margin-bottom: 12px; }
.scene-masthead p { font: 15px/1.4 var(--pixel); letter-spacing: .05em; color: var(--muted); }
.scene-masthead small { display: block; margin-top: 8px; font: 12px/1.4 var(--font-body); color: var(--muted); }
.live-badge { font: 12px/1.2 var(--font-body); letter-spacing: 0; max-width: 72px; white-space: normal; background: #a72c36; border: 2px solid #ff9b81; color: white; padding: 5px; text-align: center; }
.pixel-panel { background: #0c1a33f5; border: 4px solid #345386; box-shadow: inset 2px 2px 0 #6281b2,inset -2px -2px 0 #142949,4px 4px 0 #020918a3; }
.agenda { position: absolute; z-index: 4; top: 154px; left: 1.5%; width: 21%; padding: 16px 12px 12px; }
.agenda h2 { font: 600 23px/1.25 var(--pixel); color: var(--gold); padding-bottom: 8px; margin-bottom: 6px; border-bottom: 2px solid var(--line); }
.agenda h2 > span { margin-right: 8px; }
.agenda-active,.agenda-future { display: flex; align-items: center; gap: 10px; padding: 3px 8px; color: var(--muted); font: 15px/1.4 var(--font-body); min-height: 28px; }
.agenda-active { color: var(--ink); background: #193862; border-left: 3px solid var(--gold); text-decoration: none; font-weight: 600; min-height: 44px; margin-bottom: 4px; }
.agenda-future > span { color: #849bbc; }
.agenda-later { display: block; font-size: 12px; padding: 8px; color: var(--muted); }
.agenda-sources { display: block; width: 100%; text-align: left; color: var(--gold); font: 15px/1.3 var(--font-body); }
.scene-motto { position: absolute; top: 24px; right: 2%; width: 20%; text-align: center; display: grid; gap: 6px; color: var(--muted); font: 600 19px/1.25 var(--pixel); letter-spacing: .08em; }
.participation { position: absolute; top: 154px; right: 1.5%; width: 21%; padding: 20px 16px 16px; z-index: 4; }
.participation h2 { font: 600 27px/1.15 var(--pixel); color: var(--gold); margin-bottom: 12px; }
.participation > p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.take-floor { width: 100%; }
.take-floor b { font-size: 25px; }
.live-state { display: flex; align-items: center; gap: 9px; margin-top: 16px; min-height: 24px; }
.live-state i { width: 9px; height: 9px; flex: none; background: #dfb75a; box-shadow: 0 0 0 3px #6c542c; }
.live-state[data-connection='connected'] i { background: #b2efad; box-shadow: 0 0 0 3px #315c45; }
.live-state[data-connection='reconnecting'] i { background: #ffb59d; box-shadow: 0 0 0 3px #6b3935; }
.connection { font: 13px/1.5 var(--font-body); color: var(--muted); }
.participation > small { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 12px 18px; }
.all-contributions { display: flex; align-items: center; min-height: 44px; border-top: 1px solid var(--line); color: var(--gold); font-size: 14px; text-decoration: none; }
.stage { position: absolute; inset: 0; pointer-events: none; }
.gesture-note { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; padding: 0 5px; white-space: nowrap; color: #c6d5e8; background: #101d30; font: 10px/13px var(--font-body); }
.immersive[data-short-viewport='true'] .gesture-note { display: none; }
.backdrop-title { position: absolute; top: 64px; left: calc(var(--stage-axis) - 14%); width: 28%; text-align: center; color: #d8e5ff; pointer-events: auto; }
.backdrop-title > span { display: block; font: 12px/1.4 var(--pixel); letter-spacing: .1em; }
.backdrop-title .pixel-building { display: none; }
.backdrop-title h1 { font: 600 32px/1.15 var(--pixel); margin: 4px 0; color: var(--gold); }
.backdrop-title small { display: none; font: 12px/1.4 var(--font-body); color: #c4d4ef; }
.backdrop-title button { margin-top: 0; min-height: 44px; background: transparent; color: #cbd8e6; font-size: 13px; padding: 6px 10px; border: 0; box-shadow: none; }
.speech { position: absolute; z-index: 5; pointer-events: auto; left: calc(var(--stage-axis) - 16.5%); top: min(42%,calc(100% - 558px)); width: 33%; padding: 16px 18px; border: 4px solid #ffe2a3; box-shadow: 0 0 0 3px #b67b22,5px 5px 0 #7c511a,0 0 24px #efb53644; color: #152036; background: #fff8ea; }
.speech::after { content: ''; position: absolute; width: 26px; height: 26px; left: 47%; bottom: -26px; background: #ffe2a3; clip-path: polygon(0 0,100% 0,100% 34%,65% 34%,65% 67%,33% 67%,33% 100%,0 100%); }
.spotlight-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.spotlight-head > div { min-width: 0; flex: 1; }
.speech-label { display: block; font: 600 16px/1.25 var(--pixel); color: #28344a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speech[data-speaker-active="false"] .spotlight-head small { display: none; }
.stage:has(.speech[data-speaker-active="false"]) .spotlight-rays { display: none; }
.spotlight-head small { display: block; font: 12px/1.3 var(--font-body); color: #595f6a; margin-top: 4px; }
.spotlight-share { width: 44px; height: 44px; flex: none; padding: 4px; font-size: 24px; background: #f4e7d3; color: #873a34; border-color: #bca481; }
.spotlight-share:hover:not(:disabled) { background: #eaddc5; border-color: #8b683a; }
.speech p { font: 650 clamp(22px,1.85vw,29px)/1.32 var(--font-body); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.spotlight-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #5f594f; font: 12px/1.4 var(--font-body); margin-top: 12px; }
.spotlight-hint button { flex: none; color: #523e21; background: #f2e4cb; border-color: #bca481; font-size: 12px; }
.audience-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.audience-card { position: absolute; width: 23%; pointer-events: auto; filter: drop-shadow(3px 4px 0 #020715a0); }
/* Ambient voices are public statements. The system motion preference keeps them still. */
.immersive:not(.motion-paused) .audience-card { animation: audience-arrive .45s ease-out both; transition: opacity .45s ease, transform .45s ease, visibility 0s .45s; }
.immersive:not(.motion-paused) .audience-card.bubble-hidden { opacity: 0; transform: translateY(6px); visibility: hidden; pointer-events: none; animation: none; }
@keyframes audience-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .immersive .audience-card { animation: none !important; transition: none !important; } }
.audience-card::after { content: ''; position: absolute; width: 20px; height: 18px; bottom: -16px; left: 66%; background: #dce3f0; clip-path: polygon(0 0,100% 0,100% 34%,65% 34%,65% 67%,33% 67%,33% 100%,0 100%); }
.bubble-select { display: grid; grid-template-columns: 40px minmax(0,1fr); grid-template-rows: 16px 44px 16px; gap: 3px 10px; width: 100%; height: 104px; padding: 8px 12px; text-align: left; border: 3px solid #b8c6dc; background: #edf1f8; color: #152036; }
.bubble-select:hover:not(:disabled) { background: #fff8e5; border-color: #edc16c; }
.bubble-select .portrait { grid-row: 1 / span 3; align-self: start; }
.bubble-author { font: 600 12px/16px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #3d465b; }
.bubble-text { font: 600 16px/22px var(--font-body); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.bubble-meta { font: 12px/16px var(--font-body); display: flex; justify-content: space-between; gap: 4px; color: #5b5870; white-space: nowrap; overflow: hidden; }
.bubble-meta b { color: #9c3843; }
.seat-0 { left: 8%; top: 53%; width: 24%; }
.seat-1 { right: 2%; top: 53%; width: 24%; }
.seat-2 { left: 20%; top: calc(100% - 324px); width: 22%; }
.seat-3 { left: 49%; top: calc(100% - 324px); width: 22%; }
.seat-4 { right: 2%; top: calc(100% - 324px); width: 22%; }
.spotlight-rays { position: absolute; left: calc(var(--stage-axis) - 18%); top: 38%; width: 36%; height: 25%; pointer-events: none; z-index: 3; }
.spotlight-rays i { position: absolute; width: 8px; height: 24px; background: #fff5be; box-shadow: 3px 0 #ce941d,-3px 0 #ce941d,0 3px #ce941d,0 -3px #ce941d; }
.spotlight-rays i:nth-child(1) { left: -5%; top: 4%; transform: rotate(-63deg); }
.spotlight-rays i:nth-child(2) { left: 12%; top: -15%; transform: rotate(-35deg); }
.spotlight-rays i:nth-child(3) { right: -2%; top: 10%; transform: rotate(51deg); }
.spotlight-rays i:nth-child(4) { left: -5%; bottom: 10%; transform: rotate(69deg); }
.spotlight-rays i:nth-child(5) { right: -3%; bottom: 8%; transform: rotate(-54deg); }
.spotlight-rays i:nth-child(6) { left: 40%; bottom: -4%; transform: rotate(18deg); }
.composer-dock { position: absolute; bottom: 28px; left: 0; right: 0; z-index: 8; display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 4px 12px; padding: 8px 16px; border-top: 4px solid #5879ac; box-shadow: 0 -4px 0 #030919; background: #0b1a35; }
.scene-tools { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.scene-tools button { font: 14px/1.2 var(--pixel); min-height: 44px; padding: 8px 12px; }
.room-menu-toggle { anchor-name: --room-menu; }
.room-menu { position: fixed; inset: auto; left: 16px; bottom: min(180px,calc(100dvh - 180px)); margin: 0 0 8px; width: 210px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; position-try-fallbacks: --room-menu-viewport; padding: 6px; border: 2px solid #6584b4; background: #101e34; color: #ecf0f8; box-shadow: 3px 3px 0 #030919; }
@position-try --room-menu-viewport { position-anchor: none; inset: 8px auto auto 12px; }
.room-menu button { display: block; width: 100%; min-height: 44px; padding: 10px 12px; text-align: left; border: 0; background: transparent; box-shadow: none; font: 14px/1.3 var(--font-body); }
.room-menu button:hover,.room-menu button:focus-visible { background: #243953; }
@supports (bottom: anchor(top)) { .room-menu { position-anchor: --room-menu; left: anchor(left); bottom: anchor(top); } }
.dock-note { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; color: var(--muted); font: 12px/1.4 var(--font-body); }
.dock-note > span:last-child { text-align: right; }
.dock-input { display: flex; align-items: center; gap: 10px; border: 2px solid #6584b4; background: #08152c; padding: 4px 8px; min-width: 0; }
.dock-input textarea,.dock-input textarea:focus { font: 16px/1.45 var(--font-body); background: transparent; border: 0; border-left: 1px solid var(--line); margin: 0; padding: 8px 12px; height: 46px; min-height: 46px; max-height: 46px; resize: none; flex: 1; min-width: 0; }
.send-arrow { padding: 4px 10px; flex: none; font-size: 24px; height: 46px; color: var(--gold); }
.dock-kinds { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.dock-kinds button { flex: 1; min-width: 44px; padding: 8px; font: 16px/1.2 var(--pixel); }
.dock-kinds button > span { display: inline-block; margin-right: 6px; }
.composer-dock .feedback { grid-column: 1 / -1; height: 20px; min-height: 20px; overflow: auto; font: 13px/1.3 var(--font-body); padding-top: 4px; margin: 0; }
.replying { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-height: 32px; color: var(--gold); font-size: 14px; }
.replying button { font-size: 13px; padding: 6px 12px; }
.composer-dock:has(.replying) .dock-note { display: none; }
.scene-footer { position: absolute; bottom: 0; left: 0; right: 0; min-height: 28px; padding: 4px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #080f22; color: var(--muted); font: 12px/1.5 var(--font-body); }
.scene-footer b { margin-left: 12px; font-weight: 400; }
.discussion { width: calc(100% - 48px); max-width: var(--content-width); margin: 28px auto; }
.reference-dialog { width: min(1000px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; margin: auto; border: 3px solid #6281b2; background: var(--panel); color: var(--ink); box-shadow: 6px 6px 0 #020818; overflow: auto; }
.reference-dialog::backdrop { background: #020817cf; }
.reference-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 2px solid var(--line); background: #101e38; z-index: 2; font: 600 25px/1.2 var(--pixel); }
.reference-header button { width: 44px; height: 44px; flex: none; font-size: 24px; padding: 4px; }
.reference-body { padding: 28px; }
.reference-body .briefing { border-top: 2px solid var(--line); margin-top: 32px; padding-top: 28px; }
/* Smaller screens reflow the same scene content rather than shrink absolute coordinates. */

/* The scene is a viewport, not a document-length card feed. */
body:has(.immersive) { overflow: hidden; }
.immersive { height: var(--venue-height,100dvh); }
.immersive > main { height: 100%; }
.immersive .theatre { position: fixed; top: var(--venue-top,0px); left: 0; width: 100%; height: var(--venue-height,100dvh); min-height: 0; }
.immersive > .site-footer { display: none; }
.kind-toggle,.compact-live { display: none; }
.room-dialog { width: min(920px,calc(100vw - 32px)); max-height: calc(var(--venue-height,100dvh) - 40px); margin: max(12px,4dvh) auto; padding: 0; overflow: auto; overscroll-behavior: contain; color: var(--ink); background: #0c1a33; border: 3px solid #6584b4; box-shadow: 8px 8px 0 #03091790; }
.room-dialog::backdrop { background: #020818b8; }
.room-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 2px solid var(--line); background: #0c1a33; }
.room-dialog-head h2 { font: 600 23px/1.2 var(--pixel); margin: 0 auto 0 0; color: var(--gold); }
.room-dialog-head button { min-width: 44px; min-height: 44px; font-size: 14px; }
.room-dialog-close { font-size: 24px !important; }
.room-dialog-body { padding: 8px 12px 16px; }
.room-dialog .discussion,.room-dialog .floor-panel { width: 100%; max-width: none; margin: 0; border: 0; padding: 16px 8px; box-shadow: none; }
.room-dialog[data-panel='floor'] #discussion,.room-dialog[data-panel='discussion'] #my-floor { display: none; }
.room-dialog .section-title { flex-wrap: wrap; }
.room-dialog .floor-member-id { overflow-wrap: anywhere; }
.room-context { border-top: 1px solid var(--line); padding: 12px 8px; font: 12px/1.6 var(--font-body); color: var(--muted); }
.room-context a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold); }
@media (min-width: 901px) and (max-height: 900px) {
  .scene-art,.scene-vignette { bottom: 160px; }
  .agenda,.participation { top: 96px; width: clamp(180px,20vw,250px); }
  .agenda { padding: 10px; }
  .agenda h2 { margin: 0; padding: 0 0 6px; font-size: clamp(14px,1.4vw,18px); }
  .agenda-future,.agenda-later,.participation > h2,.participation > p,.participation > small,.scene-motto,.scene-masthead p { display: none; }
  .scene-masthead { padding: 12px 16px; }
  .scene-masthead .brand { font-size: clamp(18px,2vw,26px); margin-bottom: 4px; }
  .scene-masthead small { margin-top: 4px; font-size: 11px; }
  .participation { padding: 10px; }
  .take-floor { font-size: clamp(14px,1.3vw,18px); padding: 10px 8px; gap: 8px; }
  .take-floor b { font-size: 20px; }
  .live-state { margin-top: 10px; }
  .connection { font-size: 12px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .all-contributions { font-size: 13px; }
  .backdrop-title h1 { font-size: clamp(22px,2.2vw,30px); }
  /* The speech card follows viewport height; a fixed bottom reserve crushed the stage on laptops. */
  .speech { top: 39%; width: min(40%,560px); left: max(30%,calc(50% - 280px)); padding: 8px 14px; }
  .speech::after { width: 20px; height: 18px; bottom: -18px; }
  .spotlight-head { gap: 8px; margin-bottom: 8px; }
  .spotlight-head .portrait { width: 32px; height: 32px; }
  .speech-label { font-size: 14px; }
  .speech p { font-size: clamp(22px,1.85vw,28px); line-height: 1.2; -webkit-line-clamp: 2; }
  .spotlight-hint { margin-top: 8px; }
  .spotlight-hint > span { display: none; }
  .spotlight-hint:has(button) { justify-content: flex-end; }
  .spotlight-hint:not(:has(button)) { display: none; }
  .seat-0,.seat-1 { top: 55%; width: min(25%,300px); }
  .seat-0 { left: 16px; }
  .seat-1 { right: 16px; }
  .seat-2,.seat-3,.seat-4 { display: none; }
  .bubble-select { height: 94px; padding: 6px 8px; grid-template-rows: 16px 40px 14px; gap: 2px 8px; }
  .bubble-text { font-size: 14px; line-height: 20px; }
  .bubble-meta { font-size: 11px; line-height: 14px; }
  .composer-dock { grid-template-columns: auto minmax(0,1fr) minmax(324px,25%); }
  .scene-tools { grid-column: 1; grid-row: 1; }
  .dock-input { grid-column: 2; grid-row: 1; }
  .dock-kinds { grid-column: 3; grid-row: 1; }
  .dock-note,.replying { grid-row: 2; }
  .composer-dock .feedback { grid-row: 3; }
  .dock-kinds button { font-size: 14px; }
}
@media (min-width: 901px) and (max-height: 640px) {
  .scene-footer { display: none; }
  .composer-dock { bottom: 0; }
  .scene-art,.scene-vignette { bottom: 132px; }
  .participation .audience-stream h3 { display: none; }
}
/* Tablet and phone: retain the room composition; only the camera and UI placement change. */
@media (max-width: 900px) {
  .theatre { --venue-head: 88px; --venue-dock: calc(122px + env(safe-area-inset-bottom,0px)); }
  .scene-masthead { top: 0; left: 0; width: 100%; height: 44px; padding: 7px 12px; display: flex; align-items: center; border: 0; box-shadow: none; background: #081226; }
  .scene-masthead .brand { margin: 0; font-size: clamp(17px,4.9vw,24px); line-height: 1.25; letter-spacing: .09em; }
  .scene-masthead p,.scene-masthead small,.live-badge,.scene-motto { display: none; }
  .agenda { top: 44px; left: 8px; right: 8px; width: auto; height: 44px; display: flex; gap: 4px; align-items: stretch; padding: 0; border: 0; border-top: 1px solid #3e5c84; box-shadow: none; background: #10223d; }
  .agenda h2,.agenda-future,.agenda-later { display: none; }
  .agenda-active { flex: 1; min-width: 0; margin: 0; padding: 4px 8px; font-size: 13px; line-height: 1.1; gap: 6px; border: 0; box-shadow: none; background: transparent; }
  .agenda-sources { width: auto; padding: 6px 8px; font-size: 12px; min-width: 44px; border: 0; box-shadow: none; background: transparent; }
  .participation { z-index: 7; top: 0; right: 12px; left: auto; width: auto; height: 44px; border: 0; padding: 0; box-shadow: none; background: transparent; display: flex; align-items: center; }
  .participation > h2,.participation > p,.participation > button,.participation > small,.participation > a { display: none; }
  .live-state { margin: 0; gap: 7px; }
  .live-state .connection { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .compact-live { display: block; font: 12px/1 var(--pixel); color: #c8dfd0; }
  .live-state i { width: 6px; height: 6px; box-shadow: none !important; }
  .scene-art,.scene-vignette { inset: var(--venue-head) 0 var(--venue-dock); height: auto; }
  .scene-art canvas { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none; }
  .stage,.audience-bubbles { inset: var(--venue-head) 0 var(--venue-dock); }
  .backdrop-title { top: 14px; left: 8%; width: 84%; }
  .backdrop-title .pixel-building { display: none; }
  .backdrop-title > span { display: none; }
  .backdrop-title h1 { font-size: clamp(23px,6vw,34px); margin: 4px 0; }
  .backdrop-title small { display: none; }
  .backdrop-title button { margin-top: 0; min-height: 44px; padding: 6px 10px; font-size: 12px; border: 0; box-shadow: none; background: transparent; color: #c0cfdb; }
  .speech { left: 8%; top: 44%; width: 84%; padding: 3px; border: 0; box-shadow: none; background: transparent; filter: drop-shadow(0 3px 0 #8c6438) drop-shadow(2px 5px 0 #02071870); }
  .spotlight-head { gap: 8px; margin-bottom: 7px; min-height: 28px; padding-right: 34px; }
  .spotlight-head .portrait { width: 28px; height: 28px; box-shadow: none; }
  .speech-label { font-size: 14px; line-height: 1.15; letter-spacing: .015em; }
  .spotlight-head small { font-size: 12px; margin-top: 2px; }
  .spotlight-share { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; box-shadow: none; background: transparent; font-size: 23px; color: #796446; }
  .speech p { font-size: clamp(18px,4.8vw,20px); font-weight: 600; line-height: 1.27; -webkit-line-clamp: 3; }
  .spotlight-hint { margin-top: 2px; gap: 6px; font-size: 12px; line-height: 1.25; justify-content: flex-end; }
  .spotlight-hint > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .spotlight-hint button { min-height: 44px; padding: 4px 8px; }
  .speech::after { bottom: -19px; left: 53%; width: 20px; height: 20px; background: #f1cf83; }
  .spotlight-rays { left: 3%; top: 37%; width: 94%; height: 31%; }
  .spotlight-rays { display: none; }
  .audience-card { display: none; width: 45%; }
  .audience-card[data-compact-slot='0'],.audience-card[data-compact-slot='1'] { display: block; top: calc(100% - 130px); width: 43%; }
  .audience-card[data-compact-slot='0'] { left: 3%; right: auto; }
  .audience-card[data-compact-slot='1'] { right: 3%; left: auto; top: calc(100% - 104px); }
  .audience-card::after { width: 16px; height: 14px; bottom: -12px; }
  .bubble-select { height: 90px; min-height: 44px; grid-template-columns: 22px minmax(0,1fr); grid-template-rows: 22px 54px; gap: 3px 6px; padding: 7px 9px; border: 0; box-shadow: inset 0 0 0 2px #b4bfd0; background: #e5e9f0; clip-path: polygon(0 6px,6px 6px,6px 0,calc(100% - 6px) 0,calc(100% - 6px) 6px,100% 6px,100% calc(100% - 6px),calc(100% - 6px) calc(100% - 6px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 6px),0 calc(100% - 6px)); }
  .bubble-select .portrait { width: 22px; height: 22px; grid-row: 1; box-shadow: none; }
  .bubble-author { align-self: center; font: 10px/14px var(--font-body); letter-spacing: .04em; color: #5f6974; }
  .bubble-text { grid-column: 1 / -1; font-size: 14px; font-weight: 500; line-height: 18px; -webkit-line-clamp: 3; }
  .bubble-meta { display: none; }
  .composer-dock { inset: auto 0 0; height: var(--venue-dock); padding: 6px 10px calc(6px + env(safe-area-inset-bottom,0px)); display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: 54px 44px; gap: 4px; border-top: 2px solid #405e87; }
  .scene-tools { justify-content: flex-end; grid-column: 1; grid-row: 2; min-height: 44px; gap: 0; }
  .room-menu { left: auto; right: 12px; bottom: 60px; }
  @supports (bottom: anchor(top)) { .room-menu { right: anchor(right); bottom: anchor(top); } }
  .scene-tools button { flex: none; min-width: 44px; min-height: 44px; padding: 4px 3px; font: 13px/1.15 var(--font-body); border: 0; border-bottom: 2px solid transparent; box-shadow: none; background: transparent; color: #b9c9da; }

  .dock-note { display: none; }
  .dock-input { grid-row: 1; min-height: 54px; gap: 4px; padding: 2px 4px; border: 1px solid #526784; box-shadow: none; background: #111f34; }
  .dock-input > .portrait { display: none; }
  .kind-toggle { display: grid; place-items: center; position: relative; width: 44px; height: 46px; min-height: 44px; padding: 2px; flex: none; background: transparent; border: 0; box-shadow: none; }
  .kind-toggle canvas { width: 28px; height: 28px; }
  .kind-toggle > span { position: absolute; right: 0; bottom: 0; font-size: 12px; }
  .dock-input textarea,.dock-input textarea:focus { font-size: 16px; line-height: 1.4; padding: 10px 6px; height: 46px; min-height: 46px; max-height: 46px; }
  .send-arrow { width: 44px; height: 46px; padding: 4px; border: 0; background: #d2b579; color: #172238; box-shadow: none; }
  .dock-kinds { display: none; position: absolute; bottom: calc(100% + 6px); left: 10px; right: 10px; padding: 8px; background: #0b1a35; border: 2px solid #6584b4; box-shadow: 3px 4px #040b18; z-index: 10; }
  .kind-menu-open .dock-kinds { display: flex; }
  .dock-kinds button { min-height: 44px; font-size: 15px; }
  .composer-dock .feedback { position: absolute; bottom: calc(100% + 4px); left: 10px; right: 10px; height: auto; max-height: 72px; min-height: 0; padding: 8px 10px; color: #ffe6a8; border: 1px solid #786748; background: #102038; font-size: 12px; line-height: 1.5; overflow: auto; }
  .composer-dock .feedback:empty { display: none; }
  .replying { position: absolute; bottom: calc(100% + 4px); left: 10px; right: 10px; padding: 4px 8px; background: #0c1a33; border: 2px solid var(--line); }
  .scene-footer { display: none; }
  .reference-dialog { width: calc(100vw - 24px); max-height: calc(var(--venue-height,100dvh) - 24px); }
  .reference-header { padding: 10px 12px; font-size: 22px; }
  .reference-body { padding: 18px; }
  .room-dialog { width: calc(100vw - 16px); max-height: calc(var(--venue-height,100dvh) - 20px); margin: 10px auto; }
  .room-dialog-head { flex-wrap: wrap; padding: 8px; }
  .room-dialog-head h2 { font-size: 19px; flex-basis: calc(100% - 60px); order: 0; }
  .room-dialog-close { order: 1; }
  .room-tab { order: 2; flex: 1; }
  .room-dialog-body { padding: 4px 10px 12px; }
}
@media (max-width: 350px) {
  .speech { top: 40%; left: 8%; width: 84%; padding: 3px; }
  .speech p { font-size: 18px; line-height: 1.25; }
  .spotlight-head small { font-size: 12px; }
  .spotlight-hint > span { -webkit-line-clamp: 1; }
  .audience-card[data-compact-slot='1'] { display: none; }
  .audience-card[data-compact-slot='0'] { width: 68%; left: 5%; top: calc(100% - 112px); }
  .bubble-select { height: 78px; grid-template-rows: 22px 36px; }
  .bubble-text { -webkit-line-clamp: 2; }
  .backdrop-title > span,.backdrop-title small { display: none; }
  .backdrop-title { top: 8px; }
  .scene-tools button { font-size: 13px; }
}
/* A short visual viewport usually means landscape or an open keyboard. Keep writing usable. */
.immersive[data-short-viewport='true'] .backdrop-title > span,
.immersive[data-short-viewport='true'] .backdrop-title small,
.immersive[data-short-viewport='true'] .backdrop-title button,
.immersive[data-short-viewport='true'] .audience-bubbles,
.immersive[data-short-viewport='true'] .spotlight-rays { display: none; }
.immersive[data-short-viewport='true'] .backdrop-title { top: 8px; }
.immersive[data-short-viewport='true'] .speech { top: 54px; max-height: calc(100% - 66px); overflow: auto; }
.immersive[data-short-viewport='true'] .speech p { font-size: 18px; -webkit-line-clamp: 2; }
@media (max-width: 900px) {
 .immersive .speech::before { content:''; position:absolute; inset:0; z-index:-1; background:#f1cf83; clip-path:polygon(0 8px,4px 8px,4px 4px,8px 4px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 4px,calc(100% - 4px) 4px,calc(100% - 4px) 8px,100% 8px,100% calc(100% - 8px),calc(100% - 4px) calc(100% - 8px),calc(100% - 4px) calc(100% - 4px),calc(100% - 8px) calc(100% - 4px),calc(100% - 8px) 100%,8px 100%,8px calc(100% - 4px),4px calc(100% - 4px),4px calc(100% - 8px),0 calc(100% - 8px)); }
 .immersive .speech-surface { padding:9px 11px; background:#fff8e8; clip-path:polygon(0 5px,5px 5px,5px 0,calc(100% - 5px) 0,calc(100% - 5px) 5px,100% 5px,100% calc(100% - 5px),calc(100% - 5px) calc(100% - 5px),calc(100% - 5px) 100%,5px 100%,5px calc(100% - 5px),0 calc(100% - 5px)); }
 .immersive .speech[data-speaker-active=false] .spotlight-hint { display:none; }
 .immersive .speech[data-speaker-active=true] p { -webkit-line-clamp:2; }
 .immersive .speech[data-speaker-active=true] .spotlight-head { margin-bottom:4px; }
 .immersive .speech[data-speaker-active=true] .spotlight-hint > span { display:none; }
 .immersive .spotlight-hint button { border:0; background:transparent; box-shadow:none; padding:4px 0 0 12px; }
 .immersive .spotlight-head small { font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
 .immersive .audience-card[data-compact-slot='0']::after { left:26%; }
 .immersive .audience-card[data-compact-slot='1']::after { left:72%; }
}

@media (max-width:350px) { .immersive .speech::after { left:88%; } }

/* A broadcast-style side stream uses the same reviewed public statements as the balloons. */
.participation[data-has-voices='true'] > h2,.participation[data-has-voices='true'] > p { display: none; }
.audience-stream { margin-bottom: 12px; transition: opacity .45s ease, visibility 0s .45s; }
.audience-stream h3 { color: var(--gold); font: 600 17px/1.3 var(--pixel); margin: 0 0 8px; }
.audience-stream > div { overflow: hidden; }
.stream-statement:nth-child(n+3) { display: none; }
.stream-statement { display: block; width: 100%; min-height: 44px; padding: 4px 0; text-align: left; border: 0; box-shadow: none; background: transparent; color: #ecf0f8; font: 13px/1.35 var(--font-body); }
.stream-statement strong { color: #dcc28f; font-size: 11px; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stream-statement span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.immersive:not(.motion-paused) .stream-statement { animation: stream-arrive .5s ease-out both; }
@keyframes stream-arrive { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.immersive:not(.motion-paused) .audience-stream.stream-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@media (min-width: 901px) and (max-height: 900px) { .audience-stream { margin-bottom: 8px; } .audience-stream .stream-statement:nth-child(n+2) { display: none; } .audience-stream h3 { font-size: 14px; margin-bottom: 4px; } .stream-statement span { -webkit-line-clamp: 1; } }
@media (max-width: 900px) {
 /* The parent is pinned 12px from the right; place the stream 12px from the left to clear both stage figures. */
 .audience-stream { position: absolute; top: calc(88px + 10svh); left: calc(100% - 100vw + 24px); right: auto; width: min(34vw,180px); margin: 0; padding: 6px 8px; background: #09162aca; border-left: 2px solid #51718a; }
 .audience-stream h3 { font: 600 10px/1.25 var(--font-body); white-space: nowrap; margin-bottom: 2px; }
 .audience-stream > div { max-height: none; }
 .stream-statement { font-size: 12px; padding: 2px 0; }
 .stream-statement strong { font-size: 10px; }
 .stream-statement:nth-child(n+2) { display: none; }
 .immersive[data-short-viewport='true'] .audience-stream { display: none; }
}
@media (prefers-reduced-motion: reduce) { .audience-stream { transition: none; } .stream-statement { animation: none !important; } }
