/* */
:root {
  --bg: #000; --text-1: #f5f5f5; --text-2: #fffc; --text-3: #fff9;
  --brand: #e5243b; --brand-hover: #c41d31;
  --line: rgba(255,255,255,.08); --chip: rgba(255,255,255,.06);
  --panel: rgba(23,23,23,.8); --surface: #171717;
  --ease: cubic-bezier(.2,.8,.2,1);
  /* mode accents (their --b-mode-chat / story / movie) */
  --chat: 145,66,190; --chat-name: #e4c0ff; --chat-text: #cb9aee; --chat-a: #ffb2cb; --chat-b: #d5c0ff;
  --story: 229,36,59; --story-name: #fdadb1; --story-text: #ee8aa6; --story-a: #fda5ab; --story-b: #fda891;
  --movie: 37,117,189; --movie-name: #acd6ff; --movie-text: #83b6e8; --movie-a: #9bcdf5; --movie-b: #98e2e1;
  --dusk-ink: #2e1022;
  --font: "Nunito Sans", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text-1); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* accent per mode */
.room { --acc: var(--chat); --acc-name: var(--chat-name); --acc-text: var(--chat-text); --acc-a: var(--chat-a); --acc-b: var(--chat-b); }
.room[data-mode="story"] { --acc: var(--story); --acc-name: var(--story-name); --acc-text: var(--story-text); --acc-a: var(--story-a); --acc-b: var(--story-b); }
.room[data-mode="movie"] { --acc: var(--movie); --acc-name: var(--movie-name); --acc-text: var(--movie-text); --acc-a: var(--movie-a); --acc-b: var(--movie-b); }

.room { position: relative; height: 100dvh; display: grid; grid-template-rows: 80px minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* ---------- top bar ---------- */
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(24px + env(safe-area-inset-top)) 24px 12px; z-index: 20; min-width: 0; }
.top-group { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 0; }
.top-end { justify-content: flex-end; gap: 8px; }
.icon-key { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; color: var(--text-1); text-decoration: none; flex: none; }
.icon-key:hover { opacity: .8; }
.icon-key svg { width: 22px; height: 22px; }
.char-chip { display: flex; align-items: center; gap: 10px; height: 44px; min-width: 0; max-width: 300px; flex: 1 1 auto; padding: 0 12px 0 6px; border: .5px solid var(--line); border-radius: 12px; background: var(--chip); text-align: left; }
.char-chip:hover { background: rgba(255,255,255,.1); }
.char-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; font-weight: 800; background: #222; }
.char-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.char-words { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.char-words strong { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-words small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-chip .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s; }
.char-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }

.media-toolbar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px; border: .5px solid var(--line); border-radius: 12px; background: var(--chip); flex: none; }
.tool { height: 36px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text-1); }
.tool:hover { background: rgba(255,255,255,.08); }
.tool .ic-sound { display: none; }
#muteBtn[aria-pressed="false"] .ic-sound { display: block; } #muteBtn[aria-pressed="false"] .ic-muted { display: none; }
#ccBtn[aria-pressed="false"] { opacity: .45; }
.tool-speed { font-size: 13px; font-weight: 800; }
.tool-speed svg { width: 14px; height: 14px; }
#filmBtn.busy { color: rgb(var(--acc)); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.snap { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: .5px solid var(--line); border-radius: 12px; background: var(--chip); font-size: 14px; font-weight: 700; color: var(--text-1); }
.snap:hover { background: rgba(255,255,255,.1); }
.snap.bells { color: #ffcf4a; font-weight: 800; }
.snap.bells svg { width: 22px; height: 22px; stroke: none; }
.snap.flash { animation: flash .6s 2; }
@keyframes flash { 50% { background: rgba(var(--story), .5); } }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: .5px solid var(--line); border-radius: 12px; background: var(--chip); }
.more-anchor { position: relative; }
.more-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; padding: 6px; border-radius: 14px; background: rgba(28,28,28,.96); border: .5px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.5); z-index: 40; display: grid; }
.more-menu button, .more-menu a { padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14px; font-weight: 600; color: var(--text-1); text-decoration: none; }
.more-menu button:hover, .more-menu a:hover { background: rgba(255,255,255,.08); }
.demo-pill { height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: rgba(255,159,82,.14); color: #ffb37a; font-size: 12px; font-weight: 800; white-space: nowrap; }

/* ---------- relationship card (context rail) ---------- */
.relationship-card { position: absolute; z-index: 30; left: 12px; top: calc(84px + env(safe-area-inset-top)); width: 360px; padding: 16px; border-radius: 16px; background: var(--panel); border: .5px solid var(--line); backdrop-filter: blur(24px); box-shadow: 0 24px 60px rgba(0,0,0,.5); animation: fade-up .2s var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(-6px); } }
.rel-pair { display: flex; align-items: center; gap: 10px; }
.rel-avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #2a2a2a; font-weight: 800; flex: none; }
.rel-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.rel-you { background: linear-gradient(135deg, #3a3a3a, #1c1c1c); color: var(--text-2); }
.rel-link { width: 18px; height: 18px; color: rgb(var(--acc)); fill: rgb(var(--acc)); stroke: none; }
.rel-title { margin: 12px 0 4px; font-size: 16px; font-weight: 800; }
.rel-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rel-meter { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--text-3); }
.rel-meter .bar { flex: 1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.rel-meter .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc-a), var(--acc-b)); transition: width .6s var(--ease); }
.rel-meter b { color: var(--text-1); min-width: 22px; text-align: right; }
.rel-meter.bump b { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.4); color: var(--acc-a); } }
.rel-meta { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }

/* ---------- body: stage + narrative panel ---------- */
.room-body { display: grid; grid-template-columns: minmax(0, 1fr) 456px; gap: 16px; padding: 0 24px 24px; min-height: 0; }
.stage { position: relative; min-height: 0; border-radius: 16px; overflow: hidden; background: #000; }
.stage-backdrop { position: absolute; inset: 0; overflow: hidden; }
.stage-backdrop img { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(32px) brightness(.5) saturate(.9); transition: opacity .6s; }
.stage-frame { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; margin: 0 auto; overflow: hidden; background: #050505; }
.stage-still, .stage-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.stage-video { opacity: 0; transition: opacity .4s; }
.stage-video.on { opacity: 1; }
.stage-still { transform-origin: 50% 30%; }
.stage-still.kb { animation: kenburns var(--kb-dur, 14s) ease-in-out forwards; }
@keyframes kenburns { from { transform: scale(var(--kb-s0, 1.03)); } to { transform: scale(var(--kb-s1, 1.14)) translate(var(--kb-x1, 0), var(--kb-y1, -2%)); } }
.stage-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 22%, transparent 64%, rgba(0,0,0,.55)); }
.stage.ph-grad .stage-frame, .ph-grad { background: radial-gradient(120% 80% at 30% 15%, hsl(var(--h) 70% 55% / .55), transparent 60%), radial-gradient(90% 70% at 80% 60%, hsl(calc(var(--h) + 50) 60% 40% / .5), transparent 65%), #161616; }
.stage.ph-grad .stage-frame::before { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 30%; font-size: 160px; font-weight: 900; color: rgba(255,255,255,.12); }

/* subtitles (SubtitleLayer .web: bottom 12%, 19px, 600) */
.sub-layer { position: absolute; inset-inline: 0; bottom: 12%; z-index: 3; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; transition: bottom .32s var(--ease); }
.sub-cue { max-width: 78%; margin: 0; padding: 6px 14px; border-radius: 12px; background: rgba(0,0,0,.35); color: rgba(255,255,255,.97); text-align: center; font-size: 19px; font-weight: 600; line-height: 1.4; text-shadow: 0 1px 2px rgba(0,0,0,.7), 0 0 12px rgba(0,0,0,.35); animation: cue-in .25s var(--ease); }
.sub-cue:empty { display: none; }
.sub-cue .who { display: block; font-size: 13px; font-weight: 800; color: var(--acc-name); }
.sub-cue.narr { font-style: italic; font-weight: 500; color: rgba(255,255,255,.88); }
@keyframes cue-in { from { opacity: 0; transform: translateY(4px); } }
.room[data-cc="off"] .sub-layer { display: none; }
.scrub { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 3; height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); }
.scrub i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: #fff; }
.scrub b { position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.room:not([data-phase="opening"]) .scrub { opacity: 0; }
.filming { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); font-weight: 800; font-size: 14px; white-space: nowrap; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--acc)); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { opacity: .25; transform: translateY(-3px); } }
.media-chip { position: absolute; top: 14px; right: 14px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); font-size: 12px; font-weight: 700; color: var(--text-2); }
.media-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--acc)); animation: pulse 1.2s infinite; }

/* ---------- narrative panel: transcript + dock ---------- */
.narrative { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 0 8px; }
.transcript { flex: 1; min-height: 0; overflow-y: auto; border-radius: 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.rounds { padding: 8px 2px 16px; display: grid; gap: 20px; }
.round-open { display: grid; gap: 12px; }
.round-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; color: var(--acc-name); }
.round-label .live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: rgb(var(--acc)); vertical-align: 1px; }
.round-label time { color: var(--text-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.opening-pic { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #111; }
.opening-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.round-name { margin: 0; font-size: 34px; font-weight: 1000; font-stretch: 75%; line-height: 1; text-transform: uppercase; letter-spacing: -.005em; }
.round-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.round-tags li { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 18px; color: var(--text-2); background: rgba(255,255,255,.07); }
.round-hook { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-2); font-weight: 600; }
.round-actions { display: flex; align-items: center; gap: 8px; }
.pill-btn { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: .5px solid var(--line); border-radius: 10px; background: var(--chip); font-size: 13px; font-weight: 700; }
.pill-btn:hover { background: rgba(255,255,255,.1); }
.pill-btn svg { width: 16px; height: 16px; }
.vote { width: 36px; padding: 0; justify-content: center; }
.vote[aria-pressed="true"] { background: rgba(var(--acc), .35); border-color: rgba(var(--acc), .6); }
.round-actions .spacer { flex: 1; }
.round { display: grid; gap: 8px; padding-top: 4px; border-top: .5px solid var(--line); animation: fade-up .3s var(--ease) both; }
.round-head { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--text-3); }
.round-head .mode { color: var(--acc-name); }
.you-say { justify-self: end; max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: rgba(var(--acc), .32); border: .5px solid rgba(var(--acc), .5); font-size: 14px; font-weight: 600; line-height: 1.45; }
.scene-thumb { width: 72px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; float: right; margin: 0 0 6px 10px; background: #111; }
.scene-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scene-text { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.scene-text .narr { font-style: italic; color: var(--text-3); margin-bottom: 4px; }
.scene-text b { color: var(--acc-name); font-weight: 800; }
.scene-text .act { color: var(--text-3); font-size: 12px; }
.round-pending { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); padding: 4px 0; }

.dock { flex: none; display: grid; gap: 10px; }
.dock-status { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--text-3); }
.dock-status #dockHint { color: var(--acc-name); }
.dock-status .dot { opacity: .6; }
.room[data-phase="opening"] .dock-status #dockHint { color: var(--text-3); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.suggest:empty { display: none; }
.suggest button { max-width: 100%; height: 34px; padding: 0 12px; border: .5px solid rgba(var(--acc), .45); border-radius: 999px; background: rgba(var(--acc), .12); color: var(--text-1); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: fade-up .25s var(--ease) both; }
.suggest button:hover { background: rgba(var(--acc), .3); }
.composer { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 6px; border-radius: 16px; background: rgba(28,28,28,.9); border: .5px solid rgba(255,255,255,.12); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(var(--acc), .7); box-shadow: 0 0 0 3px rgba(var(--acc), .18); }
.mode-chip { height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: rgba(var(--acc), .2); color: var(--acc-name); font-size: 13px; font-weight: 800; white-space: nowrap; }
.composer input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 15px; font-weight: 600; }
.composer input::placeholder { color: var(--text-3); }
.composer kbd { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: .5px solid rgba(255,255,255,.2); font: 700 12px/1 var(--font); color: var(--text-3); }
.send { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 0; border-radius: 12px; background: linear-gradient(100deg, var(--acc-a), var(--acc-b)); color: var(--dusk-ink); font-weight: 900; }
.send:disabled { opacity: .45; cursor: default; }
.send .cost { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; }
.send .cost svg { width: 15px; height: 15px; stroke: none; }
.send .plane { width: 18px; height: 18px; }
.room[data-phase="opening"] .suggest, .room[data-phase="opening"] .send .cost { opacity: .5; }

/* ---------- mode picker (playMode introLayer) ---------- */
.intro-layer { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-end; }
.intro-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.8); animation: fade .22s linear both; }
@keyframes fade { from { opacity: 0; } }
.intro-sheet { position: relative; width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 20px 12px calc(14px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; border: 1px solid rgba(255,255,255,.08); border-bottom: 0; background: linear-gradient(rgba(255,255,255,.035), rgba(255,255,255,0) 140px), rgba(19,19,19,.92); backdrop-filter: blur(32px); box-shadow: 0 -18px 48px #0000004d; animation: sheet-in .22s var(--ease) both; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.intro-title { margin: 0 4px; font-size: 18px; line-height: 1.15; font-weight: 600; }
.intro-sub { margin: 4px 4px 14px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.intro-cards { display: flex; flex-direction: column; gap: 8px; }
.intro-card { --c: var(--chat); --c-name: var(--chat-name); --c-text: var(--chat-text); --c-a: var(--chat-a); --c-b: var(--chat-b);
  position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: stretch; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: rgba(29,29,29,.94); text-align: start; animation: card-in .3s var(--ease) 60ms both; transition: transform .12s var(--ease); }
.intro-card[data-mode="story"] { --c: var(--story); --c-name: var(--story-name); --c-text: var(--story-text); --c-a: var(--story-a); --c-b: var(--story-b); }
.intro-card[data-mode="movie"] { --c: var(--movie); --c-name: var(--movie-name); --c-text: var(--movie-text); --c-a: var(--movie-a); --c-b: var(--movie-b); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
.intro-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 1px rgba(255,255,255,.08); }
.intro-card:hover::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 1px rgba(255,255,255,.1); }
.intro-card.on::after { box-shadow: inset 0 0 0 1.5px var(--c-name); }
.intro-card:active { transform: scale(.99); }
.intro-art { position: relative; width: 104px; min-height: 124px; background: #111; overflow: hidden; }
.intro-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.intro-art.wide { background: #000; }
.intro-art.wide img { height: 60%; top: 20%; }
.intro-art::before { content: ""; position: absolute; top: 0; left: 0; z-index: 1; width: 72px; height: 72px; background: radial-gradient(circle at 0 0, #0009 0, #0006 22px, #00000029 40px, #0000 64px); }
.intro-badge { position: absolute; z-index: 2; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--c-a); color: var(--dusk-ink); }
.intro-badge svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.intro-text { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 10px 12px 10px 12px; }
.intro-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.intro-name { font-size: 13px; font-weight: 800; color: var(--c-name); line-height: 1.3; }
.intro-pov { height: 18px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: 4px; background: rgba(var(--c), .18); color: var(--c-text); font-size: 11px; font-weight: 600; white-space: nowrap; }
.intro-title-line { display: block; margin: 1px 0 2px; font-size: 16px; font-weight: 400; line-height: 1.2; letter-spacing: -.005em; text-wrap: balance; }
.intro-line { font-size: 11.5px; font-weight: 500; line-height: 1.4; color: var(--text-3); text-wrap: pretty; }
.intro-tag { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.intro-tag .d { color: rgba(255,255,255,.4); }
.intro-tag b { display: inline-flex; align-items: center; gap: 3px; }
.intro-tag b svg { width: 12px; height: 12px; stroke: none; }
.intro-go { display: none; }
.intro-balance { display: flex; justify-content: center; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--text-3); }
.intro-balance b { color: #ffcf4a; }
@media (min-width: 768px) {
  .intro-layer { align-items: center; overflow-y: auto; }
  .intro-scrim { background: rgba(7,7,7,.62); backdrop-filter: blur(14px); position: fixed; }
  .intro-sheet { width: auto; max-height: none; margin: auto; padding: clamp(16px, 4dvh, 40px) 24px; border: 0; border-radius: 0; background: none; backdrop-filter: none; box-shadow: none; overflow: visible; }
  .intro-title { text-align: center; margin: 0; font-size: 30px; line-height: 1.2; }
  .intro-sub { text-align: center; margin: 8px 0 30px; font-size: 15px; }
  .intro-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 296px)); justify-content: center; gap: 18px; }
  .intro-card { display: flex; flex-direction: column; border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
  .intro-art { width: 100%; height: clamp(160px, 100dvh - 560px, 240px); min-height: 0; flex: none; }
  .intro-art::before { width: 96px; height: 96px; background: radial-gradient(circle at 0 0, #0009 0, #0006 30px, #00000029 54px, #0000 86px); }
  .intro-badge { width: 28px; height: 28px; top: 12px; left: 12px; }
  .intro-text { flex: 1; justify-content: flex-start; gap: 8px; padding: 16px 20px 20px; }
  .intro-name { font-size: 15px; }
  .intro-pov { font-size: 12px; }
  .intro-title-line { font-weight: 300; }
  .intro-line { font-size: 13px; }
  .intro-tag b svg { width: 14px; height: 14px; }
  .intro-card { border-radius: 22px; }
  .intro-title-line { margin: 0; font-size: 23px; }
  .intro-line { min-height: 37.7px; font-size: 13px; line-height: 1.45; }
  .intro-tag { gap: 6px; margin-top: auto; padding-top: 2px; font-size: 12.5px; }
  .intro-go { display: flex; justify-content: center; align-items: center; height: 44px; margin-top: 14px; border-radius: 999px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); font-size: 15px; font-weight: 700; transition: background-color .12s; }
  .intro-card:hover .intro-go, .intro-card.on .intro-go { background: linear-gradient(100deg, var(--c-a), var(--c-b)); box-shadow: none; color: var(--dusk-ink); }
  .intro-balance { gap: 7px; margin-top: 26px; font-size: 15px; font-weight: 600; }
}

/* ---------- log sheet (phone), resume, toast ---------- */
.log-sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; }
.log-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); animation: fade .2s both; }
.log-panel { position: relative; width: 100%; max-height: 82dvh; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: rgba(19,19,19,.97); border: 1px solid var(--line); border-bottom: 0; animation: sheet-in .22s var(--ease) both; padding-bottom: env(safe-area-inset-bottom); }
.log-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 0 20px; }
.log-body { overflow-y: auto; padding: 4px 16px 20px; }
.resume { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.66); backdrop-filter: blur(10px); }
.resume-card { width: min(380px, 100%); padding: 24px; border-radius: 20px; background: var(--surface); border: .5px solid var(--line); text-align: center; }
.resume-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--text-3); }
.resume-card strong { font-size: 22px; }
.resume-card p#resumeInfo { margin: 8px 0 20px; color: var(--text-2); font-size: 14px; }
.resume-card .row { display: flex; gap: 10px; }
.btn-ghost, .btn-brand { flex: 1; height: 46px; border-radius: 12px; font-weight: 800; font-size: 15px; }
.btn-ghost { border: .5px solid rgba(255,255,255,.2); background: var(--chip); }
.btn-brand { border: 0; background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-hover); }
.toast { position: fixed; left: 50%; top: calc(92px + env(safe-area-inset-top)); z-index: 100; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: rgba(30,30,30,.96); border: .5px solid var(--line); font-size: 14px; font-weight: 700; white-space: nowrap; animation: fade-up .2s var(--ease) both; }

/* ---------- tablet ---------- */
@media (max-width: 1279px) { .room-body { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (max-width: 1023px) { .room-body { grid-template-columns: minmax(0, 1fr) 340px; padding: 0 16px 16px; } .top-bar { padding-inline: 16px; } .snap span { display: none; } }

/* ---------- phone: full-bleed stage, minimal chrome, frosted composer ---------- */
@media (max-width: 767px) {
  .room { grid-template-rows: auto minmax(0, 1fr); padding: 0; }
  .top-bar { position: absolute; inset: 0 0 auto; padding: calc(10px + env(safe-area-inset-top)) 8px 8px; gap: 6px; background: linear-gradient(rgba(0,0,0,.45), transparent); }
  .top-group { gap: 2px; }
  .char-chip { background: none; border: 0; padding: 0 4px; max-width: 200px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
  .char-avatar { display: none; }
  .char-chip .chev { display: none; }
  .char-words strong { font-size: 16px; }
  .media-toolbar { position: fixed; right: 8px; top: 38%; z-index: 15; flex-direction: column; height: auto; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); }
  .tool { width: 40px; height: 40px; padding: 0; }
  .tool-speed svg { display: none; }
  .snap { height: 36px; padding: 0 10px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); }
  .snap span { display: none; }
  #saveBtn { display: none; }
  .icon-btn { width: 36px; height: 36px; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); }
  .demo-pill { display: none !important; }
  .relationship-card { left: 8px; right: 8px; width: auto; top: calc(64px + env(safe-area-inset-top)); }
  .room-body { grid-row: 1 / -1; grid-template-columns: 1fr; padding: 0; gap: 0; }
  .stage { position: absolute; inset: 0; border-radius: 0; }
  .stage-backdrop { display: none; }
  .stage-frame { width: 100%; height: 100%; aspect-ratio: auto; }
  .stage-shade { background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 18%, transparent 52%, rgba(0,0,0,.72)); }
  .sub-layer { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .sub-cue { font-size: 17px; max-width: 86%; }
  .scrub { bottom: calc(132px + env(safe-area-inset-bottom)); }
  .narrative { position: absolute; inset: auto 0 0; z-index: 10; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); gap: 8px; }
  .transcript { display: none; }
  .dock-status { display: none; }
  .composer { height: 52px; background: rgba(40,40,40,.55); backdrop-filter: blur(20px) saturate(1.4); border-color: rgba(255,255,255,.14); }
  .mode-chip { height: 36px; padding: 0 10px; }
  .composer kbd { display: none; }
  .send { height: 40px; padding: 0 10px; }
  .suggest { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .suggest::-webkit-scrollbar { display: none; }
  .suggest button { flex: none; background: rgba(20,20,20,.55); backdrop-filter: blur(12px); }
  .toast { top: calc(64px + env(safe-area-inset-top)); white-space: normal; max-width: calc(100vw - 32px); text-align: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
