/* =====================================================================
   mute.css: the Mute design system (spec docs/superpowers/specs/
   2026-10-16-prototype-redesign-design.md). The ONLY place raw colours
   live: the three token blocks below. Everything else uses var(--token).
   Light is the base; dark follows the device unless data-theme="light",
   or is forced with data-theme="dark" (set by js/theme.js).
   ===================================================================== */

@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Variable.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F1F2F6;
  --surface: #FFFFFF;
  --surface-2: #E6E8EF;
  --fg: #12131A;
  --fg-rgb: 18 19 26;
  --bg-rgb: 241 242 246;
  --muted: #5A5D6B;
  --line: rgba(18, 19, 26, .10);
  --line-strong: rgba(18, 19, 26, .2);
  --line-input: rgba(18, 19, 26, .52);
  --live: #0A7556;             /* prototype #0B7A5A was 4.35:1 on --surface-2; now 4.65:1 */
  --live-fill: #2FCB9D;
  --live-soft: rgba(47, 203, 157, .14);
  --ember: #B4401C;
  --ember-fill: #F06A45;
  --end-fill: #D9532E; --end-press: #B83E1A; /* End/Leave call circle: white icon >= 3:1 */
  --ember-soft: rgba(240, 106, 69, .12);
  --ring: rgba(18, 19, 26, .12);
  --shadow: 0 1px 2px rgba(18, 19, 26, .06), 0 18px 50px -16px rgba(18, 19, 26, .22);
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 44px);
  --r-1: 6px; --r-2: 8px; --r-3: 10px; --r-4: 12px; --r-5: 18px; --r-6: 24px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 44px; --s-9: 64px;
  --h-sm: 40px; --h-md: 44px; --h-lg: 50px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .1);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-ticket: drop-shadow(0 1px 1px rgba(0, 0, 0, .08)) drop-shadow(0 22px 34px rgba(0, 0, 0, .18));
  --scrim: rgba(10, 11, 15, .5);
  --on-ember: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F1015;
    --surface: #17181F;
    --surface-2: #21232C;
    --fg: #ECEDF2;
    --fg-rgb: 236 237 242;
    --bg-rgb: 15 16 21;
    --muted: #9A9DAB;
    --line: rgba(236, 237, 242, .09);
    --line-strong: rgba(236, 237, 242, .18);
    --line-input: rgba(236, 237, 242, .42);
    --live: #79EFC8;
    --live-fill: #79EFC8;
    --live-soft: rgba(121, 239, 200, .10);
    --ember: #FF8D6E;
    --ember-fill: #FF7A57;
    --end-fill: #E05A35; --end-press: #C9461F;
    --ember-soft: rgba(255, 122, 87, .11);
    --ring: rgba(236, 237, 242, .10);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -18px rgba(0, 0, 0, .7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-knob: 0 1px 3px rgba(0, 0, 0, .6);
    --shadow-ticket: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)) drop-shadow(0 22px 34px rgba(0, 0, 0, .5));
    --scrim: rgba(0, 0, 0, .6);
    --on-ember: #FFFFFF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1015;
  --surface: #17181F;
  --surface-2: #21232C;
  --fg: #ECEDF2;
  --fg-rgb: 236 237 242;
  --bg-rgb: 15 16 21;
  --muted: #9A9DAB;
  --line: rgba(236, 237, 242, .09);
  --line-strong: rgba(236, 237, 242, .18);
  --line-input: rgba(236, 237, 242, .42);
  --live: #79EFC8;
  --live-fill: #79EFC8;
  --live-soft: rgba(121, 239, 200, .10);
  --ember: #FF8D6E;
  --ember-fill: #FF7A57;
  --end-fill: #E05A35; --end-press: #C9461F;
  --ember-soft: rgba(255, 122, 87, .11);
  --ring: rgba(236, 237, 242, .10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -18px rgba(0, 0, 0, .7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .6);
  --shadow-ticket: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)) drop-shadow(0 22px 34px rgba(0, 0, 0, .5));
  --scrim: rgba(0, 0, 0, .6);
  --on-ember: #FFFFFF;
}

/* ---------- Base (prototype lines 63–92) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: var(--r-1); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: var(--r-2); text-decoration: none; font-weight: 600; transition: top .2s; }
.skip:focus { top: 16px; }

/* Type: tracking tightens as size grows; leading loosens for body copy. */
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 .75rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.h1 { margin: 0; font: 600 clamp(2.4rem, 4.8vw, 4.2rem)/1 var(--sans); letter-spacing: -0.05em; text-wrap: balance; }
.h1 .dim { color: var(--muted); }
.h2 { margin: 0; font: 600 clamp(2rem, 4.4vw, 3.4rem)/1.03 var(--sans); letter-spacing: -0.04em; text-wrap: balance; }
.h2 .dim { color: var(--muted); }
.lede { margin: 0; max-width: 36em; color: var(--muted); font-size: clamp(1.0625rem, 1.5vw, 1.2rem); line-height: 1.55; text-wrap: pretty; }
.lede strong { color: var(--fg); font-weight: 500; }

/* Status dot. The pulse rings a few times, then rests: no endless motion. */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live-fill); flex: none; position: relative; }
.dot.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--live-fill); opacity: 0; animation: m-ping 2.4s cubic-bezier(.2, .7, .3, 1) 4; }
.dot.ember { background: var(--ember-fill); }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons: squared, neutral; mint is reserved for "live" (prototype 93–112, 397–400) ---------- */
.btn {
  --h: var(--h-lg);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: var(--r-3); border: 1px solid transparent; background: transparent; color: inherit;
  font-weight: 500; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease-out, background-color .2s, border-color .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); transition-duration: 60ms; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { opacity: .86; }
.btn-line { border-color: var(--line-input); }
.btn-line:hover { background: var(--surface-2); }
.btn-link { padding: 0 4px; min-height: var(--h-md); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.btn-link:hover { text-decoration-color: currentColor; }
.btn-ember { border-color: color-mix(in srgb, var(--ember) 45%, transparent); color: var(--ember); }
.btn-ember:hover { background: var(--ember-soft); }
.btn-sm { --h: var(--h-sm); padding: 0 16px; font-size: .9375rem; }
.btn-block { width: 100%; }
.btn .ico { width: 18px; height: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { opacity: .65; cursor: progress; }

/* Small text controls keep their look but get a 44px+ touch target (prototype 408–417). */
.link-btn { position: relative; padding: 0; min-height: 32px; border: 0; background: none; color: var(--fg); font: 500 .875rem/1 var(--sans); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; cursor: pointer; }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn::after { content: ""; position: absolute; inset: -8px -6px; }
.icon-btn { position: relative; width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-3); background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; transition: background-color .2s, color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }

/* Avatars */
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--fg); color: var(--bg); font-size: .75rem; font-weight: 600; flex: none; }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.av-o { background: transparent; border: 1.5px dashed var(--line-strong); }
.avs { display: flex; }
.avs .av + .av { margin-left: -7px; }

/* ---------- Form fields (prototype 419–442) ---------- */
.field { display: grid; gap: 8px; }
.field + .field { margin-top: 18px; }
.f-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 18px; font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.f-label small { font: 400 .8125rem/1 var(--sans); letter-spacing: 0; text-transform: none; }
.input, .select { width: 100%; min-height: var(--h-lg); padding: 0 14px; border: 1px solid var(--line-input); border-radius: var(--r-3); background: var(--surface); color: var(--fg); font: 400 1rem/1.2 var(--sans); transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: var(--muted); opacity: .75; }
.input:focus, .select:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px var(--ring); }
.input[aria-invalid="true"] { border-color: var(--ember); }
.select { appearance: none; padding-right: 40px; cursor: pointer; }
.sel { position: relative; }
.sel::after { content: ""; position: absolute; right: 17px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.pw { position: relative; }
.pw .input { padding-right: 78px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--muted); font-size: .875rem; cursor: pointer; }
.pw button:hover { color: var(--fg); background: var(--surface-2); }
.check-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding-block: 6px; color: var(--muted); font-size: .9375rem; cursor: pointer; }
.check-row input { flex: none; width: 24px; height: 24px; margin: -1px 0 0; accent-color: var(--fg); cursor: pointer; }   /* 24px: the project's minimum target (prototype had 18) */
.check-row a { color: var(--fg); }
.strength { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: .8125rem; }
.strength i { flex: 0 0 34px; height: 4px; border-radius: 2px; background: var(--line-strong); transition: background-color .3s; }
.strength i.on { background: var(--fg); }
.strength.ok i.on { background: var(--live-fill); }
.strength span { margin-left: 6px; }

/* Switch (prototype 631–637) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row strong { display: block; font-size: .9375rem; font-weight: 600; }
.switch-row small { color: var(--muted); font-size: .8125rem; }
.switch { appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: var(--line-input); cursor: pointer; transition: background-color .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-knob); transition: transform .35s cubic-bezier(.3, 1.35, .5, 1); }
.switch:checked { background: var(--fg); }
.switch:checked::after { transform: translateX(18px); }

/* Segmented tabs (prototype 454–456) */
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-4); background: var(--surface-2); }
.seg button { min-height: var(--h-md); border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; transition: background-color .25s, color .25s, box-shadow .25s; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Cards (prototype 444–450, 638–639) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-5); padding: clamp(20px, 2.6vw, 28px); }
.card .kicker { margin-bottom: 12px; }
.card-h { margin: 0; font: 600 1.375rem/1.2 var(--sans); letter-spacing: -0.02em; }
.card-sub { margin: 6px 0 0; color: var(--muted); font-size: .9375rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.card.danger { border-color: color-mix(in srgb, var(--ember-fill) 32%, var(--line)); }
.card.danger .actions { justify-content: flex-start; }

/* ---------- Pills, labels, codes (prototype 203–212, 406–407) ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 11px; border-radius: var(--r-1); font: 600 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; background: var(--live-soft); color: var(--live); transition: background-color .4s, color .4s; }
.pill.ember { background: var(--ember-soft); color: var(--ember); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }
.proto { display: inline-flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px dashed var(--line-strong); border-radius: var(--r-1); font: 500 .6875rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.meta { font: 500 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label { margin: 24px 0 4px; font: 500 .75rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.code { font: 600 clamp(1.9rem, 4.4vw, 2.6rem)/1.15 var(--mono); letter-spacing: .02em; color: var(--live); white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .4s; }
.code.ember { color: var(--ember); }
.nowrap { white-space: nowrap; }

/* ---------- The invite ticket, with a tear-off stub (prototype 178–223, 515–519) ---------- */
.ticket { --notch: 12px; position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; width: min(440px, 100%); filter: var(--shadow-ticket); }
/* The masks only use alpha: "black" here is the opaque part of the mask, not a colour on screen. */
.t-main, .t-stub { background: var(--surface); border: 1px solid var(--line); }
.t-main {
  padding: 22px 24px 20px; border-right: 0; border-radius: var(--r-5) 0 0 var(--r-5);
  -webkit-mask: radial-gradient(circle var(--notch) at 100% 0, transparent 98%, black) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, transparent 98%, black) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 100% 0, transparent 98%, black) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, transparent 98%, black) bottom / 100% 51% no-repeat;
}
.t-stub {
  width: 112px; padding: 22px 14px; border-left: 2px dashed var(--line-strong); border-radius: 0 var(--r-5) var(--r-5) 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 0, transparent 98%, black) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, transparent 98%, black) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 0, transparent 98%, black) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, transparent 98%, black) bottom / 100% 51% no-repeat;
}
.t-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.t-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.people { display: flex; align-items: center; gap: 10px; font-size: .9375rem; }
.people small { color: var(--muted); font-size: .8125rem; }
.renew { position: relative; white-space: nowrap; flex: none; min-height: 36px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--line-input); background: transparent; font-size: .875rem; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.renew:hover { background: var(--surface-2); }
.renew:active { transform: scale(.97); }
.renew::after { content: ""; position: absolute; inset: -4px; }
.stub-n { font: 600 2.4rem/1 var(--sans); letter-spacing: -0.04em; }
.stub-l { font: 500 .6875rem/1.35 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stub-burn { display: inline-flex; align-items: center; gap: 6px; font: 500 .6875rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ember); }
.stub-burn i { width: 9px; height: 9px; border: 2px solid var(--ember-fill); border-radius: 50%; flex: none; }
.ticket-sm .code { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.ticket-sm .t-main { padding: 18px 20px 16px; }
.ticket-sm .t-stub { width: 100px; }
/* The burn moment: the code goes ember, then ash; the only celebratory animation. */
.ticket.burning .code { animation: m-burn 1.8s cubic-bezier(.2, .8, .2, 1) forwards; }
.ticket.dead .code { color: var(--ember); }
.ticket.dead .stub-n { color: var(--ember); }
.ticket.dead .t-main, .ticket.dead .t-stub { background: color-mix(in srgb, var(--surface) 92%, var(--ember-fill)); }

/* ---------- App shell: sidebar, phone top bar and tab bar (prototype 471–493, 704–716) ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.side { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; gap: 22px; padding: 18px 14px 16px; border-right: 1px solid var(--line); }
.side .brand { flex: none; margin: 0 0 6px 8px; }
.nav { display: grid; gap: 2px; }
/* Header links on public pages glide to their section (owner 2026-10-18); never with reduced motion. */
@media (prefers-reduced-motion: no-preference) { html:has(body.account, body.home) { scroll-behavior: smooth; } }
/* Join with a link (owner 2026-10-18): a signed-in person can paste an invite link too. */
.side .side-join { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--h-md); padding: 0 12px; border: 1px dashed var(--line-input); border-radius: var(--r-3); background: none; color: var(--fg); font: 500 .9375rem/1.2 var(--sans); text-align: left; cursor: pointer; transition: background-color .2s, transform .1s; }
.side .side-join:hover { background: var(--surface); }
.side .side-join:active { transform: scale(.97); }
.nav a { display: flex; align-items: center; gap: 12px; min-height: var(--h-md); padding: 0 12px; border-radius: var(--r-3); color: var(--muted); font-size: .9375rem; font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s; }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.nav .count { margin-left: auto; padding: 4px 7px; border-radius: var(--r-1); background: var(--live-soft); color: var(--live); font: 600 .75rem/1 var(--mono); }
.side .side-note { margin-top: auto; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.side .side-note strong { display: block; margin-bottom: 4px; color: var(--fg); font-weight: 600; }
/* Scoped to the sidebar: a bare .me would also match my chat bubbles (.chat-msg.me). */
.side .me { display: flex; align-items: center; gap: 10px; padding: 14px 0 0 4px; border-top: 1px solid var(--line); }
.side .me .av { width: 38px; height: 38px; }
.side .me div { flex: 1; min-width: 0; line-height: 1.3; }
.side .me strong, .side .me small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me strong { font-size: .9375rem; font-weight: 600; }
.side .me small { color: var(--muted); font-size: .8125rem; }
.main { min-width: 0; padding: clamp(24px, 3.2vw, 44px) clamp(16px, 3.4vw, 48px) 72px; }
.main-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: clamp(24px, 3vw, 36px); }
.main-head .kicker { margin-bottom: 14px; }
.head-tools { display: flex; align-items: center; gap: 8px; }
.page-h { margin: 0; font: 600 clamp(2rem, 4vw, 3rem)/1.02 var(--sans); letter-spacing: -0.04em; text-wrap: balance; }
.mob-top, .tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .mob-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .mob-top .av { width: 34px; height: 34px; text-decoration: none; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--bg); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; min-height: 58px; padding: 9px 0 7px; color: var(--muted); font-size: .75rem; font-weight: 500; text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--fg); }
  .main { padding-bottom: 104px; }
}

/* ---------- Room type cards (prototype 497–506, 731–733) ---------- */
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0 6px; }
.type { position: relative; display: grid; grid-template-rows: auto 1fr; justify-items: start; gap: 22px; min-height: 124px; padding: 16px 14px 14px; border: 1px solid var(--line-input); border-radius: var(--r-4); background: transparent; text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s, box-shadow .2s, transform .12s; }
.type:hover { background: var(--surface-2); }
.type:active { transform: scale(.97); }
.type .ico { width: 24px; height: 24px; }
.type > span { align-self: end; }
.type strong { display: block; font-weight: 600; }
.type small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.35; }
.type[aria-checked="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.type[aria-checked="true"]::after { content: ""; position: absolute; top: 16px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }
@media (max-width: 560px) {
  .types { grid-template-columns: 1fr; }
  .type { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 14px; }
  .type[aria-checked="true"]::after { top: 50%; margin-top: -4px; }
}

/* ---------- Call: tiles, preview, round toggles, dock, chat (prototype 545–561, 579–609) ---------- */
.preview, .vtile { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.preview { aspect-ratio: 16 / 10; border-radius: 14px; }
.vtile { min-height: 0; border-radius: 16px; }
.preview::before, .vtile::before { content: ""; position: absolute; inset: -25%; opacity: 0; transition: opacity .6s; background: radial-gradient(38% 46% at 32% 40%, var(--live-soft), transparent 70%), radial-gradient(40% 50% at 70% 66%, color-mix(in srgb, var(--fg) 8%, transparent), transparent 70%); animation: m-drift 14s ease-in-out 2 alternate; }
.preview.cam-on::before, .vtile.cam-on::before { opacity: 1; }
.preview .av { position: relative; width: 84px; height: 84px; font-size: 1.75rem; }
.vtile .av { position: relative; width: clamp(64px, 9vw, 104px); height: clamp(64px, 9vw, 104px); font-size: clamp(1.25rem, 2.4vw, 2rem); }
.who { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtile.speaking { box-shadow: inset 0 0 0 2px var(--live-fill); }
.round { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-input); border-radius: 50%; background: var(--surface); color: var(--fg); cursor: pointer; transition: background-color .2s, color .2s, transform .12s; }
.round:active { transform: scale(.94); }
.round:disabled { opacity: .4; cursor: not-allowed; }
.round[aria-pressed="false"] { background: var(--ember-soft); color: var(--ember); border-color: transparent; }
.tg .off-i, .tg[aria-pressed="false"] .on-i { display: none; }
.tg[aria-pressed="false"] .off-i { display: block; }
.controls { display: flex; justify-content: center; gap: clamp(4px, 1.4vw, 14px); }
.ctl { display: grid; justify-items: center; gap: 6px; min-width: 58px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .75rem; font-weight: 500; cursor: pointer; }
.ctl-i { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line-input); border-radius: 50%; background: var(--surface); color: var(--fg); transition: background-color .2s, color .2s, transform .12s; }
.ctl:hover .ctl-i { background: var(--surface-2); }
.ctl:active .ctl-i { transform: scale(.94); }
.ctl:focus-visible { outline: none; }
.ctl:focus-visible .ctl-i { outline: 2px solid var(--fg); outline-offset: 3px; }
.ctl[aria-pressed="false"] .ctl-i { background: var(--ember-soft); color: var(--ember); border-color: transparent; }
.ctl[aria-expanded="true"] .ctl-i { background: var(--fg); color: var(--bg); border-color: transparent; }
.ctl-i svg { width: 22px; height: 22px; }
/* End/Leave: a filled circle like its neighbours; only the circle carries the colour; hover darkens. */
.ctl.end .ctl-i { border-color: transparent; background: var(--end-fill); color: var(--on-ember); }
.ctl.end .ctl-i svg { width: 26px; height: 26px; }
.ctl.end:hover .ctl-i, .ctl.end:active .ctl-i { background: var(--end-press); }
/* A text room has no call to hang up: its End/Leave shows an exit. */
.ctl.end .ico-exit { display: none; }
.room.is-text .ctl.end .ico-exit { display: block; }
.room.is-text .ctl.end .ico-hangup { display: none; }
.ctl:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 560px) {
  .ctl { min-width: 52px; }
  .ctl-i { width: 48px; height: 48px; }
}
.msgs { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sys { align-self: center; max-width: 36ch; margin: 0; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-3); color: var(--muted); font-size: .8125rem; text-align: center; }
.msg { align-self: flex-end; max-width: 85%; animation: m-msg-in .35s cubic-bezier(.2, .9, .25, 1); }
.msg p { margin: 0; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--fg); color: var(--bg); font-size: .9375rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg small { display: block; margin-top: 4px; text-align: right; font: 500 .6875rem/1.2 var(--mono); color: var(--muted); }
.compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.compose .input { min-height: 46px; }
.compose .btn { --h: 46px; padding: 0 14px; }

/* ---------- Dialog, bottom sheet, toast (prototype 675–693) ---------- */
.dlg { width: min(460px, calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 28px; border: 1px solid var(--line); border-radius: var(--r-5); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.dlg::backdrop { background: var(--scrim); }
.dlg[open] { animation: m-dlg-in .34s cubic-bezier(.2, .9, .25, 1); }
.dlg h2 { margin: 0 44px 10px 0; font: 600 1.375rem/1.2 var(--sans); letter-spacing: -0.02em; }
.dlg-x { position: absolute; top: 14px; right: 14px; }
.dlg-body { color: var(--muted); }
.dlg-body p { margin: 0 0 12px; }
.dlg-body .field { margin-bottom: 12px; }
.dlg-body code { font: 500 .8125rem/1 var(--mono); color: var(--fg); }
.dlg-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
/* Opened from a control near the bottom: on phones it rises from the bottom, where its button is. */
@media (max-width: 640px) {
  .dlg.sheet { width: 100%; max-width: none; margin: auto 0 0; padding-bottom: calc(28px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  .dlg.sheet[open] { animation: m-sheet-in .38s cubic-bezier(.2, .9, .25, 1); }
}
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r-4); background: var(--fg); color: var(--bg); box-shadow: var(--shadow); font-size: .9375rem; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .25s, transform .45s cubic-bezier(.2, .9, .25, 1); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Chat notification pop-ups (notify.js): bottom-right, stacked, newest last; above the phone tab bar. */
.ntoasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 95; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.ntoast { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); pointer-events: auto; animation: m-msg-in .3s cubic-bezier(.2, .9, .25, 1); transition: opacity .2s; }
.ntoast.is-leaving { opacity: 0; }
.ntoast .avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: .75rem; font-weight: 600; }
.ntoast-text { flex: 1; min-width: 0; margin: 0; font-size: .875rem; line-height: 1.35; overflow-wrap: anywhere; }
.ntoast-close { width: 32px; height: 32px; font-size: 1.25rem; line-height: 1; }
.ntoast-close::after { content: ""; position: absolute; inset: -6px; }
@media (max-width: 860px) {
  .ntoasts { left: 16px; right: 16px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---------- Accessibility preferences (prototype 385–387) ---------- */
@media (prefers-contrast: more) {
  /* :root x3 outranks both dark-theme blocks (:root[data-theme] / :root:not(...)), so it applies in every theme. */
  :root:root:root { --line: color-mix(in srgb, var(--fg) 45%, transparent); --line-strong: color-mix(in srgb, var(--fg) 70%, transparent); --line-input: color-mix(in srgb, var(--fg) 75%, transparent); --ring: color-mix(in srgb, var(--fg) 40%, transparent); --muted: var(--fg); }
}

/* =====================================================================
   Public pages (redesign phase 2): top bar, drawer, footer, status box.
   Ported from the prototype (MUTE-Website-View/index.html 113–146, 321–332).
   ===================================================================== */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color .3s, transform .35s cubic-bezier(.2, .8, .2, 1); }
.top.edge { border-bottom-color: var(--line); }
.top.hide { transform: translateY(-100%); }
.top:focus-within { transform: none; } /* keyboard focus never lands on a hidden bar */
.top-in { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--h-md); text-decoration: none; margin-right: auto; }
.brand img { width: 28px; height: 28px; }
.brand b { font: 700 1.125rem/1 var(--sans); letter-spacing: .18em; }
.links { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
/* Navigation sits next to the brand; the actions take the right (owner 2026-10-17). */
.top-in .top-nav { margin-right: auto; }
.top-in:has(.top-nav) .brand { margin-right: 0; }
.links a { display: inline-flex; align-items: center; min-height: var(--h-md); text-decoration: none; color: var(--muted); font-size: .9375rem; transition: color .2s; }
.links a:hover, .links a[aria-current] { color: var(--fg); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-actions .top-join svg { width: 16px; height: 16px; }
.top-login { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; color: var(--fg); font-size: .9375rem; font-weight: 500; text-decoration: none; transition: opacity .2s; }
.top-login:hover { opacity: .72; }
/* The page you're on (Log in / Sign up), marked on that one item only. */
.top-actions a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.top-actions .btn-primary[aria-current="page"] { text-decoration-color: color-mix(in srgb, var(--bg) 60%, transparent); }
/* The theme button (theme-switch.js) and its menu. */
.theme-btn { width: 40px; height: 40px; color: var(--fg); }
.theme-btn::after { content: ""; position: absolute; inset: -2px; }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn:active { transform: scale(.94); }
.theme-menu { position: fixed; z-index: 120; display: grid; gap: 2px; min-width: 176px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); animation: m-dlg-in .2s cubic-bezier(.2, .9, .25, 1); }
.theme-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-2); background: none; color: var(--fg); font: 500 .9375rem/1 var(--sans); text-align: left; cursor: pointer; }
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--surface-2); outline: none; }
.theme-menu button svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.theme-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; font-weight: 600; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r-3); cursor: pointer; align-items: center; justify-content: center; }
.menu-btn span, .menu-btn span::before { display: block; width: 18px; height: 1.5px; border-radius: 2px; background: var(--fg); position: relative; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.menu-btn span { transform: translateY(-3px); }
.menu-btn span::before { content: ""; position: absolute; top: 6px; }
.menu-btn[aria-expanded="true"] span { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(-6px) rotate(-90deg); }
.top-drawer {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 20px; display: grid;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .4s cubic-bezier(.2, .9, .25, 1), visibility 0s .4s;
}
.top-drawer.open { clip-path: inset(0 0 0 0); visibility: visible; transition-delay: 0s; }
.top-drawer a, .top-drawer button { display: flex; align-items: center; width: 100%; min-height: 52px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); text-align: left; text-decoration: none; font-size: 1.125rem; font-weight: 500; cursor: pointer; }
.top-drawer > :last-child { border-bottom: 0; }
.top-drawer-cta { display: none !important; }
@media (max-width: 980px) {
  .top-nav, .top-actions .top-join, .top-actions .top-login { display: none; }
  .top-in .top-actions { margin-left: auto; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 560px) { .top-in { height: 60px; gap: 12px; } }
/* Narrow phones: the header keeps only brand + menu; the menu carries "Create a private call". */
@media (max-width: 420px) {
  .top-actions .btn-primary { display: none; }
  .top-drawer-cta { display: flex !important; }
}

.site-foot { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .875rem; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.foot .brand { margin: 0; color: var(--fg); }
.built { display: inline-flex; align-items: center; gap: 8px; }
.built a { display: inline-flex; align-items: center; gap: 7px; color: var(--fg); text-decoration: none; font-weight: 500; min-height: var(--h-md); }
.built a:hover { text-decoration: underline; text-underline-offset: 4px; }
.built img { width: 18px; height: auto; }
.foot nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.foot nav a { display: inline-flex; align-items: center; min-height: var(--h-md); text-decoration: none; }
.foot nav a:hover { color: var(--fg); }
@media (max-width: 560px) { .foot { flex-direction: column; align-items: flex-start; } }

/* Status message (account pages, signed-in app pages and dialogs; auth.js & co. set .msg-error /
   .msg-ok / .hidden). Scoped: an unscoped .msg is the call chat bubble (call section above). */
:is(.account, body.app-page, body.call-page, .dlg) .msg { align-self: auto; max-width: none; animation: none; margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface-2); font-size: .9375rem; }
:is(.account, body.app-page, body.call-page, .dlg) .msg-error { border-color: color-mix(in srgb, var(--ember) 45%, transparent); background: var(--ember-soft); color: var(--ember); }
:is(.account, body.app-page, body.call-page, .dlg) .msg-warn { border-color: color-mix(in srgb, var(--ember) 30%, transparent); background: var(--surface-2); color: var(--fg); }
:is(.account, body.app-page, body.call-page, .dlg) .msg-ok { border-color: color-mix(in srgb, var(--live) 40%, transparent); background: var(--live-soft); color: var(--live); }
.hidden { display: none !important; }
.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; }

/* =====================================================================
   Home (public/index.html, redesign phase 2). Ported from the prototype
   (MUTE-Website-View/index.html 147–375) minus the top bar, footer, ticket
   and pills that already live above. Scoped to body.home so the generic
   names (.room, .step, .tile, .stats) can't leak into the app pages.
   Motion is opt-in: .reveal hides nothing unless landing.js has set
   html.js-motion (it never does under prefers-reduced-motion).
   ===================================================================== */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.home main:focus { outline: none; }

/* Hero: copy left, floating ticket right */
.home .hero { padding: clamp(100px, 13vh, 128px) 0 clamp(40px, 5vw, 64px); overflow-x: clip; }
.home .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.home .hero .lede { margin: 22px 0 0; }
.home .ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 30px; }
.home .closing .ctas { justify-content: center; }
/* One-click free call in the hero (start-trial.js): Voice / Text + Start a free call. */
.home .hero-start { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-top: 30px; }
.home .hero-kind { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; margin: 0; padding: 4px; border: 0; border-radius: var(--r-4); background: var(--surface-2); }
.home .hero-kind label { position: relative; display: grid; place-items: center; min-width: 84px; min-height: 42px; border-radius: 9px; color: var(--muted); font-weight: 500; cursor: pointer; transition: background-color .2s, color .2s; }
.home .hero-kind input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.home .hero-kind label:has(input:checked) { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.home .hero-kind label:has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: 2px; }
.home .hero-start-note { margin: 10px 0 0; color: var(--muted); font-size: .875rem; }
.home #heroStartMsg { margin-top: 12px; max-width: 540px; }
.home #heroStartMsg a { color: inherit; font-weight: 600; }
.home .hero-copy .ctas { margin-top: 18px; }
.home .more { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin: 14px 0 0; color: var(--muted); font-size: .9375rem; }
.home .more a { display: inline-flex; align-items: center; min-height: var(--h-md); color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.home .more a:hover { text-decoration-color: currentColor; }
.home .more-note { flex-basis: 100%; margin-top: -6px; font-size: .875rem; }
.home .checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9375rem; }
.home .checks li { display: inline-flex; align-items: center; gap: 8px; }
.home .checks svg { width: 15px; height: 15px; color: var(--live); }
.home .invited { margin: 22px auto 0; max-width: 34em; color: var(--muted); font-size: .9375rem; }
.home .invited .link-btn { font-size: inherit; }

/* The floating visual: ticket inside two rings, with two notes at different depths */
.home .float { position: relative; height: clamp(420px, 40vw, 530px); display: grid; place-items: center; }
:is(.home, .account) .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid var(--ring); }
.home .ring-a { --d: min(520px, 92vw); width: var(--d); aspect-ratio: 1; margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); }
.home .ring-b { --d: min(380px, 70vw); width: var(--d); aspect-ratio: 1; margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); border-style: dashed; }
.account .ring-b { border-style: dashed; }
:is(.home, .account) .ring i { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--live-fill); box-shadow: 0 0 0 6px var(--live-soft); }
.home .ring-a i { left: 13%; top: 16%; }
.home .ring-b i { right: 6%; bottom: 22%; width: 9px; height: 9px; }
:is(.home, .account) .note {
  position: absolute; left: 50%; top: 50%; z-index: 2; padding: 12px 14px; border-radius: var(--r-4); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: .8125rem; line-height: 1.3; color: var(--muted);
}
:is(.home, .account) .note strong { display: block; color: var(--fg); font-weight: 600; font-size: .9375rem; }
/* Resting places (no JS, or before landing.js paints): upper left and lower right of the ticket. */
.home #noteA { z-index: 0; transform: translate(-50%, -50%) translate(min(-200px, -30vw), -150px) scale(.94); }
.home #noteB { transform: translate(-50%, -50%) translate(min(200px, 30vw), 150px); }
.home #ticket { transform: rotate(-3deg); }
.home #ticket .t-stub { width: 100px; }
.js-motion .home .ticket, .js-motion .home .ring, .js-motion .home .note { will-change: transform; }

/* Stats */
.home .stats { border-block: 1px solid var(--line); }
.home .stats ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 auto; padding-block: 0; list-style: none; }
.home .stats li { padding: clamp(28px, 4vw, 44px) clamp(14px, 2vw, 28px); }
.home .stats li + li { border-left: 1px solid var(--line); }
.home .stat-n { display: block; font: 600 clamp(2.6rem, 5.4vw, 4.2rem)/1 var(--sans); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.home .stat-l { display: block; margin-top: 10px; color: var(--muted); font-size: .9375rem; }

/* Sections */
.home .block { padding: clamp(56px, 7vw, 96px) 0; }
.home .block-flush { padding-top: 0; }
.home .head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 44px); }
.home .head .lede { margin-top: 18px; }

/* The life of a link: a sample room moves through Ready, In call, Ended */
.home .life { position: relative; padding: clamp(56px, 7vw, 96px) 0 0; }
.home .life-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.home .life-intro { margin-bottom: clamp(28px, 4vw, 44px); }
.home .life-intro .h2 { max-width: 20ch; }
.home .steps { position: relative; padding-left: 28px; }
.home .steps::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.home .rail { position: absolute; left: 4px; top: 8px; width: 2px; height: calc(100% - 16px); border-radius: 2px; background: var(--fg); transform-origin: top; transform: scaleY(0); }
.home .rail.ember { background: var(--ember-fill); }
.home .steps ol { list-style: none; margin: 0; padding: 0; }
/* Inactive steps use the muted colour (4.5:1), never a low opacity. */
.home .step { position: relative; padding: 12px 0; color: var(--muted); transition: color .35s; }
.home .step.on { color: var(--fg); }
.home .step::before { content: ""; position: absolute; left: -28px; top: 22px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: background-color .3s, border-color .3s; }
.home .step.on::before, .home .step.done::before { background: var(--fg); border-color: var(--fg); }
.home .step.burn.on::before { background: var(--ember-fill); border-color: var(--ember-fill); }
.home .step-n { font: 500 .75rem/1 var(--mono); letter-spacing: .14em; color: var(--muted); }
.home .step h3 { margin: 8px 0 6px; font: 600 1.5rem/1.15 var(--sans); letter-spacing: -0.025em; }
.home .step-btn { display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.home .step-btn:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.home .step p { margin: 0; color: var(--muted); max-width: 30em; }

.home .room { position: relative; border-radius: var(--r-5); padding: clamp(20px, 3vw, 28px); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .5s; overflow: hidden; }
.home .room.burned { border-color: color-mix(in srgb, var(--ember-fill) 35%, var(--line)); }
.home .room-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home .timer { font: 600 1rem/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.home .room.live .timer { color: var(--fg); }
.home .room .code { font-size: clamp(2rem, 4.6vw, 3rem); }
.home .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.home .tile { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-3); border: 1.5px dashed var(--line-strong); display: grid; place-items: center; font-size: .8125rem; color: var(--muted); transition: background-color .35s, border-color .35s, opacity .45s, transform .5s cubic-bezier(.2, .9, .25, 1); }
.home .tile .av { width: 40px; height: 40px; font-size: .875rem; opacity: 0; transform: scale(.6); transition: transform .5s cubic-bezier(.3, 1.3, .5, 1), opacity .3s; }
.home .tile-who { position: absolute; left: 10px; bottom: 8px; font-size: .75rem; color: var(--muted); opacity: 0; transition: opacity .3s; }
.home .tile.in { background: var(--surface-2); border: 1.5px solid transparent; }
.home .tile.in .av { opacity: 1; transform: none; }
.home .tile.in .tile-who { opacity: 1; }
.home .tile.speaking { box-shadow: inset 0 0 0 2px var(--live-fill); }
.home .room.burned .tile { transform: scale(.96); background: transparent; border: 1.5px dashed var(--line-strong); }
/* Ended: greyed by colour, not opacity, so the labels keep 4.5:1. */
.home .room.burned .tile .av { background: var(--muted); color: var(--bg); }
/* Ended: the code stays and burns (struck through, ember to ash), never a row of dots. */
.home .room.burned .code { color: var(--ember); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--ember) 70%, transparent); transition: color .8s; }
/* An empty seat says so, the same for every seat; it hides once someone sits there. */
.home .tile-open { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .3s; }
.home .tile.in .tile-open { opacity: 0; }
.home .room-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); min-height: var(--h-md); }
.home .room-count { font-family: var(--mono); }
.home .room.burned .room-state { color: var(--ember); }
.home .seal { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 50% 120%, var(--ember-soft), transparent 60%); opacity: 0; transition: opacity .8s; }
.home .room.burned .seal { opacity: 1; }

/* How calls move */
.home .flow-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.home .flow-grid .head { margin-bottom: 0; }
.home .flow { border-radius: var(--r-5); background: var(--surface); border: 1px solid var(--line); padding: clamp(18px, 3vw, 32px); }
.home .flow svg { width: 100%; max-width: 760px; margin-inline: auto; height: auto; overflow: visible; }
.home .flow .node { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; transition: stroke .4s; }
.home .flow.connected .node { stroke: var(--live-fill); }
.home .flow .node-t { fill: var(--fg); font: 600 15px var(--sans); }
.home .flow .node-c { fill: var(--muted); font: 500 11px var(--mono); letter-spacing: .1em; }
.home .flow .wire { stroke: var(--live-fill); stroke-width: 2; stroke-linecap: round; }
.home .flow.closed .wire { stroke: var(--ember-fill); }
.home .flow .relay { stroke: var(--line-strong); stroke-width: 1.25; stroke-dasharray: 3 5; fill: none; }
.home .flow .relay-box { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.25; }
.home .flow .relay-t { fill: var(--muted); font: 500 11px var(--mono); letter-spacing: .08em; }
.home .flow .pkt { fill: var(--live-fill); }
.home .flow.closed .pkt { opacity: 0; transition: opacity .2s; }
.home .flow .spark { fill: var(--ember-fill); opacity: 0; }
.home .flow-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(16px, 3vw, 28px); padding-top: 18px; border-top: 1px solid var(--line); }
.home .flow-status { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: .9375rem; }
.home .flow.closed .flow-status { color: var(--ember); }
.home .flow-note { margin: 16px 0 0; font-size: .875rem; color: var(--muted); max-width: 40em; }

/* Privacy (deliberately still) */
.home .privacy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.home .privacy .lede { margin-top: 20px; }
.home .points { list-style: none; margin: 0; padding: 0; }
.home .points li { display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; padding: 24px 0; border-top: 1px solid var(--line); }
.home .points li:last-child { border-bottom: 1px solid var(--line); }
.home .points .n { grid-row: span 2; font: 500 .75rem/1.9 var(--mono); letter-spacing: .14em; color: var(--muted); }
.home .points strong { font-weight: 600; font-size: 1.0625rem; }
.home .points small { color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.home .p-link-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 0; }
.home .p-link { display: inline-flex; align-items: center; gap: 12px; min-height: var(--h-md); font-weight: 500; text-decoration: none; }
.home .p-link:hover .t { text-decoration: underline; text-underline-offset: 4px; }

/* Closing */
.home .closing { text-align: center; padding: clamp(64px, 8vw, 112px) 0; border-top: 1px solid var(--line); }
.home .closing .kicker { justify-content: center; }
.home .closing .h2 { max-width: 15ch; margin-inline: auto; }

/* Reveal: only with motion allowed and landing.js running. */
.js-motion .home .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.js-motion .home .reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 980px) {
  .home .privacy, .home .flow-grid, .home .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .home .float { height: clamp(400px, 70vw, 500px); }
  .home .stats ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .stats li:nth-child(3) { border-left: 0; }
  .home .stats li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .home .life-grid { grid-template-columns: 1fr; gap: 20px; }
  .home .steps { padding-left: 0; }
  .home .steps::before, .home .rail, .home .step::before { display: none; }
  /* With motion the steps take turns in one slot; without it they simply stack. */
  .js-motion .home .steps { min-height: 158px; }
  .js-motion .home .step { position: absolute; inset: 0 0 auto 0; padding: 0; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .3s, transform .4s cubic-bezier(.2, .8, .2, 1), visibility 0s .4s; }
  .js-motion .home .step.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
@media (max-width: 560px) {
  .home .ctas .btn { flex: 1 1 100%; }
  .home .float { height: 500px; margin-top: 8px; }
  .home .people small { display: none; }
  .home .ticket { grid-template-columns: 1fr; width: min(340px, 100%); }
  .home .t-main { border-right: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-5) var(--r-5) 0 0;
    -webkit-mask: radial-gradient(circle var(--notch) at 0 100%, transparent 98%, black) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 100%, transparent 98%, black) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 100%, transparent 98%, black) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 100%, transparent 98%, black) right / 51% 100% no-repeat; }
  .home #ticket .t-stub { width: auto; flex-direction: row; padding: 14px 20px; border-left: 1px solid var(--line); border-top: 2px dashed var(--line-strong); border-radius: 0 0 var(--r-5) var(--r-5);
    -webkit-mask: radial-gradient(circle var(--notch) at 0 0, transparent 98%, black) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 0, transparent 98%, black) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 0, transparent 98%, black) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% 0, transparent 98%, black) right / 51% 100% no-repeat; }
  .home .stub-n { font-size: 1.75rem; }
  .home .note { font-size: .75rem; padding: 10px 12px; }
  .home .note strong { font-size: .875rem; }
  .home #noteA { transform: translate(-50%, -50%) translate(-28vw, -190px) scale(.94); }
  .home #noteB { transform: translate(-50%, -50%) translate(28vw, 190px); }
  .home .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .tiles .tile:nth-child(n + 5) { display: none; }
  .home .tile { aspect-ratio: 16 / 9; }
  .home .tile-who { display: none; }
}

/* =====================================================================
   Account pages (redesign phase 2): log in, create account, forgot,
   reset and confirm email. Ported from the prototype (MUTE-Website-View/
   index.html 452–470). Layout classes are scoped to body.account; the
   password widgets (.pw-wrap, .pw-toggle, .pw-rules) match what
   password-toggle.js and password-meter.js expect and generate.
   ===================================================================== */
.account { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.account main { flex: 1 0 auto; }
.account main:focus { outline: none; }
.account .top { position: sticky; top: 0; }


/* Log in / Create account: the form left, the invite ticket right. */
.account .auth-main { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: clamp(32px, 7vw, 112px); align-items: center; min-height: calc(100svh - 69px); padding-block: clamp(32px, 6vw, 72px); }
.account .auth-h { margin: 0 0 8px; font: 600 clamp(1.9rem, 4vw, 2.5rem)/1.05 var(--sans); letter-spacing: -0.035em; text-wrap: balance; }
.account .auth-sub { margin: 0 0 28px; color: var(--muted); }
.account .auth-submit { margin-top: 24px; }
.account .auth-note { margin: 22px 0 0; color: var(--muted); font-size: .875rem; text-align: center; }
.account .auth-note strong { color: var(--fg); font-weight: 500; }
.account .f-label .link-btn { letter-spacing: 0; text-transform: none; }
/* Friendly, sentence-case labels on the account pages (mono caps stay for the kicker only). */
.account .f-label { font: 500 .875rem/1.2 var(--sans); letter-spacing: 0; text-transform: none; color: var(--fg); }
/* One line under the button switches between Log in and Sign up (two real pages, no tabs). */
.account .auth-switch { margin: 16px 0 0; color: var(--muted); font-size: .9375rem; text-align: center; }
.account .auth-switch a { display: inline-flex; align-items: center; min-height: 32px; color: var(--fg); font-weight: 600; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.account .auth-switch a:hover { text-decoration-color: currentColor; }
.account .auth-note .link-btn { font-size: inherit; }
/* The header marks the page you're on. */
.account .top-drawer a[aria-current="page"] { font-weight: 600; }
.account .f-hint { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.account .keep-list { display: grid; gap: 14px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .875rem; }
.account .keep-list dt { font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.account .keep-list dd { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }

/* Log in / Sign up art: home's floating ticket, open on the page (rings, notes). Static. */
.account .auth-float { position: relative; height: clamp(440px, 40vw, 540px); display: grid; place-items: center; }
.account .auth-float .ring-a { --d: min(520px, 46vw); width: var(--d); aspect-ratio: 1; margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); }
.account .auth-float .ring-b { --d: min(380px, 34vw); width: var(--d); aspect-ratio: 1; margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); }
.account .auth-float .ring-a i { left: 13%; top: 16%; }
.account .auth-float .ring-b i { right: 6%; bottom: 22%; width: 9px; height: 9px; }
.account .auth-float .ticket { z-index: 1; width: min(420px, 100%); transform: rotate(-3deg); }
.account .auth-float .t-stub { width: 100px; }
.account .auth-float .note-a { z-index: 0; transform: translate(-50%, -50%) translate(-170px, -150px) scale(.94); }
.account .auth-float .note-b { transform: translate(-50%, -50%) translate(170px, 150px); }
/* Sign up's form is long: the art stays in view near the top instead of centring far down. */
.account .auth-main:has(#registerForm) .auth-float { align-self: start; position: sticky; top: 96px; }

/* Forgot / reset / confirm email: one centred card. */
.account .auth-single { position: relative; display: grid; place-items: center; padding-block: clamp(32px, 8vw, 96px); overflow: hidden; }
/* A faint pair of home's rings behind the card, so it sits in Mute, not on a bare page. */
.account .auth-rings { position: absolute; inset: 0; pointer-events: none; }
.account .auth-rings span { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid var(--ring); translate: -50% -50%; }
.account .auth-rings span:first-child { width: min(640px, 120vw); aspect-ratio: 1; }
.account .auth-rings span:last-child { width: min(460px, 90vw); aspect-ratio: 1; border-style: dashed; }
.account .auth-single .auth-card { position: relative; }
.account .auth-card { width: 100%; max-width: 480px; }
.account .auth-card h1 { margin: 0 0 8px; font: 600 clamp(1.6rem, 3vw, 2rem)/1.1 var(--sans); letter-spacing: -0.03em; }
.account .auth-card .auth-sub { margin-bottom: 24px; }
.account .auth-foot { margin: 20px 0 0; color: var(--muted); font-size: .9375rem; }
.account .auth-foot + .auth-foot { margin-top: 8px; }
.account .auth-foot a { display: inline-flex; align-items: center; min-height: 32px; color: var(--fg); font-weight: 500; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.account .auth-foot a:hover { text-decoration-color: currentColor; }
.account .auth-foot .link-btn { font-size: inherit; }
.account .otp-input { font: 600 1.5rem/1 var(--mono); letter-spacing: .4em; text-align: center; }

@media (max-width: 980px) {
  .account .auth-main { grid-template-columns: minmax(0, 1fr); max-width: 520px; min-height: 0; }
  .account .auth-float { display: none; }
}

/* Password: show/hide button inside the field (styled as the prototype's .pw), and the live rule list. */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 56px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: var(--r-2); background: transparent; color: var(--muted); cursor: pointer; }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--fg); background: var(--surface-2); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .8125rem; }
.pw-rules li { display: inline-flex; align-items: center; gap: 7px; }
.pw-rules li::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-input); transition: background-color .3s, border-color .3s; }
.pw-rules li.ok { color: var(--fg); }
.pw-rules li.ok::before { background: var(--live-fill); border-color: var(--live-fill); }

/* ==========================================================================
   Policy pages (redesign phase 2): privacy and terms. A sticky table of
   contents beside the legal text; one column on narrow screens.
   ========================================================================== */
.policy { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: clamp(24px, 6vw, 96px); padding-block: clamp(48px, 8vw, 104px); }
.toc { position: sticky; top: 88px; align-self: start; display: grid; gap: 2px; }
.toc .kicker { margin-bottom: 10px; }
.toc a { display: flex; align-items: center; min-height: 36px; color: var(--muted); font-size: .9375rem; text-decoration: none; }
.toc a:hover { color: var(--fg); }
.prose { max-width: 68ch; }
.prose .h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.prose .lede { margin-top: 20px; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 32px 0 0; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: .9375rem; }
.notice strong { color: var(--fg); font-weight: 600; }
.notice .ico { margin-top: 0; color: var(--ember); }
.prose h2 { margin: 48px 0 12px; font: 600 1.5rem/1.2 var(--sans); letter-spacing: -0.02em; scroll-margin-top: 88px; }
.prose h3 { margin: 32px 0 8px; font: 600 1.125rem/1.3 var(--sans); letter-spacing: -0.01em; scroll-margin-top: 88px; }
.prose h2:focus, .prose h3:focus { outline: none; }
.prose p, .prose li { color: var(--muted); }
.prose p strong, .prose li strong { color: var(--fg); font-weight: 500; }
.prose-next { display: flex; flex-wrap: wrap; gap: 10px; max-width: 68ch; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .policy { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 40px 64px; }
  .toc { position: static; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
}

/* ==========================================================================
   Invitation help (redesign phase 3): /help, one card per invitation state.
   Static page; scoped under body.help.
   ========================================================================== */
.help .states { padding-block: clamp(48px, 8vw, 104px); }
.help .states-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.help .states-head .lede { margin-top: 18px; }
.help .state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.help .st-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; scroll-margin-top: 88px; }
.help .st-card h2 { margin: 4px 0 0; font: 600 1.25rem/1.2 var(--sans); letter-spacing: -0.02em; }
.help .st-card p { margin: 0; color: var(--muted); font-size: .9375rem; }
.help .st-card:target { border-color: var(--line-strong); }

/* ==========================================================================
   App pages (redesign phase 3): the signed-in shell (history, quick; later
   dashboard and settings) and what their scripts create. Builds on the app
   shell section above (prototype 471–493, 704–716) and the prototype's
   table (495–535, 728–745). Static markup in each page; shell.js only fills
   #shellUser, .shell-avatar, #adminLink and #logoutBtn. Scoped to
   body.app-page (+ .hist-page / .quick-page) so the generic names can't
   leak. Not body.app: .app is the shell grid itself (the <div> inside body).
   ========================================================================== */
body.app-page .side { z-index: 20; overflow-y: auto; background: var(--bg); }
body.app-page .nav a[aria-current="true"] { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
body.app-page .nav-dot { flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--live-fill); }
/* Shell rules stay in the sidebar: a bare .me or .side-note would reach Chats' own
   (.chat-msg.me, the Requests note). */
body.app-page .side .me { margin-top: auto; }
body.app-page .side .side-note + .me { margin-top: 0; }
/* Two rows (owner 2026-10-18): avatar + the whole name, then theme + Log out, so a
   30-character username is never cut to "va…". */
body.app-page .side .me { flex-wrap: wrap; row-gap: 12px; }
body.app-page .side .me .me-name { flex: 1 1 calc(100% - 48px); }
body.app-page .side .me-name strong { font-size: .9375rem; font-weight: 600; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
body.app-page .side .me .btn { flex: 1 1 auto; }
body.app-page .side .me .theme-btn { flex: none; }
body.app-page .app-col { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100svh; }
body.app-page .main { flex: 1 0 auto; }
body.app-page .main:focus { outline: none; }
body.app-page .main-head .lede { margin-top: 8px; font-size: .9375rem; }
/* Working titles on signed-in pages (not marketing size). */
body.app-page .page-h { font-size: clamp(1.6rem, 2.4vw, 2rem); letter-spacing: -0.03em; }
body.app-page .main-head { margin-bottom: clamp(18px, 2vw, 24px); }
body.app-page .app-foot { padding-inline: clamp(16px, 3.4vw, 48px); }
body.app-page .phone-only { display: none; }
@media (max-width: 860px) {
  /* Phones: the sidebar becomes the top bar (brand, avatar, Log out), so #logoutBtn exists once. */
  body.app-page .side { position: sticky; top: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; height: 60px; padding: 0 16px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  body.app-page .side .brand { margin: 0 auto 0 0; }
  body.app-page .side .nav, body.app-page .side .side-note { display: none; }
  body.app-page .side .me { margin: 0; padding: 0; border-top: 0; }
  body.app-page .side .me .av { width: 34px; height: 34px; }
  body.app-page .side .me-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.app-page .app-col { min-height: 0; }
  body.app-page .main { padding-bottom: 40px; }
  body.app-page .app-foot { padding-bottom: calc(32px + 58px + env(safe-area-inset-bottom)); }
  body.app-page .phone-only { display: inline-flex; }
  body.app-page .phone-only.hidden { display: none; }
  body.app-page .tabbar .ico { width: 22px; height: 22px; }
  body.app-page .tab-i { position: relative; }
  body.app-page .tab-i .nav-dot { position: absolute; top: -2px; right: -5px; margin: 0; box-shadow: 0 0 0 2px var(--bg); }
}

/* Table (prototype 520–527, 742–743) */
body.app-page .table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
body.app-page .table th { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font: 500 .6875rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
body.app-page .table td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
body.app-page .table tr:last-child td { border-bottom: 0; }
body.app-page .mono { font: 500 .875rem/1.3 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
body.app-page .tag { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: var(--r-1); font: 600 .6875rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
body.app-page .tag-active { background: var(--live-soft); color: var(--live); }
body.app-page .tag-ended { background: var(--surface-2); color: var(--muted); }
body.app-page .kind-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: var(--r-1); background: var(--surface-2); color: var(--muted); font: 500 .6875rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
body.app-page .kind-tag svg { width: 12px; height: 12px; flex: none; }
body.app-page .role-tag { font: 500 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
body.app-page .room-name { font-weight: 600; white-space: normal; }
body.app-page .room-code { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font: 500 .75rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
body.app-page .cell-unit { display: none; }
body.app-page .empty-note { padding: 40px 20px; text-align: center; color: var(--muted); }
body.app-page .empty-note p { margin: 0 0 16px; }

/* Call history */
.hist-page .hist-stats, .dash-page .dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 32px; }
:is(.hist-page, .dash-page) .stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); }
:is(.hist-page, .dash-page) .stat dt { font: 500 .6875rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
:is(.hist-page, .dash-page) .stat dd { margin: 8px 0 0; font: 600 1.75rem/1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hist-page .filters { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.hist-page .filters .field + .field { margin-top: 0; }
.hist-page .filters :is(.input, .select) { min-width: 0; min-height: var(--h-md); }
.hist-page .list-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 10px; }
.hist-page .hist-count { margin: 0; color: var(--muted); font-size: .875rem; }
.hist-page .table-card { padding: 6px 14px; overflow-x: auto; }
.hist-page .hist-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.hist-page .hist-foot p { margin: 0; max-width: 40em; color: var(--muted); font-size: .875rem; }
@media (max-width: 1180px) {
  .hist-page .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hist-page .f-find { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .hist-page .hist-stats, .dash-page .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-page .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-page .f-find { grid-column: 1 / -1; }
}
/* Phones: each room is one block (name + outcome, then the facts on one line). */
@media (max-width: 640px) {
  body.hist-page .table-card { padding: 0 16px; }
  body.hist-page .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.hist-page .table, body.hist-page .table tbody { display: block; width: 100%; }
  body.hist-page .table tr { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  body.hist-page .table tr:last-child { border-bottom: 0; }
  body.hist-page .table td { display: block; padding: 0; border: 0; white-space: normal; }
  body.hist-page .table td.col-room { flex: 1 1 55%; order: 1; min-width: 0; }
  body.hist-page .table td[data-label="Outcome"] { order: 1; margin-left: auto; }
  body.hist-page .table tr::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  body.hist-page .table td.meta-cell { order: 3; font: 500 .75rem/1.3 var(--mono); color: var(--muted); }
  body.hist-page .table td.meta-cell + td.meta-cell::before { content: "·"; margin: 0 8px; }
  body.hist-page .table td[data-empty] { display: none; }
  body.hist-page .cell-unit { display: inline; white-space: pre; }
}

/* Quick room (and the free trial's kinds): type cards and a participant row, both real radios. The radio covers its whole
   card (invisible, but clickable and focusable); :has() draws the checked and focus states. */
.quick-page .quick-card { max-width: 640px; }
/* The form and "What happens next" side by side on wide screens (no empty third). */
.quick-page .quick-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1100px) {
  .quick-page .quick-layout { grid-template-columns: minmax(0, 640px) minmax(260px, 1fr); }
}
.quick-page .quick-side .next-steps { display: grid; gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; }
.quick-page .quick-side li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.quick-page .quick-side li strong { display: block; color: var(--fg); font-weight: 600; margin-bottom: 2px; }
.quick-page .quick-side .step-num { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-input); border-radius: 50%; color: var(--fg); font: 600 .8125rem/1 var(--mono); }
:is(.quick-page, .dash-page, .trial-page) fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
:is(.quick-page, .dash-page, .trial-page) legend:not(.sr-only) { width: 100%; padding: 0; margin-bottom: 10px; }
.quick-page .q-row + .q-row { margin-top: 26px; }
.quick-page .types { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.quick-page .type { min-height: 112px; }
:is(.quick-page, .dash-page, .trial-page) :is(.type, .seg-r label) input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
:is(.quick-page, .dash-page, .trial-page) .type:has(input:checked) { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
:is(.quick-page, .dash-page, .trial-page) .type:has(input:checked)::after { content: ""; position: absolute; top: 16px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }
:is(.quick-page, .dash-page, .trial-page) :is(.type, .seg-r label):has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: 3px; }
:is(.quick-page, .dash-page) .seg-r { grid-template-columns: repeat(5, minmax(0, 1fr)); }
:is(.quick-page, .dash-page) .seg-r label { position: relative; display: grid; place-items: center; min-height: var(--h-md); border-radius: 9px; color: var(--muted); font: 600 1rem/1 var(--mono); transition: background-color .25s, color .25s, box-shadow .25s; }
:is(.quick-page, .dash-page) .seg-r label:hover { color: var(--fg); }
:is(.quick-page, .dash-page) .seg-r label:has(input:checked) { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
:is(.quick-page, .dash-page) .seg-r label:active { transform: scale(.97); }
.quick-page .msg { margin: 24px 0 0; }
.quick-page .q-submit { margin-top: 28px; }
.quick-page .quick-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; line-height: 1.5; }
.quick-page .quick-note .dot { margin-top: 7px; }
.quick-page .quick-note p { margin: 0; }
@media (max-width: 560px) {
  .quick-page .types { grid-template-columns: minmax(0, 1fr); }
  .quick-page .type { min-height: 64px; }
  :is(.quick-page, .dash-page, .trial-page) .type:has(input:checked)::after { top: 50%; margin-top: -4px; }
}

/* Settings (prototype 616–630, 717–741). The generic components (.card, .switch-row, .switch,
   .seg, .pw-wrap) are global above; only the page layout lives here. */
.set-page .set { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.set-page .set-nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.set-page .set-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: .9375rem; text-decoration: none; transition: background-color .2s, color .2s; }
.set-page .set-nav a:hover { background: var(--surface-2); color: var(--fg); }
.set-page .set-stack { display: grid; gap: 20px; max-width: 760px; }
.set-page .set-stack > .card { scroll-margin-top: 24px; }
.set-page .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-top: 18px; }
.set-page .two:first-child { margin-top: 0; }
.set-page .two .field + .field { margin-top: 0; }
.set-page .two + .field { margin-top: 18px; }
.set-page .photo { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.set-page .photo + .two { margin-top: 0; }
.set-page .photo .av { width: 76px; height: 76px; font-size: 1.375rem; }
.set-page .photo strong { font-weight: 600; }
.set-page .photo p { margin: 2px 0 12px; color: var(--muted); font-size: .875rem; }
.set-page .photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.set-page .photo-actions label { cursor: pointer; }
.set-page .photo-actions input:focus-visible + label { outline: 2px solid var(--fg); outline-offset: 3px; }
.set-page .card .msg { margin: 20px 0 0; }
.set-page .switch-row + .msg { margin-top: 4px; }
.set-page .card.danger .card-sub { max-width: 40em; }
@media (max-width: 860px) {
  .set-page .set { grid-template-columns: minmax(0, 1fr); }
  .set-page .set-nav { position: static; display: flex; gap: 4px; overflow-x: auto; margin-inline: -4px; padding: 2px 4px; scrollbar-width: none; }
  .set-page .set-nav a { white-space: nowrap; }
  .set-page .set-stack > .card { scroll-margin-top: 76px; }
}
@media (max-width: 560px) {
  .set-page .two { grid-template-columns: minmax(0, 1fr); }
  .set-page .photo { align-items: flex-start; }
}

/* Dashboard (prototype 495–535, 728–745). Static markup in dashboard.html; dashboard.js builds
   the room cards, recent rooms, and both side drawers' contents (class names kept from the old
   page). The radio cards and the people row share the quick page's rules above. */
.dash-page .dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-page .faint { color: var(--muted); }
.dash-page .new-card .types { margin: 22px 0 0; }
.dash-page .q-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 22px; }
.dash-page .q-grid .field + .field { margin-top: 0; }
.dash-page .opt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0; padding: 16px 0 20px; border-block: 1px solid var(--line); }
.dash-page .opt-row label { display: block; font-weight: 600; font-size: .9375rem; }
.dash-page .opt-row small { display: block; margin-top: 2px; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.dash-page .opt-row .sel { flex: none; width: 176px; }
.dash-page .opt-row .select { min-height: var(--h-md); }
.dash-page .q-icon svg { width: 18px; height: 18px; }
.dash-page .q-plan { margin: 14px 0 0; color: var(--muted); font-size: .875rem; text-align: center; }
.dash-page .q-plan .link-btn { margin-left: 4px; }

/* The latest room as an invite ticket */
.dash-page .active-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.dash-page .active-card:focus { outline: none; }
.dash-page .active-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dash-page .active-top .kicker { margin-bottom: 12px; }
.dash-page .active-card .card-sub { margin-top: -8px; }
.dash-page .active-card .ticket { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
.dash-page .pill.neutral .dot { background: var(--muted); }
.dash-page .pill.ember .dot { background: var(--ember-fill); }
.dash-page .t-hint { margin: 4px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.dash-page .t-link { display: block; margin-top: 8px; font: 500 .75rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.dash-page .active-card.has-link .t-link { color: var(--fg); user-select: all; }
.dash-page .active-card.is-empty .code { color: var(--muted); }
.dash-page .active-card .ticket.dead .t-link { color: var(--ember); }
.dash-page .renew:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.dash-page .active-card .people { min-width: 0; }
.dash-page #activeGuestLabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-page .active-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Flip through open rooms (dashboard.js): a pager, a peeking next ticket, dots. */
.dash-page .active-head { min-width: 0; }
.dash-page .active-head .pill { margin-top: 10px; }
.dash-page .active-pager { display: flex; align-items: center; gap: 2px; flex: none; }
.dash-page .active-pager.hidden { display: none; }
.dash-page .pager-btn { width: 36px; height: 36px; color: var(--fg); transition: background-color .2s, transform .12s ease-out; }
.dash-page .pager-btn::after { content: ""; position: absolute; inset: -4px; }
.dash-page .pager-btn svg { width: 18px; height: 18px; }
.dash-page .pager-btn:active { transform: scale(.94); }
.dash-page .pager-btn[aria-disabled="true"] { color: var(--muted); opacity: .45; cursor: default; }
.dash-page .pager-btn[aria-disabled="true"]:hover { background: transparent; }
.dash-page .pager-count { min-width: 4.5em; text-align: center; font: 500 .8125rem/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-page .ticket-stack { position: relative; padding: 14px 18px 14px 0; margin: -14px -18px -14px 0; touch-action: pan-y; }
/* Clip only while a ticket slides: at rest its shadow stays whole. */
.dash-page .ticket-stack.is-moving { overflow: hidden; }
.dash-page .ticket-stack .ticket { will-change: transform; user-select: none; -webkit-user-select: none; }
.dash-page .ticket-stack .t-link { user-select: text; -webkit-user-select: text; }
.dash-page .ticket-peek { position: absolute; z-index: 0; top: 14px; bottom: 14px; left: 0; right: 18px; border: 1px solid var(--line); border-radius: var(--r-5); background: var(--surface-2); opacity: .7; transform: translateX(10px) scale(.95); transform-origin: right center; pointer-events: none; }
.dash-page .ticket-peek.is-left { transform: translateX(-10px) scale(.95); transform-origin: left center; }
.dash-page .ticket-peek.hidden { display: none; }
.dash-page .active-dots { display: flex; justify-content: center; gap: 6px; margin-top: -6px; }
.dash-page .active-dots.hidden { display: none; }
.dash-page .active-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: width .25s cubic-bezier(.2, .9, .25, 1), background-color .2s; }
.dash-page .active-dots span.on { width: 18px; border-radius: 3px; background: var(--fg); }
.dash-page .active-dots span.live { background: var(--live-fill); }
@media (prefers-reduced-motion: reduce) { .dash-page .ticket-peek, .dash-page .ticket-peek.is-left { transform: none; } }
/* No opacity fade when the buttons wake up after loading (an axe run mid-fade reads low contrast). */
.dash-page .active-actions .btn { transition: transform .12s ease-out, background-color .2s, border-color .2s; }


/* Stats and sections */
.dash-page .dash-stats { margin: 32px 0 0; }
.dash-page .dash-side { display: grid; gap: 20px; align-content: start; min-width: 0; }
.dash-page .dash-main { display: grid; gap: 20px; align-content: start; min-width: 0; }
.dash-page .dash-main .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
/* Start a call: one click per kind; the full form folds under More options. */
.dash-page .start-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.dash-page .start-tile { display: grid; justify-items: start; align-content: start; gap: 4px; min-height: 112px; padding: 16px; border: 1px solid var(--line-input); border-radius: var(--r-4); background: var(--surface); color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s, transform .12s; }
.dash-page .start-tile:hover { border-color: var(--fg); background: var(--surface-2); }
.dash-page .start-tile:active { transform: scale(.97); }
.dash-page .start-tile:disabled { opacity: .6; cursor: progress; }
.dash-page .start-tile .ico { width: 24px; height: 24px; margin-bottom: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dash-page .start-tile strong { font-size: 1.0625rem; font-weight: 600; }
.dash-page .start-tile small { color: var(--muted); font-size: .8125rem; line-height: 1.35; }
.dash-page #startError { margin-top: 12px; }
@media (max-width: 560px) {
  .dash-page .start-tiles { grid-template-columns: minmax(0, 1fr); }
  .dash-page .start-tile { grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "ico name" "ico note"; align-items: center; column-gap: 14px; min-height: 64px; }
  .dash-page .start-tile .ico { grid-area: ico; margin: 0; }
  .dash-page .start-tile strong { grid-area: name; }
  .dash-page .start-tile small { grid-area: note; }
}
.dash-page .more-options { margin-top: 18px; border-top: 1px solid var(--line); }
.dash-page .more-options > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-top: 14px; cursor: pointer; font-weight: 600; list-style: none; }
.dash-page .more-options > summary::-webkit-details-marker { display: none; }
.dash-page .more-options > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.dash-page .more-options[open] > summary::before { transform: rotate(45deg); }
.dash-page .more-options > summary small { color: var(--muted); font-weight: 400; font-size: .875rem; }
.dash-page .more-options > .card-sub { margin-top: 8px; }
.dash-page .new-card > .q-plan { margin-top: 14px; }
.dash-page .q-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; margin-top: 14px; }
.dash-page .q-foot .q-plan { margin: 0; }
.dash-page .stat dd small { color: var(--muted); font-size: .875rem; font-weight: 500; letter-spacing: 0; }
.dash-page .dash-section { margin-top: 40px; }
.dash-page .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* Open rooms */
.dash-page .room-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
/* Wide screens: each open room is one row (name, state, seats, actions), no half-empty grid. */
@media (min-width: 900px) {
  .dash-page .room-card { grid-template-columns: minmax(0, 36%) minmax(0, 1fr) max-content; grid-template-areas: "names state actions" "facts slots actions"; align-items: center; gap: 8px 24px; padding: 16px 20px; }
  .dash-page .room-card-top { display: contents; }
  .dash-page .room-card-top > :first-child { grid-area: names; }
  .dash-page .room-card-top > .btn-row { grid-area: state; }
  .dash-page .room-card .room-facts { grid-area: facts; display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .dash-page .room-card .slots { grid-area: slots; }
  .dash-page .room-card .room-card-actions { grid-area: actions; padding-top: 0; border-top: 0; flex-wrap: nowrap; }
}
.dash-page .room-card { display: grid; align-content: start; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-5); background: var(--surface); }
.dash-page .room-card.is-live { border-color: color-mix(in srgb, var(--live) 45%, var(--line)); }
.dash-page .room-card-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dash-page .room-card h3 { margin: 0; font: 600 1.125rem/1.3 var(--sans); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dash-page .btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-page .room-state { display: inline-flex; align-items: center; gap: 6px; font: 500 .75rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg); }
.dash-page .room-state .when { color: var(--muted); text-transform: none; letter-spacing: 0; }
.dash-page .room-state .sep { color: var(--muted); }
.dash-page .room-state.is-live { color: var(--live); }
.dash-page .pip { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dash-page .is-live .pip, .dash-page .link-block.is-active .pip { background: var(--live-fill); }
.dash-page .room-facts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .875rem; }
.dash-page .room-facts li { display: flex; align-items: center; gap: 8px; }
.dash-page .room-facts svg { width: 15px; height: 15px; flex: none; }
.dash-page .slots { display: grid; gap: 8px; }
.dash-page .slot-bar { display: flex; gap: 4px; }
.dash-page .slot { flex: 1; height: 6px; border-radius: 3px; background: var(--line-strong); }
.dash-page .slot.is-joined { background: var(--live-fill); }
.dash-page .slot.is-out { background: var(--fg); }
.dash-page .slot-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 .75rem/1.3 var(--mono); color: var(--muted); }
.dash-page .slot-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.dash-page .slot-legend .key::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--line-strong); }
.dash-page .slot-legend .key-joined::before { background: var(--live-fill); }
.dash-page .slot-legend .key-out::before { background: var(--fg); }
.dash-page .room-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.dash-page .tag-pending { background: transparent; box-shadow: inset 0 0 0 1px var(--line-input); color: var(--fg); }

/* First run and empty notes */
.dash-page .first-run { display: grid; gap: 20px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-5); }
.dash-page .first-run h3 { margin: 0 0 4px; font: 600 1.125rem/1.3 var(--sans); }
.dash-page .first-run p { margin: 0; color: var(--muted); font-size: .9375rem; }
.dash-page .first-run ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.dash-page .first-run li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--muted); font-size: .9375rem; }
.dash-page .first-run li strong { display: block; color: var(--fg); font-weight: 600; }
.dash-page .step-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--fg); font: 600 .875rem/1 var(--mono); }
.dash-page .card.empty-note { padding: 28px 20px; }
.dash-page .card.empty-note p { margin: 0; }

/* Recent rooms */
.dash-page .recent { padding: 0 20px; }
.dash-page .recent ul { margin: 0; padding: 0; list-style: none; }
.dash-page .recent li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.dash-page .recent li:first-child { border-top: 0; }
.dash-page .burn-pip { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dash-page .r-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-page .r-meta { grid-column: 2 / -1; font: 500 .75rem/1.4 var(--mono); color: var(--muted); }
.dash-page .recent .empty-note { padding: 28px 0; }
.dash-page .recent-foot { display: flex; justify-content: center; padding: 14px 0; border-top: 1px solid var(--line); }

/* Side drawers: Invites & settings, Plan a room. Right-hand sheets; bottom sheets on phones. */
.dash-page .drawer { position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); max-width: 100vw; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.dash-page .drawer[open] { display: flex; flex-direction: column; animation: m-drawer-in .38s cubic-bezier(.2, .9, .25, 1); }
.dash-page .drawer::backdrop { background: var(--scrim); }
.dash-page .drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.dash-page .drawer-head > div { flex: 1; min-width: 0; }
.dash-page .drawer-head .kicker { margin-bottom: 10px; }
.dash-page .drawer-head h2 { margin: 0; font: 600 1.375rem/1.2 var(--sans); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.dash-page .drawer-close { margin: -6px -10px 0 0; }
.dash-page .drawer-close .ico { width: 18px; height: 18px; }
.dash-page .drawer-body { flex: 1; display: grid; align-content: start; gap: 28px; margin: 0; padding: 24px; overflow-y: auto; }
.dash-page .drawer-body > .msg { margin: 0; }
.dash-page .drawer-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.dash-page .drawer-section h3 { margin: 0 0 6px; font: 600 1rem/1.3 var(--sans); }
.dash-page .drawer-section > .faint { margin: 0 0 14px; font-size: .875rem; }
.dash-page .drawer-danger { padding-top: 22px; border-top: 1px solid var(--line); }
.dash-page .drawer-danger > .faint { max-width: 32em; }
.dash-page .link-block { display: grid; gap: 10px; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface-2); }
.dash-page .link-block.is-active { border-color: color-mix(in srgb, var(--live) 45%, var(--line)); background: var(--live-soft); }
.dash-page .link-status { display: flex; align-items: center; gap: 8px; font: 600 .75rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--live); }
.dash-page .copy-row { display: flex; gap: 8px; }
.dash-page .copy-row .input { flex: 1; min-width: 0; min-height: var(--h-sm); font: 500 .8125rem/1.2 var(--mono); }
.dash-page .copy-row .ico, .dash-page .copy-row svg { width: 16px; height: 16px; }
.dash-page .link-note { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.dash-page .link-block .link-note { color: var(--fg); }
.dash-page .invite-list { margin: 0 0 6px; padding: 0; list-style: none; }
.dash-page .invite-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 0; border-top: 1px solid var(--line); }
.dash-page .invite-list li:first-child { border-top: 0; }
.dash-page .invite-name { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.dash-page .invite-add { display: grid; gap: 8px; margin-top: 14px; }
.dash-page .invite-add .msg { margin: 6px 0 0; }
.dash-page .invite-add-row { display: flex; gap: 8px; }
.dash-page .invite-add-row .input { flex: 1; min-width: 0; min-height: var(--h-md); }
.dash-page .invite-add-row .btn { --h: var(--h-md); padding: 0 16px; }
.dash-page .panel-note { margin: 4px 0 0; font-size: .875rem; }
.dash-page .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-4); }
.dash-page .toggle-row p { margin: 0; color: var(--muted); font-size: .875rem; }
.dash-page .toggle-row strong { display: block; color: var(--fg); font-size: .9375rem; font-weight: 600; }
.dash-page .toggle-row .btn { flex: none; }
.dash-page .drawer-section form > .btn { margin-top: 18px; }

/* Settings fields built by buildSettings (plan + a pending room's edit) */
.dash-page .settings-stack { display: grid; gap: 20px; }
.dash-page .settings-stack .field + .field { margin-top: 0; }
.dash-page .f-label .faint { font: 400 .8125rem/1 var(--sans); letter-spacing: 0; text-transform: none; }
.dash-page .segmented { min-width: 0; margin: 0; padding: 0; border: 0; }
.dash-page .segmented legend { display: flex; gap: 8px; margin-bottom: 8px; font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dash-page .segmented legend .faint { font: 400 .8125rem/1 var(--sans); letter-spacing: 0; text-transform: none; }
.dash-page :is(.preset-options, .segmented-options) { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 4px; padding: 4px; border-radius: var(--r-4); background: var(--surface-2); }
.dash-page .seg-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-page .seg-kind { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-page :is(.preset-options, .segmented-options) label { position: relative; display: grid; }
.dash-page :is(.preset-options, .segmented-options) input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dash-page :is(.preset-options, .segmented-options) input:disabled { cursor: not-allowed; }
.dash-page :is(.preset-options, .segmented-options) span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h-sm); padding: 6px 8px; border-radius: 9px; color: var(--muted); font-size: .875rem; font-weight: 500; line-height: 1.2; text-align: center; transition: background-color .25s, color .25s, box-shadow .25s; }
.dash-page .seg-compact span { font: 600 1rem/1 var(--mono); }
.dash-page :is(.preset-options, .segmented-options) span svg { width: 16px; height: 16px; flex: none; }
.dash-page :is(.preset-options, .segmented-options) label:hover span { color: var(--fg); }
.dash-page :is(.preset-options, .segmented-options) input:checked + span { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.dash-page :is(.preset-options, .segmented-options) input:disabled + span { text-decoration: line-through; }
.dash-page :is(.preset-options, .segmented-options) input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.dash-page .settings-stack .link-note { margin-top: -10px; }
.dash-page .plan-summary { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--r-4); background: var(--surface-2); }
.dash-page .plan-summary .pip { margin-top: 8px; background: var(--fg); }
.dash-page .plan-summary p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.dash-page .plan-summary strong { color: var(--fg); font-weight: 600; }

@media (max-width: 1100px) {
  .dash-page .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .dash-page .first-run ol { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .dash-page .new-card .types { grid-template-columns: minmax(0, 1fr); }
  .dash-page .new-card .type { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 14px; }
  .dash-page .opt-row { flex-direction: column; align-items: stretch; }
  .dash-page .opt-row .sel { width: 100%; }
  .dash-page .active-card .t-stub { width: auto; }
  .dash-page .active-card .avs { display: none; }

  .dash-page .drawer { inset: auto 0 0 0; width: 100%; height: auto; max-height: 92svh; border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; }
  .dash-page .drawer[open] { animation-name: m-sheet-in; }
  .dash-page .drawer-head, .dash-page .drawer-body { padding-inline: 16px; }
  .dash-page .drawer-foot { padding-inline: 16px; }
  .dash-page .copy-row { flex-wrap: wrap; }
  .dash-page .copy-row .input { flex-basis: 100%; }
}

/* ==========================================================================
   Call page (redesign phase 4): room.html, scoped under body.call-page.
   Pre-call screens (gate, guest name step, lobby, ended) follow the prototype
   lobby (MUTE-Website-View/index.html 536–575, 1137–1177) and its burned
   card (1368–1420). room.js toggles .hidden, [hidden], data-cam/data-kind,
   aria-pressed and the btn-primary/btn-secondary class names used below.
   ========================================================================== */
body.call-page [hidden] { display: none !important; } /* svg[hidden] icons: base styles make svg display:block */
body.call-page svg { width: 20px; height: 20px; flex: none; }
body.call-page .faint, body.call-page .subtitle { color: var(--muted); }
body.call-page .call-screen { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
body.call-page .call-top { border-bottom: 1px solid var(--line); }
body.call-page .call-top-in { display: flex; align-items: center; height: 68px; }
body.call-page .call-top .brand svg, body.call-page .brand img { width: 28px; height: 28px; }
body.call-page .call-center { flex: 1; display: grid; place-items: center; padding-block: clamp(32px, 7vw, 96px); }
body.call-page .call-card { width: min(540px, 100%); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
body.call-page .call-card .kicker { margin: 0 0 4px; }
body.call-page .call-h { margin: 0; font: 600 clamp(1.625rem, 3.2vw, 2rem)/1.12 var(--sans); letter-spacing: -0.03em; text-wrap: balance; }
body.call-page .call-sub { margin: 0; max-width: 40em; color: var(--muted); text-wrap: pretty; }
body.call-page .call-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
body.call-page .call-wait { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 2px; }
/* Status pip and the old spinner: one finite ping, never an endless loop. */
/* Conversation pieces shared by the call page, Chats and Send a file (redesign phase 5):
   chat bubbles, file cards, chat form, seal, safety codes, burned link, pips, old-name buttons. */
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .pip, :is(body.call-page, body.chats-page, body.send-page, body.drop-page) .spinner { position: relative; display: inline-block; width: 8px; height: 8px; flex: none; border: 0; border-radius: 50%; background: var(--live-fill); box-shadow: none; animation: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .spinner::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--live-fill); opacity: 0; animation: m-ping 2.4s cubic-bezier(.2, .7, .3, 1) 4; }

/* The older button names room.js, file-transfer.js and admin.js still write. With .btn they take its size. */
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .btn.btn-secondary { border-color: var(--line-input); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .btn.btn-secondary:hover { background: var(--surface-2); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) :is(.btn-primary, .btn-secondary, .btn-ghost, .btn-danger):not(.btn) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h-sm); padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-3); background: transparent; color: inherit;
  font: 500 .9375rem/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .12s ease-out, background-color .2s, opacity .2s;
}
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) :is(.btn-primary, .btn-secondary, .btn-ghost, .btn-danger):not(.btn):active { transform: scale(.97); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) :is(.btn-primary, .btn-secondary, .btn-ghost, .btn-danger):not(.btn):disabled { opacity: .4; cursor: not-allowed; transform: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) .btn-primary:not(.btn) { background: var(--fg); color: var(--bg); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) .btn-secondary:not(.btn) { border-color: var(--line-input); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) :is(.btn-secondary, .btn-ghost):not(.btn):hover { background: var(--surface-2); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) .btn-danger:not(.btn) { border-color: color-mix(in srgb, var(--ember) 45%, transparent); color: var(--ember); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) .btn-danger:not(.btn):hover { background: var(--ember-soft); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page, body.admin-page) .btn-small:not(.btn) { min-height: 36px; padding: 0 12px; font-size: .875rem; }

/* ---- Guest name step (pre-join): copy left, preview card right ---- */
body.call-page .prejoin-grid { flex: 1; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding-block: clamp(32px, 6vw, 80px); }
body.call-page .prejoin-copy .lede { margin-top: 18px; }
body.call-page .eyebrow { display: inline-flex; align-items: center; min-height: 28px; margin: 0 0 16px; padding: 0 11px; border-radius: var(--r-1); background: var(--surface-2); color: var(--muted); font: 500 .75rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
body.call-page .prejoin-copy .eyebrow { display: flex; width: max-content; max-width: 100%; }
body.call-page .room-state { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; min-height: 28px; margin: 0 0 16px; padding: 0 11px; border-radius: var(--r-1); background: var(--live-soft); color: var(--live); font: 600 .75rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
body.call-page .room-state .when { text-transform: none; letter-spacing: 0; }
body.call-page .once-note { display: flex; gap: 12px; margin-top: 28px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-4); color: var(--muted); font-size: .9375rem; line-height: 1.45; }
body.call-page .once-note svg { width: 18px; height: 18px; margin-top: 2px; color: var(--ember); }
body.call-page .once-note p { margin: 0; }
body.call-page .privacy-note { margin: 18px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
body.call-page .privacy-note strong { color: var(--fg); font-weight: 600; }

body.call-page .prejoin-card { display: grid; gap: 20px; min-width: 0; }
body.call-page .prejoin-preview { display: grid; gap: 12px; }
#nameStep[data-kind="text"] .prejoin-preview { display: none; }
body.call-page .preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
body.call-page .preview[data-cam="on"]::before { opacity: 1; }
body.call-page .preview[data-cam="off"] video { visibility: hidden; }
body.call-page .preview-note { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 6px 8px; border-radius: var(--r-1); background: var(--surface); color: var(--muted); font: 500 .6875rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
body.call-page .mic-level { position: absolute; top: 12px; right: 12px; z-index: 1; display: flex; align-items: flex-end; gap: 3px; height: 14px; padding: 5px 7px; border-radius: var(--r-1); background: var(--surface); box-sizing: content-box; }
body.call-page .mic-level span { width: 3px; height: 20%; border-radius: 1px; background: var(--live-fill); transition: height .1s; }
body.call-page .preview-tools { position: absolute; left: 50%; bottom: 14px; z-index: 1; display: flex; gap: 10px; transform: translateX(-50%); }
body.call-page .round svg { width: 20px; height: 20px; }
#nameStep[data-kind="voice"] #previewCam { display: none !important; }
#nameStep[data-kind="voice"] .preview video { opacity: 0; }
#nameStep[data-kind="voice"] .preview .tile-avatar { display: grid; }
body.call-page .device { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; border: 1px solid var(--line-input); border-radius: var(--r-3); background: transparent; color: var(--fg); text-align: left; cursor: pointer; transition: background-color .2s, transform .12s; }
body.call-page .device:hover { background: var(--surface-2); }
body.call-page .device:active { transform: scale(.97); }
body.call-page .device span { min-width: 0; line-height: 1.3; }
body.call-page .device small { display: block; font: 500 .6875rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
body.call-page .device strong { display: block; font-size: .9375rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.call-page .prejoin-form { display: grid; min-width: 0; }
body.call-page .field-hint { margin: 8px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.call-page .remember-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
body.call-page .remember-row .check-row { margin: 0; align-items: center; }
body.call-page #joinBtn { margin-top: 20px; }
body.call-page .prejoin-foot { margin: 12px 0 0; color: var(--muted); font-size: .875rem; text-align: center; }
@media (max-width: 860px) {
  body.call-page .prejoin-grid { grid-template-columns: minmax(0, 1fr); align-items: start; padding-top: 28px; }
}
@media (max-width: 560px) {
  body.call-page .call-top-in { height: 60px; }
  body.call-page .prejoin-copy .h2 { font-size: 1.875rem; }
}

/* ---- Avatars: initials, or a verified peer's picture on top (spec 5.7) ---- */
body.call-page .tile-avatar { position: absolute; inset: 0; display: none; place-items: center; }
body.call-page :is(.tile, .preview)[data-cam="off"] .tile-avatar { display: grid; }
body.call-page .tile-avatar > * { grid-area: 1 / 1; }
body.call-page .tile-avatar > span { display: grid; place-items: center; width: clamp(64px, 9vw, 96px); height: clamp(64px, 9vw, 96px); border-radius: 50%; background: var(--fg); color: var(--bg); font: 600 clamp(1.25rem, 2.4vw, 1.75rem)/1 var(--sans); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .tile-avatar img.tile-pic, :is(body.call-page, body.chats-page, body.send-page, body.drop-page) .avatar img.tile-pic { display: block; object-fit: cover; border-radius: 50%; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .tile-avatar img.tile-pic { position: relative; z-index: 1; width: clamp(64px, 9vw, 96px); height: clamp(64px, 9vw, 96px); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .avatar { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; overflow: hidden; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: .75rem; font-weight: 600; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .avatar > * { grid-area: 1 / 1; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .avatar img.tile-pic { width: 100%; height: 100%; }

/* ---- Lobby ---- */
body.call-page .lobby-countdown { font: 600 1.625rem/1.2 var(--mono); letter-spacing: .02em; color: var(--live); font-variant-numeric: tabular-nums; }

/* ---- Ended: the link burns (armed -> ember -> ash), the one celebratory animation ---- */
body.call-page .ended-link { display: grid; gap: 12px; width: 100%; margin-bottom: 8px; padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--ember-fill) 32%, var(--line)); border-radius: var(--r-4); background: color-mix(in srgb, var(--surface) 94%, var(--ember-fill)); box-shadow: none; animation: none; }
body.call-page .ended-link .link-status { display: inline-flex; align-items: center; gap: 8px; width: max-content; min-height: 28px; padding: 0 11px; border-radius: var(--r-1); background: var(--ember-soft); color: var(--ember); font: 600 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
body.call-page .ended-link .pip { background: var(--ember-fill); animation: none; }
body.call-page .ended-link .link-value { font: 600 1rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; animation: m-burn 1.8s cubic-bezier(.2, .8, .2, 1) both; }

/* ---- In-call view (prototype call screen 572–614, 694–745): call bar, stage of tiles, a dock of
   round labelled controls, the chat/invite rail on the right (a bottom sheet on phones), status bar.
   room.js switches the phone layout at 720 px (chatVisible), so the sheet does too. ---- */
body.call-page .room { display: flex; flex-direction: column; height: 100vh; height: 100svh; }

/* Call bar */
body.call-page .room-header { display: flex; align-items: center; gap: 8px 16px; min-height: 64px; padding: 8px clamp(12px, 2vw, 24px); border-bottom: 1px solid var(--line); }
body.call-page .room-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
body.call-page .room-title-group .brand { flex: 0 1 auto; min-width: 0; margin: 0; gap: 10px; font: 600 1.0625rem/1.2 var(--sans); letter-spacing: -0.01em; }
body.call-page .room-title-group .brand img { width: 28px; height: 28px; flex: none; }
body.call-page #roomTitle { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.call-page .room-divider { display: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .room-status { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 28px; padding: 0 11px; border-radius: var(--r-1); background: var(--surface-2); color: var(--muted); font: 600 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .room-status.waiting .pip { background: var(--muted); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .room-status.live { background: var(--live-soft); color: var(--live); }
body.call-page .room-meta { display: flex; align-items: center; gap: 8px; flex: none; }
body.call-page .room-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: transparent; color: var(--fg); font: 500 .8125rem/1 var(--mono); font-variant-numeric: tabular-nums; }
body.call-page .room-chip svg { width: 16px; height: 16px; }
body.call-page .chip-btn { display: none; min-height: 44px; cursor: pointer; transition: background-color .2s, transform .12s; }
body.call-page .chip-btn:hover { background: var(--surface-2); }
body.call-page .chip-btn:active { transform: scale(.97); }
body.call-page .chip-btn[aria-expanded="true"] { background: var(--fg); color: var(--bg); border-color: transparent; }
body.call-page .chip-locked { border-color: color-mix(in srgb, var(--ember) 45%, transparent); color: var(--ember); }
body.call-page .room-banner { padding: 10px clamp(12px, 2vw, 24px); border-bottom: 1px solid color-mix(in srgb, var(--ember) 30%, transparent); background: var(--ember-soft); color: var(--fg); font-size: .9375rem; }

/* Stage: the tiles, then the dock */
body.call-page .room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 440px); }
body.call-page .video-stage { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
body.call-page .video-grid { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
body.call-page .video-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
body.call-page .video-grid:is([data-count="5"], [data-count="6"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.call-page .tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 16px; background: var(--surface-2); }
body.call-page .tile::before { content: ""; position: absolute; inset: -25%; background: radial-gradient(38% 46% at 32% 40%, var(--live-soft), transparent 70%), radial-gradient(40% 50% at 70% 66%, color-mix(in srgb, var(--fg) 8%, transparent), transparent 70%); }
body.call-page .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body.call-page .tile-local video { transform: scaleX(-1); }
body.call-page .tile[data-cam="off"] video { visibility: hidden; }
body.call-page .tile[data-share="on"] video { object-fit: contain; transform: none; }
body.call-page .tile[data-state="failed"] { box-shadow: inset 0 0 0 2px var(--ember-fill); }
/* Who is talking (speaking.js): a ring drawn over the video (--live: 3:1+ on the tile in both themes); a failed tile keeps its own. */
body.call-page .tile::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--live); opacity: 0; transition: opacity .15s; pointer-events: none; }
body.call-page .tile[data-speaking="on"]:not([data-state="failed"])::after { opacity: 1; }
/* Screen share stage (room.js updateStage): a peer's shared screen is the big tile,
   everyone else a strip on the right. Up to 5 others (mesh of 6). */
body.call-page .video-grid[data-layout="stage"] { grid-template-columns: minmax(0, 1fr) clamp(140px, 16vw, 220px); grid-template-rows: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
body.call-page .video-grid[data-layout="stage"] .tile { grid-column: 2; }
body.call-page .video-grid[data-layout="stage"] .tile[data-stage="on"] { grid-column: 1; grid-row: 1 / -1; animation: m-enter .3s cubic-bezier(.2, .9, .25, 1); }
body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) :is(.tile-avatar > span, .tile-avatar img.tile-pic) { width: 40px; height: 40px; font-size: .9375rem; }
body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-label { left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 4px 8px; font-size: .75rem; }
body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-sec { display: none; }
body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-mic { top: 8px; right: 8px; width: 26px; height: 26px; }
body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-state { top: 8px; left: 8px; }
body.call-page .tile-full { position: absolute; right: 12px; bottom: 12px; z-index: 2; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
body.call-page .tile-full svg { width: 20px; height: 20px; }
body.call-page .tile:fullscreen { border-radius: 0; background: var(--bg); }
body.call-page .tile-label { position: absolute; left: 12px; bottom: 12px; z-index: 1; max-width: calc(100% - 24px); padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); color: var(--fg); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.call-page .tile-sec { color: var(--muted); }
body.call-page .tile-mic { position: absolute; top: 12px; right: 12px; z-index: 1; display: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--ember); }
body.call-page .tile-mic svg { width: 16px; height: 16px; }
body.call-page .tile[data-mic="off"] .tile-mic { display: grid; }
body.call-page .tile-state { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 6px 8px; border-radius: var(--r-1); background: var(--surface); color: var(--muted); font: 500 .6875rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
body.call-page .tile-state:empty { display: none; }
/* Waiting for others: a card of its own at the top of the stage, never text on the video. */
body.call-page .stage-overlay { position: absolute; top: 30px; left: 50%; z-index: 2; width: min(460px, calc(100% - 60px)); transform: translateX(-50%); pointer-events: none; }
body.call-page .overlay-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow); animation: m-enter .4s cubic-bezier(.2, .9, .25, 1); }
body.call-page .overlay-card .spinner { grid-row: 1; margin: 0 2px; }
body.call-page .overlay-card h2 { margin: 0; font: 600 1.0625rem/1.3 var(--sans); letter-spacing: -0.01em; }
body.call-page .overlay-card p { grid-column: 2; margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }
/* The host's guest link, one tap away while waiting (owner 2026-10-18). */
body.call-page .overlay-actions { pointer-events: auto; grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
body.call-page .text-empty .overlay-actions { grid-column: auto; justify-content: center; margin-top: 8px; }
body.call-page .text-empty .overlay-actions .btn { margin-top: 0; }
body.call-page .share-pill { display: flex; align-items: center; align-self: center; gap: 10px; padding: 4px 4px 4px 14px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); font-size: .875rem; }

/* The dock: round labelled controls (.ctl from the design system); End is the ember pill. */
body.call-page .control-dock { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: center; gap: clamp(4px, 1.4vw, 14px); }
body.call-page .ctl-i { position: relative; }
body.call-page .ctl-l { white-space: nowrap; }
body.call-page .ctl.off .ctl-i { background: var(--ember-soft); color: var(--ember); border-color: transparent; }
body.call-page #shareBtn[aria-pressed="false"] .ctl-i { background: var(--surface); color: var(--fg); border-color: var(--line-input); }
body.call-page #shareBtn[aria-pressed="false"]:hover .ctl-i { background: var(--surface-2); }
body.call-page #shareBtn[aria-pressed="true"] .ctl-i { background: var(--fg); color: var(--bg); border-color: transparent; }
body.call-page .dock-badge { position: absolute; top: -4px; right: -4px; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--bg); border-radius: 10px; background: var(--fg); color: var(--bg); font: 600 .6875rem/1 var(--mono); box-sizing: content-box; }
/* Text rooms: End sits in the call bar, as an outlined ember button. */
body.call-page .room-meta .ctl.end { grid-auto-flow: column; align-items: center; gap: 6px; min-width: 0; min-height: 44px; padding: 0 14px 0 6px; border: 1px solid color-mix(in srgb, var(--ember) 45%, transparent); border-radius: var(--r-3); transition: background-color .2s, transform .12s; }
body.call-page .room-meta .ctl.end:hover { background: var(--ember-soft); }
body.call-page .room-meta .ctl.end:active { transform: scale(.97); }
body.call-page .room-meta .ctl.end .ctl-i { width: 32px; height: 32px; background: transparent; color: var(--ember); }
body.call-page .room-meta .ctl.end:active .ctl-i { transform: none; }
body.call-page .room-meta .ctl.end .ctl-l { font-size: .9375rem; }
body.call-page .room-meta .ctl.end:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
body.call-page .room-meta .ctl.end:focus-visible .ctl-i { outline: none; }
body.call-page .only-mobile, body.call-page .show-mobile { display: none; }

/* Text rooms: the chat is the stage, under the "not saved" seal */
body.call-page .room.is-text .video-stage { display: none; }
body.call-page .text-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .seal { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px clamp(12px, 2vw, 24px); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .seal p { margin: 0; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .seal-label { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 11px; border-radius: var(--r-1); background: var(--surface-2); color: var(--fg); font: 600 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .seal .pip { background: var(--muted); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .seal.is-live .seal-label { background: var(--live-soft); color: var(--live); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .seal.is-live .pip { background: var(--live-fill); }
body.call-page .text-stage .chat { width: min(760px, 100%); margin-inline: auto; border-inline: 1px solid var(--line); background: var(--surface); }

/* Rail: tabs, chat, people, invites */
body.call-page .rail { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--surface); }
body.call-page .rail-tabs { display: flex; align-items: center; gap: 4px; margin: 12px 12px 0; padding: 4px; border-radius: var(--r-4); background: var(--surface-2); }
body.call-page .rail-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: .9375rem; font-weight: 500; cursor: pointer; transition: background-color .25s, color .25s, box-shadow .25s; }
body.call-page .rail-tab[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
body.call-page .rail-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-1); background: var(--fg); color: var(--bg); font: 600 .6875rem/1 var(--mono); }
body.call-page .drawer-close { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: var(--r-3); background: none; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s; }
body.call-page .drawer-close:hover { background: var(--surface-2); color: var(--fg); }
body.call-page .rail-sheet-close { display: none; }
body.call-page .chat { display: flex; flex: 1; flex-direction: column; min-height: 0; }
body.call-page .chat-header, body.call-page .rail-panel-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 10px 4px 16px; border-bottom: 1px solid var(--line); }
body.call-page :is(.chat-header, .rail-panel-head) h2 { margin: 0; font: 600 .9375rem/1.2 var(--sans); }
body.call-page .chat-header > svg { width: 18px; height: 18px; color: var(--live); }
body.call-page :is(.chat-header, .rail-panel-head) .rail-sheet-close { margin-left: auto; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-messages { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; overflow-y: auto; overscroll-behavior: contain; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg { max-width: 85%; padding: 8px 12px; font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; animation: m-msg-in .35s cubic-bezier(.2, .9, .25, 1); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--fg); color: var(--bg); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg.them { align-self: flex-start; border-radius: 14px 14px 14px 4px; background: var(--surface-2); color: var(--fg); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg.system { align-self: center; max-width: 36ch; padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-3); color: var(--muted); font-size: .75rem; text-align: center; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-name { margin-bottom: 3px; color: var(--muted); font: 600 .6875rem/1.3 var(--mono); letter-spacing: .06em; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-time { display: block; margin-top: 4px; color: var(--muted); font: 500 .6875rem/1.2 var(--mono); text-align: right; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg.me .chat-time { color: color-mix(in srgb, var(--bg) 78%, var(--fg)); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg.chat-file { min-width: min(260px, 85%); border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-msg.chat-file .chat-time { color: var(--muted); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-row { display: flex; align-items: center; gap: 10px; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-row svg { width: 22px; height: 22px; color: var(--live); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-meta { display: flex; flex-direction: column; min-width: 0; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-name { font-weight: 500; overflow-wrap: anywhere; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-size { color: var(--muted); font: 500 .75rem/1.4 var(--mono); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-status { margin: 6px 0 0; color: var(--muted); font-size: .8125rem; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-status:empty { display: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-progress { display: block; width: 100%; height: 6px; margin-top: 8px; accent-color: var(--fg); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-progress[hidden] { display: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-actions:empty { display: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-file-preview { display: block; max-width: 100%; max-height: 240px; margin-bottom: 8px; border-radius: var(--r-2); object-fit: contain; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-form input { flex: 1; }
body.call-page .rail .chat-form input, body.call-page .text-stage .chat-form input { min-height: 40px; font-size: .9375rem; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-attach { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--line-input); border-radius: var(--r-3); background: none; color: var(--fg); cursor: pointer; transition: background-color .2s, transform .12s; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-attach:hover:not(:disabled) { background: var(--surface-2); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-attach:active:not(:disabled) { transform: scale(.97); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-attach:disabled { opacity: .4; cursor: not-allowed; }
/* Emoji picker and reactions (emoji.js): popovers inside the form / the bubble. */
:is(body.call-page, body.chats-page) .chat-form { position: relative; }
:is(body.call-page, body.chats-page) .chat-emoji { font-size: 1.25rem; line-height: 1; }
:is(body.call-page, body.chats-page) .emoji-pop { position: absolute; z-index: 40; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--surface); color: var(--fg); box-shadow: var(--shadow); animation: m-msg-in .2s cubic-bezier(.2, .9, .25, 1); }
:is(body.call-page, body.chats-page) .emoji-picker { left: 12px; bottom: calc(100% - 4px); grid-template-columns: repeat(8, 36px); max-width: calc(100% - 24px); overflow-x: auto; }
:is(body.call-page, body.chats-page) .react-bar { bottom: calc(100% + 4px); grid-template-columns: repeat(6, 36px); }
:is(body.call-page, body.chats-page) .chat-msg.me .react-bar { right: 0; }
:is(body.call-page, body.chats-page) .react-bar.is-below { top: calc(100% + 4px); bottom: auto; }
:is(body.call-page, body.chats-page) .chat-msg.them .react-bar { left: 0; }
:is(body.call-page, body.chats-page) .emoji-cell { width: 36px; height: 36px; border: 0; border-radius: var(--r-2); background: none; font-size: 1.25rem; line-height: 1; cursor: pointer; transition: background-color .15s, transform .12s; }
:is(body.call-page, body.chats-page) .emoji-cell:hover, :is(body.call-page, body.chats-page) .emoji-cell:focus-visible { background: var(--surface-2); }
:is(body.call-page, body.chats-page) .emoji-cell:active { transform: scale(.94); }
:is(body.call-page, body.chats-page) .chat-msg[data-msg-id] { position: relative; }
:is(body.call-page, body.chats-page) .react-btn { position: absolute; top: 50%; width: 28px; height: 28px; margin-top: -14px; border: 1px solid var(--line-input); border-radius: 50%; background: var(--surface); color: var(--fg); font-size: 1rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, transform .12s; }
:is(body.call-page, body.chats-page) .chat-msg.me .react-btn { left: -36px; }
:is(body.call-page, body.chats-page) .chat-msg.them .react-btn { right: -36px; }
:is(body.call-page, body.chats-page) .chat-msg:hover .react-btn, :is(body.call-page, body.chats-page) .chat-msg:focus-within .react-btn, :is(body.call-page, body.chats-page) .react-btn[aria-expanded="true"] { opacity: 1; }
:is(body.call-page, body.chats-page) .react-btn:active { transform: scale(.94); }
@media (hover: none) { :is(body.call-page, body.chats-page) .react-btn { opacity: 1; } }
:is(body.call-page, body.chats-page) .reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
:is(body.call-page, body.chats-page) .reaction { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px; border: 1px solid var(--line-input); border-radius: 999px; background: var(--surface); color: var(--fg); font: 500 .8125rem/1 var(--sans); cursor: pointer; }
:is(body.call-page, body.chats-page) .reaction.is-mine { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
body.call-page #chatSend { min-height: 40px; padding: 0 14px; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .chat-note { margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: .75rem; }
body.call-page .text-empty { display: grid; justify-items: center; gap: 8px; padding: 36px 20px 24px; text-align: center; }
body.call-page .text-empty h2 { margin: 0; font: 600 1.125rem/1.3 var(--sans); }
body.call-page .text-empty p { margin: 0; max-width: 40ch; color: var(--muted); font-size: .9375rem; }
body.call-page .text-empty .btn-primary { margin-top: 8px; min-height: 44px; }
body.call-page .sec-details { padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: .875rem; }
body.call-page .sec-details summary { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 500; cursor: pointer; }
body.call-page .sec-details summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; }
body.call-page .sec-details[open] summary::before { transform: rotate(45deg); }
body.call-page .sec-details summary::-webkit-details-marker { display: none; }
body.call-page .sec-details summary { list-style: none; }
body.call-page .sec-note { margin: 6px 0 10px; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.call-page .sec-list { display: grid; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
body.call-page .sec-list li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-3); }
body.call-page .sec-name { font-weight: 500; overflow-wrap: anywhere; }
body.call-page .sec-state { color: var(--muted); font-size: .8125rem; }
body.call-page .sec-state.is-verified { color: var(--live); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .sec-code { color: var(--fg); font: 500 .875rem/1.4 var(--mono); letter-spacing: .04em; }
body.call-page .rail-panel { flex: 1; display: grid; align-content: start; gap: 16px; padding: 16px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
body.call-page .rail-panel-head { margin: -16px -20px 0; }
body.call-page .people-list { display: grid; margin: 0; padding: 0; list-style: none; }
body.call-page .people-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
body.call-page .person-main { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
body.call-page .person-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.call-page .person-state { color: var(--muted); font-size: .8125rem; }
body.call-page .person-state.is-live { color: var(--live); }
body.call-page .role-tag { flex: none; padding: 5px 8px; border-radius: var(--r-1); background: var(--surface-2); color: var(--muted); font: 600 .6875rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
body.call-page .slots { display: grid; gap: 8px; }
body.call-page .slot-bar { display: flex; gap: 4px; }
body.call-page .slot { flex: 1; height: 6px; border-radius: 3px; background: var(--line-strong); }
body.call-page .slot.is-joined { background: var(--fg); }
body.call-page .slot.is-out { background: var(--live-fill); }
body.call-page .slot-legend, body.call-page .panel-note, body.call-page .invite-panel-note { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.call-page #inviteLinks { display: grid; gap: 10px; }
body.call-page #inviteLinks:empty { display: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-block:not(.ended-link) { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--bg); animation: none; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-block .link-status { display: flex; align-items: center; gap: 8px; color: var(--live); font: 600 .75rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-block.is-burned:not(.ended-link) { border-color: color-mix(in srgb, var(--ember-fill) 32%, var(--line)); background: color-mix(in srgb, var(--surface) 94%, var(--ember-fill)); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-block.is-burned .link-status { color: var(--ember); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-block.is-burned .pip { background: var(--ember-fill); }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-block:not(.ended-link) .link-value { color: var(--muted); font: 500 .8125rem/1.4 var(--mono); overflow-wrap: anywhere; }
body.call-page .copy-row { display: flex; align-items: center; gap: 8px; }
body.call-page .copy-row input { flex: 1; font: 500 .8125rem/1.2 var(--mono) !important; text-overflow: ellipsis; }
body.call-page .copy-row button { flex: none; min-height: 44px; }
body.call-page .copy-row button svg { width: 16px; height: 16px; }
:is(body.call-page, body.chats-page, body.send-page, body.drop-page) .link-note { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.call-page .btn-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
body.call-page .rail-panel .btn-small:not(.btn) { min-height: 40px; }
body.call-page .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
body.call-page .toggle-row p { display: grid; gap: 2px; margin: 0; font-size: .875rem; line-height: 1.4; }
body.call-page .toggle-row strong { font-weight: 600; }
body.call-page .toggle-row span { color: var(--muted); font-size: .8125rem; }
body.call-page .rail-panel .field + .field { margin-top: 0; }
body.call-page :is(.rail, .text-stage, .dlg) .field > label { font: 500 .75rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
body.call-page :is(.rail, .text-stage, .dlg) .field > label .faint { text-transform: none; letter-spacing: 0; font-family: var(--sans); }
body.call-page :is(.rail, .text-stage) :is(input[type="text"], input:not([type])) { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: var(--r-3); background: var(--surface); color: var(--fg); font: 400 .9375rem/1.2 var(--sans); transition: border-color .2s, box-shadow .2s; }
body.call-page :is(.rail, .text-stage) :is(input[type="text"], input:not([type])):focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px var(--ring); }
body.call-page .rail .select { min-height: 44px; }

/* Status bar */
body.call-page .call-statusbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 8px clamp(12px, 2vw, 24px); border-top: 1px solid var(--line); color: var(--muted); font: 500 .75rem/1.4 var(--mono); letter-spacing: .04em; }
body.call-page :is(.statusbar-item, .statusbar-right) { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
body.call-page .statusbar-item { gap: 8px; font-variant-numeric: tabular-nums; }
body.call-page .statusbar-item svg { width: 14px; height: 14px; }
body.call-page .chip-warn { color: var(--ember); }

/* Dialogs: Devices (a sheet on phones) and the leave / end confirmation */
body.call-page .invite-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
body.call-page .dlg .invite-panel-head h2 { margin: 0; }
body.call-page .settings-fields { display: grid; gap: 16px; }
body.call-page .settings-fields .field + .field { margin-top: 0; }
body.call-page .settings-fields + .msg { margin: 18px 0 0; }
body.call-page .dlg .subtitle { margin: 0; color: var(--muted); line-height: 1.5; }

@media (max-width: 720px) {
  body.call-page .room-header { min-height: 60px; padding-block: 8px; gap: 8px; }
  body.call-page .room-title-group { gap: 8px; }
  body.call-page .room-title-group .brand img { width: 24px; height: 24px; }
  body.call-page .room-body { grid-template-columns: minmax(0, 1fr); }
  body.call-page .video-stage { padding: 10px 10px calc(12px + env(safe-area-inset-bottom)); gap: 12px; }
  body.call-page .video-grid { gap: 10px; }
  body.call-page .video-grid[data-count="2"] { grid-template-columns: minmax(0, 1fr); }
  body.call-page .video-grid:is([data-count="5"], [data-count="6"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Stage on phones: the screen on top, the others a row underneath. */
  body.call-page .video-grid[data-layout="stage"] { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) clamp(72px, 16svh, 112px); }
  body.call-page .video-grid[data-layout="stage"] .tile { grid-column: auto; grid-row: 2; }
  body.call-page .video-grid[data-layout="stage"] .tile[data-stage="on"] { grid-column: 1 / -1; grid-row: 1; }
  body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) :is(.tile-avatar > span, .tile-avatar img.tile-pic) { width: 32px; height: 32px; font-size: .8125rem; }
  body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-label { left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 2px 6px; }
  body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-mic { top: 4px; right: 4px; width: 22px; height: 22px; }
  body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-mic svg { width: 12px; height: 12px; }
  body.call-page .video-grid[data-layout="stage"] .tile:not([data-stage="on"]) .tile-state { display: none; }
  body.call-page .stage-overlay { top: 22px; width: calc(100% - 40px); }
  body.call-page .rail { display: none; }
  body.call-page .rail.is-sheet { position: fixed; inset: auto 0 0 0; z-index: 40; display: flex; height: min(82svh, 640px); padding-bottom: env(safe-area-inset-bottom); border: 0; border-top: 1px solid var(--line-strong); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); animation: m-sheet-in .38s cubic-bezier(.2, .9, .25, 1); }
  body.call-page .rail.is-sheet .rail-sheet-close { display: inline-grid; }
  body.call-page .rail.is-sheet .rail-tabs { margin-top: 14px; }
  body.call-page .ctl.only-mobile { display: grid; }
  body.call-page .show-mobile { display: inline-flex; }
  body.call-page .ctl.hide-mobile { display: none; }
  body.call-page .room.is-text #peopleChip { display: none; }
  body.call-page .room.is-text .chip-btn { display: inline-flex; }
  body.call-page .text-stage .chat { border-inline: 0; }
  body.call-page .room-meta .ctl.end { padding-right: 12px; }
}
@media (max-width: 560px) {
  body.call-page .call-actions .btn { flex: 1 1 auto; }
  body.call-page .room-status { padding: 0 9px; }
  /* Text rooms on phones: End in the call bar is icon only (its label stays its accessible name). */
  body.call-page .room-meta .ctl.end { width: 44px; padding: 0; justify-content: center; }
  body.call-page .room-meta .ctl.end .ctl-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.call-page .dlg-actions .btn { flex: 1 1 auto; }
  body.call-page .seal p { font-size: .8125rem; }
}

/* =====================================================================
   Anonymous tools (redesign phase 5): Send a file (/send), receive a
   file (/f/:id) and the free trial (/trial). body.account + page class;
   the prototype lobby's two columns: copy left, the card right, one
   column on phones. The file card itself is the shared Conversation
   style (.chat-msg.chat-file), the radio cards the quick-page ones.
   ===================================================================== */
:is(.send-page, .drop-page, .trial-page) .tool { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); gap: clamp(32px, 7vw, 112px); align-items: center; padding-block: clamp(40px, 7vw, 96px); }
:is(.send-page, .drop-page, .trial-page) .tool-h { margin: 0; font: 600 clamp(1.9rem, 3.2vw, 2.6rem)/1.05 var(--sans); letter-spacing: -0.045em; text-wrap: balance; }
:is(.send-page, .drop-page, .trial-page) .tool-h .dim { color: var(--muted); }
:is(.send-page, .drop-page, .trial-page) .tool-intro .lede { margin-top: 18px; }
:is(.send-page, .drop-page, .trial-page) .tool-card { width: 100%; max-width: 520px; justify-self: end; }
:is(.send-page, .drop-page, .trial-page) .tool-card .card-sub { margin-bottom: 22px; }
:is(.send-page, .drop-page, .trial-page) .tool-submit { margin-top: 22px; }
:is(.send-page, .drop-page, .trial-page) .tool-note { margin: 10px 0 0; color: var(--muted); font-size: .875rem; }
:is(.send-page, .drop-page, .trial-page) .tool-foot { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9375rem; }
:is(.send-page, .drop-page, .trial-page) .tool-foot a { display: inline-flex; align-items: center; min-height: 32px; color: var(--fg); font-weight: 500; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
:is(.send-page, .drop-page, .trial-page) .tool-foot a:hover { text-decoration-color: currentColor; }
/* /f/: the brand is plain text (no way home mid-transfer). */
.drop-page .top .brand { color: var(--fg); }

/* Send: the native file picker inside an .input box, its button in the design's line style. */
.send-page .file-input { display: flex; align-items: center; padding: 6px 8px; font-size: .9375rem; cursor: pointer; }
.send-page .file-input::file-selector-button { min-height: 36px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--line-input); border-radius: var(--r-2); background: var(--surface-2); color: var(--fg); font: 500 .875rem/1 var(--sans); cursor: pointer; transition: background-color .2s; }
.send-page .file-input:hover::file-selector-button { background: var(--surface); }
.send-page .file-input:disabled { opacity: .5; cursor: not-allowed; }
.send-page .copy-row { display: flex; gap: 8px; }
.send-page .copy-row .input { flex: 1; min-width: 0; font: 500 .8125rem/1.2 var(--mono); }
.send-page .copy-row .btn { flex: none; min-height: var(--h-lg); }

/* Status, safety code and the file card area. */
:is(body.send-page, body.drop-page) .drop-status { margin: 18px 0 0; color: var(--muted); font-size: .9375rem; }
:is(body.send-page, body.drop-page) .drop-status:empty { display: none; }
:is(body.send-page, body.drop-page) .drop-code { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-2); color: var(--fg); font: 600 1.25rem/1.3 var(--mono); letter-spacing: .06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
:is(body.send-page, body.drop-page) .drop-card-area { min-height: 0; margin-top: 16px; padding: 0; overflow: visible; }
:is(body.send-page, body.drop-page) .drop-card-area:empty { display: none; }
/* display: block — kept explicit for the sender's file card (a block, not a row). */
:is(body.send-page, body.drop-page) .drop-card-area .chat-msg.chat-file { display: block; max-width: 100%; width: 100%; }
:is(body.send-page, body.drop-page) .drop-card-area .chat-file-progress[hidden] { display: none; }
:is(body.send-page, body.drop-page) .drop-card-area .btn-small:not(.btn) { min-height: 40px; padding: 0 16px; }

/* Trial: the two kinds side by side, then the limits. */
.trial-page .types { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.trial-page .type { min-height: 104px; }
.trial-page .trial-rules { display: grid; gap: 8px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.trial-page .trial-rules li { position: relative; padding-left: 18px; }
.trial-page .trial-rules li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

@media (max-width: 720px) {
  :is(.send-page, .drop-page, .trial-page) .tool { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 28px 48px; }
  :is(.send-page, .drop-page, .trial-page) .tool-card { justify-self: stretch; max-width: none; }
}
@media (max-width: 560px) {
  /* "Safety code 0000 0000 0000" stays on one line at 390 px. */
  :is(body.send-page, body.drop-page) .drop-code { padding: 12px; font-size: 1.125rem; letter-spacing: 0; }
  .trial-page .types { grid-template-columns: minmax(0, 1fr); }
  .trial-page .type { min-height: 64px; }
}

/* =====================================================================
   Chats (redesign phase 5): /chats, live 1:1 contact chat inside the
   signed-in shell. Scoped under body.chats-page. Static markup in
   chats.html; chats.js builds the contact list and the conversation pane
   (class names unchanged; the bubbles, file cards, seal, burned link and
   old-name buttons are the shared Conversation styles in the call-page
   section). Two panes in one card down to 721 px; at 720 px and below
   (chats.js's narrowMq) one pane at a time, and an open conversation
   (body.chat-focus) takes the whole screen: no top bar, no tab bar.
   ===================================================================== */
body.chats-page :where(svg:not(.ico)) { width: 18px; height: 18px; flex: none; }
body.chats-page .main { padding-top: clamp(16px, 2vw, 24px); }
body.chats-page .main-head { margin-bottom: 12px; }
/* A compact head (owner 2026-10-16: the chat was too small): title and note on one row. */
body.chats-page .main-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
body.chats-page .main-head .kicker { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.chats-page .page-h { font-size: 1.5rem; }
body.chats-page .main-head .lede { flex: 1 1 360px; max-width: none; margin: 0; font-size: .8125rem; line-height: 1.45; }
body.chats-page .chats-banner { margin: 0 0 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ember) 30%, transparent); border-radius: var(--r-3); background: var(--ember-soft); color: var(--fg); font-size: .9375rem; }
body.chats-page .chats-gate { display: grid; place-items: center; padding-block: clamp(24px, 6vw, 72px); }
body.chats-page .gate-card { width: min(520px, 100%); }
body.chats-page .gate-card .actions { justify-content: flex-start; }

/* The two panes, in one card */
body.chats-page .chats { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: clamp(480px, calc(100vh - 100px), 1000px); height: clamp(480px, calc(100svh - 100px), 1000px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-5); background: var(--surface); }
body.chats-page .chats-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
body.chats-page .side-head { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px 8px 20px; border-bottom: 1px solid var(--line); }
body.chats-page .side-head h2 { margin: 0 auto 0 0; font: 600 .9375rem/1.2 var(--sans); letter-spacing: -0.01em; }
body.chats-page .presence-note { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.chats-page .presence-note .pip { top: -1px; }
body.chats-page .side-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body.chats-page .side-group + .side-group { border-top: 1px solid var(--line); }
body.chats-page .side-group h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 20px 8px; font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
body.chats-page .side-group h3 .count { padding: 3px 6px; border-radius: var(--r-1); background: var(--surface-2); color: var(--fg); letter-spacing: 0; }
/* chats.js's own note under Requests: not the shell's dashed sidebar note (.side-note). */
body.chats-page .chats-side .side-note { margin: 0; padding: 0 20px 8px; border: 0; border-radius: 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.chats-page .side-empty { margin: 0; padding: 20px; color: var(--muted); font-size: .9375rem; }
body.chats-page :is(.contact-list, .request-list) { margin: 0; padding: 0 0 8px; list-style: none; }

/* A contact row: avatar with presence, name + status, then a knock or the unread count */
body.chats-page .contact-btn { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 20px; border: 0; background: transparent; color: var(--fg); text-align: left; cursor: pointer; transition: background-color .2s; }
body.chats-page .contact-btn:hover { background: var(--surface-2); }
body.chats-page .contact-btn[aria-current="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--fg); }
body.chats-page .contact-btn:focus-visible { outline-offset: -3px; border-radius: 0; }
body.chats-page .avatar { overflow: visible; }
body.chats-page .presence { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border: 2px solid var(--surface); border-radius: 50%; background: var(--muted); }
body.chats-page .contact-btn:is(:hover, [aria-current="true"]) .presence { border-color: var(--surface-2); }
body.chats-page .presence.is-online { background: var(--live-fill); }
body.chats-page .contact-main { display: grid; gap: 2px; min-width: 0; }
body.chats-page .contact-name { overflow: hidden; font-size: .875rem; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
body.chats-page .contact-status { color: var(--muted); font: 500 .75rem/1.3 var(--mono); }
body.chats-page .contact-status:is(.is-on, .is-waiting) { color: var(--fg); }
body.chats-page .contact-status.is-live { color: var(--live); }
body.chats-page .contact-end { display: inline-flex; align-items: center; gap: 8px; }
body.chats-page .knock { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 8px; border-radius: var(--r-1); background: var(--live-soft); color: var(--live); font: 600 .6875rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
body.chats-page .unread { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--fg); color: var(--bg); font: 600 .75rem/1 var(--mono); }
body.chats-page .request { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 12px 20px; }
body.chats-page .request + .request { border-top: 1px solid var(--line); }
body.chats-page .request-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; }

/* The conversation pane: head, seal, then the state or the chat */
body.chats-page .convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
body.chats-page .convo-head { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 14px 6px 20px; border-bottom: 1px solid var(--line); }
body.chats-page .convo-who { display: grid; justify-items: start; gap: 4px; min-width: 0; }
body.chats-page .convo-head h2 { max-width: 100%; margin: 0; overflow: hidden; font: 600 .9375rem/1.2 var(--sans); letter-spacing: -0.01em; white-space: nowrap; text-overflow: ellipsis; }
body.chats-page .convo-head h2:focus { outline: none; }
body.chats-page .convo-head .room-status { min-height: 24px; padding: 0 9px; font-size: .6875rem; }
body.chats-page .room-status .pip { background: var(--muted); }
body.chats-page .room-status:is(.is-online, .live) .pip { background: var(--live-fill); }
body.chats-page .convo-actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
body.chats-page .convo-back { display: none; place-items: center; width: 44px; height: 44px; flex: none; margin-left: -8px; padding: 0; border: 0; border-radius: var(--r-3); background: transparent; color: var(--fg); cursor: pointer; transition: background-color .2s; }
body.chats-page .convo-back:hover { background: var(--surface-2); }
body.chats-page .convo-back:active { transform: scale(.94); }
body.chats-page .seal { gap: 4px 10px; padding: 8px 20px; font-size: .8125rem; }
body.chats-page .seal p { flex: 1 1 240px; }
body.chats-page .seal.is-ended .seal-label { background: var(--ember-soft); color: var(--ember); }
body.chats-page .seal.is-ended .pip { background: var(--ember-fill); }
/* Written while they were away: waits in this page's memory until the connection opens. */
body.chats-page .chat-pending { display: block; margin-top: 4px; color: color-mix(in srgb, var(--bg) 78%, var(--fg)); font: 500 .6875rem/1.2 var(--mono); text-align: right; }
body.chats-page .seal-sec { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
body.chats-page .seal-sec:empty { display: none; }
body.chats-page .is-match { color: var(--live); font: 600 .8125rem/1.3 var(--mono); }
body.chats-page .convo-state { flex: 1; min-height: 0; display: grid; align-content: center; justify-items: center; gap: 14px; padding: clamp(28px, 5vw, 56px) 24px; overflow-y: auto; text-align: center; }
body.chats-page .convo-state h3 { margin: 0; font: 600 clamp(1.25rem, 2vw, 1.5rem)/1.2 var(--sans); letter-spacing: -0.02em; text-wrap: balance; }
body.chats-page .convo-state > p { margin: 0; max-width: 34rem; color: var(--muted); text-wrap: pretty; }
body.chats-page .convo-state > :is(.btn-primary, .btn-secondary) { min-height: var(--h-md); padding: 0 22px; font-size: 1rem; }
body.chats-page .convo-state .link-block { width: min(100%, 420px); text-align: left; }
body.chats-page .keep-list { display: grid; gap: 16px; width: min(100%, 30rem); margin: 10px 0 0; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; }
body.chats-page .keep-list dt { margin-bottom: 4px; font: 500 .75rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg); }
body.chats-page .keep-list dd { margin: 0; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
body.chats-page .convo-remove { width: min(100%, 420px); margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
body.chats-page .convo-remove .btn-ghost { min-height: var(--h-md); color: var(--muted); white-space: normal; text-align: center; line-height: 1.3; }
body.chats-page .convo-remove .btn-ghost:hover { color: var(--fg); }
body.chats-page .convo .chat-messages { flex: 1 1 auto; min-height: 0; padding: 16px 20px; }
body.chats-page .convo .chat-msg { max-width: min(78%, 34rem); }
body.chats-page .chat-form input:not([type="file"]) { width: 100%; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: var(--r-3); background: var(--surface); color: var(--fg); font: 400 .9375rem/1.2 var(--sans); transition: border-color .2s, box-shadow .2s; }
body.chats-page .chat-form input:not([type="file"])::placeholder { color: var(--muted); opacity: 1; }
body.chats-page .chat-form input:not([type="file"]):focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px var(--ring); }
body.chats-page .chat-form input:disabled { opacity: .6; }
body.chats-page #convoSend { min-height: 40px; }
body.chats-page .chat-file .btn-small:not(.btn) { min-height: 40px; }

/* Dialogs */
body.chats-page .field-hint { margin: 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
body.chats-page .dlg .field { gap: 8px; }
body.chats-page .safety-code-big { margin: 4px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-2); color: var(--fg); font: 600 1.5rem/1.3 var(--mono); letter-spacing: .06em; text-align: center; font-variant-numeric: tabular-nums; }

/* Shell phone chrome (860 px) with two panes still side by side: a narrower list. */
@media (max-width: 860px) {
  body.chats-page .chats { grid-template-columns: 280px minmax(0, 1fr); height: clamp(480px, calc(100svh - 170px), 900px); }
}
/* chats.js's narrow layout (720 px): one pane at a time. */
@media (max-width: 720px) {
  body.chats-page .main-head .lede { font-size: .9375rem; }
  body.chats-page .chats { grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; }
  body.chats-page .chats-side { border-right: 0; }
  body.chats-page .side-scroll { overflow: visible; }
  body.chats-page .side-head, body.chats-page .presence-note { padding-inline: 16px; }
  body.chats-page .side-group h3, body.chats-page .chats-side .side-note, body.chats-page .side-empty, body.chats-page .request { padding-inline: 16px; }
  body.chats-page .contact-btn { padding-inline: 16px; }
  body.chats-page .chats[data-view="list"] .convo { display: none; }
  body.chats-page .chats[data-view="convo"] .chats-side { display: none; }
  /* First run: the list and the explainer share one screen. */
  body.chats-page .chats.is-empty[data-view="list"] .convo { display: flex; border-top: 1px solid var(--line); }
  body.chats-page .convo-back { display: inline-grid; }
  body.chats-page .convo-head { min-height: 60px; padding: 8px 12px; }
  body.chats-page .convo-head .avatar { display: none; }
  body.chats-page .seal { padding-inline: 16px; }
  body.chats-page .seal p { font-size: .8125rem; }
  body.chats-page .convo-state { padding: 32px 16px; }
  body.chats-page .convo .chat-messages { padding: 16px; }
  body.chats-page .convo .chat-msg { max-width: 85%; }
  body.chats-page .dlg-actions .btn { flex: 1 1 auto; }
  /* An open conversation is its own screen: the shell's top bar, tab bar and footer step away;
     the page head stays for screen readers only (the page keeps its h1). */
  body.chats-page.chat-focus :is(.side, .tabbar, .app-foot) { display: none; }
  body.chats-page.chat-focus .main-head { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.chats-page.chat-focus .main { display: flex; flex-direction: column; height: 100vh; height: 100svh; padding: 0; }
  body.chats-page.chat-focus .chats-banner { margin: 0; border-width: 0 0 1px; border-radius: 0; }
  body.chats-page.chat-focus .chats { flex: 1; min-height: 0; height: auto; overflow: hidden; border: 0; border-radius: 0; }
  body.chats-page.chat-focus .convo { padding-bottom: env(safe-area-inset-bottom); }
}

/* ==========================================================================
   Admin (redesign phase 5): /admin.html. Static markup in admin.html; admin.js
   builds the user rows (li.user-item > .user-row, .reset-form, .pw-rules-admin,
   .user-msg) and the audit rows (li.audit-item), with the old button names (see
   the compat rules above) and .code / .meta / .tag*. Everything is scoped under
   body.admin-page, so the global .code (the big ticket code) and .meta (mono
   caps) never reach a username or an email line.
   ========================================================================== */
body.admin-page #smtpWarning { margin: 0 0 28px; }
body.admin-page #smtpWarning code { font: 500 .8125rem/1 var(--mono); }
body.admin-page .adm-section + .adm-section { margin-top: 48px; }
body.admin-page .section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; }
body.admin-page .sec-h { margin: 0; font: 600 1.375rem/1.2 var(--sans); letter-spacing: -0.02em; }
body.admin-page .count-chip { font: 500 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
body.admin-page .sec-sub { margin: 0 0 20px; max-width: 46em; color: var(--muted); font-size: .9375rem; line-height: 1.55; }
body.admin-page .adm-toolbar { max-width: 360px; margin-bottom: 16px; }
body.admin-page .adm-toolbar .input { min-height: var(--h-md); }
body.admin-page .list-card { padding: 4px clamp(16px, 2.2vw, 24px); }
body.admin-page :is(.user-list, .audit-list) { margin: 0; padding: 0; list-style: none; }
body.admin-page :is(.user-item, .audit-item) { padding: 16px 0; border-bottom: 1px solid var(--line); }
body.admin-page :is(.user-item, .audit-item):last-child { border-bottom: 0; }

/* Users */
body.admin-page .user-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
body.admin-page .user-row > div:first-child { flex: 1 1 260px; min-width: 0; }
body.admin-page .user-row .code { font: 600 1rem/1.3 var(--sans); letter-spacing: 0; color: var(--fg); white-space: normal; overflow-wrap: anywhere; transition: none; }
body.admin-page :is(.user-row, .audit-who) .meta { margin-top: 4px; font: 400 .8125rem/1.45 var(--mono); letter-spacing: 0; text-transform: none; color: var(--muted); overflow-wrap: anywhere; }
body.admin-page .btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.admin-page .btn-row .tag { margin-right: 4px; }
body.admin-page .tag-pending { background: transparent; box-shadow: inset 0 0 0 1px var(--line-input); color: var(--fg); }
body.admin-page .tag-danger { background: var(--ember-soft); color: var(--ember); }
body.admin-page .reset-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 600px; margin-top: 14px; }
body.admin-page .reset-form .input { flex: 1 1 220px; width: auto; min-width: 0; min-height: var(--h-sm); }
body.admin-page .pw-rules-admin { margin-top: 10px; }
body.admin-page .user-msg { margin: 12px 0 0; }

/* Audit log: time, event, who (two lines) */
body.admin-page .audit-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 16px; }
body.admin-page .audit-filters .field { flex: 0 1 300px; min-width: 0; }
body.admin-page .audit-filters .select { min-height: var(--h-md); }
body.admin-page .audit-user-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: var(--h-md); font-size: .9375rem; }
body.admin-page .audit-item { display: grid; grid-template-columns: 13.5rem auto minmax(0, 1fr); align-items: baseline; gap: 6px 16px; }
body.admin-page .audit-time { font: 500 .8125rem/1.45 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
body.admin-page .audit-item .tag { justify-self: start; }
body.admin-page .audit-name { font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; }
body.admin-page .audit-more { margin-top: 16px; }
body.admin-page .list-card .empty-note { padding: 32px 0; }

@media (max-width: 720px) {
  body.admin-page .adm-toolbar { max-width: none; }
  /* Row actions as a 2 × 2 grid of full-width buttons; tags on their own line above. */
  body.admin-page .user-row .btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  body.admin-page .user-row .btn-row .tag { grid-column: 1 / -1; justify-self: start; margin: 0; }
  body.admin-page .user-row .btn-row button { width: 100%; }
  body.admin-page .user-row .btn-row .btn-ghost { border-color: var(--line-input); }
  body.admin-page .audit-filters .field { flex: 1 1 100%; }
  body.admin-page .audit-item { grid-template-columns: auto minmax(0, 1fr); }
  body.admin-page .audit-item .tag { grid-row: 1; grid-column: 1; }
  body.admin-page .audit-time { grid-row: 1; grid-column: 2; justify-self: end; text-align: right; }
  body.admin-page .audit-who { grid-column: 1 / -1; }
  body.admin-page .dlg-actions .btn { flex: 1 1 auto; }
}

/* /send: once a link exists, Back to home would end the drop (F-048). */

/* Chats: "Turn on notifications" bar (owner 2026-10-17). */

/* Tools while a transfer is live (site.js data-live): a quiet line under the header. */
.live-note { display: none; }
body[data-live="1"] .live-note { display: block; position: fixed; top: 68px; left: 0; right: 0; z-index: 49; max-width: none; margin: 0; padding: 8px var(--gutter); border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .8125rem; text-align: center; }
@media (max-width: 560px) { body[data-live="1"] .live-note { top: 60px; } }

/* /send: the file drop zone (the native input stays, visually hidden). */
/* /send signed in (send-app.html, owner 2026-10-18): the tool card in the app column. */
body.send-app .tool-card { max-width: 600px; margin: 0; justify-self: start; }
body.send-app .tool-card .card-sub { margin-top: 0; }
body.send-app .live-note { display: none; }
body.send-app[data-live="1"] .live-note { display: block; position: static; max-width: 600px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-3); text-align: left; }
.send-page .drop-zone { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 14px 16px; border: 1.5px dashed var(--line-input); border-radius: var(--r-4); background: var(--surface); color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s; }
.send-page .drop-zone:hover, .send-page .drop-zone.is-over { border-color: var(--fg); background: var(--surface-2); }
.send-page .drop-zone.has-file { border-style: solid; }
.send-page .drop-zone:disabled { opacity: .6; cursor: not-allowed; }
.send-page .drop-zone svg { width: 24px; height: 24px; flex: none; color: var(--muted); }
.send-page .dz-text { display: grid; gap: 3px; min-width: 0; }
.send-page .dz-main { font-weight: 600; overflow-wrap: anywhere; }
.send-page .dz-sub { color: var(--muted); font-size: .875rem; }
