/* Собес: as plain as ChatGPT and Claude. White (or dark) page, a sidebar with history, one big input.
   The call screen keeps its own dark palette below. */

:root, [data-theme='light'] {
  --bg: #ffffff;
  --side: #f9f9f9;
  --surface: #ffffff;
  --raised: #ffffff;
  --hover: #ececec;
  --subtle: #f4f4f4;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #0d0d0d;
  --text-2: #5d5d5d;
  --text-3: #8f8f8f;
  --primary: #0d0d0d;
  --on-primary: #ffffff;
  --primary-hover: #333333;
  --ring: rgba(13, 13, 13, 0.12);
  --ok: #1a7f37;
  --warn: #9a6700;
  --danger: #cf222e;
  --danger-soft: #ffebe9;
  --warn-soft: #fff8c5;
  --ok-soft: #dafbe1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #212121;
  --side: #181818;
  --surface: #2f2f2f;
  --raised: #303030;
  --hover: #2f2f2f;
  --subtle: #2a2a2a;
  --border: #3a3a3a;
  --border-strong: #4a4a4a;
  --text: #ececec;
  --text-2: #b4b4b4;
  --text-3: #8e8e8e;
  --primary: #ececec;
  --on-primary: #0d0d0d;
  --primary-hover: #ffffff;
  --ring: rgba(236, 236, 236, 0.18);
  --ok: #56d364;
  --warn: #e3b341;
  --danger: #ff7b72;
  --danger-soft: rgba(255, 123, 114, 0.12);
  --warn-soft: rgba(227, 179, 65, 0.12);
  --ok-soft: rgba(86, 211, 100, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root {
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --side-w: 260px;
  --font: 'Inter', ui-sans-serif, -apple-system, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 28px; line-height: 36px; }
h2 { font-size: 20px; line-height: 28px; }
h3 { font-size: 16px; line-height: 24px; }
p { margin: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; line-height: 20px; }
.tiny { font-size: 13px; line-height: 18px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.i { width: 20px; height: 20px; flex: none; }
.i-sm { width: 16px; height: 16px; flex: none; }
/* Sprite attributes are not inherited through <use>, so the outline style is set here. */
.i, .i-sm, .i-xs { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-xs { stroke-width: 2.25; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
a, button, summary, label, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Hover only where there is a pointer that hovers: on phones a tapped button would stay "hovered". */
@media (hover: hover) {
  .side-item:hover, .side-list a:hover, .icon-btn:hover { background: var(--hover); }
  .btn:hover { background: var(--subtle); }
  .btn-primary:hover { background: var(--primary-hover); }
  .btn-ghost:hover { background: var(--subtle); }
  .btn-danger-text:hover { background: var(--danger-soft); }
  .pill-btn:hover, .chip:hover, .round-btn:hover { background: var(--subtle); }
  .menu button:hover { background: var(--subtle); }
  .linkbtn:hover { color: var(--text); }
  .seg button:not([aria-pressed='true']):hover { color: var(--text); }
  .round:not(.off):hover { background: #353430; }
  .cbtn:not(.off):not(.on):not(.end):hover { background: #353430; }
  .cbtn.end:hover { background: #b93a30; }
  .tr time:hover { color: var(--text); }
  .hist a:hover { background: var(--subtle); }
}
.btn:active, .chip:active, .pill-btn:active, .send:active, .round:active, .cbtn:active { filter: brightness(0.92); }

/* ---------- shell: sidebar + content ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); z-index: 30;
  display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  transition: transform 0.2s ease;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 600; font-size: 17px; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; color: var(--text); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; text-decoration: none; flex: none; }
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); text-decoration: none; font-size: 14px; line-height: 20px; cursor: pointer; text-align: left;
}
.side-item .av { width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.side-item span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-label { padding: 18px 10px 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.side-list { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.side-list a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); font-size: 14px; line-height: 20px; }
.side-list a.active { background: var(--hover); }
.side-list a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list a small { flex: none; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.side-list .empty { padding: 8px 10px; font-size: 13px; color: var(--text-3); }
.side-bottom { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.side-backdrop { display: none; }
.content { margin-left: var(--side-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; transition: margin-left 0.2s ease; }
.topbar { display: none; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 8px 8px; position: sticky; top: 0; z-index: 10; background: var(--bg); }
.topbar-title { flex: 1; display: flex; align-items: center; min-height: 40px; font-weight: 600; font-size: 16px; text-decoration: none; color: var(--text); padding-left: 4px; }
#app { flex: 1; display: flex; flex-direction: column; }
/* Desktop: the sidebar can be tucked away. */
body.side-closed .side { transform: translateX(-100%); }
body.side-closed .content { margin-left: 0; }
body.side-closed .topbar { display: flex; }
/* Signed out and in the call there is no sidebar. */
body.guest .side, body.guest .topbar, body.in-call .side, body.in-call .topbar, body.in-call .side-backdrop { display: none !important; }
body.guest .content, body.in-call .content { margin-left: 0; }

/* ---------- layout ---------- */
.page { width: 100%; max-width: 768px; margin: 0 auto; padding: 32px 24px calc(80px + env(safe-area-inset-bottom)); }
.page.narrow { max-width: 440px; }
.head { margin-bottom: 24px; }
.head p { margin-top: 6px; color: var(--text-2); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: flex-start; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section { padding: 24px 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: 0; padding-top: 0; }
.section > h2 { margin-bottom: 14px; }

/* ---------- buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-weight: 500; font-size: 15px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-ghost { border-color: transparent; }
.btn-danger-text { border-color: transparent; color: var(--danger); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); font-size: 14px; cursor: pointer; white-space: nowrap; }
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: revert; }
  .mouse-only { display: none; }
  /* Finger-sized hit areas without moving the text. */
  .linkbtn { padding: 10px 2px; margin: -10px -2px; }
  .head a, p a { padding-block: 12px; }
  .att button { width: 32px; height: 32px; margin: -5px -2px -5px 0; }
}

.field { display: block; margin-bottom: 18px; }
.field > span, .label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.field > span .faint { font-weight: 400; }
.hint { display: block; font-size: 13px; line-height: 18px; color: var(--text-3); margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 12px 14px;
  font-size: 16px; line-height: 24px; color: var(--text); outline: none; /* under 16px iOS zooms into the field */
}
.input { height: 48px; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { min-height: 140px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--ring); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--subtle); border-radius: 999px; max-width: 100%; }
.seg button { border: 0; background: transparent; color: var(--text-2); height: 34px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
[data-theme='dark'] .seg button[aria-pressed='true'] { background: #424242; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--text); width: 18px; height: 18px; flex: none; }
.check b { display: block; font-weight: 500; }
.check span { display: block; font-size: 14px; line-height: 20px; color: var(--text-2); }
.check + .check { margin-top: 14px; }
details.more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 500; color: var(--text-2); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .i-sm { transition: transform 0.15s; }
details.more[open] > summary .i-sm { transform: rotate(180deg); }
details.more > div { margin-top: 12px; }

/* dropdown menus of the composer */
.menu {
  position: absolute; z-index: 50; min-width: 220px; max-width: min(320px, calc(100vw - 32px)); padding: 6px; border-radius: var(--r-lg);
  background: var(--raised); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  overflow-y: auto; overscroll-behavior: contain; animation: menuIn 0.16s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: top left;
}
.menu.up { transform-origin: bottom left; animation-name: menuUp; }
.menu-note { padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; line-height: 17px; color: var(--text-3); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes menuUp { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }
.menu button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); text-align: left; cursor: pointer; font-size: 14px; line-height: 20px; }
.menu button .i-sm { margin-top: 2px; visibility: hidden; }
.menu button[aria-checked='true'] .i-sm { visibility: visible; }
.menu button small { display: block; color: var(--text-3); font-size: 13px; line-height: 18px; }

/* ---------- blocks ---------- */
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.notice { border-radius: var(--r); padding: 12px 14px; font-size: 14px; line-height: 20px; display: flex; gap: 10px; align-items: flex-start; background: var(--subtle); color: var(--text-2); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.tag { display: inline-block; font-size: 13px; line-height: 20px; padding: 0 8px; border-radius: 6px; background: var(--subtle); color: var(--text-2); white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--text-2); font-size: 14px; line-height: 20px; }
.list { margin: 0; padding-left: 20px; }
.list li + li { margin-top: 6px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li + li { margin-top: 12px; }
.spinner { width: 20px; height: 20px; animation: spin 0.9s linear infinite; color: var(--text-3); }
@keyframes spin { to { transform: rotate(360deg); } }
.drop { border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 20px; text-align: center; transition: background 0.12s; }
.drop.over { background: var(--subtle); }
.drop p + p { margin-top: 4px; }
.progress { height: 3px; background: var(--subtle); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--text); transition: width 0.15s; }
.file { display: flex; align-items: center; gap: 12px; }
.file .i { color: var(--text-2); }
.file div { flex: 1; min-width: 0; }
.file b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or { margin-top: 12px; font-size: 14px; color: var(--text-2); }

/* ---------- home: one question, one input ---------- */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 20px 14vh; }
.home h1 { font-size: 30px; line-height: 38px; font-weight: 500; text-align: center; margin-bottom: 28px; }
.composer {
  width: min(760px, 100%); background: var(--raised); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow);
  padding: 10px 10px 10px 12px; position: relative;
}
[data-theme='dark'] .composer { border-color: transparent; }
.composer textarea {
  display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--text);
  font-size: 16px; line-height: 24px; padding: 8px 8px 4px; max-height: 200px; min-height: 40px;
}
.composer textarea::placeholder { color: var(--text-3); }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 6px; }
.attachments:empty { display: none; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 10px; border-radius: var(--r); background: var(--subtle); font-size: 13px; line-height: 18px; }
.att .i-sm { color: var(--text-2); }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att span b { font-weight: 500; }
.att button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.bar { display: flex; align-items: center; gap: 4px; }
/* The options scroll sideways on narrow screens; "+" and the send button stay put. */
.pills { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.pill-btn { height: 36px; padding: 0 10px 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { opacity: 0.35; cursor: default; }
.send .i { width: 20px; height: 20px; stroke-width: 2.25; }
.home .chips { margin-top: 18px; max-width: 760px; }
.home .foot { margin-top: 20px; font-size: 13px; color: var(--text-3); text-align: center; }
.home .notice { width: min(760px, 100%); margin-bottom: 16px; }
.home-error { width: min(760px, 100%); margin-top: 12px; }

/* ---------- lobby ---------- */
.lobby { max-width: 720px; }
.lobby .head { text-align: center; }
.lobby .head a { color: var(--text-2); }
.preview { position: relative; aspect-ratio: 16 / 9; background: #141412; border-radius: var(--r-xl); overflow: hidden; }
.preview video, .tile video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview .initial, .tile .initial { position: absolute; inset: 0; display: grid; place-items: center; }
.avatar { width: 88px; height: 88px; border-radius: 50%; background: #2c2a27; color: #ece9e3; display: grid; place-items: center; font-size: 36px; font-weight: 500; }
.preview .name { position: absolute; left: 16px; top: 14px; color: #ece9e3; font-size: 14px; font-weight: 500; }
.preview .toggles { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 12px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(42, 41, 38, 0.9); color: #ece9e3; display: grid; place-items: center; cursor: pointer; }
.round.off { background: #e0564a; color: #fff; }
.levels { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.levels i { width: 3px; height: 3px; background: currentColor; border-radius: 1px; }
.preview .levels { position: absolute; right: 18px; bottom: 32px; color: #5fb3b8; }
.status { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0 24px; }
.status span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--subtle); font-size: 13px; line-height: 18px; color: var(--text-2); }
.status span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status span.ok::before { background: var(--ok); }
.status span.bad { color: var(--danger); }
.status span.bad::before { background: var(--danger); }
.lobby .cta { display: flex; justify-content: center; }
.lobby .cta .btn { min-width: 280px; }
.lobby-more { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 8px; }
.lobby-more > div > * + * { margin-top: 14px; }
.lobby .note { margin-top: 16px; text-align: center; font-size: 13px; color: var(--text-3); }
.topics { font-size: 14px; color: var(--text-2); }
.topics b { display: block; color: var(--text); font-weight: 500; margin-bottom: 4px; }

/* ---------- auth ---------- */
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 10vh; }
.auth .brand { font-size: 20px; margin-bottom: 28px; }
.auth h1 { font-size: 32px; line-height: 40px; text-align: center; }
.auth .lead { margin: 8px 0 28px; color: var(--text-2); text-align: center; }
.auth-card { width: min(400px, 100%); }
.switch { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-2); }
.switch .linkbtn { color: var(--text); }

/* ---------- call (dark) ---------- */
.call {
  --c-bg: #141412; --c-tile: #1f1e1b; --c-line: #2c2a27; --c-text: #ece9e3; --c-text-2: #a29d93;
  --r: 8px; --r-lg: 12px; /* the call keeps its own, tighter shapes */
  position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--c-bg); color: var(--c-text);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
body.in-call { background: #141412; overflow: hidden; overscroll-behavior: none; }
.call-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
}
.call-top b { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-top .right { display: flex; gap: 16px; align-items: center; color: var(--c-text-2); font-size: 14px; flex: none; }
.rec { color: #e0564a; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 6px; }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.over { color: #e0a44a; }
.call-body {
  position: relative; flex: 1; display: flex; gap: 12px; min-height: 0;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.stage { position: relative; flex: 1; min-width: 0; background: var(--c-tile); border-radius: var(--r-lg); overflow: hidden; }
.stage .who { position: absolute; inset: 0; display: grid; place-items: center; }
.stage .who .avatar { width: 128px; height: 128px; font-size: 52px; box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.12s; }
.stage.speaking .who .avatar { box-shadow: 0 0 0 2px #5fb3b8; }
.stage .label { position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; color: var(--c-text); max-width: calc(100% - 24px); }
.stage .label #hr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage .label .levels { color: #5fb3b8; }
.tile { position: absolute; right: 12px; bottom: 12px; width: 220px; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: #2a2926; border: 2px solid transparent; z-index: 3; }
.tile.speaking { border-color: #5fb3b8; }
.tile .avatar { width: 52px; height: 52px; font-size: 22px; background: #353430; }
.tile .label { left: 8px; top: auto; bottom: 6px; font-size: 13px; }
.tile .muted-mark { position: absolute; right: 6px; top: 6px; color: #e0564a; }
.captions { position: absolute; left: 16px; right: 248px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 2; pointer-events: none; max-width: 760px; margin: 0 auto; }
.cap { background: rgba(10, 10, 9, 0.78); border-radius: var(--r); padding: 8px 12px; transition: opacity 0.4s; }
.cap.fade { opacity: 0; }
.cap b { display: block; font-size: 12px; font-weight: 600; color: #5fb3b8; }
.cap.me b { color: #b5d69f; }
/* Up to five lines of her reply stay in view; older lines fade out at the top as the box glides up. */
.cap-text { max-height: calc(1.5em * 5); overflow: hidden; font-size: 16px; line-height: 1.5; }
.cap-text.cap-over { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.5em); mask-image: linear-gradient(to bottom, transparent 0, #000 1.5em); }
.cap-words { margin: 0; }
.cap-words .cw { display: inline-block; margin-right: 0.27em; animation: wordIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes wordIn { from { opacity: 0; transform: translateY(0.3em); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) { .cap-words .cw { animation: none; } }
.panel { width: 340px; flex: none; background: var(--c-tile); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0; }
.panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--c-line); }
.panel header b { font-weight: 500; }
.transcript { flex: 1; overflow-y: auto; padding: 12px 16px 16px; -webkit-user-select: text; user-select: text; overscroll-behavior: contain; }
.msg + .msg { margin-top: 12px; }
.msg .w { font-size: 12px; font-weight: 600; color: #5fb3b8; display: flex; gap: 8px; }
.msg.me .w { color: #b5d69f; }
.msg .w time { color: var(--c-text-2); font-weight: 400; }
.msg p { font-size: 14px; margin-top: 2px; }
.msg.partial p { color: var(--c-text-2); }
.controls {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 14px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.cbtn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #2a2926; color: var(--c-text); display: grid; place-items: center; cursor: pointer; flex: none; }
.cbtn.sm { width: 36px; height: 36px; }
.cbtn.off { background: #e0564a; color: #fff; }
.cbtn.on { background: #3a4a4c; }
.cbtn.end { width: 64px; border-radius: 24px; background: #d0453a; color: #fff; }
.banners { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); }
.banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r); border: 0;
  background: #2c2a27; color: var(--c-text); font-size: 14px; box-shadow: var(--shadow); text-align: left;
}
.banner.action { background: #ece9e3; color: #1c1b19; cursor: pointer; font-weight: 500; min-height: 44px; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 20, 18, 0.88); z-index: 5; text-align: center; padding: 24px; }
.overlay .box-dark { max-width: 380px; }
.overlay h2 { margin: 12px 0 8px; }
.overlay p { color: var(--c-text-2); font-size: 15px; }
.overlay ol { text-align: left; color: var(--c-text-2); font-size: 14px; margin: 16px auto 0; display: inline-block; padding-left: 20px; }
.overlay li.now { color: var(--c-text); }
.overlay .spinner { color: var(--c-text-2); width: 28px; height: 28px; }

/* ---------- report: the verdict first, then sections that read at a glance ---------- */
.i-xs { width: 14px; height: 14px; flex: none; }
.report .meta { margin-bottom: 6px; }
.report h1 { font-size: 26px; line-height: 34px; }
.report .sub { margin-top: 4px; }
.report strong { font-weight: 600; color: var(--text); }

/* Status badges: an icon and a word always go with the colour. */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--subtle); color: var(--text-2); }
.badge.lg { height: 28px; padding: 0 11px; font-size: 14px; gap: 6px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }

.callout { border-radius: var(--r); padding: 14px 16px; background: var(--subtle); }
.callout.slim { display: flex; gap: 8px; align-items: center; padding: 10px 14px; margin-top: 12px; font-size: 14px; }
.callout.warn { background: var(--warn-soft); }
.callout.warn .i-sm { color: var(--warn); }
.callout.bad { background: var(--danger-soft); margin-top: 20px; }
.callout-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.callout-head .i-sm { color: var(--danger); }
.callout .list { font-size: 15px; line-height: 23px; }

/* Hero: the number, a meter and the one-sentence verdict. */
.hero { margin: 24px 0 16px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--subtle); display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: start; }
.hero-num { display: flex; align-items: baseline; gap: 6px; }
.hero-num b { font-size: 56px; line-height: 1; font-weight: 650; letter-spacing: -0.04em; }
.hero-num span { font-size: 18px; color: var(--text-3); font-weight: 500; }
.meter { height: 6px; border-radius: 999px; background: var(--border); margin: 14px 0 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--v); background: var(--text); border-radius: 999px; animation: grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.headline { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); max-width: 34ch; }
.headline strong { font-weight: 700; }
.scale summary { font-size: 13px; font-weight: 400 !important; color: var(--text-3); }
.scale ul { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }

/* What to do next: three numbered actions. */
.next { margin: 0 0 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--r-lg); }
.next h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; margin-bottom: 10px; }
.next ol, .plan { list-style: none; margin: 0; padding: 0; }
.next li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; }
.next p { font-size: 15.5px; line-height: 24px; }
.n { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 600; display: grid; place-items: center; margin-top: 1px; font-variant-numeric: tabular-nums; }
.report .actions { margin: 4px 0 8px; }

/* Section jump links. */
.toc { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 4px; border-bottom: 1px solid var(--border); }
.toc a { font-size: 14px; color: var(--text-2); text-decoration: none; padding: 5px 12px; border-radius: 999px; background: var(--subtle); }
@media (hover: hover) { .toc a:hover { color: var(--text); background: var(--hover); } }

.rsec { padding: 28px 0 4px; scroll-margin-top: 16px; }
.rsec > h2 { margin-bottom: 6px; }
.rsec h3 { display: flex; align-items: center; gap: 8px; margin: 20px 0 8px; font-size: 16px; }
.rsec > h2 + h3 { margin-top: 10px; }
.sec-sub { color: var(--text-3); font-size: 14px; line-height: 20px; margin-bottom: 14px; }
.lead { max-width: 68ch; }
.lead p { font-size: 17px; line-height: 27px; }
.lead p + p { margin-top: 12px; }

/* Competencies: one row per skill, bars on one baseline. */
.meters, .vlist { list-style: none; margin: 0; padding: 0; }
.meters li, .vlist li { padding: 12px 0; border-top: 1px solid var(--border); }
.meters li:first-child, .vlist li:first-child { border-top: 0; padding-top: 2px; }
.m-head { display: flex; align-items: center; gap: 8px; }
.m-name { font-weight: 600; min-width: 0; }
.m-head .badge { margin-left: 2px; }
.m-val { margin-left: auto; font-weight: 650; white-space: nowrap; }
.m-val small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 1px; }
.m-bar { height: 6px; background: var(--subtle); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.m-bar i { display: block; height: 100%; width: var(--v); background: var(--text); border-radius: 999px; animation: grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
.m-note { font-size: 15px; line-height: 23px; color: var(--text-2); margin-top: 8px; max-width: 70ch; }
@keyframes grow { from { width: 0; } }

/* Lists with an icon per item. */
.ilist { list-style: none; margin: 0; padding: 0; }
.ilist li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 15px; line-height: 23px; }
.ilist li + li { margin-top: 8px; }
.ilist .i-sm { margin-top: 3.5px; color: var(--text-3); }
.ilist.ok .i-sm { color: var(--ok); }
.ilist.warn .i-sm { color: var(--warn); }

/* Improvements: the problem, then what to do, set apart. */
.impr { list-style: none; margin: 0; padding: 0; }
.impr-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); }
.impr-card + .impr-card { margin-top: 10px; }
.impr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.impr-head b { font-weight: 600; }
.impr-card .muted { font-size: 15px; line-height: 23px; }
.todo { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; margin-top: 10px; padding: 10px 12px; background: var(--subtle); border-radius: var(--r-sm); font-size: 15px; line-height: 23px; }
.todo .i-sm { margin-top: 3.5px; }
.todo span { font-weight: 600; }

/* Answers: an accordion; the score chip carries the band in colour and in its title. */
details.qa { border-top: 1px solid var(--border); }
details.qa:first-of-type { border-top: 0; }
details.qa summary { list-style: none; cursor: pointer; padding: 14px 0; display: grid; grid-template-columns: 56px minmax(0, 1fr) 20px; gap: 12px; align-items: start; }
details.qa summary::-webkit-details-marker { display: none; }
.qscore { display: flex; align-items: baseline; justify-content: center; gap: 1px; height: 30px; border-radius: var(--r-sm); background: var(--subtle); padding-top: 5px; }
.qscore b { font-size: 15px; font-weight: 650; line-height: 1; }
.qscore small { font-size: 11px; color: var(--text-3); }
.qscore.ok { background: var(--ok-soft); }
.qscore.ok b { color: var(--ok); }
.qscore.bad { background: var(--danger-soft); }
.qscore.bad b { color: var(--danger); }
.qtitle { font-weight: 500; line-height: 24px; }
.qtitle small { display: block; color: var(--text-3); font-size: 13px; line-height: 18px; margin-top: 2px; font-weight: 400; }
details.qa summary .i-sm { margin-top: 5px; color: var(--text-3); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
details.qa[open] summary .i-sm { transform: rotate(180deg); }
details.qa .body { padding: 0 0 20px 68px; font-size: 15px; line-height: 24px; }
details.qa .body > * + * { margin-top: 14px; }
details.qa[open] .body { animation: reveal 0.25s ease-out; }
details.qa h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.said p { color: var(--text-2); border-left: 2px solid var(--border-strong); padding-left: 12px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.better { background: var(--subtle); border-radius: var(--r); padding: 12px 14px; }
.better h4 { color: var(--text); }
code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--subtle); border-radius: 5px; padding: 1px 5px; }
.better code { background: var(--bg); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

/* Speech: four numbers in tiles. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.stat { padding: 14px; border-radius: var(--r); background: var(--subtle); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-2); line-height: 18px; }
.stat-value { font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -0.02em; }
.stat-note { font-size: 12.5px; line-height: 17px; color: var(--text-3); overflow-wrap: anywhere; }

/* Study plan and the before-the-interview groups. */
.plan li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; }
.plan li + li { border-top: 1px solid var(--border); }
.plan b { font-weight: 600; }
.plan .muted { font-size: 15px; line-height: 23px; margin-top: 2px; }
.res { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 19px; color: var(--text-3); margin-top: 6px; }
.res .i-xs { margin-top: 2.5px; }
.group + .group { margin-top: 4px; }
.group h3 .i-sm { color: var(--text-3); }
.group .list { font-size: 15px; line-height: 23px; }

.player { padding: 4px 8px; background: var(--subtle); border-radius: var(--r); }
.player audio { display: block; width: 100%; height: 40px; }
audio { width: 100%; }
.tr { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 5px 0; font-size: 15px; line-height: 23px; }
.tr time { color: var(--text-3); font-variant-numeric: tabular-nums; cursor: pointer; }
.tr b { font-weight: 600; }

/* Sections arrive one after another. */
.report > .hero, .report > .next, .report > .rsec { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.report > .next { animation-delay: 80ms; }
.report > .rsec { animation-delay: calc(140ms + var(--i, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- waiting for the report ---------- */
.center-state { text-align: center; padding: 64px 0; }
.center-state .spinner { width: 28px; height: 28px; }
.center-state h2 { margin: 16px 0 8px; }
.prep { max-width: 420px; margin: 56px auto 0; }
.prep h2 { font-size: 22px; line-height: 30px; }
.prep-eta { color: var(--text-2); margin-top: 6px; min-height: 24px; font-variant-numeric: tabular-nums; }
.prep-bar { height: 4px; border-radius: 999px; background: var(--subtle); overflow: hidden; margin: 18px 0 22px; }
.prep-bar i { display: block; height: 100%; width: 0; background: var(--text); border-radius: 999px; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.prep-steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 70ms); }
.step-ic { position: relative; width: 22px; height: 22px; }
.step-ic svg { position: absolute; inset: 0; width: 22px; height: 22px; }
.step-tx { color: var(--text-3); transition: color 0.3s; }
.step .sp { opacity: 0; color: var(--text-2); }
.step .sp circle { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 38 100; }
.step .ck { opacity: 0; transform: scale(0.6); }
.step .ck circle { fill: var(--ok); }
.step .ck path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; }
[data-theme='dark'] .step .ck path { stroke: #0d0d0d; }
.step.is-wait .step-ic::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--border-strong); }
.step.is-run .sp, .step.is-retry .sp { opacity: 1; animation: spin 0.9s linear infinite; }
.step.is-retry .sp { color: var(--warn); }
.step.is-run .step-tx, .step.is-retry .step-tx { color: var(--text); font-weight: 500; }
.step.is-done .ck { opacity: 1; transform: scale(1); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s; }
.step.is-done .ck path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s 0.12s ease-out; }
.step.is-done .step-tx { color: var(--text-2); }
.prep-note { margin-top: 22px; font-size: 14px; color: var(--text-3); }

@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .hero-num b { font-size: 48px; }
  .headline { font-size: 18px; line-height: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  details.qa summary { grid-template-columns: 48px minmax(0, 1fr) 20px; gap: 10px; }
  details.qa .body { padding-left: 0; }
  .prep { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .meter i, .m-bar i, .report > *, .step, details.qa[open] .body { animation: none !important; }
  .prep-bar i, .step .ck, .step .ck path { transition: none !important; }
}

/* ---------- history ---------- */
.hist { border-top: 1px solid var(--border); }
.hist a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 8px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); border-radius: 0; }
.hist b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .sub { display: block; font-size: 13px; color: var(--text-3); margin-top: 2px; }
.hist .hs { font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.hist .hs small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.hist .hs.none { font-size: 13px; font-weight: 400; color: var(--text-3); }
.empty-state { text-align: center; padding: 48px 0; color: var(--text-2); }
.empty-state h2 { margin-bottom: 6px; }
.empty-state .btn { margin-top: 20px; }

/* ---------- toasts & modal ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 100; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; line-height: 20px; box-shadow: var(--shadow-pop); max-width: min(520px, 92vw); }
.toast.error { background: var(--danger); color: #fff; }
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--raised); color: var(--text); border-radius: var(--r-xl); padding: 24px; width: min(440px, 100%); box-shadow: var(--shadow-pop); }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.modal .actions { justify-content: flex-end; margin-top: 20px; }

/* ---------- responsive ---------- */
/* Narrow screens: the sidebar slides over the page like the ChatGPT app. */
@media (max-width: 1023px) {
  .side { transform: translateX(-100%); box-shadow: var(--shadow-pop); width: min(300px, 86vw); }
  body.side-open .side { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 25; }
  .content { margin-left: 0; }
  .topbar { display: flex; }
  #side-toggle { display: none; }
  .panel { position: absolute; top: 0; right: 8px; bottom: 0; z-index: 10; width: min(360px, calc(100% - 16px)); box-shadow: var(--shadow); }
  .captions { right: 16px; bottom: 168px; }
}

/* Phones, portrait. */
@media (max-width: 600px) {
  .page { padding: 16px 16px calc(64px + env(safe-area-inset-bottom)); }
  h1 { font-size: 24px; line-height: 32px; }
  .home { padding: 12px 12px 10vh; justify-content: flex-end; }
  .home h1 { font-size: 24px; line-height: 32px; margin-bottom: 20px; }
  .composer { border-radius: 24px; }
  .home .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; margin-top: 14px; padding-bottom: 2px; scrollbar-width: none; }
  .home .chips::-webkit-scrollbar { display: none; }
  .chip { height: 40px; }
  .row { flex-direction: column; gap: 0; }
  .btn { height: 48px; }
  .btn-sm { height: 40px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 0 6px; height: 40px; }
  .lobby .cta .btn { width: 100%; min-width: 0; }
  .preview { border-radius: var(--r-lg); }
  .score-card { padding: 16px; gap: 16px; }
  .score-card b { font-size: 42px; }
  .report .actions > * { flex: 1 1 auto; }
  details.qa summary { grid-template-columns: 36px minmax(0, 1fr) 20px; gap: 10px; }
  details.qa .body { padding-left: 0; }

  /* call: own tile in the top corner, captions get the full width at the bottom */
  .call-top { padding: max(10px, env(safe-area-inset-top)) 16px 10px; min-height: 44px; }
  .call-top b { font-size: 14px; }
  .call-top .right { gap: 12px; font-size: 13px; }
  #net, .rec span { display: none; }
  .call-body { padding: 0 8px; }
  .stage .who { padding-bottom: 30%; }
  .stage .who .avatar { width: 96px; height: 96px; font-size: 40px; }
  .stage .label { max-width: calc(100% - 128px); }
  .tile { top: 12px; right: 12px; bottom: auto; width: 96px; aspect-ratio: 3 / 4; }
  .tile .avatar { width: 44px; height: 44px; font-size: 18px; }
  .tile .label { font-size: 12px; }
  .captions { left: 10px; right: 10px; bottom: 10px; }
  .cap-text { font-size: 15px; max-height: calc(1.5em * 4); }
  .panel { inset: 0 8px; width: auto; }
  .cbtn.sm { width: 44px; height: 44px; }
  .controls { gap: 10px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }

  /* dialogs become bottom sheets */
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 20px 20px 0 0; padding: 24px 16px calc(16px + env(safe-area-inset-bottom)); }
  .modal .actions { flex-direction: column-reverse; align-items: stretch; }
  .modal .actions .btn { width: 100%; height: 50px; }
}
@media (max-width: 350px) {
  .controls { gap: 8px; }
  .cbtn { width: 44px; height: 44px; }
  .cbtn.end { width: 56px; }
}

/* Phones, landscape: little height, so everything in the call gets compact. */
@media (max-height: 500px) and (orientation: landscape) {
  .call-top { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; min-height: 36px; }
  .call-top b { font-size: 14px; }
  #net { display: none; }
  .controls { gap: 10px; padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .cbtn { width: 44px; height: 44px; }
  .cbtn.end { width: 56px; }
  .stage .who { padding-bottom: 22%; }
  .stage .who .avatar { width: 72px; height: 72px; font-size: 30px; }
  .stage .label { max-width: calc(100% - 200px); }
  .tile { top: 8px; right: 8px; bottom: auto; width: auto; height: 46%; aspect-ratio: 4 / 3; }
  .captions { left: 10px; right: 10px; bottom: 8px; }
  .cap:not(:last-child) { display: none; }
  .cap-text { max-height: calc(1.5em * 2); font-size: 15px; }
  .panel { inset: 0 8px; width: auto; }
}
