/* nioai: Mia's page (same elements, same places, same behaviour) in nioai's own look: pure white, the overlit
   pictures of the host in the background, a white print-like frame around the stream. */
:root {
  --studio: #F5F5F5;      /* the portrait's studio background; /api/config can override it */
  --ink: #111;
  --soft: #2b2b2b;        /* message text */
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --line-strong: #cfcfcf;
  --panel: #ffffff;
  --field: #ffffff;
  --live: #e5372b;
  --error: #d32f2f;
  --overlay: rgba(17, 17, 17, .72);   /* the boxes on the stream: live badge, sound, full screen */
  --shadow: 0 30px 80px rgba(0, 0, 0, .12), 0 3px 10px rgba(0, 0, 0, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; overflow: hidden; background: #ffffff; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* pure white, so the pictures can start and end as white and be invisible */
  background: #ffffff;
  color: var(--ink);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ico { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.noscript { position: relative; z-index: 2; margin: 0; padding: 16px 24px; background: var(--ink); color: #fff; }

/* ---------- backdrop: draft G, "white -> overlit -> white", spawning like Mia's (see backdrop.js) ----------
   Pictures of the host appear around the player. Each starts pure white on the white page (invisible), dims down to
   an overlit look (bleached skin, soft bloom, edges melting into white), holds, then brightens back to white. Nothing
   fades: a white veil and the exposure carry the whole animation. Like Mia's pieces, each runs an endless cycle
   (--cycle, 15-23 s): visible in the first 49%, quiet (hidden) for the rest, then it starts over somewhere else. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.piece {
  position: absolute;
  width: 200px;
  height: 200px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  /* opaque: where pictures overlap, the newer one sits on top and fully covers the one under it */
  animation: expose var(--cycle, 19s) linear var(--delay, 0s) infinite both;
}
/* each piece is one of the picked pictures (backdrop.js sets it). They're chest-up with his face high in the frame,
   so the picture sits 30px lower inside the round fade, keeping his hair out of the faded rim. */
.piece .ph, .piece .bloom {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: center 30px;
}
/* contrast before brightness, so the photo's near-white background (and the empty strip above it) ends as pure
   white: a grey background (contrast last left it at #f5f5f5) builds up into a visible disc with a rim when many
   pictures stack on one spot, e.g. someone spam-clicking */
/* the look (draft F): fitted to the overexposed reference frame by measuring its face (brightness spread, about a
   quarter blown to pure white, skin colour per brightness level, softness); most of it is a wide, bright glow
   layer over a slightly punchier photo. The blur suits his face at this size (~64px wide). */
.piece .ph { background-color: #fff; filter: contrast(1.27) brightness(1.15) saturate(.59); }
.piece .bloom { filter: blur(16px) brightness(1.46); mix-blend-mode: screen; opacity: .93; }
/* the white veil guarantees true white at both ends (brightness alone would leave dark hair grey) */
.piece .veil {
  position: absolute;
  inset: 0;
  background: #fff;
  animation: veil var(--cycle, 19s) linear var(--delay, 0s) infinite both;
}
/* the visible half, with G's curve: in (quick at first, then settling), a short hold, out (eases in and out until
   he's gone); then pure white and hidden until the next cycle */
@keyframes expose {
  0% { filter: brightness(2.2); visibility: visible; animation-timing-function: cubic-bezier(.25, .6, .3, 1); }
  20.6% { filter: brightness(1); animation-timing-function: linear; }
  26.5% { filter: brightness(1); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  49% { filter: brightness(2.2); visibility: visible; }
  49.1%, 100% { filter: brightness(2.2); visibility: hidden; }
}
@keyframes veil {
  0% { opacity: 1; animation-timing-function: cubic-bezier(.25, .6, .3, 1); }
  20.6% { opacity: 0; animation-timing-function: linear; }
  26.5% { opacity: 0; animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  49%, 100% { opacity: 1; }
}
/* a picture made by a click: there at once (already half out of the white), holds, then goes back into the white;
   9 s, like Mia's */
.piece.clicked { animation: click-expose 9s linear 1 forwards; }
.piece.clicked .veil { animation: click-veil 9s linear 1 forwards; }
@keyframes click-expose {
  0% { filter: brightness(1.7); animation-timing-function: cubic-bezier(.25, .6, .3, 1); }
  7% { filter: brightness(1); animation-timing-function: linear; }
  55% { filter: brightness(1); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  97%, 100% { filter: brightness(2.2); }
}
@keyframes click-veil {
  0% { opacity: .55; animation-timing-function: cubic-bezier(.25, .6, .3, 1); }
  7% { opacity: 0; animation-timing-function: linear; }
  55% { opacity: 0; animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  97%, 100% { opacity: 1; }
}
/* people who ask for less motion get pictures at rest; a click's picture just comes and goes */
.piece.still, .piece.still .veil { animation: none; }
.piece.still .veil { opacity: 0; }
.piece.clicked.still { animation: click-still 6s linear forwards; }
@keyframes click-still { 0% { opacity: 0; } 5% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- the page, above the backdrop ---------- */
.page { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }

/* ---------- top bar: the name top left; Token and X top right ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; }
/* pictures may sit behind the top bar (like Mia's); a soft white glow keeps it readable */
.brand, .token, .x-link { text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.brand { color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1; text-decoration: none; }
.top-right { display: flex; align-items: center; gap: 14px; }
.token, .x-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.token::after, .x-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  background: currentColor;
  opacity: 0;
}
.token:hover::after, .x-link:hover::after, .token:focus-visible::after, .x-link:focus-visible::after { opacity: 1; }

/* ---------- one screen, no page scrolling: the stream as big as the space allows (16:9), the chat flush to its right */
@property --chat-w { syntax: '<length>'; inherits: true; initial-value: 320px; }
@property --grow { syntax: '<number>'; inherits: true; initial-value: 0; }
.stage {
  --chat-w: 320px;
  --grow: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  container-type: size;
  transition: --grow .35s cubic-bezier(.65, 0, .35, 1), --chat-w .45s cubic-bezier(.65, 0, .35, 1) .3s;
}
.stage.chat-hidden { --chat-w: 36px; --grow: 1; transition: --chat-w .5s cubic-bezier(.65, 0, .35, 1), --grow .45s cubic-bezier(.65, 0, .35, 1) .45s; }
.stage.no-anim, .stage.no-anim .chat-inner, .stage.no-anim .chat-rail { transition: none; }
.duo { display: flex; align-items: stretch; max-width: 100%; }
.stream { flex: none; display: flex; flex-direction: column; }

/* a white border around the stream, like a big print */
.frame {
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px 0 0 6px;
  box-shadow: var(--shadow);
}
.screen {
  --vw: min(calc(100cqw - var(--chat-w) - 26px), calc((100cqh - 26px) * 16 / 9));
  --h-open: calc(min(calc(100cqw - 346px), calc((100cqh - 26px) * 16 / 9)) * 9 / 16);
  --h-hidden: calc(min(calc(100cqw - 62px), calc((100cqh - 26px) * 16 / 9)) * 9 / 16);
  position: relative;
  width: var(--vw);
  height: calc(var(--h-open) + (var(--h-hidden) - var(--h-open)) * var(--grow));
  overflow: hidden;
  background: var(--studio);
}
.screen > video, .screen > img {
  /* the face is a 16:9 studio shot (assets/face/portrait-wide.png): it fills the whole screen, edge to edge, like a
     person filmed in a white studio; no fading */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The video stays laid out (just invisible) until it plays: LiveKit's adaptive streaming pauses video
   it thinks nobody can see, and a display:none player looks like that. */
.screen > video { opacity: 0; transition: opacity .3s; }
.screen[data-mode="live"] > video { opacity: 1; }
/* whatever keeps his picture from showing: his portrait as a faded still, with one line on it */
.screen > img { filter: grayscale(1) contrast(1.05); opacity: .4; transition: opacity .3s; }
.screen[data-mode="live"] > img { opacity: 0; }
.slate { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.slate[hidden] { display: none; }
.slate strong {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}

/* Live: top left of the stream, a steady red dot. In the Graphite style of the sound and full-screen controls
   (draft "C6c + Live", option A): 7px corners, heavy lowercase "live", graphite with off-white type. */
.live-badge {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 10px; box-sizing: border-box;
  background: #2b2b2b; border: 1px solid #2b2b2b; border-radius: 7px; color: #f2f2f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 22px rgba(0, 0, 0, .16);
  font-size: 13px; font-weight: 800; letter-spacing: -.02em; line-height: 1;
}
.live-badge[hidden] { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
/* nioai's own addition: one plain line at the bottom middle of the page saying he isn't a real person. It sits in
   the strip under the player (the 24px that used to be the stage's bottom padding), with the same soft white glow
   as the top bar so background pictures behind it never hide it. */
.ai-note {
  flex: none; height: 24px; margin: 0; padding-inline: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .01em; line-height: 1; text-align: center;
  text-shadow: 0 0 6px #fff, 0 0 2px #fff;
}
.ai-note:empty { display: none; }

/* Sound and full screen: draft C6c, "wordmark labels" in graphite. Heavy lowercase type like the nioai wordmark,
   7px corners, solid graphite with off-white type and a hairline highlight along the top; hover and the open slider
   deepen to ink. */
.vol-tap, .vol-ctl, .fs-btn {
  background: #2b2b2b;
  border: 1px solid #2b2b2b;
  border-radius: 7px;
  color: #f2f2f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 22px rgba(0, 0, 0, .16);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
  transition: background .15s, border-color .15s;
}
.vol .ico, .fs-btn .ico { stroke-width: 2.4; }

/* Sound: bottom left. "tap to unmute" while muted (a tap anywhere on the page does it too). On hover the box grows
   smoothly to --vol-w (172 px, under askMia's 191) while the words fade into the speaker and the volume slider; once the
   sound is on it shrinks to just the speaker and grows the same way on hover. The words and the slider are two layers
   on top of each other; the box (.vol) carries the width and animates it. app.js measures the words' own width into
   --tap-w, so it fits any font. */
.vol {
  --vol-w: 172px; --tap-w: 146px; position: absolute; left: 14px; bottom: 14px; z-index: 3; color: #f2f2f2;
  width: var(--tap-w); height: 40px; transition: width .24s cubic-bezier(.2, .7, .2, 1);
}
.vol[data-muted="0"] { width: 42px; }
.vol[data-open="1"], .vol[data-muted="0"]:has(:focus-visible) { width: var(--vol-w); }
.vol-tap, .vol-ctl { position: absolute; inset: 0; display: inline-flex; align-items: center; overflow: hidden; transition: opacity .18s ease, background-color .2s ease; }
.vol-tap { gap: 9px; padding: 0 12px 0 10px; white-space: nowrap; cursor: pointer; }
.vol-ctl { gap: 10px; padding: 0 12px 0 9px; opacity: 0; pointer-events: none; }
.vol-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.vol-range { --fill: 0%; display: block; flex: 1; min-width: 0; height: 24px; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.vol-range:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vol-range::-webkit-slider-runnable-track { height: 3px; border: 0; border-radius: 2px; background: linear-gradient(to right, #fff 0 var(--fill), rgba(255, 255, 255, .24) var(--fill) 100%); }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 0; border-radius: 50%; background: #fff; }
.vol-range::-moz-range-track { height: 3px; border: 0; border-radius: 2px; background: rgba(255, 255, 255, .24); }
.vol-range::-moz-range-progress { height: 3px; border-radius: 2px; background: #fff; }
.vol-range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.vol[data-muted="1"] .ico-on, .vol[data-muted="0"] .ico-off { display: none; }
/* which layer shows: the words while muted and not opened; the speaker + slider otherwise */
.vol[data-muted="0"] .vol-ctl, .vol[data-open="1"] .vol-ctl { opacity: 1; pointer-events: auto; }
.vol[data-muted="0"] .vol-tap, .vol[data-open="1"] .vol-tap { opacity: 0; pointer-events: none; }
.vol[data-open="1"] .vol-ctl, .vol[data-muted="0"]:has(:focus-visible) .vol-ctl { background: #111; border-color: #111; color: #fff; }
.vol[data-muted="0"]:not([data-open="1"]):not(:hover):not(:has(:focus-visible)) .vol-range { visibility: hidden; }
@media (hover: hover) {
  .vol:hover { width: var(--vol-w); }
  .vol:hover .vol-ctl { opacity: 1; pointer-events: auto; background: #111; border-color: #111; color: #fff; }
  .vol:hover .vol-tap { opacity: 0; pointer-events: none; }
}
/* iPhones only allow the hardware volume buttons: no slider, the speaker stays a square */
.vol.no-volume .vol-range { display: none !important; }
.vol.no-volume[data-muted="0"], .vol.no-volume[data-open="1"] { width: 42px !important; }
@media (prefers-reduced-motion: reduce) { .vol, .vol-tap, .vol-ctl { transition: none; } }

/* Full screen: bottom right of the stream; the whole picture (with these controls) goes full screen. Just the icon,
   a 40px square; its name is in aria-label ("Full screen" / "Exit full screen"). */
.fs-btn { position: absolute; right: 14px; bottom: 14px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; cursor: pointer; }
.fs-btn[hidden] { display: none; }
@media (hover: hover) {
  .fs-btn:hover { background: #111; border-color: #111; color: #fff; }
}
.screen .ico-fs-out, .screen.is-fs .ico-fs-in { display: none; }
.screen.is-fs .ico-fs-out { display: block; }
@media (prefers-reduced-motion: reduce) { .vol-tap, .vol-ctl, .fs-btn { transition: none; } }
.screen:fullscreen { width: 100% !important; height: 100% !important; max-height: none !important; aspect-ratio: auto !important; }
.screen:-webkit-full-screen { width: 100% !important; height: 100% !important; max-height: none !important; aspect-ratio: auto !important; }

/* ---------- chat: flush to the stream's right, as tall as the framed stream; folds into a slim rail ---------- */
.chat {
  position: relative;
  flex: none;
  width: var(--chat-w);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-inner { position: absolute; top: 0; bottom: 0; right: 0; width: 320px; display: flex; flex-direction: column; }
.chat-hide, .rail-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; color: var(--ink); }
.chat-hide { flex: none; margin: -6px 0 -6px -8px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.chat-hide:hover, .chat-rail:hover .rail-icon { background: #f0f0f0; }
.chat-rail {
  position: absolute;
  inset: 0;
  display: flex;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, visibility 0s linear .15s;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.chat-rail .rail-label { writing-mode: vertical-rl; }
.stage.chat-hidden .chat-rail { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .25s ease .45s, visibility 0s linear .45s; }
.stage.chat-hidden .chat-inner { visibility: hidden; transition: visibility 0s linear .5s; }
.chat-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 16px; font-weight: 700; }

.log-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.log {
  list-style: none;
  margin: 0;
  padding: 14px 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .2) transparent;
}
.log > li:first-child { margin-top: auto; }
.msg { padding: 7px 10px; font-size: 15px; line-height: 1.45; color: var(--soft); overflow-wrap: anywhere; }
.msg .nick { color: var(--ink); font-weight: 700; margin-right: 7px; }
.msg.own .nick { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sys { padding: 7px 10px; color: var(--muted); font-size: 14px; }
/* the message he's answering right now, pinned at the top of the chat */
.pinned {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}
.pinned[hidden] { display: none; }
.pinned-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.pinned-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pinned-msg { margin: 0; font-size: 15px; line-height: 1.45; color: var(--soft); overflow-wrap: anywhere; }
.pinned-msg .nick { margin-right: 7px; color: var(--ink); font-weight: 700; }
.jump {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.jump[hidden] { display: none; }

/* the section above the input: the Cloudflare box (when needed) and what the chat filters say about your message */
.chat-alerts.open { padding: 14px 16px; border-top: 1px solid var(--line); }
#ts:empty { display: none; }
.filter-note { margin: 0; color: var(--error); font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: .02em; text-transform: uppercase; }
#ts.open + .filter-note { margin-top: 10px; }

.composer { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.name-row { display: flex; align-items: stretch; height: 42px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); overflow: hidden; cursor: text; }
.name-row:hover { border-color: #b5b5b5; }
.name-row:focus-within { border-color: var(--ink); outline: 3px solid var(--ink); outline-offset: 2px; }
.name-row label { display: flex; align-items: center; padding: 0 12px; border-right: 1px solid var(--line); background: #f6f6f6; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; cursor: text; }
.name-row input { flex: 1; min-width: 0; padding: 0 6px 0 12px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; }
.name-row input:focus-visible { outline: none; }
.name-row .edit { display: flex; align-items: center; padding: 0 12px 0 6px; color: var(--muted); }
.name-row .edit svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.msg-row { display: flex; gap: 8px; }
.msg-row input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; font-size: 16px; }
.msg-row input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
input::placeholder { color: #9a9a9a; }
#msg:disabled { opacity: 1; cursor: not-allowed; border-style: dashed; }
.send { min-width: 88px; height: 48px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.send:disabled { background: #e9e9e9; color: var(--muted); cursor: default; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; min-height: 16px; font-size: 12px; color: var(--muted); }
.note { color: var(--muted); font-size: 12px; }
.note.err { color: var(--error); }

/* ---------- narrow screens: the stream on top, the chat fills the rest of the screen ---------- */
@media (max-width: 820px) {
  .top { padding: 14px 16px; }
  .stage { align-items: stretch; justify-content: stretch; padding: 0 10px; }
  .ai-note { height: 26px; font-size: 11px; }
  .duo { flex-direction: column; width: 100%; height: 100%; }
  .stream { width: 100%; }
  .frame { border-radius: 6px 6px 0 0; padding: 8px; }
  .screen { width: 100%; height: auto; aspect-ratio: var(--ar, 16 / 9); max-height: calc(100cqh - 236px); }
  .chat { flex: 1; width: auto; min-height: 0; border-left: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; }
  .chat-inner { width: auto; left: 0; right: 0; }
  .chat-hide, .stage.chat-hidden .chat-rail { display: none; }
  .stage.chat-hidden .chat-inner { visibility: visible; }
}
