/* NexCall web. The phone app's design language (android ui/theme: Color.kt, Shape.kt, Spacing.kt, Motion.kt,
   Elevation.kt): Lagoon on ink, a true-black dark ground with ink-blue lifts, the same radii, inks and springs.
   Fonts: the system's (the CSP has no font-src). Motion: transform and opacity only, every curve from the tokens below,
   and none at all under prefers-reduced-motion. */
:root {
  color-scheme: light;
  /* Surfaces (Color.kt): ground -> raised -> fill -> fillStrong; overlay floats above all of them. */
  --ground: #f5f6f8; --raised: #ffffff; --overlay: #ffffff; --fill: #eceff3; --fill-strong: #e2e6ec;
  --fg: #0b1220; --fg2: #485160; --line: rgba(11, 18, 32, .14); --edge: transparent; --pressed: rgba(11, 18, 32, .06);
  /* Lagoon: the one accent, for the primary action, unread/active state, trust, and links as text. */
  --accent: #0a7f8c; --accent-text: #07707c; --accent-fg: #ffffff; --accent-soft: #e1f1f4; --lagoon: #2bc4d4; --accent-deep: #12a0b0;
  --mine-top: #d6f3f7; --mine: #c4eef3; --mine-fg: #0b1220; --theirs: #ffffff; --theirs-fg: #0b1220; --tick: #0a55c2;
  --success: #067a4f; --warn-bg: #fff4d6; --warn-fg: #6b4d00; --danger: #b7332a; --scrim: rgba(14, 18, 25, .40);
  /* Still Water (the chats' own ground and its ripples) */
  --chat-ground: #f6f5f1; --ripple: color-mix(in srgb, var(--accent) 4%, transparent); --wash: color-mix(in srgb, var(--accent) 7%, transparent);
  --glass: rgba(255, 255, 255, .80);
  --shadow-1: 0 1px 2px rgba(11, 18, 32, .06), 0 0 0 .5px rgba(11, 18, 32, .04);
  --shadow-2: 0 10px 32px rgba(11, 18, 32, .12), 0 2px 6px rgba(11, 18, 32, .06);
  /* SenderInks: eight hues for avatars and group names, each 4.5:1 on its theme */
  --ink-0: #8e1e9e; --ink-1: #1b66bb; --ink-2: #6620df; --ink-3: #8a5b14; --ink-4: #107059; --ink-5: #c01b73; --ink-6: #327411; --ink-7: #202ddf;
  --av-strong: 14%; --av-soft: 8%;

  /* Shape.kt: xs 8, sm 12, md 16, lg 20 (bubbles), xl 28 (sheets); a bubble's joined corner is 6 */
  --ic-xs: 14px; --ic-s: 16px; --ic-m: 18px; --ic-l: 20px; --ic-stroke: 1.6px; --ic-stroke-strong: 2.2px; --ic-stroke-dot: 2.8px;
  --stamp-ink: 74%;
  --r-xs: 8px; --r-s: 12px; --r-m: 16px; --r-l: 20px; --r-xl: 28px; --r-join: 6px; --r-pill: 999px;
  /* Spacing.kt: 4, 8, 12, 16, 20, 24, 32, 40 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;
  /* Type: one scale, the system's faces */
  --ts: 1; --fs-cap: calc(11.5px * var(--ts)); --fs-sm: calc(12.5px * var(--ts)); --fs-row: calc(13.5px * var(--ts)); --fs-body: calc(15px * var(--ts)); --fs-title: calc(16px * var(--ts)); --fs-h2: calc(20px * var(--ts)); --fs-h1: calc(22px * var(--ts));
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ── Motion tokens (Motion.kt) ── Easings, verbatim: */
  --ease-emph: cubic-bezier(.2, 0, 0, 1);   /* entrances */
  --ease-out: cubic-bezier(0, 0, 0, 1);     /* decelerate: fades in */
  --ease-in: cubic-bezier(.3, 0, 1, 1);     /* accelerate: exits */
  --ease-std: cubic-bezier(.4, 0, .2, 1);   /* scrims, loops */
  /* Springs (damping / stiffness from Motion.kt), as curves; an overshoot-free fallback where linear() is missing */
  --spring-glide: var(--ease-emph);   /* 0.9 / 700: lists, bubbles, sheets */
  --spring-settle: var(--ease-emph);  /* 0.9 / 300: arriving and resting */
  --spring-pop: cubic-bezier(.34, 1.4, .64, 1);   /* 0.72 / 520: things that appear where you pointed */
  --spring-seal: cubic-bezier(.34, 1.56, .64, 1); /* 0.62 / 520: signature moments only */
  --spring-press: cubic-bezier(.34, 1.3, .64, 1); /* 0.6 / 500: a press coming back */
  --spring: var(--spring-pop);
  /* Durations: each spring's own settle time, then the tween durations. Moving between places (a screen, a sheet,
     a list) stays at or under 360 ms, so the eye follows it and the hand never waits on it. */
  --t-glide: 320ms; --t-pop: 420ms; --t-seal: 520ms; --t-settle: 360ms;
  --t-press: 140ms; --t-fast: 140ms; --t-quick: 200ms; --t-mid: 240ms; --t-row: 280ms; --t-overlay: 320ms; --t-slow: 420ms; --t-screen: 340ms;
  /* Loops */
  --loop-typing: 700ms; --loop-typing-stagger: 140ms; --loop-live: 1600ms; --loop-shimmer: 1400ms; --loop-ring: 2400ms;
  --stagger: 28ms;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-glide: linear(0, .05, .164, .3, .436, .56, .665, .752, .82, .873, .912, .941, .962, .976, .986, .993, .997, .999, 1);
    --spring-settle: linear(0, .049, .159, .292, .427, .549, .655, .742, .811, .865, .906, .936, .958, .973, .984, .991, .996, .999, 1);
    --spring-pop: linear(0, .065, .214, .392, .564, .714, .832, .919, .977, 1.013, 1.031, 1.038, 1.037, 1.032, 1.026, 1.019, 1.013, 1.008, 1.004, 1.002, 1);
    --spring-seal: linear(0, .099, .313, .552, .762, .918, 1.017, 1.068, 1.083, 1.077, 1.059, 1.039, 1.022, 1.008, .999, .995, .993, .995, .998, 1);
    --spring-press: linear(0, .059, .202, .381, .564, .729, .865, .967, 1.036, 1.076, 1.093, 1.084, 1.068, 1.051, 1.034, 1.019, 1.008, 1, .995, .992, 1);
  }
}
/* Dark: by the system unless the person chose Light; or always, when they chose Dark (Settings). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #000000; --raised: #0f131a; --overlay: #1c212a; --fill: #1a1f28; --fill-strong: #242a34;
    --fg: #f2f5f9; --fg2: #a8b1c0; --line: rgba(255, 255, 255, .13); --edge: rgba(255, 255, 255, .05); --pressed: rgba(255, 255, 255, .08);
    --accent: #45bdc9; --accent-text: #45bdc9; --accent-fg: #0b1220; --accent-soft: #0a2529;
    --mine-top: #0e353c; --mine: #0a2a30; --mine-fg: #f2f5f9; --theirs: #171c24; --theirs-fg: #f2f5f9; --tick: #6cc4ff;
    --success: #3de8a0; --warn-bg: #241d08; --warn-fg: #e7b25e; --danger: #ff8a80; --scrim: rgba(0, 0, 0, .60);
    --chat-ground: #000000; --ripple: color-mix(in srgb, var(--accent) 4%, transparent); --wash: color-mix(in srgb, var(--accent) 8%, transparent);
    --glass: rgba(10, 13, 18, .74);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5); --shadow-2: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    --ink-0: #de8af2; --ink-1: #63a6f2; --ink-2: #b48ef6; --ink-3: #eea02b; --ink-4: #2beec0; --ink-5: #f476b9; --ink-6: #6cee2b; --ink-7: #9299f6;
    --av-strong: 18%; --av-soft: 12%;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #000000; --raised: #0f131a; --overlay: #1c212a; --fill: #1a1f28; --fill-strong: #242a34;
  --fg: #f2f5f9; --fg2: #a8b1c0; --line: rgba(255, 255, 255, .13); --edge: rgba(255, 255, 255, .05); --pressed: rgba(255, 255, 255, .08);
  --accent: #45bdc9; --accent-text: #45bdc9; --accent-fg: #0b1220; --accent-soft: #0a2529;
  --mine-top: #0e353c; --mine: #0a2a30; --mine-fg: #f2f5f9; --theirs: #171c24; --theirs-fg: #f2f5f9; --tick: #6cc4ff;
  --success: #3de8a0; --warn-bg: #241d08; --warn-fg: #e7b25e; --danger: #ff8a80; --scrim: rgba(0, 0, 0, .60);
  --chat-ground: #000000; --ripple: color-mix(in srgb, var(--accent) 4%, transparent); --wash: color-mix(in srgb, var(--accent) 8%, transparent);
  --glass: rgba(10, 13, 18, .74);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5); --shadow-2: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  --ink-0: #de8af2; --ink-1: #63a6f2; --ink-2: #b48ef6; --ink-3: #eea02b; --ink-4: #2beec0; --ink-5: #f476b9; --ink-6: #6cee2b; --ink-7: #9299f6;
  --av-strong: 18%; --av-soft: 12%;
}
.s0 { --ink: var(--ink-0); } .s1 { --ink: var(--ink-1); } .s2 { --ink: var(--ink-2); } .s3 { --ink: var(--ink-3); }
.s4 { --ink: var(--ink-4); } .s5 { --ink: var(--ink-5); } .s6 { --ink: var(--ink-6); } .s7 { --ink: var(--ink-7); }

* { box-sizing: border-box; }
/* --app-h: what the on-screen keyboard leaves showing, set from visualViewport on touch screens (app.mjs). */
html { height: 100%; }
body { height: var(--app-h, 100%); }
/* The app fills the window: no rubber-band on the page itself, only inside its lists. */
html:has(#app.full), html:has(#app.full) body { overflow: hidden; overscroll-behavior: none; }
.list, .msgs, .sheet-body, .cmd-list { overscroll-behavior: contain; }
body { margin: 0; display: flex; flex-direction: column; background: var(--ground); color: var(--fg);
  font: var(--fs-body)/1.47 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: color-mix(in srgb, var(--lagoon) 35%, transparent); }
::placeholder { color: var(--fg2); opacity: 1; }
[hidden] { display: none !important; }
/* Read by screen readers, never seen. */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

main { flex: 1; min-height: 0; width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s6) var(--s4); }
main.full { max-width: none; padding: 0; }

/* ── Buttons: every one answers a press with a small, quick sink and a soft spring back ── */
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:where(button) { transition: transform var(--t-overlay) var(--spring-press); }
:where(button:not(:disabled):not(.veil)):active { transform: scale(.96); transition-duration: var(--t-press); transition-timing-function: var(--ease-std); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card button, .pass-form button { min-height: 48px; padding: 10px 20px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--raised); font-weight: 600;
  transition: background var(--t-fast) var(--ease-std), transform var(--t-overlay) var(--spring-press); }
.card button:hover:not(:disabled), .pass-form button:hover:not(:disabled) { background: var(--fill); }
.card button:active:not(:disabled), .pass-form button:active:not(:disabled) { transform: scale(.97); transition-duration: var(--t-press); }
.card button.primary, .pass-form button.primary, .list-empty button.primary { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 82%, #000)); color: var(--accent-fg);
  border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18); }
.card button.primary:hover:not(:disabled), .list-empty button.primary:hover { background: var(--accent); }
.card button:disabled { opacity: .5; }
.ic path { vector-effect: non-scaling-stroke; }
.ic { width: var(--ic-l); height: var(--ic-l); fill: none; stroke: currentColor; stroke-width: var(--ic-stroke); stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .fill { fill: currentColor; stroke: none; }
.ic.small { width: var(--ic-xs); height: var(--ic-xs); }
.ic.big { width: 28px; height: 28px; }
.ic.accent { color: var(--accent-text); }
.ic.kebab { stroke-width: var(--ic-stroke-dot); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--fg2);
  transition: background var(--t-fast) var(--ease-std), color var(--t-fast), transform var(--t-overlay) var(--spring-press); }
.icon-btn:hover { background: var(--fill); color: var(--fg); }
.icon-btn:active { transform: scale(.9); transition-duration: var(--t-press); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn[aria-expanded="true"] { background: var(--fill); color: var(--fg); }

/* ── Skeletons: a placeholder with a slow light passing over it, never a spinner ── */
.sk { position: relative; display: block; overflow: hidden; background: var(--fill); border-radius: var(--r-pill); }
.sk::after, .photo.loading::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--raised) 70%, transparent), transparent);
  animation: shimmer var(--loop-shimmer) var(--ease-std) infinite; }
.boot { display: flex; flex-direction: column; align-items: center; gap: var(--s3); margin-top: 18vh; animation: fade-in var(--t-slow) var(--ease-out) both 120ms; }
.boot .mark { width: 64px; height: 64px; margin-bottom: var(--s3); border-radius: 25%; box-shadow: var(--shadow-2); animation: breathe-soft var(--loop-ring) var(--ease-std) infinite; }
/* NC-16: the way out when app.mjs never draws a screen; hidden until 20 s have passed (a step, not motion, so the
   reduced-motion rule, which shortens every animation, must not shorten this one). The first screen replaces .boot. */
.boot-late { visibility: hidden; max-width: 22rem; margin: var(--s4) var(--s4) 0; text-align: center; color: var(--fg2); font-size: 1rem; animation: boot-late 20s step-end forwards; }
#app .boot-late { animation-duration: 20s !important; }
.boot-late a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s2); color: var(--accent-text); font-weight: 650; }
@keyframes boot-late { to { visibility: visible; } }
.sk-line { width: 180px; height: 10px; }
.sk-line.short { width: 116px; }

/* ── The mark: the phone's launcher icon, with a halo that breathes while something is waited for ── */
.mark { position: relative; width: 68px; height: 68px; margin: 0 auto; }
.mark img { position: relative; display: block; width: 100%; height: 100%; border-radius: 25%;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--lagoon) 28%, transparent), 0 2px 6px rgba(11, 18, 32, .18); animation: pop var(--t-seal) var(--spring-seal) both; }
.mark::before { content: ""; position: absolute; inset: -9px; border-radius: 30px; border: 1.5px solid color-mix(in srgb, var(--lagoon) 45%, transparent);
  animation: breathe var(--loop-ring) var(--ease-std) infinite; }
.mark.mini { width: 36px; height: 36px; flex: none; margin: 0; }
.mark.mini::before { content: none; }
.mark.mini img { box-shadow: var(--shadow-1); animation: none; }
/* The linked moment: a check seals on, one ring spreads, the halo stops. */
.mark.done::before { content: none; }
.seal { position: absolute; right: -8px; bottom: -8px; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--success); color: #fff; box-shadow: 0 0 0 3px var(--raised); animation: pop var(--t-seal) var(--spring-seal) both 120ms; }
.seal .ic { width: 17px; height: 17px; stroke-width: var(--ic-stroke-strong); }
.ripple { position: absolute; inset: 0; border-radius: 25%; border: 2px solid var(--lagoon); opacity: 0; animation: ripple 900ms var(--ease-out) 160ms both; }
.linked h2, .linked p { animation: rise var(--t-screen) var(--ease-emph) both 200ms; }

/* ── Link, install and notice cards ── */
.card { position: relative; max-width: 420px; margin: 7vh auto 0; padding: var(--s7) 28px 28px; background: var(--raised); border-radius: var(--r-xl);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge); text-align: center; animation: card-in var(--t-settle) var(--spring-settle) both; }
.card h2 { margin: 22px 0 var(--s2); font: 650 var(--fs-h1)/1.25 var(--font-display); letter-spacing: -.015em; }
.card p { color: var(--fg2); }
.card.install { text-align: left; }
.card.install h2 { text-align: center; }
.card.install button.primary { width: 100%; margin-top: var(--s2); }
.steps { counter-reset: s; list-style: none; margin: 14px auto 6px; padding: 0; max-width: 300px; text-align: left; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: var(--s3); margin: 10px 0; color: var(--fg); animation: rise var(--t-screen) var(--ease-emph) both; }
.steps li:nth-child(2) { animation-delay: 70ms; }
.steps li:nth-child(3) { animation-delay: 140ms; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); font-weight: 700; }
.qr-frame { position: relative; width: fit-content; max-width: 100%; margin: 18px auto var(--s3); padding: 10px; border-radius: var(--r-l); background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px color-mix(in srgb, var(--lagoon) 18%, transparent); overflow: hidden; animation: pop var(--t-seal) var(--spring-pop) both 160ms; }
/* While it waits: a soft band of light passes down the code now and then. */
.qr-frame::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--lagoon) 22%, transparent), transparent); animation: scan 3.6s var(--ease-std) infinite 1s; }
.qr-code { display: block; width: 236px; max-width: 100%; height: auto; image-rendering: pixelated; }
/* A tablet stands further off than a phone is held: bigger, so a phone camera reads it from arm's length. */
@media (min-width: 600px) and (min-height: 640px) { .qr-code { width: 340px; } }
/* The link ended on the server (logged out, unlinked, expired): said once, calmly, above the steps to link again. */
.card .signed-out { margin: var(--s2) 0 var(--s1); padding: 10px 14px; border-radius: var(--r-m); background: var(--accent-soft); color: var(--accent-text); font-size: calc(.875rem * var(--ts)); line-height: 1.4; }
.card .wait { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); margin: var(--s1) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--accent-text); }
.wait-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wait-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ring-out var(--loop-live) var(--ease-out) infinite; }
.code { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin: var(--s4) 0 22px; perspective: 400px; }
.code span { --i: 0; width: 2.625rem; height: 3.375rem; display: grid; place-items: center; border-radius: var(--r-s); background: var(--fill);
  font: 650 1.625rem/1 ui-monospace, "Cascadia Mono", "SF Mono", monospace; animation: flip var(--t-slow) var(--spring-pop) both; animation-delay: calc(var(--i) * 60ms); }
.code span:nth-child(3) { margin-right: 10px; }
.code.typed span:nth-child(3) { margin-right: 0; }
.code.typed span.gap { margin-left: 10px; }
/* "Is this you?": who asks, then 4 boxes drawn over one real field, then one clear Link (11-05 redesign). */
.card.who { text-align: center; }
.who-mark { width: 56px; height: 56px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font: 650 1.5rem/1 var(--font-display); }
.card.who h2 { margin-top: var(--s3); }
.card .who-name { margin: 0; color: var(--fg); font-weight: 650; font-size: 1.05rem; }
.card .who-handle { margin: 2px 0 var(--s3); font-size: var(--fs-sm); }
.card .who-ask { margin: 0 0 var(--s3); }
.pin { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin: 0 auto var(--s4); width: max-content; max-width: 100%; }
.pin-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 1rem; caret-color: transparent; }
.pin-box { width: 3.25rem; height: 3.875rem; display: grid; place-items: center; border-radius: var(--r-s); background: var(--fill); border: 2px solid transparent;
  font: 650 1.75rem/1 ui-monospace, "Cascadia Mono", "SF Mono", monospace; transition: border-color var(--t-press), background var(--t-press); pointer-events: none; }
.pin-box.full { background: var(--raised); border-color: var(--line); }
.pin-box.on { border-color: var(--accent); }
.pin:has(.pin-input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-s); }
.actions.stack { flex-direction: column; align-items: stretch; gap: var(--s2); }
.card button.wide { width: 100%; }
.card button.quiet { border-color: color-mix(in srgb, var(--fg2) 55%, transparent); background: transparent; color: var(--fg); } /* sheet rules 11-17: quiet = a 1 px outline, never text only */
.card .who-safe { margin: var(--s3) 0 0; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.meta { color: var(--fg2); font-size: calc(13px * var(--ts)); }

/* ── Chats: two panes on a computer, one at a time at phone width ── */
.shell { display: grid; grid-template-columns: clamp(336px, 31vw, 430px) minmax(0, 1fr); height: 100%; background: var(--raised); }
.side { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--raised); border-right: 1px solid var(--line); }
.glass { background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.side-head, .pane-head { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 14px var(--s3) var(--s4); min-height: 66px; border-bottom: 1px solid var(--line); }
.side-head { border-bottom-color: transparent; }
.grow { flex: 1; min-width: 0; }
.brand { font: 700 19px/1.2 var(--font-display); letter-spacing: -.02em; color: var(--fg); }
.title { font: 650 var(--fs-title)/1.25 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { display: flex; align-items: center; gap: 5px; color: var(--fg2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub.e2e .ic { color: var(--accent-text); }
/* A narrow header ends the line with an ellipsis, never mid-word ("last seen 27 mir"). */
.sub.e2e { min-width: 0; }
/* Search in a chat has its own close button: the browser's own clear cross would be a second, identical one. */
.find input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* Search in a chat: the matched words, lit (CSS Highlight API). */
::highlight(find) { background-color: #f3c64f; color: #111; }
.sub.e2e .who-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub.live { color: var(--accent-text); }
.status .st-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg); font-weight: 560; }
.status .st-rest { flex: 0 100000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Under the brand there is room for a second line: the link state wraps onto it rather than being cut. */
.side-head .status { flex-wrap: wrap; row-gap: 0; white-space: normal; }
.side-head .status .st-rest { flex: 0 1 auto; white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn-fg); flex: none; animation: pulse 1.2s var(--ease-std) infinite; }
.status .dot.on { background: var(--success); animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.search { display: flex; align-items: center; gap: var(--s2); margin: var(--s3) var(--s3) 6px; padding: 0 var(--s3); min-height: 40px; border-radius: var(--r-s); background: var(--fill);
  color: var(--fg2); border: 1px solid transparent; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-mid) var(--ease-emph); }
.search:focus-within { background: var(--raised); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.search .ic { width: var(--ic-m); height: var(--ic-m); }
.search input { flex: 1; min-width: 0; text-overflow: ellipsis; border: 0; background: transparent; color: var(--fg); font: inherit; outline: none; }
.search kbd { font: 11px/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--fg2); transition: opacity var(--t-fast); }
.search:focus-within kbd { opacity: 0; }

/* Chats | Contacts | Calls, with a sliding pill under the chosen one */
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; margin: 2px var(--s3) 0; padding: 3px; border-radius: var(--r-s); background: var(--fill); }
.tab { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: var(--fg2); font-size: var(--fs-row); font-weight: 600; transition: color var(--t-mid) var(--ease-emph), transform var(--t-overlay) var(--spring-press); }
.tab[aria-selected="true"] { color: var(--fg); }
.tab-ink { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 9px; background: var(--overlay); box-shadow: var(--shadow-1), inset 0 1px 0 var(--edge);
  transition: transform var(--t-pop) var(--spring-pop); }
.tabs[data-on="contacts"] .tab-ink { transform: translateX(100%); }
.tabs[data-on="calls"] .tab-ink { transform: translateX(200%); }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-fg);
  font-size: 11px; font-weight: 700; animation: pop var(--t-pop) var(--spring-pop) both; }
.chips { display: flex; gap: 6px; padding: 2px var(--s3) var(--s2); overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; min-height: 30px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--fg2); font-size: calc(13px * var(--ts)); font-weight: 560;
  transition: background var(--t-mid) var(--ease-emph), color var(--t-fast), border-color var(--t-fast), transform var(--t-overlay) var(--spring-press); }
.chip:hover { background: var(--fill); color: var(--fg); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

.list { flex: 1; overflow-y: auto; padding: var(--s1) var(--s2) var(--s3); scrollbar-width: thin; }
.row { position: relative; display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 10px; margin: 1px 0; border: 0; border-radius: var(--r-m);
  background: transparent; text-align: left; transition: background var(--t-fast) var(--ease-std), transform var(--t-overlay) var(--spring-press); }
.row:hover { background: var(--pressed); }
.row:active { transform: scale(.985); transition-duration: var(--t-press); }
.row.on { background: var(--accent-soft); }
.row.on::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent);
  animation: grow-y var(--t-mid) var(--ease-emph) both; }
/* First draw: the rows arrive one after another, quickly, and settle. */
.stagger .row, .stagger .group-head, .stagger .letter { animation: rise var(--t-screen) var(--spring-settle) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }
.line1, .line2 { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.line2 { margin-top: 1px; }
.name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { flex: none; color: var(--fg2); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
.row.unread .time { color: var(--accent-text); font-weight: 650; }
.preview { flex: 1; min-width: 0; color: var(--fg2); font-size: var(--fs-row); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unread .name { font-weight: 700; }
.row.unread .preview { color: var(--fg); }
.row.unread .preview.blocked { color: var(--fg2); }
.preview .tiny { width: var(--ic-s); height: var(--ic-s); color: var(--fg2); vertical-align: -3px; margin-right: 2px; }
.preview.typing { color: var(--accent-text); font-weight: 560; }
.you { color: var(--fg2); }
.badge { flex: none; min-width: 20px; min-height: 20px; padding: 0 6px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--accent); color: var(--accent-fg); font-size: var(--fs-cap); font-weight: 700; font-variant-numeric: tabular-nums; }
.badge.bump { animation: pop var(--t-seal) var(--spring-seal) both; }
.none { color: var(--fg2); padding: var(--s6) var(--s4); text-align: center; animation: rise var(--t-screen) var(--ease-emph) both; }
.foot { margin: 14px var(--s4) 6px; color: var(--fg2); font-size: calc(12px * var(--ts)); text-align: center; }
.group-head { display: flex; align-items: center; gap: var(--s2); margin: 14px 10px var(--s1); color: var(--fg2); font-size: calc(12px * var(--ts)); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.group-head .count { padding: 1px 7px; border-radius: var(--r-pill); background: var(--fill); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.letter { margin: 10px 14px 2px; color: var(--accent-text); font: 650 13px/1 var(--font-display); }
.row.person .name { display: block; }
div.row.person { cursor: default; }
/* Not tappable, so no hover wash; the pill and the foot say where to act, and the pill never shrinks the line (QC W-09). */
div.row.person:hover { background: transparent; }
div.row.person .pill { white-space: nowrap; }
div.row.person:active { transform: none; }
/* A call's row: the wide part opens the chat, the two round buttons call. Three separate buttons, never one inside another. */
.call-row { gap: 2px; padding: 0 6px 0 0; }
.call-row:active { transform: none; }
.call-main { display: flex; flex: 1; align-items: center; gap: var(--s3); min-width: 0; padding: 10px; border: 0; border-radius: var(--r-m); background: transparent; color: inherit; text-align: left; cursor: pointer;
  transition: transform var(--t-overlay) var(--spring-press); }
.call-main:active { transform: scale(.985); transition-duration: var(--t-press); }
.call-main:disabled { cursor: default; }
.call-main:disabled:active { transform: none; }
.call-main > .grow { min-width: 0; }
.call-row .name { flex: 0 1 auto; }
.call-row .time { margin-left: auto; }
.call-count { flex: none; margin-left: -4px; color: var(--fg2); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; }
.call-line { gap: 5px; align-items: flex-start; }
.call-line .preview { white-space: normal; overflow-wrap: anywhere; }
.call-dir { flex: none; color: var(--fg2); }
.call-row.missed .name, .call-row.missed .call-dir { color: var(--danger); }
.call-now { flex: none; color: var(--accent-text); }
.call-now:hover { background: var(--accent-soft); color: var(--accent-text); }
.pill { flex: none; padding: var(--s1) 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-cap); font-weight: 600; }
.ic.pin { width: var(--ic-xs); height: var(--ic-xs); color: var(--fg2); flex: none; }

/* Avatars (NexAvatar): a soft 135-degree tint of the person's ink, the initials in the ink itself; a group's is a squircle */
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font: 650 15.5px/1 var(--font-display); letter-spacing: .01em; color: var(--ink, var(--ink-1));
  background: linear-gradient(135deg, color-mix(in srgb, var(--ink, var(--ink-1)) var(--av-strong), var(--raised)), color-mix(in srgb, var(--ink, var(--ink-1)) var(--av-soft), var(--raised)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink, var(--ink-1)) 10%, transparent); }
.avatar.group { border-radius: 30%; }
.pane-head .avatar { width: 40px; height: 40px; font-size: 14px; }
.avatar.huge { width: 96px; height: 96px; font-size: 34px; margin-bottom: var(--s2); animation: pop var(--t-seal) var(--spring-seal) both; }
.avatar.tappable { cursor: pointer; }
.members .avatar { width: 36px; height: 36px; font-size: 13px; }
.av-wrap { position: relative; flex: none; display: inline-grid; }
.online-dot { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 2.5px var(--raised); animation: pop var(--t-pop) var(--spring-pop) both; }
.row.on .online-dot { box-shadow: 0 0 0 2.5px var(--accent-soft); }

/* Typing: three dots bobbing in turn (Motion.kt TYPING_CYCLE / TYPING_STAGGER) */
.typing-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: bob var(--loop-typing) var(--ease-std) infinite; }
.typing-dots i:nth-child(2) { animation-delay: var(--loop-typing-stagger); }
.typing-dots i:nth-child(3) { animation-delay: calc(var(--loop-typing-stagger) * 2); }

/* ── The open chat, on a plain ground (Design 11-18: the owner read the ripples as a target behind the bubbles).
   The ripples are one choice, "Rings": rings only, no wash, at 4 %. ── */
.pane { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-ground); }
.pane::before, .pane::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; display: none; }
.pane:has(.msgs[data-wall="rings"])::before, .pane:has(.msgs[data-wall="rings"])::after { display: block; }
.pane::before { background: repeating-radial-gradient(circle at 100% 0%, transparent 0 62px, var(--ripple) 62px 63.5px, transparent 63.5px 96px);
  -webkit-mask-image: radial-gradient(640px 640px at 100% 0%, #000 20%, transparent 75%); mask-image: radial-gradient(640px 640px at 100% 0%, #000 20%, transparent 75%); }
.pane::after { background: repeating-radial-gradient(circle at 0% 100%, transparent 0 62px, var(--ripple) 62px 63.5px, transparent 63.5px 96px);
  -webkit-mask-image: radial-gradient(460px 460px at 0% 100%, #000 15%, transparent 75%); mask-image: radial-gradient(460px 460px at 0% 100%, #000 15%, transparent 75%); }
.pane-head { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.back { display: none; margin-left: -6px; }
.who { cursor: pointer; border-radius: 10px; padding: 2px 6px; margin: -2px -6px; transition: background var(--t-fast); }
.who:hover { background: var(--pressed); }
.pane-head .icon-btn.on { color: var(--accent-text); background: var(--accent-soft); }
.msgs { flex: 1; overflow-y: auto; padding: 18px max(18px, calc((100% - 780px) / 2)) 10px; display: flex; flex-direction: column; overflow-x: hidden; scrollbar-width: thin; }
/* Not sticky: in one scrolling column every day chip would stick to the same spot and stack (live test, 2026-10-29). */
.day { position: relative; z-index: 1; align-self: center; margin: var(--s4) 0 var(--s2); padding: var(--s1) var(--s3); border-radius: var(--r-pill); font-size: calc(12px * var(--ts)); font-weight: 600;
  color: var(--fg2); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-1); }

/* Bubbles (NexShapes.bubble): 20 round; the tail corner and every corner that meets a neighbour in a run close to 6.
   A block, not a flex row: the words flow as text, and the time floats at the end of their last line (see .stamp). */
.bubble { position: relative; max-width: min(76%, 560px); margin-top: var(--s2); padding: 6px var(--s3) 7px; border-radius: var(--r-l);
  white-space: pre-wrap; overflow-wrap: anywhere; display: flow-root; box-shadow: var(--shadow-1); }
.bubble.cont { margin-top: 2px; }
.bubble.theirs { align-self: flex-start; background: var(--theirs); color: var(--theirs-fg); border-bottom-left-radius: var(--r-join); transform-origin: 0 100%; }
.bubble.mine { align-self: flex-end; color: var(--mine-fg); background: linear-gradient(180deg, var(--mine-top), var(--mine)); border-bottom-right-radius: var(--r-join); transform-origin: 100% 100%; }
.bubble.theirs.cont { border-top-left-radius: var(--r-join); }
.bubble.mine.cont { border-top-right-radius: var(--r-join); }
/* Sent: rises out of the composer. Received: slides in from its side. Both glide, no bounce. */
.bubble.enter.mine { animation: send-in var(--t-overlay) var(--spring-glide) both; }
.bubble.enter.theirs { animation: recv-in var(--t-overlay) var(--spring-glide) both; }
.bubble.failed { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); cursor: pointer; animation: shake 360ms var(--ease-std); }
.bubble.deleted { background: transparent; color: var(--fg2); box-shadow: inset 0 0 0 1px var(--line); }
.gone { font-style: italic; }
/* Very long text: folded at about 30 lines (app.mjs longText), the rest behind Read more. */
.body.long .text { display: block; }
.body.long:not(.open) .text { max-height: calc(1.47em * 30); overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 3em), transparent); mask-image: linear-gradient(#000 calc(100% - 3em), transparent); }
.more-btn { display: inline-block; margin: 4px 0 0; padding: 2px 0; border: 0; background: none; color: var(--accent-text); font-size: calc(14px * var(--ts)); font-weight: 650; }
.more-btn:hover { text-decoration: underline; }
/* A message the keyboard is on: the arrows move between them (app.mjs setRover). */
.bubble:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The time and ticks: a float after the last word, so it sits at the end of the last line when it fits and takes a line
   of its own, at the right, when it does not. Never over the words. The top margin lines it up with the text's foot. */
.stamp { float: right; display: inline-flex; align-items: center; gap: 3px; min-height: 15px; margin: 7px -3px 0 12px; font-size: calc(13px * var(--ts)); line-height: 1;
  color: color-mix(in srgb, currentColor var(--stamp-ink), transparent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.edited { font-style: italic; margin-right: 3px; }
.ic.tiny-t { width: 11px; height: 11px; }
/* Ticks, as the phone (SendState): a clock while sending, one tick taken by the server, two delivered, two in the read
   colour once read. A tick that changes while the chat is open lands with a small pop (.fresh). */
.tick { width: var(--ic-s); height: var(--ic-s); color: inherit; }
.tick.wait { width: 12px; height: 12px; }
/* Read differs from delivered by weight as well as colour, so it still reads for colour-blind eyes and in dark. */
.tick.read, .ic.tiny.read { color: var(--tick); stroke-width: var(--ic-stroke-strong); }
.tick.fresh { animation: pop var(--t-pop) var(--spring-pop) both; }
.notice { position: relative; align-self: center; margin: auto 0; max-width: 340px; padding: var(--s4) 18px; text-align: center; color: var(--fg2); border-radius: var(--r-l);
  background: var(--raised); box-shadow: var(--shadow-1); animation: rise var(--t-screen) var(--ease-emph) both; }
.unread-line { align-self: stretch; display: flex; align-items: center; gap: 10px; margin: 14px 0 var(--s1); color: var(--accent-text); font-size: calc(12px * var(--ts)); font-weight: 650; }
.unread-line::before, .unread-line::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--accent) 40%, transparent); }
.jump { position: absolute; right: max(18px, calc((100% - 780px) / 2)); bottom: 86px; z-index: 3; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 50%; border: 0; background: var(--overlay); color: var(--fg); box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge);
  opacity: 0; transform: translateY(12px) scale(.8); pointer-events: none; transition: opacity var(--t-mid) var(--ease-emph), transform var(--t-pop) var(--spring-pop); }
.jump.show { opacity: 1; transform: none; pointer-events: auto; }
.jump-count { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: none; place-items: center;
  background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 700; }
.jump.has-count .jump-count { display: grid; animation: pop var(--t-pop) var(--spring-pop) both; }

/* Message tools, quotes, replies */
.bubble .tools { position: absolute; top: 50%; display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--overlay); box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge);
  opacity: 0; pointer-events: none; transform: translateY(calc(-50% + 4px)); transition: opacity 200ms var(--ease-emph), transform 200ms var(--ease-emph); } /* X1: glide, rise 4 px */
.bubble.mine .tools { right: calc(100% + 8px); }
.bubble.theirs .tools { left: calc(100% + 8px); }
/* An invisible bridge over the gap, so the pointer keeps the bubble hovered on its way to the tools. */
.bubble .tools::before { content: ""; position: absolute; top: -10px; bottom: -10px; width: 14px; }
.bubble.mine .tools::before { left: 100%; }
.bubble.theirs .tools::before { right: 100%; }
.bubble:hover .tools, .bubble:has(:focus-visible) .tools, .bubble:focus-visible .tools { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) { .bubble .tools { transform: translateY(-50%); transition: opacity 170ms var(--ease-std); } }
.tool { width: 30px; height: 30px; color: var(--fg2); }
/* X1 (batch W): Reply, React and More are 48 px buttons with their words (senior rule), still in one floating bar. */
.tool.worded { display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 48px; padding: 0 14px 0 10px; border: 0; border-radius: 24px;
  background: none; color: var(--fg); font: 600 calc(16px * var(--ts))/1 var(--font); white-space: nowrap; cursor: pointer; }
.tool.worded:hover { background: var(--fill); }
.tool .ic { width: var(--ic-s); height: var(--ic-s); }
.quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 2px 0 6px; padding: 6px 10px; border: 0; border-left: 3px solid var(--accent);
  border-radius: var(--r-xs); background: color-mix(in srgb, var(--fg) 6%, transparent); color: inherit; text-align: left; cursor: pointer; }
.quote-who { font-size: calc(12px * var(--ts)); font-weight: 650; color: var(--accent-text); }
.quote-text { font-size: calc(13px * var(--ts)); color: inherit; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
/* A quoted line jumped to: a ring of light fades in and out over it (opacity only). */
.bubble::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); opacity: 0; pointer-events: none; }
.bubble.flash::after { animation: flash 1.2s var(--ease-std); }
.bubble.hit { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.bubble.hit.cur { box-shadow: 0 0 0 3px var(--accent); animation: pop-up var(--t-mid) var(--spring-pop) both; }
.fwd { display: flex; align-items: center; gap: var(--s1); width: 100%; font-size: calc(12px * var(--ts)); font-style: italic; color: color-mix(in srgb, currentColor 75%, transparent); margin-bottom: 2px; }
.who-name { width: 100%; margin-bottom: 1px; font-size: var(--fs-sm); font-weight: 650; color: var(--ink, var(--accent-text)); }

/* Reactions */
.bubble.has-reacts { --react-drop: max(28px, calc(28px * var(--ts))); margin-bottom: var(--react-drop); }
.reacts { position: absolute; bottom: calc(-1 * var(--react-drop)); display: flex; gap: 3px; }
.bubble.mine .reacts { right: 10px; }
.bubble.theirs .reacts { left: 10px; }
.react { position: relative; display: inline-flex; align-items: center; gap: 3px; min-height: max(32px, calc(32px * var(--ts))); padding: 0 7px; border-radius: var(--r-pill); border: 0; background: var(--overlay);
  box-shadow: 0 0 0 2px var(--chat-ground), var(--shadow-1); font-size: calc(13px * var(--ts)); transition: transform var(--t-pop) var(--spring-pop); }
/* Only a reaction that just landed pops; a bubble drawn again (a chat reopened, older lines) shows its chips still. */
.react.fresh { animation: pop var(--t-seal) var(--spring-seal) both; }
.react:hover { transform: scale(1.08); }
.react.mine { background: var(--accent-soft); }
.react .n { font-size: var(--fs-cap); font-weight: 650; color: var(--fg2); }
.react-row { display: flex; gap: 2px; padding: 2px; }
.menu-item + .react-row, .react-row:not(:only-child) { margin-bottom: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu:has(> .react-row:only-child) { min-width: 0; }
.react-row button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 21px; line-height: 1;
  transition: transform var(--t-pop) var(--spring-pop), background var(--t-fast); animation: pop var(--t-pop) var(--spring-pop) both; }
.react-row button:nth-child(2) { animation-delay: 20ms; }
.react-row button:nth-child(3) { animation-delay: 40ms; }
.react-row button:nth-child(4) { animation-delay: 60ms; }
.react-row button:nth-child(5) { animation-delay: 80ms; }
.react-row button:nth-child(6) { animation-delay: 100ms; }
.react-row button:hover, .react-row button:focus-visible { background: var(--fill); transform: scale(1.22); outline: none; }
.react-row button.on { background: var(--accent-soft); }

/* Photos, voice, video, files. Every card is one width (--card), a photo its own (--pw, from its real shape, app.mjs
   photoBox), and the bubble as wide as the card or photo: a caption wraps under it instead of widening it. */
.bubble { --card: 296px; }
/* Width 0 and min-width 100%: a caption, a quote or a name takes the photo's or card's width and never widens it. */
.bubble.media > :is(.body, .quote, .who-name, .fwd) { width: 0; min-width: 100%; }
.bubble.media.image { padding: 3px; }
.bubble.media.image > .who-name, .bubble.media.image > .fwd { padding: 3px 9px 2px; }
.bubble.media.image > .quote { margin: 0 0 3px; }
.bubble.media.image > .body { padding: 2px 9px 2px; }
/* No caption: the time sits on the photo, over a soft scrim, white. */
.bubble.media.image:not(.cap) > .body { position: absolute; right: 9px; bottom: 8px; width: auto; min-width: 0; padding: 0; }
.bubble.media.image:not(.cap) .stamp { float: none; margin: 0; font-size: calc(14px * var(--ts)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.bubble.media.image:not(.cap) .tick.read { color: #8fd8ff; }
.photo { --in: calc(var(--r-l) - 3px); position: relative; display: block; width: var(--pw, 260px); max-width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0;
  border-radius: var(--in); overflow: hidden; background: var(--fill); cursor: zoom-in; }
.bubble.media.image:not(.cap) .photo::before { content: ""; position: absolute; inset: auto 0 0; z-index: 1; height: 56px; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0)); }
/* The photo's corners follow the bubble's: a joined corner stays joined, a captioned photo's foot is squarer. */
.bubble.image.cap :is(.photo, .grid) { border-bottom-left-radius: var(--r-xs); border-bottom-right-radius: var(--r-xs); }
.bubble.image.mine:not(.cap) :is(.photo, .grid) { border-bottom-right-radius: 4px; }
.bubble.image.theirs:not(.cap) :is(.photo, .grid) { border-bottom-left-radius: 4px; }
.bubble.image.mine.cont :is(.photo, .grid) { border-top-right-radius: 4px; }
.bubble.image.theirs.cont :is(.photo, .grid) { border-top-left-radius: 4px; }
.bubble.image:has(> .who-name, > .fwd, > .quote) :is(.photo, .grid) { border-top-left-radius: var(--r-xs); border-top-right-radius: var(--r-xs); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-emph); }
.photo.blur img { filter: blur(14px) saturate(1.2); transform: scale(1.08); }
.photo.ready img { animation: fade-in var(--t-slow) var(--ease-out) both; }
.photo.failed::after { content: "Could not load · tap to retry"; position: absolute; inset: auto 0 0; padding: var(--s2); font-size: calc(12px * var(--ts)); color: #fff; background: rgba(0, 0, 0, .62); }
/* Albums: photos from one sender in a row, one mosaic. 2 px seams; the outer corners are the bubble's, the inner square.
   2 = side by side at their own shapes (--a, --b, --ar from app.mjs), 3 = one tall and two stacked, 4+ = 2x2. */
.grid { --in: calc(var(--r-l) - 3px); position: relative; display: grid; gap: 2px; width: 314px; max-width: 100%; border-radius: var(--in); overflow: hidden; }
.grid.n2 { grid-template-columns: var(--a, 1fr) var(--b, 1fr); aspect-ratio: var(--ar, 1.5); }
.grid.n3 { grid-template-columns: 3fr 2fr; grid-template-rows: 1fr 1fr; aspect-ratio: 314 / 290; }
.grid.n3 > :first-child { grid-row: span 2; }
.grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1; }
.tile { position: relative; display: block; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: var(--fill); cursor: zoom-in; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-emph), opacity var(--t-slow) var(--ease-out); }
.tile.blur img { filter: blur(10px) saturate(1.2); transform: scale(1.1); }
.tile.ready img { animation: fade-in var(--t-slow) var(--ease-out) both; }
.tile.loading::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); animation: shimmer var(--loop-shimmer) var(--ease-std) infinite; }
@media (hover: hover) { .tile:hover img { transform: scale(1.035); } }
.tile:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--lagoon); }
.tile.failed::after, .tile.unsent::after { content: "Tap to retry"; position: absolute; inset: 0 0 auto; padding: 6px; font-size: calc(12px * var(--ts)); color: #fff; background: rgba(0, 0, 0, .62); }
.tile.unsent::after { content: "Not sent · tap to retry"; }
.tile.tile-in { animation: pop var(--t-pop) var(--spring-pop) both; }
/* Five and more: the fourth cell dims and says how many are not shown; the viewer has them all. */
.tile.more { background: #000; }
.tile.more img { opacity: .42; }
.more-n { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 600 26px/1 var(--font-display); letter-spacing: -.02em; pointer-events: none; }
/* A tile's own reactions (the album's chips under the bubble are its last item's). */
.tile-rx { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 2px 6px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .45); font-size: calc(12px * var(--ts)); line-height: 1.3; }
.tile-play { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; }
.tile-play .ic { width: 18px; height: 18px; transform: translateX(1px); }
/* The time and ticks once, on a scrim across the album's foot. */
.bubble.album:not(.cap) .grid::after { content: ""; position: absolute; inset: auto 0 0; height: 56px; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0)); }
.bubble.album:not(.cap) > .body { z-index: 2; }
/* Ours on its way: a ring per photo turns until that photo is sent. */
.up { position: absolute; inset: 0; z-index: 2; margin: auto; width: 34px; height: 34px; border-radius: 50%; display: none; pointer-events: none;
  border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; box-shadow: 0 0 0 6px rgba(0, 0, 0, .28); animation: spin 900ms linear infinite; }
:is(.photo, .tile).sending > .up { display: block; }
:is(.photo, .tile).sending img { opacity: .78; }
.photo-get { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; padding: var(--s2) 14px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .62); color: #fff; font-size: calc(13px * var(--ts)); font-weight: 600; }
.voice { display: flex; align-items: center; gap: 8px; width: var(--card); max-width: 100%; padding: 2px 0 0; }
.voice .play { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: linear-gradient(140deg, var(--lagoon), var(--accent)); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform var(--t-overlay) var(--spring-press); }
.voice .play:active { transform: scale(.9); transition-duration: var(--t-press); }
.voice .play .ic { width: 18px; height: 18px; transform: translateX(1px); }
.voice.on .play .ic { transform: none; }
.voice.loading .play { animation: pulse 1s ease-in-out infinite; }
.wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.wave span { flex: 1; min-width: 2px; height: calc(var(--h) * 100%); border-radius: 2px; background: currentColor; opacity: .32; transition: opacity var(--t-fast), background var(--t-fast); }
.wave span.lit { opacity: 1; background: var(--accent-text); }
.wave { min-width: 0; overflow: hidden; gap: 1.5px; cursor: pointer; touch-action: none; border-radius: 4px; }
.wave span { min-width: 1.5px; }
.voice .speed { flex: none; display: grid; align-content: center; min-width: 44px; min-height: max(44px, calc(44px * var(--ts))); padding: 0; border: 0; border-radius: var(--r-pill); background: none;
  font-size: calc(14px * var(--ts)); font-weight: 650; font-variant-numeric: tabular-nums; }
.voice .speed > span { display: grid; place-items: center; min-height: max(32px, calc(32px * var(--ts))); padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text); }
.voice-time { flex: none; font-size: calc(13px * var(--ts)); font-variant-numeric: tabular-nums; color: color-mix(in srgb, currentColor 75%, transparent); min-width: 32px; }
.att { display: flex; flex-direction: column; gap: 6px; width: var(--card); max-width: 100%; }
.video-th { position: relative; border-radius: var(--r-s); overflow: hidden; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.video-th img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.video-badge { position: absolute; left: var(--s2); bottom: var(--s2); padding: 2px var(--s2); border-radius: var(--r-pill); background: rgba(0, 0, 0, .62); color: #fff; font-size: calc(12px * var(--ts)); }
.bubble .video-badge { font-size: calc(14px * var(--ts)); }
.att > .file, .bubble > .other { display: flex; align-items: center; gap: 10px; width: 100%; padding: var(--s2); border-radius: var(--r-s); background: color-mix(in srgb, var(--fg) 5%, transparent); }
.bubble > .other { width: var(--card); max-width: 100%; margin-top: 2px; }
/* Only emoji, one to three: larger, on the chat's ground with no bubble; the time in a small glass pill under it. */
.bubble.jumbo { background: none; box-shadow: none; padding: 0 2px; }
.bubble.jumbo .text { font: 40px/1.15 "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", var(--font); }
.bubble.jumbo .stamp { float: none; display: flex; width: fit-content; margin: 2px 0 0 auto; padding: 3px 7px; height: auto; border-radius: var(--r-pill);
  background: var(--glass); box-shadow: var(--shadow-1); color: var(--fg2); }
/* Animated emoji (emoji-anim.mjs): the glyph holds the place; a playing animation covers it, a little larger, as Noto's art fills its frame. */
.ae { position: relative; display: inline-block; }
.ae-p { position: absolute; left: 50%; top: 50%; width: 1.2em; height: 1.2em; transform: translate(-50%, -50%); pointer-events: none; }
.ae-play > .ae-g { opacity: 0; }
.file-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.file-name { font-weight: 600; font-size: calc(14px * var(--ts)); white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-meta { font-size: calc(12px * var(--ts)); color: var(--fg2); white-space: normal; }
.att .file-name { font-size: calc(16px * var(--ts)); }
.att .file-meta { font-size: calc(14px * var(--ts)); }
.file-save { flex: none; min-width: 44px; min-height: max(44px, calc(44px * var(--ts))); padding: 0 10px; border: 0; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text); font-size: calc(14px * var(--ts)); font-weight: 650; }
.bubble.mine .file-meta { color: color-mix(in srgb, currentColor 72%, transparent); }
a.link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 2px; word-break: break-all; }
.bubble.theirs .link { color: var(--accent-text); }
a.link:hover { text-decoration-color: currentColor; }

/* ── Composer ── */
.composer { position: relative; z-index: 2; display: flex; flex-direction: column; gap: var(--s2); padding: 10px max(18px, calc((100% - 780px) / 2)) var(--s4);
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
/* Send-anytime: why this chat sends later, or not from here. Calm, small, centred over the composer. */
.chat-note { align-self: center; max-width: 560px; padding: 6px 14px; border-radius: var(--r-pill); background: var(--raised); color: var(--fg2);
  font-size: var(--fs-sm); text-align: center; text-wrap: balance; box-shadow: var(--shadow-1); animation: rise var(--t-glide) var(--spring-glide) both; }
.composer-row .icon-btn { margin-bottom: 3px; }
.field { flex: 1; display: flex; border-radius: 24px; background: var(--fill); border: 1px solid transparent;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-mid) var(--ease-emph); }
.field:focus-within { background: var(--raised); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.field textarea { flex: 1; resize: none; max-height: 168px; overflow-y: hidden; padding: 11px var(--s4); border: 0; background: transparent; color: var(--fg); font: inherit; outline: none; }
.field textarea:disabled { cursor: not-allowed; }
/* A long name never wraps the placeholder onto a second line (which also grew the box): one line, an ellipsis. */
.field textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--fill-strong); color: var(--fg2);
  transform: scale(.88); transition: background var(--t-mid) var(--ease-emph), color var(--t-mid), transform var(--t-pop) var(--spring-pop), box-shadow var(--t-mid); }
.send .ic { width: var(--ic-l); height: var(--ic-l); transform: translateX(1px); transition: transform var(--t-pop) var(--spring-pop); }
.send.ready { background: linear-gradient(140deg, var(--lagoon), var(--accent)); color: #fff; transform: scale(1);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.send.ready .ic { transform: translateX(1px) rotate(-8deg); }
.send.ready:active, .send.record:active { transform: scale(.9); transition-duration: var(--t-press); }
.send.record { transform: scale(1); color: var(--fg); background: var(--fill); }
.send.record:hover { background: var(--fill-strong); }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: var(--s2) var(--s2) var(--s2) var(--s3); border-radius: var(--r-m); background: var(--fill); border-left: 3px solid var(--accent);
  animation: rise var(--t-glide) var(--spring-glide) both; }
.reply-bar .quote-text { -webkit-line-clamp: 1; }
.composer.editing .reply-bar { border-left-color: var(--tick); }
/* Recording replaces the row: a pulsing dot, the clock, and the microphone's live waveform */
.rec-bar { display: flex; align-items: center; gap: var(--s3); min-height: 54px; padding: 4px 4px 4px 18px; border-radius: 28px; background: var(--fill); animation: rise var(--t-glide) var(--spring-glide) both; }
.rec-dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.rec-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--danger); animation: ring-out var(--loop-live) var(--ease-out) infinite; }
.rec-clock { flex: none; font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 560; }
.rec-wave { display: flex; align-items: center; justify-content: flex-end; gap: 3px; height: 28px; overflow: hidden; }
.rec-wave span { flex: none; width: 3px; height: 100%; border-radius: 2px; background: var(--accent-text); transform: scaleY(var(--v, .08)); transition: transform 90ms linear; }
.pane.drop { outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: -10px; }
.empty { position: relative; margin: auto; padding: var(--s6); text-align: center; color: var(--fg2); animation: rise var(--t-screen) var(--ease-emph) both; }
.empty > h2 { color: var(--fg); margin: 26px 0 6px; font: 650 var(--fs-h1)/1.25 var(--font-display); letter-spacing: -.015em; }
.empty { max-width: 880px; width: 100%; text-align: start; display: flex; flex-direction: column; gap: var(--s4); }
.home-date { margin: 0 0 calc(-1 * var(--s3)); color: var(--accent-text); font-size: var(--fs-sm); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.home-hello { margin: 0; color: var(--fg); font: 700 clamp(1.6rem, 3.2vw, 2.4rem)/1.15 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.safe-hero { display: flex; align-items: center; gap: var(--s5); padding: var(--s5); border-radius: var(--r-l); background: var(--raised, var(--bg2)); border: 1px solid var(--line); }
.safe-hero h2 { color: var(--fg); margin: 0 0 4px; font: 650 var(--fs-h2, 1.25rem)/1.25 var(--font-display); }
.safe-hero p { margin: 0; }
.home-seal { position: relative; flex: none; width: 96px; height: 96px; display: grid; place-items: center; }
.hs-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent-text); opacity: 0; animation: hs-rise 3.6s linear infinite; }
.hs-ring:nth-child(2) { animation-delay: -1.2s; }
.hs-ring:nth-child(3) { animation-delay: -2.4s; }
.hs-core { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.hs-core .ic { width: 26px; height: 26px; }
@keyframes hs-rise { from { transform: scale(.6); opacity: .45; } to { transform: scale(1); opacity: 0; } }
:root[data-rm] .hs-ring { animation: none; opacity: .25; transform: scale(.8); }
@media (prefers-reduced-motion: reduce) { .hs-ring { animation: none; opacity: .25; transform: scale(.8); } .tip-in { animation: none; } }
.safe-over { margin: var(--s2) var(--s3); font-size: var(--fs-xs, .72rem); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.safe-tip { display: flex; align-items: center; gap: var(--s3); margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-l); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--fg); }
.safe-tip .ic { color: var(--accent-text); flex: none; }
.tip-in { animation: rise 600ms var(--ease-emph) both; }
@media (max-width: 520px) { .safe-hero { flex-direction: column; text-align: center; } }
.hint { font-size: var(--fs-sm); }

/* Emoji */
.emoji-pop { position: absolute; bottom: calc(100% - 4px); left: max(18px, calc((100% - 780px) / 2)); z-index: 5; width: min(360px, calc(100% - 16px));
  padding: var(--s2); border-radius: var(--r-l); background: var(--overlay); box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge); animation: pop-up var(--t-pop) var(--spring-pop) both; transform-origin: 0 100%; }

/* (fork 11-03) This contact's device lists disagree: held first in the chat, never folded away */
.fork-bar { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: var(--s3); padding: 10px 14px 10px var(--s4); background: var(--warn-bg); color: var(--warn-fg);
  border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.fork-bar .ic { flex: none; margin-top: 2px; }
.fork-title { font-weight: 650; }
.fork-detail { margin-top: 2px; color: var(--fg); }
.fork-action { margin-top: 4px; font-weight: 600; }

/* Offline: over the chat, not only in the list's header */
.offline { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px var(--s4); background: var(--warn-bg); color: var(--warn-fg);
  font-size: var(--fs-sm); font-weight: 560; animation: rise var(--t-glide) var(--spring-glide) both; }
.offline .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s var(--ease-std) infinite; }
.offline-try { flex: none; padding: 4px 10px; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: var(--r-pill); background: transparent; color: inherit; font-size: calc(12px * var(--ts)); font-weight: 650; }

/* Search in the open chat */
.find { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px var(--s4); border-bottom: 1px solid var(--line);
  color: var(--fg2); animation: rise var(--t-glide) var(--spring-glide) both; }
.find .ic { width: var(--ic-m); height: var(--ic-m); }
.find input { flex: 1; min-width: 0; min-height: 34px; border: 0; background: transparent; color: var(--fg); font: inherit; outline: none; }
.find-count { flex: none; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ── Toast: a quiet pill that springs up from the bottom ── */
.toast { position: fixed; left: 50%; bottom: max(96px, calc(env(safe-area-inset-bottom) + 84px)); /* above the composer (QC W-28) */ z-index: 50; padding: 10px 18px; border-radius: var(--r-pill); background: var(--fg); color: var(--ground);
  font-size: var(--fs-row); font-weight: 560; box-shadow: var(--shadow-2); opacity: 0; transform: translate(-50%, 16px) scale(.94); pointer-events: none;
  transition: opacity var(--t-mid) var(--ease-out), transform var(--t-pop) var(--spring-pop); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ── Menus: grow out of what opened them (the origin is set from the anchor), and fade back into it ── */
.menu { position: fixed; z-index: 60; min-width: 220px; padding: 6px; border-radius: var(--r-m); background: var(--overlay); box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge);
  border: 1px solid var(--line); transform-origin: top right; animation: menu-in var(--t-pop) var(--spring-pop) both; }
.menu.out { animation: menu-out 120ms var(--ease-in) both; pointer-events: none; }
.menu-item { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 9px var(--s3); border: 0; border-radius: 10px; background: transparent; text-align: left;
  font-size: calc(14px * var(--ts)); color: var(--fg); transition: background var(--t-fast), transform var(--t-overlay) var(--spring-press); animation: rise var(--t-row) var(--ease-emph) both; }
.menu-item:nth-child(2) { animation-delay: 15ms; } .menu-item:nth-child(3) { animation-delay: 30ms; } .menu-item:nth-child(4) { animation-delay: 45ms; }
.menu-item:nth-child(n + 5) { animation-delay: 60ms; }
.menu-item .ic { width: var(--ic-m); height: var(--ic-m); color: var(--fg2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--fill); outline: none; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-sep { height: 1px; margin: 5px var(--s2); background: var(--line); }

/* ── Sheets: grow from the control that opened them (--fx, --fy), shrink back into it on close ── */
.sheet { width: min(460px, calc(100vw - 24px)); max-height: min(720px, calc(100dvh - 40px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--raised); color: var(--fg);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in var(--t-settle) var(--spring-settle) both; }
.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in var(--t-mid) var(--ease-out) both; }
.sheet.closing { animation: sheet-out 180ms var(--ease-in) both; }
.sheet.closing::backdrop { animation: fade-out 180ms var(--ease-in) both; }
.sheet-head { display: flex; align-items: center; padding: var(--s4) var(--s3) var(--s2) 22px; }
.sheet-head h2 { margin: 0; font: 650 calc(22px * var(--ts))/1.2 var(--font-display); letter-spacing: -.015em; }
.sheet .sheet-head h2, .sheet-body > h2 { overflow-wrap: anywhere; }
/* Not every sheet button: GIF tiles, video and camera controls live in sheets too. */
.sheet .sheet-head .icon-btn { flex: none; min-width: 48px; min-height: 48px; }
.sheet-body { overflow-y: auto; padding: var(--s1) 18px var(--s5); }
.sheet-body > h2 { font-size: calc(22px * var(--ts)); }
.sheet-body > * { animation: rise var(--t-screen) var(--ease-emph) both 60ms; }
.small-sheet { width: min(420px, calc(100vw - 24px)); }
/* The app's own question (app.mjs ask): the commit on top, the way out last, full width (long labels never squeeze). */
.ask .sheet-body { padding: 22px 20px 18px; }
.ask h2 { margin: 0 0 6px; font: 650 calc(22px * var(--ts))/1.25 var(--font-display); letter-spacing: -.015em; }
.ask p { margin: 0 0 18px; }
.ask-actions { display: flex; flex-direction: column; gap: 6px; }
.send-hd { display: flex; justify-content: flex-start; margin: 0 0 var(--s2); }
.send-hd[hidden] { display: none; }
.ask-btn { min-height: 48px; padding: 10px 16px; border: 0; border-radius: var(--r-m); background: var(--fill); color: var(--fg); font-weight: 600;
  transition: background var(--t-fast), transform var(--t-overlay) var(--spring-press); }
.ask-btn:hover { background: var(--fill-strong); }
.ask-btn.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.ask-btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.ask-btn.quiet { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg2) 55%, transparent); } /* the safe way out: outlined, last */
.sec-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px; margin: var(--s1) 0 var(--s2); border-radius: var(--r-l);
  background: linear-gradient(140deg, color-mix(in srgb, var(--lagoon) 14%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)); }
.set-section { margin-top: 18px; }
.set-section h3 { margin: 0 0 6px 14px; font-size: calc(12px * var(--ts)); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--fg2); }
.set-card { border-radius: var(--r-l); background: var(--fill); overflow: hidden; }
.set-card > * + * { border-top: 1px solid color-mix(in srgb, var(--fg) 9%, transparent); }
.set-note { margin: 6px 14px 0; font-size: calc(16px * var(--ts)); line-height: calc(22px * var(--ts)); color: var(--fg2); overflow-wrap: anywhere; }
.set-note.warn { color: var(--warn-fg); }
.set-row { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 48px; padding: 10px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
div.set-row { cursor: default; flex-wrap: wrap; }
.set-row > .set-label.grow { min-width: 120px; }
.set-row > .seg { margin-inline-start: auto; background: var(--fill-strong); }
label.set-row:hover, button.set-row:hover { background: var(--pressed); }
/* Settings, as on the desktop: its places in the chat list's column, the chosen place in the chat area; at phone
   width the list fills the screen and a place steps in over it (docs/reviews/2026-11-03_web-desktop-settings-parity-design.md). */
.shell.set-open .side-main, .shell.set-open > .pane, .shell.set-open > .dock { display: none; }
.set-nav { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--raised); }
.set-nav-head { display: flex; align-items: center; gap: var(--s1); padding: max(var(--s3), env(safe-area-inset-top)) var(--s3) var(--s2) var(--s2); }
.set-nav-head h2 { margin: 0; font: 650 var(--fs-h2)/1.2 var(--font-display); letter-spacing: -.015em; }
.set-me { display: flex; align-items: center; gap: var(--s3); margin: 0 var(--s3) var(--s2); padding: var(--s3); border-radius: var(--r-l); background: var(--fill); min-width: 0; }
.set-me-ini { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; font: 650 19px/1 var(--font-display);
  background: linear-gradient(140deg, var(--lagoon), var(--accent)); }
.set-places { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s1) var(--s2) var(--s4); overscroll-behavior: contain; }
.set-nav-row { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: var(--r-m); background: transparent; color: var(--fg);
  font: inherit; text-align: start; cursor: pointer; animation: rise var(--t-screen) var(--ease-emph) both calc(var(--i, 0) * 30ms);
  transition: background var(--t-fast), transform var(--t-overlay) var(--spring-press); }
.set-nav-row:hover { background: var(--pressed); }
.set-nav-row:active { transform: scale(.985); }
.set-nav-row.on { background: var(--accent-soft); }
.set-nav-row.on .set-nav-name { color: var(--accent-text); }
.set-nav-words { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.set-nav-name { font-weight: 600; font-size: var(--fs-row); }
.set-nav-row .chev { display: none; color: var(--fg2); }
.set-tile { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; }
.set-tile[data-tint="violet"] { background: #7a64e8; } .set-tile[data-tint="red"] { background: #e8505e; } .set-tile[data-tint="green"] { background: #22a86c; }
.set-tile[data-tint="blue"] { background: #2f7de1; } .set-tile[data-tint="gray"] { background: #7d8592; } .set-tile[data-tint="orange"] { background: #e88a1a; }
.set-page { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; overflow-y: auto; background: var(--chat-ground); overscroll-behavior: contain; }
.set-page.enter .set-page-inner { animation: rise var(--t-screen) var(--ease-emph) both; }
.set-page-inner { max-width: 680px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 32px max(48px, env(safe-area-inset-bottom)); }
.set-overline { font-size: calc(11.5px * var(--ts)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.set-page-title { margin: 4px 0 0; font: 680 28px/1.15 var(--font-display); letter-spacing: -.02em; }
.set-page-title:focus { outline: none; }
.set-page-sum { margin: 4px 0 6px; }
/* One line under a Settings nav row: it ellipsizes (Codex WR-7 #4); 14 px, not the 16 px of explanations. */
.set-nav-sum { font-size: calc(14px * var(--ts)); color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-page .set-card { background: var(--raised); box-shadow: var(--shadow-1); }
.set-back { display: none; align-items: center; gap: 2px; margin: 0 0 6px -6px; padding: 6px; min-height: 44px; border: 0; background: transparent; color: var(--accent-text); font: 560 calc(15px * var(--ts))/1 inherit; cursor: pointer; }
@media (max-width: 760px) {
  .shell.set-open > .set-page { grid-column: 1; z-index: 31; }
  .shell[data-set-view="list"] > .set-page { display: none; }
  .set-nav-row .chev { display: block; }
  .set-nav-row.on { background: transparent; }
  .set-nav-row.on .set-nav-name { color: var(--fg); }
  .set-back { display: inline-flex; }
  .set-page-inner { padding: max(8px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); }
  .shell[data-set-view="page"] > .set-page.enter .set-page-inner { animation: set-push var(--t-screen) var(--ease-emph) both; }
}
/* Fingers: Apple's 44 pt for every choice in Settings. */
@media (pointer: coarse) { .set-page .seg button { min-height: 40px; padding-left: 14px; padding-right: 14px; } .set-nav-row { min-height: 60px; } }
@keyframes set-push { from { opacity: 0; transform: translateX(28px); } }
.set-label { font-weight: 560; }
.sub.wrap { white-space: normal; overflow: visible; display: block; line-height: 1.4; }
.sub.pad { padding: var(--s1) var(--s3) var(--s2); }
.sub.warn { color: var(--warn-fg); }
.sub.center { justify-content: center; }
.set-page .sub.wrap, .set-page-sum, .set-me .sub,
.sheet-body .sub.wrap, .sheet-body > p, .sheet-body .none {
  display: block; font-size: calc(16px * var(--ts)); line-height: calc(22px * var(--ts)); color: var(--fg2);
  white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip;
}
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: var(--fill-strong); position: relative; cursor: pointer;
  transition: background var(--t-mid) var(--ease-emph); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform var(--t-pop) var(--spring-pop); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 11px; background: var(--fill); }
.seg button { padding: 6px var(--s3); border: 0; border-radius: var(--r-xs); background: transparent; color: var(--fg2); font-size: calc(13px * var(--ts)); font-weight: 560;
  transition: background var(--t-mid) var(--ease-emph), color var(--t-fast), box-shadow var(--t-mid), transform var(--t-overlay) var(--spring-press); }
.seg button.on { background: var(--overlay); color: var(--fg); box-shadow: var(--shadow-1); }
.danger-btn { display: flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: 44px; margin-top: 18px; padding: var(--s3); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: var(--r-m); background: transparent; color: var(--danger); font-weight: 600; transition: background var(--t-fast), transform var(--t-overlay) var(--spring-press); }
.danger-btn:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
kbd.key { flex: none; min-width: 120px; padding: 4px var(--s2); border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--fill); font: 12.5px/1.3 ui-monospace, "Cascadia Mono", "SF Mono", monospace; }
.hero { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: 6px 0 14px; }
.hero-name { font: 650 var(--fs-h1)/1.25 var(--font-display); letter-spacing: -.015em; text-align: center; }
.hero-acts { display: flex; gap: 10px; margin-top: 14px; }
.hero-act { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 86px; padding: var(--s3) 6px 10px; border: 0; border-radius: var(--r-m);
  background: var(--fill); color: var(--accent-text); font-size: var(--fs-sm); font-weight: 600; transition: background var(--t-fast), transform var(--t-overlay) var(--spring-press); }
.hero-act:hover { background: var(--fill-strong); }
.hero-act:active { transform: scale(.94); transition-duration: var(--t-press); }
.hero-act span { color: var(--fg); }
.members .row { padding: 6px 4px; }

/* Photo viewer (app.mjs showPhotos): the photo on a dark shade over a blurred, dimmed copy of itself, so each photo
   brings its own light. The dialog itself is transparent: the shade, the copy and the bars fade in (opacity) while the
   photo flies out of its bubble (transform), and both run backwards on close. */
.viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: hidden; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer::backdrop { background: transparent; }
.viewer-shade { position: absolute; inset: 0; background: #05080b; }
.viewer-bg { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(56px) saturate(1.5) brightness(.55); opacity: .6; pointer-events: none; }
.viewer-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s1); padding: max(10px, env(safe-area-inset-top)) 12px 10px 20px;
  background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); }
.viewer-who { font: 650 var(--fs-title)/1.25 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-when { font-size: var(--fs-sm); color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .icon-btn { color: #fff; }
.viewer .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.viewer .icon-btn:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.viewer-stage { position: relative; z-index: 1; display: grid; place-items: center; min-height: 0; touch-action: none; }
.viewer-img { width: var(--iw, 60vw); height: var(--ih, 60vh); border-radius: 6px; box-shadow: 0 24px 80px rgba(0, 0, 0, .55); user-select: none; -webkit-user-select: none;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--z, 1)); transition: transform var(--t-overlay) var(--ease-emph); cursor: zoom-in; }
.viewer-img.blur { filter: blur(10px); }
.viewer-img.zoomed { cursor: grab; }
.viewer-img.drag { transition: none; }
.viewer-nav { position: absolute; top: 50%; z-index: 2; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%;
  background: rgba(20, 26, 34, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.viewer-nav.prev { left: 20px; }
.viewer-nav.next { right: 20px; }
.viewer-nav:disabled { opacity: 0; pointer-events: none; }
.viewer-strip { position: relative; z-index: 2; display: flex; gap: 6px; padding: 10px 20px max(16px, env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none;
  justify-content: safe center; }
.viewer-strip button { flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .08);
  opacity: .5; transform: scale(.88); transition: opacity var(--t-fast) var(--ease-std), transform var(--t-pop) var(--spring-pop); }
.viewer-strip button:hover { opacity: .85; }
.viewer-strip button[aria-current="true"] { opacity: 1; transform: none; box-shadow: 0 0 0 2px var(--lagoon); }
.viewer-strip button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.viewer-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Phone width: no strip (a swipe moves on), the arrows smaller and clear of the photo's edge on a touch screen. */
@media (max-width: 760px) {
  .viewer-strip { display: none; }
  .viewer[open] { grid-template-rows: auto minmax(0, 1fr) max(16px, env(safe-area-inset-bottom)); }
  .viewer-nav { width: 40px; height: 40px; margin-top: -20px; }
  .viewer-nav.prev { left: 8px; }
  .viewer-nav.next { right: 8px; }
}
@media (max-width: 760px) and (hover: none) { .viewer-nav { display: none; } }

/* Privacy screen */
/* X3: the cover is opaque and never blurs what is behind it (Advisor ruling 11-17). */
.veil { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px;
  background: var(--ground); color: var(--fg); text-align: center; cursor: pointer; } /* no fade-in: the cover is whole at once (Fable Low) */
.veil .title { margin: 0; font: 650 30px/38px var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.veil-mark { position: relative; width: 200px; height: 200px; display: grid; place-items: center; margin-bottom: 8px; }
.veil-mark::before, .veil-mark::after { content: ""; position: absolute; border-radius: 50%; }
.veil-mark::before { inset: 34px; border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.veil-mark::after { inset: 8px; border: 1px solid var(--line); }
.veil-mark .mark { width: 64px; height: 64px; }
.veil-mark .mark::before { content: none; } /* nothing loops on the cover */
.veil-mark .mark img { box-shadow: none; animation: none; }
.veil-show { min-height: 56px; min-width: 200px; padding: 0 40px; border: 0; border-radius: 28px; background: var(--accent); color: var(--accent-fg, #fff);
  font: 600 calc(17px * var(--ts))/1 var(--font-display); cursor: pointer; }
.veil-show:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
/* The Locked cover (addendum 11-18): a 56 px passcode field and Unlock, 300 px wide. */
.veil-lock { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(300px, 100%); cursor: default; }
.veil-lock .secret { width: 100%; }
.veil-lock input { width: 100%; min-height: 56px; padding: 0 52px 0 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--raised); color: var(--fg);
  font: inherit; font-size: calc(18px * var(--ts)); }
.veil-lock .veil-show { width: 100%; }

/* Passcode */
.lock-card input, .pass-form input { width: 100%; min-height: 48px; margin: 14px 0 6px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: var(--fill); color: var(--fg); font: inherit; font-size: calc(16px * var(--ts)); letter-spacing: .08em; outline: none; transition: border-color var(--t-fast), box-shadow var(--t-mid); }
.lock-card input:focus, .pass-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.lock-card button.primary { width: 100%; margin-top: var(--s2); min-height: 56px; }
.lock-card input { min-height: 56px; } /* X3 Locked: the field and Unlock are 56 px (senior rule) */
.card button.linkish, button.linkish { min-height: 0; border: 0; background: none; box-shadow: none; color: var(--accent-text); margin-top: 10px; padding: 6px; font-size: var(--fs-row); }
.err { color: var(--danger); min-height: 1.2em; }
.shake { animation: shake 360ms var(--ease-std); }
.pass-form h2 { margin: 6px 0 6px; font: 650 calc(22px * var(--ts))/1.2 var(--font-display); }
.pass-form input { margin: var(--s2) 0 0; }
.pass-form .actions { justify-content: flex-start; margin-top: var(--s3); }
/* The eye inside a passcode field: the box takes the field's margins so the eye sits centred in it. */
.secret { position: relative; }
.lock-card .secret { margin: 14px 0 6px; }
.pass-form .secret { margin: var(--s2) 0 0; }
.lock-card .secret input, .pass-form .secret input { margin: 0; padding-right: 52px; }
.secret button.secret-eye { position: absolute; top: 0; bottom: 0; margin: auto 0; right: 4px; width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; box-shadow: none; color: var(--fg2); }
.pass-form .secret button.secret-eye { min-height: 48px; }

/* Touch screens (iPad, phones): no hover, so a long press opens a message's menu; every target at least 44 px; the iOS callout off. */
.bubble { -webkit-touch-callout: none; }
@media (hover: none) {
  .bubble .tools { display: none; }
  .bubble, .row, .call-main, .tab, .chip, .rail-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  /* Under 16 px Safari zooms the whole page when a field takes the keyboard. */
  input, textarea, select { font-size: max(16px, calc(16px * var(--ts))) !important; }
  .search { min-height: 44px; }
  .who { min-height: 44px; }
  .send, .react-more, .offline-try, .call-now { min-width: 44px; min-height: 44px; }
  .ask-btn, .set-row, .dock-row, .pin-bar { min-height: 44px; }
  .row, .menu-item, .chip, .tab, .seg button, .card button.linkish { min-height: 44px; }
  .icon-btn, .icon-btn.small, .jump { width: 44px; height: 44px; }
  .voice .play { width: 44px; height: 44px; }
  .react-row button { width: 44px; height: 44px; }
  .react::after { content: ""; position: absolute; inset: 50% -4px auto; height: max(44px, 100%); transform: translateY(-50%); }
  .row:hover, .who:hover, label.set-row:hover { background: transparent; }
  .row.on:hover { background: var(--accent-soft); }
}
/* Installed on an iPad or iPhone: clear of the notch, the rounded corners and the home bar. */
.composer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.list { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.shell { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* ── Keyframes: transform and opacity only ── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes flip { from { opacity: 0; transform: translateY(14px) rotateX(70deg); } }
@keyframes send-in { from { opacity: 0; transform: translateY(26px) scale(.94); } }
@keyframes recv-in { from { opacity: 0; transform: translateX(-18px) scale(.96); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes scan { 0% { opacity: 0; transform: translateY(-100%); } 12% { opacity: 1; } 55% { opacity: 1; } 70%, 100% { opacity: 0; transform: translateY(340%); } }
@keyframes breathe { 0%, 100% { opacity: .2; transform: scale(.94); } 50% { opacity: .9; transform: scale(1.04); } }
@keyframes breathe-soft { 0%, 100% { opacity: .85; transform: scale(.98); } 50% { opacity: 1; transform: scale(1); } }
@keyframes ring-out { from { opacity: .55; transform: scale(1); } to { opacity: 0; transform: scale(2.8); } }
@keyframes ripple { from { opacity: .8; transform: scale(.95); } to { opacity: 0; transform: scale(1.9); } }
@keyframes bob { 0%, 60%, 100% { opacity: .45; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes pop-up { from { opacity: 0; transform: translateY(8px) scale(.9); } }
@keyframes menu-in { from { opacity: 0; transform: scale(.9); } }
@keyframes menu-out { to { opacity: 0; transform: scale(.96); } }
@keyframes sheet-in { from { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 24px)) scale(.9); } }
@keyframes sheet-out { to { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 16px)) scale(.94); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pill-in { from { background-color: transparent; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes flash { 0%, 100% { opacity: 0; } 25%, 60% { opacity: 1; } }

/* View Transitions: the list reorders by gliding; at phone width a chat pushes in (its avatar flies to the header) and
   pops back; with two panes the chat cross-fades in place. */
::view-transition-group(*) { animation-duration: var(--t-glide); animation-timing-function: var(--spring-glide); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--t-mid); animation-timing-function: var(--ease-out); }
@media (max-width: 760px) {
  html[data-vt="forward"]::view-transition-old(root) { animation: var(--t-mid) var(--ease-in) both vt-out-left; }
  html[data-vt="forward"]::view-transition-new(root) { animation: var(--t-screen) var(--spring-settle) both vt-in-right; }
  html[data-vt="back"]::view-transition-old(root) { animation: var(--t-mid) var(--ease-in) both vt-out-right; }
  html[data-vt="back"]::view-transition-new(root) { animation: var(--t-screen) var(--spring-settle) both vt-in-left; }
  html[data-vt]::view-transition-group(*) { animation-duration: var(--t-screen); animation-timing-function: var(--spring-settle); }
}
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-12%); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(18%); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(18%); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-12%); } }

/* ── Emoji panel ── */
.ep { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: min(336px, calc(100vw - 48px)); }
.ep-search { width: 100%; min-height: 34px; padding: 0 var(--s3); border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--fg); font-size: calc(13.5px * var(--ts)); }
.ep-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ep-tabs { display: flex; gap: 2px; }
.ep-tab { flex: 1; height: 32px; border: 0; border-radius: var(--r-xs); background: transparent; font-size: 17px; line-height: 1; }
.ep-tab:hover, .ep-tab:focus-visible { background: var(--fill); outline: none; }
.ep-scroll { height: 240px; overflow-y: auto; scrollbar-width: thin; }
.ep-head { position: sticky; top: 0; z-index: 1; padding: 6px 4px 4px; background: var(--overlay); color: var(--fg2); font-size: calc(12px * var(--ts)); font-weight: 650; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; }
.ep-e { height: 36px; border: 0; border-radius: 10px; background: transparent; font-size: 21px; line-height: 1; transition: transform var(--t-overlay) var(--spring-press), background var(--t-fast); }
.ep-e:hover, .ep-e:focus-visible { background: var(--fill); transform: scale(1.14); outline: none; }
@media (hover: none) { .ep-e { height: 44px; } .ep-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); } }
.react-more { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--fg2); display: grid; place-items: center; }
.react-more:hover, .react-more:focus-visible { background: var(--fill); color: var(--fg); outline: none; }
.react-more .ic { width: 18px; height: 18px; }
.anchor-spot { position: fixed; width: 0; height: 0; }

/* ── Formatting: *bold* _italic_ ~strike~ `code` ── */
.text strong { font-weight: 700; }
.text code { padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, currentColor 10%, transparent); font: .93em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; }

/* ── A timer's line, a draft in the list, the star on a bubble ── */
.bubble.sysline { align-self: center; display: flex; align-items: center; gap: 6px; max-width: min(88%, 460px); margin: var(--s3) 0 var(--s1); padding: 6px var(--s3); border-radius: var(--r-m);
  background: color-mix(in srgb, var(--raised) 78%, transparent); color: var(--fg2); font-size: calc(12.5px * var(--ts)); line-height: 1.35; text-align: center; box-shadow: var(--shadow-1); }
.bubble.sysline .ic { flex: none; }
.draft-tag { color: var(--accent-text); font-weight: 650; }
.stamp .ic.tiny-t:has(.fill) { color: var(--accent-text); }

/* ── Cards: poll ── */
.bubble > .other.poll { display: block; padding: var(--s3); }
.poll-options { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: 6px; }
.poll-options li { display: flex; align-items: flex-start; gap: var(--s2); font-size: calc(14px * var(--ts)); line-height: 1.35; overflow-wrap: anywhere; }
.poll-options i { flex: none; width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid color-mix(in srgb, currentColor 60%, transparent); border-radius: 50%; }
.poll-options .many i { border-radius: 3px; }
.other a.link { display: inline-block; margin-top: 3px; font-size: calc(13px * var(--ts)); font-weight: 600; }

/* ── Pinned messages, over the chat ── */
.pin-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 7px max(18px, calc((100% - 780px) / 2)); border: 0; border-bottom: 1px solid var(--line); background: var(--raised); text-align: left; color: var(--fg); }
.pin-bar:hover { background: var(--fill); }
.pin-bar > .ic { color: var(--accent-text); }
.pin-bar .grow { min-width: 0; }
.pin-label { display: block; color: var(--accent-text); font-size: calc(12px * var(--ts)); font-weight: 650; }
.pin-text { display: block; font-size: calc(13px * var(--ts)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Select many ── */
.msgs.picking .bubble { cursor: pointer; }
.msgs.picking .tools { display: none; }
.bubble.picked::after { opacity: 1; box-shadow: 0 0 0 2.5px var(--accent); }
/* A solid ring and a tick instead of a tint over the words: the chosen one reads clearly, not washed out (QC W-20). */
.bubble.picked::before { content: "¹3"; position: absolute; top: -8px; left: -8px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 20px; text-align: center; pointer-events: none; }
.tile.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.select-bar { display: flex; align-items: center; gap: var(--s1); padding: var(--s3) max(14px, calc((100% - 780px) / 2)); border-top: 1px solid var(--line); }
.pick-count { min-width: 0; padding: 0 var(--s2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-bar .icon-btn:disabled { opacity: .35; }
.day { cursor: pointer; }

/* ── The dock: details beside the chat from 1180 px; below that it covers the chat, the list stays ── */
@media (min-width: 1180px) { .shell.docked { grid-template-columns: clamp(336px, 31vw, 430px) minmax(0, 1fr) 372px; } .dock { grid-column: 3; } }
.shell > .side { grid-column: 1; grid-row: 1; }
.shell > .pane { grid-column: 2; grid-row: 1; }
.shell { grid-template-rows: minmax(0, 1fr); }
@media (max-width: 1179.98px) { .dock { grid-column: 2; grid-row: 1; z-index: 8; } }
@media (max-width: 760px) { .shell > .pane, .dock { grid-column: 1; } .dock { z-index: 31; } } /* over the search box (30) too */
.dock { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--raised); border-left: 1px solid var(--line); overflow: hidden; animation: dock-in var(--t-overlay) var(--spring-glide) both; }
@keyframes dock-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.dock .sheet-head { gap: var(--s2); padding: 12px var(--s4) 10px 10px; }
.dock .sheet-head h2 { font-size: var(--fs-title); }
.overline { color: var(--accent-text); font-size: calc(11.5px * var(--ts)); font-weight: 650; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--s3) var(--s5); scrollbar-width: thin; }
/* A wash of the person's own ink (their avatar's) behind who they are: the panel belongs to them. */
.dock-hero { position: relative; margin: 0 calc(var(--s3) * -1) var(--s3); padding: var(--s6) var(--s4) var(--s4);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 16%, var(--raised)), color-mix(in srgb, var(--ink) 4%, var(--raised)) 62%, var(--raised)); }
.dock .avatar.huge { width: 112px; height: 112px; font-size: 40px; animation: none; box-shadow: 0 0 0 4px var(--raised), var(--shadow-2); }
.dock-hero .hero-act { background: color-mix(in srgb, var(--raised) 68%, transparent); }
.dock-hero .hero-act:hover { background: var(--raised); }
.dock-card { margin-bottom: var(--s2); padding: 4px; border-radius: var(--r-m); background: var(--fill); }
.dock-card h3 { margin: 8px 12px 2px; color: var(--accent-text); font-size: calc(11.5px * var(--ts)); font-weight: 650; letter-spacing: .02em; }
.dock-row { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 10px var(--s3); border: 0; border-radius: var(--r-s); background: transparent; color: var(--fg); text-align: left; }
button.dock-row:hover { background: var(--pressed); }
.dock-row > .ic:first-child { color: var(--fg2); }
.timer-pick { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s3) 10px; }
.dock-row .grow { min-width: 0; }
.dock-foot { padding: var(--s2) var(--s3) 0; }
.gal-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 0 var(--s2) var(--s2); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; margin-top: var(--s2); }
.gal-tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--r-xs); background: var(--fill-strong); color: var(--fg2); overflow: hidden; display: grid; place-items: center; transition: transform var(--t-overlay) var(--spring-press); }
.gal-tile:hover { transform: scale(.97); }
.gal-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gal-list { display: grid; gap: 2px; margin-top: var(--s2); }
.gal-link, .gal-doc { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 10px var(--s3); border: 0; border-radius: var(--r-s); background: transparent; color: var(--fg); text-align: left; text-decoration: none; min-width: 0; }
.gal-link { flex-direction: column; align-items: flex-start; gap: 2px; }
.gal-link:hover, .gal-doc:hover { background: var(--fill); }
.gal-doc .grow { min-width: 0; }
.link-url { max-width: 100%; color: var(--accent-text); font-size: calc(13.5px * var(--ts)); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.star-row { display: flex; align-items: flex-start; gap: var(--s1); padding: 2px 0; border-bottom: 1px solid var(--line); }
.star-go { flex: 1; min-width: 0; padding: 10px var(--s2); border: 0; border-radius: var(--r-s); background: transparent; color: var(--fg); text-align: left; }
.star-go:hover { background: var(--fill); }
.star-top { display: flex; justify-content: space-between; gap: var(--s2); }
.star-top .sub { flex: none; font-size: calc(11.5px * var(--ts)); }
.star-who { min-width: 0; color: var(--accent-text); font-size: calc(12.5px * var(--ts)); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-words { margin-top: 2px; font-size: calc(13.5px * var(--ts)); line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.star-row .icon-btn { color: var(--accent-text); margin-top: 6px; }

/* ── Sheets about messages ── */
.fw-list { max-height: 360px; overflow-y: auto; margin: var(--s2) 0; }
.fw-list .row { min-height: 48px; padding: 4px 10px; }
.fw-list .avatar { width: 36px; height: 36px; }
.fw-list .row:disabled { opacity: .5; cursor: default; }
.fw-check { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--fg2); border-radius: 4px; }
.fw-check .ic { width: 16px; height: 16px; visibility: hidden; }
.fw-list [aria-checked='true'] .fw-check { border-color: var(--accent-text); color: var(--accent-text); }
.fw-list [aria-checked='true'] .fw-check .ic { visibility: visible; }
.sheet-body > .search { margin: 0; }
.info-words { padding: var(--s3); border-radius: var(--r-s); background: var(--fill); font-size: calc(16px * var(--ts)); line-height: calc(22px * var(--ts)); color: var(--fg2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow-y: auto; user-select: text; }
.info-row { display: flex; align-items: flex-start; gap: var(--s3); padding: 10px 2px 0; }
.info-row .ic { margin-top: 3px; color: var(--fg2); }
.info-row .ic.read-ink { color: var(--tick); }
.info-label { flex: none; width: 74px; font-size: calc(13.5px * var(--ts)); font-weight: 600; }
.version { margin-top: var(--s3); }
.version .overline { margin-bottom: 4px; color: var(--fg2); }
.version.now .overline { color: var(--accent-text); }
.version.now .info-words { background: var(--accent-soft); }
.cal-head { display: flex; align-items: center; gap: var(--s2); }
.cal-name { text-align: center; font-weight: 650; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: var(--s2) 0; }
.cal-dow { padding: 4px 0; text-align: center; color: var(--fg2); font-size: calc(12px * var(--ts)); }
.cal-day { aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; color: var(--fg2); font-size: calc(13.5px * var(--ts)); opacity: .5; }
.cal-day.has { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; opacity: 1; cursor: pointer; transition: transform var(--t-overlay) var(--spring-press); }
.cal-day.has:hover, .cal-day.has:focus-visible { transform: scale(1.1); outline: 2px solid var(--accent); outline-offset: -2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ── Phone width: one pane at a time ── */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell.open .side, .shell:not(.open) .pane { display: none; }
  .side { border-right: 0; }
  .back { display: inline-grid; }
  .bubble { max-width: 84%; }
  .card { margin-top: var(--s4); padding: 26px var(--s5) 22px; }
  .search kbd { display: none; }
  /* Room for voice and video in the header: search in the chat stays under the chat's menu. */
  .head-find { display: none; }
  /* Narrow: only the More button beside the bubble (React and Reply are in its menu), so three stacked buttons never spill over the bubble above. */
  .bubble .tools { top: 50%; flex-direction: column; }
  .bubble .tools .tool:not(:last-child) { display: none; }
  .bubble.mine .tools { right: calc(100% + 6px); }
  .bubble.theirs .tools { left: calc(100% + 6px); }
  .bubble .tools::before { top: 0; bottom: 0; width: 10px; }
  .msgs { padding-left: var(--s3); padding-right: var(--s3); }
  .composer { padding-left: var(--s2); padding-right: var(--s2); }
}
@media (max-width: 760px) and (hover: none) {
}

/* ── Calls: the stage is always dark, whatever the theme, as video reads best on black ── */
.call { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: #f2f5f9; outline: 0; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0, rgba(69, 189, 201, .12), transparent 70%), #05070a; }
.call[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fade-in var(--t-mid) var(--ease-out) both; }
.call::backdrop { background: #05070a; }
.call-top { z-index: 2; display: flex; align-items: center; gap: var(--s2); min-height: 56px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.call-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--fs-title)/1.3 var(--font-display); }
.call-name[hidden], .call-clock[hidden], .call-safe[hidden], .call-bars[hidden] { display: none; }
.call-clock { color: #dfe5ee; font-size: var(--fs-body, 15px); font-weight: 500; font-variant-numeric: tabular-nums; }
.call-safe { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(69, 189, 201, .16); color: #45bdc9; font-size: var(--fs-cap); font-weight: 600; }
.call-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; padding: 4px; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.call-bars:focus-visible { outline: 2px solid #45bdc9; outline-offset: 1px; }
.call-info { position: absolute; z-index: 3; top: 56px; right: max(16px, env(safe-area-inset-right)); width: min(280px, calc(100% - 32px)); padding: 10px 14px; border-radius: 12px; background: rgba(27, 29, 34, .94); color: #f2f5f9; font: 400 var(--fs-sm)/1.35 var(--font); }
.call-info[hidden] { display: none; }
.call-info-h { font-weight: 600; margin-bottom: 6px; }
.call-info dl { margin: 0; display: grid; gap: 2px; }
.call-info dt { color: #a9b2bf; margin-top: 4px; }
.call-info dd { margin: 0; }
.call-chip.call-zoom { top: auto; bottom: var(--s3); }
/* Remote zoom: the whole frame, small, with the part on screen boxed; only while the other camera sends a close-up. */
.call-lens { --lw: 96px; position: absolute; z-index: 2; left: max(var(--s3), env(safe-area-inset-left)); bottom: var(--s3); width: var(--lw); border-radius: 6px; background: rgba(0, 0, 0, .45); box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); overflow: hidden; pointer-events: none; }
.call-lens[hidden] { display: none; }
.call-lens i { position: absolute; box-sizing: border-box; border: 2px solid #45bdc9; border-radius: 2px; }
@media (max-width: 480px) { .call-lens { --lw: 64px; bottom: calc(var(--s3) + 44px); } }
.call-bars i { width: 4px; border-radius: 2px; background: currentColor; }
.call-bars i:nth-child(1) { height: 6px; } .call-bars i:nth-child(2) { height: 10px; } .call-bars i:nth-child(3) { height: 14px; }
.call-bars[data-q="good"] { color: #45bdc9; }
.call-bars[data-q="fair"] { color: #e7b25e; } .call-bars[data-q="fair"] i:nth-child(3) { opacity: .3; }
.call-bars[data-q="poor"] { color: #ff8a80; } .call-bars[data-q="poor"] i:nth-child(n+2) { opacity: .3; }
.call-mid { position: relative; min-height: 0; overflow: hidden; display: grid; place-items: center; }
.call-soft { position: absolute; inset: -8%; width: 116%; height: 116%; filter: blur(32px) saturate(1.15) brightness(.55); opacity: 0; transition: opacity var(--t-slow) var(--ease-out); }
.call-soft[data-on="1"] { opacity: 1; }
.call-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; touch-action: none; transform: translate(var(--zx, 0), var(--zy, 0)) scale(var(--zs, 1)); }
.call-pic[hidden] { display: none; }
.call-voice { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: 0 var(--s4); max-width: 100%; text-align: center; }
.call-voice[hidden] { display: none; }
.call-halo { --lv: 0; position: relative; display: grid; place-items: center; margin-bottom: var(--s3); }
.call-halo::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: rgba(69, 189, 201, .16); transform: scale(calc(1 + var(--lv) * .22)); opacity: calc(.45 + var(--lv) * .55); transition: transform var(--t-quick) var(--ease-out), opacity var(--t-quick) var(--ease-out); }
.call[data-state="calling"] .call-halo::before { animation: call-breathe var(--loop-ring) var(--ease-std) infinite; }
@keyframes call-breathe { from { transform: scale(.94); opacity: .7; } to { transform: scale(1.5); opacity: 0; } }
.avatar.call-av { position: relative; width: clamp(88px, 22vmin, 152px); height: clamp(88px, 22vmin, 152px); font-size: clamp(30px, 7.5vmin, 52px); }
.call-who { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 650 clamp(20px, 3.8vmin, 28px)/1.25 var(--font-display); letter-spacing: -.01em; }
.call-line { min-height: 20px; color: #9aa4b4; font-size: calc(14px * var(--ts)); font-variant-numeric: tabular-nums; }
.call-self { position: absolute; z-index: 1; width: clamp(112px, 24vw, 240px); aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: var(--r-m); overflow: hidden; background: #000; cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .16); }
.call-self[hidden] { display: none; }
.call-self.tall { width: clamp(88px, 15vw, 150px); }
.call-self.s1 { width: clamp(160px, 34vw, 340px); } .call-self.tall.s1 { width: clamp(120px, 22vw, 220px); }
.call-self.s2 { width: clamp(220px, 46vw, 480px); } .call-self.tall.s2 { width: clamp(160px, 30vw, 300px); }
.call-self { -webkit-touch-callout: none; user-select: none; transition: width var(--t-mid) var(--ease-std); }
@media (prefers-reduced-motion: reduce) { .call-self { transition: none; } }
.call-self video { display: block; width: 100%; height: 100%; object-fit: contain; }
.call-self video.mirror { transform: scaleX(-1); }
.call-pic.mirror { transform: translate(var(--zx, 0), var(--zy, 0)) scale(var(--zs, 1)) scaleX(-1); }
.call-self:focus-visible { outline: 2px solid #45bdc9; outline-offset: 2px; }
.call-self.c0 { top: var(--s4); left: var(--s4); } .call-self.c1 { top: var(--s4); right: var(--s4); }
.call-self.c2 { bottom: var(--s4); left: var(--s4); } .call-self.c3 { bottom: var(--s4); right: var(--s4); }
/* The self view sits top right, under the top bar and clear of the controls, above every layer a tap could land on;
   it never moves when the controls fade. Tapping it swaps it with the big picture. */
.call-self.c1, .call-self.c3 { top: calc(max(var(--s4), env(safe-area-inset-top)) + 64px); right: max(var(--s4), env(safe-area-inset-right)); bottom: auto; left: auto; z-index: 4; }
.call-chip { position: absolute; z-index: 2; top: var(--s3); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px 14px; border: 0; border-radius: var(--r-pill); background: rgba(36, 42, 52, .94); color: #f2f5f9; font: 500 var(--fs-sm)/1.35 var(--font); cursor: pointer; }
.call-chip[hidden] { display: none; }
.call-sharing { z-index: 3; display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: 8px 14px; background: rgba(36, 42, 52, .94); color: #f2f5f9; font: 500 var(--fs-sm)/1.35 var(--font); }
.call-sharing[hidden], .call-theirs[hidden] { display: none; }
.call-chip-stop { border: 0; border-radius: var(--r-pill); padding: 6px 14px; background: #e5534b; color: #fff; font: inherit; cursor: pointer; }
.call-theirs { position: absolute; z-index: 2; bottom: var(--s3); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 6px 12px; border-radius: var(--r-pill); background: rgba(36, 42, 52, .94); color: #f2f5f9; font: 500 var(--fs-sm)/1.35 var(--font); pointer-events: none; }
.call-bar { z-index: 2; display: flex; justify-content: center; align-items: flex-start; gap: clamp(12px, 3vw, 24px); padding: var(--s3) max(var(--s4), env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(var(--s4), env(safe-area-inset-left)); background: linear-gradient(transparent, rgba(0, 0, 0, .38)); transition: opacity var(--t-mid) var(--ease-std); }
.call-top { transition: opacity var(--t-mid) var(--ease-std); }
.call.idle .call-bar, .call.idle .call-top { opacity: 0; pointer-events: none; }
@media (min-width: 700px) { .call-disc { width: 64px; height: 64px; } .call-disc .ic { width: 26px; height: 26px; } .call-btn.end .call-disc { width: 88px; } .call-btn { font-size: var(--fs-sm); gap: 8px; } .call-lab { color: #c3cbd8; } .call-clock { font-size: var(--fs-title, 17px); } }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: #f2f5f9; font: 500 var(--fs-cap)/1.2 var(--font); cursor: pointer; }
.call-btn:disabled { opacity: .5; cursor: default; }
.call-disc { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .13); transition: background var(--t-fast) var(--ease-std), transform var(--t-press) var(--spring-press); }
.call-disc .ic { width: 22px; height: 22px; }
.call-btn:hover .call-disc { background: rgba(255, 255, 255, .22); }
.call-btn:active .call-disc { transform: scale(.92); }
.call-btn:focus-visible .call-disc { outline: 2px solid #45bdc9; outline-offset: 2px; }
.call-btn:focus-visible { outline: 0; }
.call-btn.off .call-disc { background: #f2f5f9; color: #0b1220; }
.call-btn.end .call-disc { width: 72px; border-radius: var(--r-pill); background: #d9362c; color: #fff; }
.call-btn.end:hover .call-disc { background: #e8483e; }
.call-lab { color: #9aa4b4; }
.call-devices { position: absolute; z-index: 3; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); translate: -50% 0; display: grid; gap: var(--s3); width: min(380px, calc(100% - 24px)); padding: var(--s4); border-radius: var(--r-l); background: #1c212a; box-shadow: 0 16px 48px rgba(0, 0, 0, .55); animation: rise var(--t-quick) var(--ease-emph) both; }
.call-devices[hidden] { display: none; }
.call-dev { display: grid; gap: 4px; color: #9aa4b4; font-size: var(--fs-sm); }
.call-dev[hidden] { display: none; }
.call-dev select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-s); background: #242a34; color: #f2f5f9; font: 400 calc(14px * var(--ts)) var(--font); }
.call-ended { position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); padding: var(--s5); text-align: center; background: #05070a; animation: fade-in var(--t-mid) var(--ease-out) both; }
.call-ended[hidden] { display: none; }
.call-end-av { opacity: .6; margin-bottom: var(--s2); }
.call-end-note { max-width: 420px; color: #9aa4b4; font-size: calc(14px * var(--ts)); line-height: 1.45; font-variant-numeric: tabular-nums; }
.call-end-note.bad { color: #ff8a80; }
.call-end-close { margin-top: var(--s3); min-height: 40px; padding: 0 var(--s5); border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .13); color: #45bdc9; font: 600 calc(14px * var(--ts)) var(--font); cursor: pointer; }
.call-end-close[hidden] { display: none; }
@media (max-height: 520px) { .call-disc { width: 44px; height: 44px; } .call-btn.end .call-disc { width: 60px; } .call-lab { display: none; } .call-top { min-height: 44px; } .call-devices { bottom: 72px; } }
@media (max-width: 420px) { .call-lab { display: none; } .call-devices { bottom: calc(84px + env(safe-area-inset-bottom)); } }

.ringcard { position: fixed; inset: auto max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) auto; z-index: 45; width: min(360px, calc(100vw - 24px)); margin: 0; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--overlay); color: var(--fg); box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge); }
.ringcard[open] { display: grid; gap: var(--s3); animation: rise var(--t-settle) var(--spring-settle) both; }
.ringcard::backdrop { background: var(--scrim); }
.ring-head { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.ring-av { position: relative; flex: none; display: grid; place-items: center; }
.ring-av::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: var(--accent); opacity: .22; animation: call-breathe var(--loop-ring) var(--ease-std) infinite; }
.ring-av .avatar { position: relative; }
.ring-av > .ic { position: relative; width: 26px; height: 26px; margin: 10px; color: var(--accent-text); }
.ring-text { min-width: 0; }
.ring-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 650 var(--fs-title)/1.3 var(--font-display); }
.ring-kind { display: flex; align-items: center; gap: 4px; color: var(--fg2); font-size: var(--fs-sm); }
.ring-why { margin: 0; color: var(--fg2); font-size: var(--fs-sm); line-height: 1.4; }
.ring-why[hidden] { display: none; }
.ring-act { display: flex; gap: var(--s2); }
.ring-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 var(--s2); border: 0; border-radius: var(--r-pill); font: 600 var(--fs-row)/1 var(--font); cursor: pointer; transition: transform var(--t-press) var(--spring-press); }
.ring-btn:active { transform: scale(.95); }
.ring-btn .ic { width: 18px; height: 18px; }
.ring-btn.no { background: #d9362c; color: #fff; }
.ring-btn.yes { background: var(--accent); color: var(--accent-fg); }
/* A group voice call (web-group-call.mjs): the Join bar in its chat, and the call's small panel, always dark like the 1:1 stage. */
.gcall-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s3); padding: 8px 14px 8px var(--s4); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.gcall-bar[hidden] { display: none; }
.gcall-join { min-height: 34px; padding: 0 var(--s4); border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-fg); font: 600 var(--fs-row)/1 var(--font); cursor: pointer; }
.gcall-join:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.gcall { position: fixed; inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto; z-index: 44; display: grid; gap: var(--s2); width: min(340px, calc(100vw - 32px)); max-height: min(70vh, 560px); padding: var(--s4); border-radius: var(--r-l); background: #0b1220; color: #f2f5f9; box-shadow: var(--shadow-2); }
.gcall[hidden] { display: none; }
.gcall-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcall-status, .gcall-sub { color: #c3cbd8; font-size: var(--fs-sm); }
.gcall-people { display: grid; gap: 6px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.gcall-person { display: flex; align-items: center; gap: var(--s2); min-width: 0; padding: 4px; border-radius: 10px; }
.gcall-person .avatar { width: 32px; height: 32px; flex: none; box-shadow: 0 0 0 2px transparent; transition: box-shadow var(--t-fast) var(--ease-std); }
.gcall-person.speaking .avatar { box-shadow: 0 0 0 2px #45bdc9; }
.gcall-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcall-bar-btns { display: flex; justify-content: center; gap: var(--s5, 24px); padding-top: var(--s2); }
@media (prefers-reduced-motion: reduce) { .gcall-person .avatar { transition: none; } }
.ring-btn.plain { background: var(--fill); color: var(--fg); }
@media (max-width: 760px) { .ringcard { inset: max(12px, env(safe-area-inset-top)) 12px auto 12px; width: auto; } }

.bubble.callcard { padding: 0; }
.bubble.callcard.folded { display: none; }
.callfold { align-self: center; display: inline-flex; align-items: center; gap: var(--s2); margin: var(--s1) auto; padding: 6px 14px; border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--fg2); font: inherit; font-size: var(--fs-sm); cursor: pointer; transition: background var(--t-fast) var(--ease-std); }
.callfold:hover { background: var(--pressed); }
.callfold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.callcard-go { display: flex; align-items: center; gap: var(--s3); min-width: 196px; padding: 10px 14px 10px 10px; border: 0; border-radius: inherit; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.callcard-go:hover { background: var(--pressed); }
.callcard-disc { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.callcard.missed .callcard-disc { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.callcard-words { display: grid; gap: 1px; min-width: 0; }
.callcard-title { font-weight: 600; font-size: var(--fs-row); }
.callcard.missed .callcard-title { color: var(--danger); }
.callcard-sub { display: flex; align-items: center; gap: 4px; color: var(--fg2); font-size: calc(13px * var(--ts)); font-variant-numeric: tabular-nums; }
.callcard-dir { flex: none; width: var(--ic-xs); height: var(--ic-xs); color: var(--accent-text); }
.callcard.missed .callcard-dir { color: var(--danger); }

/* ── The navigation: every place named and one press away. A labelled column on a wide window, icons with a tip on a
   narrower one, a bar along the bottom at phone width. One selected place, marked by colour and a bar, never colour alone. ── */
.side-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rail { flex: none; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s3) 0 var(--s2); min-height: 0; overflow-y: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--accent) 5%, var(--ground)); border-right: 1px solid var(--line); }
.rail-sep { flex: none; width: 24px; height: 1px; margin: var(--s1) 0; background: var(--line); }
.rail > .grow { flex: 1; }
.rail-btn { position: relative; flex: none; width: 44px; height: 44px; border-radius: var(--r-m); color: var(--fg2);
  transition: background var(--t-fast) var(--ease-std), color var(--t-fast) var(--ease-std), border-radius var(--t-mid) var(--spring-press), transform var(--t-overlay) var(--spring-press); }
.rail-btn:hover { background: var(--pressed); color: var(--fg); }
.rail-btn.on { background: var(--accent-soft); color: var(--accent-text); border-radius: var(--r-s); }
.rail-btn.on::before { content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); animation: grow-y var(--t-mid) var(--spring-settle) both; }
.rail-letter { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--fill-strong); color: var(--fg); font: 650 13px/1 var(--font-display); }
.rail-btn.on .rail-letter { background: var(--accent); color: var(--accent-fg); }
/* The bell's unread dot: a mark, never a count. */
.rail-dot { position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--ground); }
.bell-list { display: grid; gap: 4px; margin: 8px 0 4px; max-height: min(60vh, 520px); overflow: auto; }
.bell-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; }
.bell-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; }
.bell-row.new .bell-dot { background: var(--accent); }
.bell-what { font-size: calc(16px * var(--ts)); line-height: 22px; }
.bell-row.new .bell-what { font-weight: 650; }
.rail-badge { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-fg); font: 700 10.5px/17px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
@media (min-width: 761px) {
  /* Icons only: the name is a tip beside the button on hover or keyboard focus. Fixed, so the scrolling rail never clips
     it; its left/top come from the button's own box (railBtn, owner bug 11-12: a width-based offset put it under the
     search icon). */
  .rail-text { position: fixed; z-index: 30; padding: 5px 10px; border-radius: var(--r-xs); background: var(--fg); color: var(--ground); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
    pointer-events: none; opacity: 0; transform: translate(-6px, -50%) scale(.94); transform-origin: left center; transition: opacity var(--t-fast) var(--ease-in), transform var(--t-fast) var(--ease-in); }
  .rail-btn:hover .rail-text, .rail-btn:focus-visible .rail-text { opacity: 1; transform: translate(0, -50%); transition: opacity var(--t-quick) var(--ease-out) 300ms, transform var(--t-pop) var(--spring-pop) 300ms; }
  .rail-btn:focus-visible .rail-text { transition-delay: 0ms; }
  .side { flex-direction: row; border-right: 0; }
  .tabs, .chip.list-chip { display: none; }
  .search { margin-top: 2px; }
  .pane, .dock { margin: var(--s2) var(--s2) var(--s2) 0; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-2); }
  .pane-head { border-top-left-radius: inherit; border-top-right-radius: inherit; }
}
/* Wide enough for words: the names stand beside the icons. An open side panel takes that room back (icons only again). */
@media (min-width: 1200px), (min-width: 1024px) and (hover: none) and (pointer: coarse) {
  .shell:not(.docked) { grid-template-columns: calc(clamp(336px, 31vw, 430px) + 128px) minmax(0, 1fr); }
  .shell:not(.docked) .rail { width: 192px; align-items: stretch; padding-left: 10px; padding-right: 10px; }
  .shell:not(.docked) .rail-btn { width: auto; min-height: 40px; display: flex; align-items: center; justify-content: flex-start; gap: var(--s3); padding: 0 10px; border-radius: var(--r-s); }
  .shell:not(.docked) .rail-text { position: static; padding: 0; border-radius: 0; background: none; color: inherit; font-size: var(--fs-row); font-weight: 560; opacity: 1; transform: none; transition: none;
    overflow: hidden; text-overflow: ellipsis; }
  .shell:not(.docked) .rail-btn.on .rail-text { font-weight: 650; }
  .shell:not(.docked) .rail-btn.rail-list { padding-left: 6px; }
  .shell:not(.docked) .rail-badge { position: static; margin-left: auto; flex: none; }
  .shell:not(.docked) .rail-sep { width: auto; margin: var(--s2) 10px; }
}
/* Phone width: a bar along the bottom with the five places a thumb needs; lists, Archived and Lock stay in the chat list and its menu. */
@media (max-width: 760px) {
  .side { flex-direction: column; }
  .tabs { display: none; }
  .rail { order: 2; width: auto; flex-direction: row; align-items: stretch; justify-content: space-around; gap: 0; overflow: visible;
    padding: 4px max(var(--s2), env(safe-area-inset-left)) max(4px, env(safe-area-inset-bottom)) max(var(--s2), env(safe-area-inset-right));
    border-right: 0; border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
  .rail-sep, .rail > .grow, .rail-list, .rail-btn[data-key="newlist"], .rail-btn[data-key="archived"], .rail-btn[data-key="lock"] { display: none; }
  .rail-btn { flex: 1 1 0; min-width: 0; width: auto; max-width: 96px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--r-s); }
  .rail-btn, .rail-btn:hover, .rail-btn.on { background: transparent; }
  .rail-btn .ic { box-sizing: content-box; padding: 3px 16px; border-radius: var(--r-pill); transition: background var(--t-mid) var(--ease-emph); }
  .rail-btn.on .ic { background: var(--accent-soft); animation: pill-in var(--t-mid) var(--ease-out) both; }
  .rail-btn.on::before { display: none; }
  .rail-text { font-size: 11px; font-weight: 600; }
  /* Large text: six places in 390 px. A word may take a second line, and if the bar still overflows it scrolls sideways, so every place stays reachable (D-WD56c). */
  .rail-text { max-width: 100%; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
  .rail { overflow-x: auto; scrollbar-width: none; }
  .rail-badge { top: 2px; right: auto; left: calc(50% + 6px); }
}

.archive-row { color: var(--fg2); min-height: 46px; }
.archive-row .ic { flex: none; margin: 0 10px 0 6px; }
.hit-row { min-height: 54px; }
.hit-words { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-words mark { background: color-mix(in srgb, var(--accent) 26%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Polls that can be voted on: the share of voters fills behind each answer. */
.poll-options li { display: block; }
.poll-opt { position: relative; isolation: isolate; display: flex; align-items: flex-start; gap: var(--s2); width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r-xs); background: color-mix(in srgb, var(--fg) 4%, transparent); color: inherit; font: inherit; line-height: 1.35; text-align: start; overflow: hidden; }
button.poll-opt { cursor: pointer; }
button.poll-opt:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.poll-fill { position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--accent) 20%, transparent); transform: scaleX(var(--share, 0)); transform-origin: left; transition: transform var(--t-mid) var(--spring-glide); }
.poll-n { flex: none; color: var(--fg2); font-size: calc(12.5px * var(--ts)); font-variant-numeric: tabular-nums; }
.poll-options li.on i { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--raised); }
.poll-edit { display: grid; gap: var(--s2); margin: var(--s2) 0; }
.sheet-input { display: block; box-sizing: border-box; width: 100%; padding: 10px var(--s3); border: 1px solid var(--line); border-radius: var(--r-s); background: var(--fill); color: var(--fg); font: inherit; resize: vertical; }
.sheet-input:focus { outline: none; background: var(--raised); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.sheet-body > .sheet-input { margin: var(--s2) 0; }
.note-box { margin: var(--s1) 0; }
button.set-link { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; }
button.set-link:hover { background: var(--pressed); }

/* The preview of a link, made by whoever sent it. */
.link-card { display: flex; gap: 10px; margin-top: 6px; padding: var(--s2); border-radius: var(--r-s); background: color-mix(in srgb, var(--fg) 5%, transparent); color: inherit; text-decoration: none; overflow: hidden; }
.link-card:hover { background: color-mix(in srgb, var(--fg) 9%, transparent); }
.link-card img { flex: none; width: 58px; height: 58px; border-radius: var(--r-xs); object-fit: cover; }
.link-title, .link-desc, .link-site { display: block; overflow-wrap: anywhere; }
.link-title { font-weight: 600; font-size: calc(14px * var(--ts)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-desc { font-size: calc(13px * var(--ts)); color: var(--fg2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-site { font-size: calc(12px * var(--ts)); color: var(--accent-text); margin-top: 2px; }

/* Saved replies over the box. */
.quick-pop { display: grid; gap: 2px; margin: 0 var(--s2) 6px; padding: var(--s1); border-radius: var(--r-m); background: var(--overlay); box-shadow: var(--shadow-2); animation: rise var(--t-quick) var(--ease-emph) both; }
.quick-pop[hidden] { display: none; }
.quick-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border: 0; border-radius: var(--r-s); background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.quick-item.on, .quick-item:hover { background: var(--accent-soft); }
.quick-name { flex: none; color: var(--accent-text); font-weight: 650; }
.quick-words { color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A chat's own wallpaper: this browser's, drawn over the standard rings. */
.msgs[data-wall="plain"], .msgs[data-wall="rings"] { background: transparent; }
.msgs[data-wall="dusk"] { background: radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--ink-2) 16%, transparent), transparent 70%), linear-gradient(to top, color-mix(in srgb, var(--ink-5) 9%, var(--chat-ground)), var(--chat-ground)); }
.msgs[data-wall="tide"] { background: radial-gradient(110% 80% at 10% 100%, color-mix(in srgb, var(--lagoon) 18%, transparent), transparent 70%), var(--chat-ground); }
.msgs[data-wall="moss"] { background: radial-gradient(120% 90% at 15% 0%, color-mix(in srgb, var(--ink-4) 15%, transparent), transparent 70%), linear-gradient(to top, color-mix(in srgb, var(--ink-6) 7%, var(--chat-ground)), var(--chat-ground)); }
.msgs[data-wall="ember"] { background: radial-gradient(110% 80% at 90% 100%, color-mix(in srgb, var(--ink-3) 18%, transparent), transparent 70%), var(--chat-ground); }
@media (hover: none) { .poll-opt { min-height: 44px; } .quick-item { min-height: 44px; } }
.other .linkish { display: inline; margin-top: 3px; padding: 0; border: 0; background: none; color: var(--accent-text); font: 600 calc(13px * var(--ts))/1.35 var(--font); cursor: pointer; }
.other .linkish + .linkish { margin-left: var(--s3); }

/* ── Command bar: the search box, with what it can do under it ── */
.search-slot { position: relative; z-index: 30; }
.cmd { position: absolute; top: calc(100% - 2px); left: var(--s3); width: min(520px, calc(100vw - var(--s6))); display: flex; flex-direction: column; max-height: min(560px, calc(var(--app-h, 100dvh) - 190px));
  border-radius: var(--r-l); background: var(--overlay); box-shadow: var(--shadow-2), inset 0 1px 0 var(--edge); border: 1px solid var(--line); overflow: hidden;
  transform-origin: top left; animation: cmd-in var(--t-mid) var(--spring-settle) both; }
@keyframes cmd-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.cmd-chips { display: flex; flex: none; gap: 6px; padding: var(--s3) var(--s3) 0; overflow-x: auto; scrollbar-width: none; }
.cmd-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.cmd-head { margin: var(--s2) 10px var(--s1); color: var(--fg2); font-size: var(--fs-cap); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.cmd-row { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 6px 10px; border-radius: var(--r-s); cursor: pointer; }
.cmd-row .avatar { width: 36px; height: 36px; font-size: 13px; }
.cmd-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cmd-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--fill); color: var(--fg2); }
.cmd-row.on .cmd-ic { background: var(--raised); color: var(--accent-text); }
.cmd-row.calls .cmd-ic { background: var(--accent); color: var(--accent-fg); }
.cmd-label { font-size: var(--fs-body); font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-hint { font-size: var(--fs-sm); color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-enter { flex: none; visibility: hidden; font: 11px/1 var(--font); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--raised); color: var(--fg2); }
.cmd-row.on .cmd-enter { visibility: visible; }
.cmd-none { margin: 0; padding: var(--s5) var(--s4); text-align: center; color: var(--fg2); }
.cmd-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); padding: 7px var(--s4); border-top: 1px solid var(--line); color: var(--fg2); font-size: var(--fs-cap); }
.cmd-foot > span { white-space: nowrap; }
.cmd-private { white-space: nowrap; }
@media (max-width: 760px), (hover: none) { .cmd-keys, .cmd-enter { display: none; } .cmd-foot { justify-content: center; } }
@media (max-width: 760px) { .cmd { left: var(--s3); right: var(--s3); width: auto; } .cmd-row { min-height: 56px; } }

/* A Calls row with no chat behind it says why it does nothing. */
.call-nochat { margin-top: 2px; color: var(--fg2); font-size: var(--fs-sm); line-height: 1.35; white-space: normal; }
/* The pinned banner's way to unpin, beside it rather than inside its button. */
.pin-wrap { position: relative; z-index: 2; flex: none; }
.pin-wrap .pin-bar { padding-right: calc(max(18px, (100% - 780px) / 2) + 36px); }
.pin-x { position: absolute; z-index: 3; top: 50%; right: max(10px, calc((100% - 780px) / 2)); transform: translateY(-50%); }
.pin-x:active { transform: translateY(-50%) scale(.9); }
.who-emoji { font-size: 22px; line-height: 1; }
/* An address that may not be what it looks like: marked before anyone clicks. */
.link.risky { color: var(--danger); text-decoration: underline wavy; text-underline-offset: 3px; }
a.risky { cursor: pointer; } /* no href (it asks first), so the hand is set here */
.link-card.risky .link-site, .gal-link.risky .link-url { color: var(--danger); }

/* ── A call minimized: a slim bar over the top of the app and a small floating picture (call-ui.mjs). Always dark, like the call. ── */
.call-min { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, .1); color: #f2f5f9; font: 600 var(--fs-sm)/1 var(--font); cursor: pointer; }
.call-min:hover { background: rgba(255, 255, 255, .18); }
.call-min .ic { width: 18px; height: 18px; }
.call-mini { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); background: #0d4f57; color: #f2f5f9; cursor: pointer; }
.call-mini[hidden], .call-tile[hidden] { display: none; }
.mini-go { display: flex; flex: 1; align-items: center; gap: var(--s2); min-width: 0; min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: inherit; font: 600 var(--fs-sm)/1.2 var(--font); text-align: left; cursor: pointer; }
.mini-go .ic { flex: none; width: 18px; height: 18px; }
.mini-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-clock { flex: none; font-variant-numeric: tabular-nums; opacity: .85; }
.mini-ret { margin-left: auto; flex: none; opacity: .85; font-weight: 500; }
.mini-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #f2f5f9; cursor: pointer; }
.mini-btn.off { background: #f2f5f9; color: #0d4f57; }
.mini-btn.end { background: #d9453b; color: #fff; }
.mini-btn .ic { width: 20px; height: 20px; }
.mini-go:focus-visible, .mini-btn:focus-visible, .call-tile:focus-visible, .call-min:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
html.callbar body { box-sizing: border-box; padding-top: calc(44px + env(safe-area-inset-top)); }
.call-tile { position: fixed; z-index: 30; right: var(--s4); bottom: var(--s4); width: clamp(120px, 28vw, 220px); aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: var(--r-m); overflow: hidden; background: #000; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); cursor: grab; touch-action: none; }
.call-tile video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
@media (max-width: 520px) { .mini-ret { display: none; } .call-min span { display: none; } .call-min { width: 44px; padding: 0; justify-content: center; } }

/* Text size (Settings, Appearance): one multiplier for every --fs-* size and every calc(Npx * var(--ts)). Android's
   steps (Small .9, Large 1.15, Larger 1.3), then up to twice the size (owner 11-17, senior-friendly). */
:root[data-ts="small"] { --ts: .9; }
:root[data-ts="large"] { --ts: 1.15; }
:root[data-ts="larger"] { --ts: 1.3; }
:root[data-ts="xlarge"] { --ts: 1.5; }
:root[data-ts="xxlarge"] { --ts: 1.75; }
:root[data-ts="largest"] { --ts: 2; }
/* Past Larger: every place in the left bar keeps its word, short and under its icon (two lines at most), never a
   hover-only tip; the bar scrolls when the places no longer fit. Interim form until Design sets it from the PC shots. */
@media (min-width: 761px) {
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell { grid-template-columns: calc(clamp(336px, 31vw, 430px) + 56px) minmax(0, 1fr); }
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell .rail { width: 120px; align-items: stretch; padding-left: 6px; padding-right: 6px; overflow-y: auto; }
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell .rail-btn { width: auto; height: auto; min-height: 56px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px; padding: 8px 4px; border-radius: var(--r-s); }
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell .rail-text { position: static; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    max-width: 100%; padding: 0; border-radius: 0; background: none; color: inherit; font-size: calc(11px * var(--ts)); font-weight: 600; line-height: 1.15; text-align: center;
    white-space: normal; overflow: hidden; overflow-wrap: break-word; opacity: 1; transform: none; transition: none; }
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell .rail-badge { position: absolute; top: 4px; right: 6px; margin: 0; }
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell .rail-btn.on::before { left: -6px; }
  :root:is([data-ts="xlarge"], [data-ts="xxlarge"], [data-ts="largest"]) .shell .rail-sep { width: auto; margin: var(--s2) 10px; }
}
/* The bottom bar at phone width: its words grow, up to what five places side by side can hold, on two lines. */
@media (max-width: 760px) {
  .rail-text { font-size: min(calc(11px * var(--ts)), 15px); line-height: 1.15; text-align: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}
/* The text size chooser: seven steps as a list of big choices, never a row cut off at the side. */
.set-row.stack { flex-wrap: wrap; }
.set-row.stack > .set-label { flex-basis: 100%; }
.set-row.stack > .seg { margin: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10em), 1fr)); gap: 4px; }
.set-row.stack > .seg button { min-height: 48px; font-size: var(--fs-body); }
/* Button rows wrap instead of cutting the last button off at a large size. */
.hero-acts, .row-acts { flex-wrap: wrap; }
/* Voice preview before sending. */
.rec-bar.review .rec-dot { display: none; }
.rec-play { flex: none; }
.rec-bar.review .rec-wave { justify-content: flex-start; }
.rec-bar.review .rec-wave span { transform: scaleY(var(--v, .08)); transition: none; }
.store-note { padding: 0 var(--s4) var(--s2); }
.safety-digits { padding: var(--s2) var(--s4); font: 560 calc(15px * var(--ts))/1.6 ui-monospace, "Cascadia Mono", "SF Mono", monospace; letter-spacing: .04em; word-spacing: .3em; user-select: all; }

/* ── Chat screen redesign 2026-11-03 (docs/reviews/2026-11-03_web-chat-screen-redesign-design.md) ──
   WhatsApp's edge-to-edge panes and runs, Apple's large title, glass bars, solid sent colour and 44 pt targets. */
/* One app, not a card beside a list: the chat runs edge to edge, a hairline between; both headers 64 px so their lines meet. */
@media (min-width: 761px) {
  .pane, .dock { margin: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .pane-head { border-radius: 0; }
}
.side-head, .pane-head { min-height: 64px; }
.pane-head { background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
/* The list's large title (the brand mark is on the app's icon and tab already). */
.side-head .mark { display: none; }
.side-head .brand { font: 760 27px/1.1 var(--font-display); letter-spacing: -.025em; }
.side-head .status { margin-top: 2px; }
/* Rows: a little taller, bigger faces, the line between them starting where the words do. */
.list .row { min-height: 70px; padding: 10px 12px; border-radius: 14px; }
.list .row .avatar { width: 50px; height: 50px; }
.list .row:not(.on) + .row:not(.on)::after { content: ""; position: absolute; left: 74px; right: 12px; top: -1px; height: 1px; background: var(--line); pointer-events: none; }
.list .row:hover::after, .list .row:hover + .row::after { opacity: 0; }
/* Sent: the accent, solid, light words on it (Apple); received: the raised surface with a hairline. */
:root { --mine-top: #0a7884; --mine: #086c76; --mine-fg: #ffffff; --mine-tick: #c9f3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mine-top: #57cbd6; --mine: #44b9c5; --mine-fg: #04161b; --mine-tick: #063f8c; } }
:root[data-theme="dark"] { --mine-top: #57cbd6; --mine: #44b9c5; --mine-fg: #04161b; --mine-tick: #063f8c; }
.bubble { border-radius: 18px; }
.bubble.theirs { box-shadow: var(--shadow-1), inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); }
.bubble.mine { box-shadow: 0 1px 2px color-mix(in srgb, var(--mine) 35%, transparent); --stamp-ink: 90%; }
.bubble + .bubble:not(.cont) { margin-top: 10px; }
/* Everything inside a sent bubble takes its light-on-colour form. */
.bubble.mine .tick.read { color: var(--mine-tick); }
.bubble.mine .quote { background: color-mix(in srgb, currentColor 14%, transparent); border-left-color: currentColor; }
.bubble.mine .quote-who, .bubble.mine .more-btn, .bubble.mine a { color: inherit; }
.bubble.mine a { text-decoration: underline; text-underline-offset: 2px; }
.bubble.mine .voice .play { background: var(--mine-fg); color: var(--mine); box-shadow: none; }
.bubble.mine .wave span.lit { background: currentColor; }
.bubble.mine .callcard-disc { background: color-mix(in srgb, currentColor 18%, transparent); color: inherit; }
.bubble.mine .callcard-dir, .bubble.mine .callcard-sub { color: inherit; }
.bubble.mine .callcard-sub { opacity: .8; }
.bubble.mine .file-meta, .bubble.mine .sub { color: color-mix(in srgb, currentColor 78%, transparent); }
/* The composer: a + for attach, a capsule field with the emoji button inside its right edge, a round accent send or mic. */
.composer { background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.composer-row { align-items: flex-end; gap: 8px; }
.field { align-items: flex-end; border-radius: 22px; }
.field .in-field { flex: none; margin: 0 4px 3px 0; }
.send.record { background: linear-gradient(140deg, var(--lagoon), var(--accent)); color: #fff; }
.chat-note { padding: 5px 12px; font-size: calc(12.5px * var(--ts)); box-shadow: none; background: var(--fill); }
/* Menus: Apple's frosted panel, rows a finger can hit on a touch screen. */
.menu { border-radius: 14px; background: color-mix(in srgb, var(--overlay) 86%, transparent); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
@media (pointer: coarse) { .menu-item { min-height: 44px; } .composer-row .icon-btn, .pane-head .icon-btn { min-width: 44px; min-height: 44px; } }
/* Call events: one slim line inside the conversation, still a button that calls back. */
.callcard-go { min-width: 0; gap: 10px; padding: 6px 12px 6px 6px; }
.callcard-disc { width: 28px; height: 28px; }
.callcard-words { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.callcard-title { font-size: var(--fs-sm); }
/* Review fixes: the mic keeps its colour on hover; red and accent marks never sit on the sent colour; an opaque menu where blur is missing; the emoji button does not grow a one-line field on touch. */
.send.record:hover { background: linear-gradient(140deg, var(--lagoon), var(--accent)); filter: brightness(1.08); }
.bubble.mine .callcard.missed .callcard-title, .bubble.mine .stamp .ic.tiny-t:has(.fill) { color: inherit; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .menu { background: var(--overlay); } }
@media (pointer: coarse) { .field .in-field { margin-bottom: 0; } }
/* Message focus (docs/reviews/2026-11-03_message-focus-design.md): the message a menu is about stands out, the rest steps back. */
.msgs.focusing :is(.bubble, .day, .chat-note) { transition: opacity 160ms ease, filter 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.msgs.focusing :is(.bubble:not(.focus-msg), .day, .chat-note) { opacity: .35; filter: blur(1.5px); }
.msgs.focusing .bubble.focus-msg { position: relative; z-index: 1; transform: scale(1.02); box-shadow: var(--shadow-2); }
@media (prefers-reduced-motion: reduce) { .msgs.focusing :is(.bubble, .day, .chat-note) { transition: none; } .msgs.focusing .bubble.focus-msg { transform: none; } }
/* Calls: the people called most, as faces above the list (docs/reviews/2026-11-03_calls-tab-redesign-design.md). */
.call-faves { display: flex; gap: 2px; padding: 2px 6px 8px; overflow-x: auto; scrollbar-width: none; }
.call-faves::-webkit-scrollbar { display: none; }
.fave { flex: none; display: grid; justify-items: center; gap: 6px; width: 72px; padding: 8px 4px 6px; border: 0; border-radius: 14px; background: transparent; color: inherit; cursor: pointer;
  transition: transform var(--t-overlay) var(--spring-press), background-color var(--t-overlay) ease; }
.fave:hover, .fave[aria-expanded="true"] { background: var(--pressed); }
.fave:active { transform: scale(.96); transition-duration: var(--t-press); }
.fave .avatar { width: 52px; height: 52px; font-size: 17px; }
.fave-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 550; }
@media (prefers-reduced-motion: reduce) { .fave, .fave:active { transition: none; transform: none; } }
/* QC fixes 2026-11-03 (docs/runtime-validation/2026-11-03_web-ui-qc-coverage.md). */
/* W-02: a link inside a sent bubble takes the bubble's own ink. */
.bubble.mine .linkish { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* W-05: the info panel's four actions share its width instead of overflowing it. */
.hero-acts { width: 100%; max-width: 380px; }
.hero-act { flex: 1 1 0; width: auto; min-width: 0; padding-left: 4px; padding-right: 4px; }
.hero-act > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* W-17, W-14: the main action of a sheet is the accent; disabled looks disabled. */
.ask-btn.primary { background: var(--accent); color: var(--accent-fg, #fff); }
.ask-btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.ask-btn:disabled { opacity: .45; cursor: default; }
.ask-btn:disabled:hover { background: var(--fill); }
.ask-btn.primary:disabled:hover { background: var(--accent); }

/* A chat this browser cannot send in: the composer looks as inert as it is (QC W-15). */
.composer.off .composer-row { opacity: .5; }
.menu-item.off { opacity: .6; cursor: default; }
.menu-item.off:hover { background: transparent; }
.quick-hint { padding: 8px 10px; color: var(--fg2); font-size: var(--fs-row); }
/* Ctrl+A outside a field no longer paints the whole app; message text stays selectable (QC W-23). */
.side, .rail, .pane-head { -webkit-user-select: none; user-select: none; }
.side input, .side textarea, .pane-head input { -webkit-user-select: text; user-select: text; }
/* One line at every width: "· linked" shrinks with an ellipsis before it wraps (QC W-27). */
.side-head .status { flex-wrap: nowrap; }
.side-head .status .st-rest { flex: 0 100000 auto; }
/* The chips scroll sideways with a fade at the right edge as the cue that more follow (QC W-27). */
.chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
/* The command bar stays inside the list column it opens under (QC W-25). */
.cmd { width: calc(100% - 2 * var(--s3)); max-width: 520px; }
/* Search filters (docs/reviews/2026-11-03_search-filters-design.md): in place of the chat chips while searching. */
.find-kinds { display: none; }
.side-main.finding > .find-kinds { display: flex; }
.side-main.finding > .chips:not(.find-kinds) { display: none; }

/* ── Device linking (docs/reviews/2026-11-03_device-linking-redesign-design.md): steps beside a large code, code check, loading ── */
.link-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.card-out { position: absolute; left: 0; right: 0; pointer-events: none; animation: link-out 180ms var(--ease-emph) forwards; }
.link-wide { max-width: 420px; }
.link-qr { display: flex; flex-direction: column; align-items: center; }
.link-text { text-align: left; }
.link-text .overline { display: flex; align-items: center; gap: var(--s2); margin: 0; font-size: var(--fs-sm); font-weight: 650; letter-spacing: .02em; color: var(--accent-text); }
.link-text h2 { margin-top: var(--s2); }
.link-text .steps { max-width: none; margin: var(--s4) 0 var(--s3); }
.link-text .steps b { font-weight: 650; color: var(--fg); }
.lock-note { display: flex; align-items: flex-start; gap: var(--s2); margin: var(--s3) 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--fg2); }
.lock-note .ic { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.loading .lock-note { justify-content: center; align-items: center; }
.card button.linkish { min-height: 44px; }
.renew { width: 100%; max-width: 264px; height: 3px; margin: 2px 0 var(--s2); border-radius: 2px; background: var(--fill); overflow: hidden; }
.renew i { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: drain 270s linear forwards; }
.indet { width: 160px; height: 4px; margin: var(--s4) auto 0; border-radius: 2px; background: var(--fill); overflow: hidden; }
.indet i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--accent); animation: indet 1.2s var(--ease-std) infinite; }
.code span { animation: rise var(--t-screen) var(--ease-emph) both; animation-delay: calc(120ms + var(--i) * 90ms); }
.mark.linking::before { inset: -8px; border-radius: 50%; border-width: 3px; border-color: var(--fill); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.qr-frame::after { animation-duration: 5.4s; }
@keyframes link-out { to { opacity: 0; transform: scale(.96); } }
@keyframes drain { to { transform: scaleX(0); } }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (min-width: 56.25em) {
  .link-wide { max-width: 880px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 56px; align-items: center; padding: 48px; }
  .link-wide .link-qr { grid-column: 2; grid-row: 1; }
  .link-wide .link-text { grid-column: 1; grid-row: 1; }
  .link-wide h2 { font-size: 2.125rem; }
  .link-wide .qr-code { width: 264px; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .code span, .steps li, .card-out { animation-name: fade-in; }
  .card-out { animation-name: fade-out; }
  .qr-frame::after, .wait-dot::after, .mark::before, .mark img { animation: none; }
  .mark.linking::before { animation: none; }
  .renew { display: none; } /* a still bar would say nothing about the renewal */
  .indet i { animation: none; }
  .indet i { width: 100%; opacity: .5; }
}
.card[tabindex="-1"]:focus { outline: none; }
.cam-view { display: block; width: 100%; max-height: 55vh; object-fit: contain; border-radius: var(--r-m); background: #000; margin-bottom: var(--s2); }
/* Settings > Reduce motion: the same stillness as the system's setting. */
:root[data-rm] *, :root[data-rm] *::before, :root[data-rm] *::after, :root[data-rm]::view-transition-group(*), :root[data-rm]::view-transition-old(*), :root[data-rm]::view-transition-new(*) {
  animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }

/* Touch: sticky :hover after a tap is cleared, keyboard-only hints go, the rest of the 44 px targets, swipe-to-reply keeps vertical scroll. */
@media (hover: none) {
  :is(.icon-btn, .chip, .menu-item, .set-nav-row, button.set-link, .callcard-go, .quick-item, .gal-link, .gal-doc, .star-go, .fave):hover:not(.on):not([aria-expanded="true"]) { background: transparent; }
  .search kbd, .cmd-keys, .cmd-enter { display: none; }
  .ep-tab, .quick-item, .star-go, .gal-link, .gal-doc, .poll-opt { min-height: 44px; }
}
@media (pointer: coarse) { .bubble { touch-action: pan-y; } }

/* QA 11-05: the chat a row menu is about stays marked, and the menu names it. */
.menu-on { background: color-mix(in srgb, var(--accent) 14%, transparent) !important; }
.menu-who { margin: 0; padding: 6px 12px 8px; font-weight: 650; color: var(--fg); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid var(--line); }

/* QA 11-05: what is picked shows before it is sent. */
.send-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0 12px; max-height: 50vh; overflow: auto; }
.send-tile { margin: 0; aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; background: var(--bg2, color-mix(in srgb, var(--fg) 6%, transparent)); display: grid; place-items: center; text-align: center; padding: 4px; }
.send-tile img { width: 100%; height: 100%; object-fit: cover; }
.send-tile figcaption { font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* QA 11-05: every touch target at least 44 px on touch screens (Apple HIG), the iPad status line kept whole. */
@media (pointer: coarse) {
  .chip { min-height: 44px; min-width: 44px; padding: 0 14px; }
  .jump { width: 48px; height: 48px; }
  .set-page .seg button { min-height: 44px; }
}

/* Contacts from this browser (2026-11-05): actions on a request row, and the Add contact row. */
.row-acts { display: flex; gap: 6px; flex: none; }
.ask-btn.row-act { min-height: 48px; padding: 6px 12px; font-size: calc(13px * var(--ts)); }
.row.person.add-contact { color: var(--accent-text, var(--accent)); font-weight: 600; gap: 12px; }
.row.person.add-contact .ic { width: 22px; height: 22px; margin: 0 9px; }
.add-found { margin-top: 10px; }
@media (pointer: coarse) { .ask-btn.row-act { min-height: 44px; } }
/* Two buttons (a request for you) go under the name, so a list column never squeezes the name to an initial. */
.row.person:has(.row-acts > :nth-child(2)) { flex-wrap: wrap; row-gap: 8px; }
.row.person:has(.row-acts > :nth-child(2)) .row-acts { flex-basis: 100%; padding-left: 58px; }
.row.person:has(.row-acts > :nth-child(2)) .row-acts { justify-content: flex-end; }
.row.person:has(.row-acts > :nth-child(2)) .row-acts .ask-btn { min-width: 96px; } /* W-01: two even buttons, not two bars across the list */

button.dock-row.danger { color: var(--danger); }
/* UX round 11-06: an admin in the members list, a quiet pill (desktop GroupInfoPanel). */
.badge.admin { width: auto; padding: 0 8px; font-size: calc(11px * var(--ts)); font-weight: 600; color: var(--accent-text, var(--accent)); background: var(--accent-soft, transparent); }
/* UX round 11-06: nothing can be typed here, so the note stands in for the box. */
.composer.locked .composer-row { display: none; }
.composer.locked .chat-note { max-width: none; width: 100%; padding: 12px 16px; font-size: calc(13.5px * var(--ts)); text-align: center; }
.composer.blocked > :not(.chat-note) { display: none; }
.composer.blocked .chat-note { display: flex; align-items: center; justify-content: center; gap: var(--s2); }
.composer.blocked .chat-note span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer.blocked .chat-note button { flex: none; }
/* UX round 11-06: a group's few faces before its member count. */
.sub .pile { display: inline-flex; margin-right: 2px; }
.sub .pile > * { width: 22px; height: 22px; min-width: 22px; font-size: 9px; letter-spacing: -.02em; border: 2px solid var(--surface, var(--bg)); margin-left: -7px; flex: none; }
.sub .pile > *:first-child { margin-left: 0; }

/* Home redesign 11-06 (the desktop's Home.kt): head with the seal, four tiles, one privacy strip. */
.home-head { display: flex; align-items: center; gap: var(--s5); }
.home-head .home-seal { flex: none; width: 88px; height: 88px; }
.home-line { margin: 4px 0 0; font: 600 1.05rem/1.35 var(--font-display, inherit); color: var(--fg2); }
.home-line.waiting { color: var(--accent-text, var(--accent)); }
.home-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--s4); border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised, var(--bg2)); color: var(--fg); text-align: start; cursor: pointer; font: inherit; transition: transform .12s, border-color .12s; }
.home-tile:hover { border-color: var(--accent); }
.home-tile:active { transform: scale(.98); }
.home-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ht-top { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
.ht-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft, var(--bg2)); color: var(--accent-text, var(--accent)); }
.ht-key { font: 600 .72rem/1 var(--font-mono, monospace); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--fg2); }
.ht-label { font-weight: 650; }
.ht-hint { font-size: .82rem; color: var(--fg2); }
.home-strip { padding: var(--s3) var(--s4); border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised, var(--bg2)); }
.home-strip .safe-over { margin: 0 0 var(--s2); }
.home-pills { display: flex; flex-wrap: wrap; gap: var(--s2); }
.home-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 0; font-weight: 600; font-size: .85rem; line-height: 1.2; font-family: inherit; background: var(--bg2); color: var(--fg); }
.home-pill.on { background: var(--accent-soft, var(--bg2)); color: var(--accent-text, var(--accent)); }
button.home-pill { cursor: pointer; }
button.home-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1100px) { .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .home-head .home-seal { display: none; } .ht-hint { display: none; } }
.home-head > .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* D-127 winner (11-06): the Find bar above three tiles, as the desktop's home. */
.home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-find { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 12px var(--s4); border-radius: 999px; border: 1px solid var(--line); background: var(--raised, var(--bg2)); color: var(--fg2); font: inherit; text-align: start; cursor: text; transition: border-color .12s; }
.home-find .ic { color: var(--accent-text, var(--accent)); }
.home-find .hf-words { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-find:hover { border-color: var(--accent); }
.home-find:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1100px) { .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .home-tiles { grid-template-columns: 1fr; } }
/* D-129 (as the desktop): an off fact you can fix (the passcode) is outlined in the accent, a call to act. */
button.home-pill:not(.on) { background: transparent; border: 1px solid var(--accent-text, var(--accent)); color: var(--accent-text, var(--accent)); }

/* W-01: an empty list says what it is for and offers its one action. */
.list-empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); margin: auto; padding: var(--s7, 48px) var(--s5); text-align: center; color: var(--fg2); max-width: 320px; animation: rise var(--t-screen) var(--ease-emph) both; }
.list-empty .le-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft, var(--bg2)); color: var(--accent-text, var(--accent)); margin-bottom: var(--s2); }
.list-empty h3 { margin: 0; color: var(--fg); font: 650 1.1rem/1.3 var(--font-display, inherit); }
.list-empty p { margin: 0; font-size: var(--fs-sm, .9rem); line-height: 1.45; }
.list-empty .primary { margin-top: var(--s3); padding: 10px 20px; border-radius: var(--r-pill, 999px); border: 1px solid transparent; font-weight: 650; }
.list-empty .primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.call-4k { font: 750 .85rem/1 var(--font-display, inherit); letter-spacing: .02em; }

/* 11-07 "Get NexCall" page (docs/design/2026-11-07_web-get-nexcall-page.md): this device's way in, then the others. */
.card.get { max-width: 460px; text-align: center; }
.card.get .get-title { margin: 14px 0 2px; font: 700 1.6rem/1.2 var(--font-display, inherit); letter-spacing: -.02em; color: var(--fg); }
.card.get .get-pitch { margin: 0 0 var(--s4); }
.get-body { text-align: left; padding: var(--s4); border-radius: var(--r-l); border: 1px solid var(--line); background: var(--bg2); }
.get-body h2 { margin: 0 0 var(--s2); text-align: left; font-size: 1.2rem; }
.get-body button.primary { width: 100%; margin-top: var(--s3); }
.get-body .get-line { display: block; white-space: normal; margin: 6px 0 0; text-align: center; font-size: var(--fs-sm); }
.get-body button.get-alt { width: 100%; margin-top: var(--s2); }
.card.get .get-over { margin: var(--s5) 0 var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--fg2); }
.get-devices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.card .get-devices button.get-device { min-height: 44px; padding: 8px 6px; font-size: .85rem; line-height: 1.2; }
.card .get-devices button.get-device[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text, var(--accent)); background: var(--accent-soft, var(--bg2)); }
@media (max-width: 480px) { .get-devices { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card.get { margin-inline: 16px; padding-inline: 18px; } }
/* On a signed-in Windows browser: one slim offer of the desktop app. */
.home-get { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised, var(--bg2)); }
.home-get[hidden] { display: none; }
.home-get .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-get button { min-height: 36px; padding: 6px 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: transparent; color: var(--fg); font: 600 .88rem/1 inherit; font-family: inherit; cursor: pointer; }
.home-get button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.home-get button.quiet { border-color: transparent; color: var(--fg2); }
.home-get button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .home-get { flex-wrap: wrap; } }
.get-body .steps { max-width: none; margin-inline: 0; }
/* 11-07: a member with a chat here is a button that opens it; member search past five members. */
.members button.row { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; border-radius: var(--r-m); }
.members button.row:hover { background: var(--fill, var(--bg2)); }
.members button.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.member-find { width: 100%; margin: 0 0 var(--s2); }
/* 11-07: Settings, the six quick reactions. */
.qr-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--s2); }
.qr-slot, .qr-choice { min-width: 44px; min-height: 44px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--raised, var(--bg2)); font-size: 22px; line-height: 1; cursor: pointer; }
.qr-slot.on { border-color: var(--accent); background: var(--accent-soft, var(--bg2)); }
.qr-slot:focus-visible, .qr-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qr-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--s2); max-height: 200px; overflow: auto; }
.qr-pick[hidden] { display: none; }
.qr-choice { min-width: 40px; min-height: 40px; font-size: 20px; border-color: transparent; background: transparent; }
.qr-choice:hover { background: var(--fill, var(--bg2)); }
/* 11-07 @mentions: the picked-out words, yours stronger; "@" before the unread count; the picker's small faces. */
.text .mention { color: var(--accent-text, var(--accent)); font-weight: 600; }
.text .mention.me { background: var(--accent-soft, var(--bg2)); border-radius: 4px; padding: 0 2px; }
.mine .text .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.badge.at-you { background: var(--accent); color: var(--accent-fg); font-weight: 700; margin-inline-end: 4px; }
.mention-pop .avatar.tiny { width: 24px; height: 24px; min-width: 24px; font-size: 10px; }
.mention-pop .quick-item { display: flex; align-items: center; gap: var(--s2); }
/* Videos play in a sheet (blob: URL, never cached); GIFs and stickers tray. */
.video-sheet { width: min(960px, calc(100vw - 24px)); }
.video-sheet video { display: block; width: 100%; max-height: 72vh; background: #000; border-radius: var(--r-m); }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 4px 0 12px; max-height: 50vh; overflow: auto; }
.gif-tile { aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--r-m); overflow: hidden; cursor: pointer; background: var(--bg2, color-mix(in srgb, var(--fg) 6%, transparent)); }
.gif-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gif-tile:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.group-ask-list { max-height: 320px; overflow: auto; margin: 4px 0; }

/* The photo editor before a send: the picture on a dark mat, the crop box over it, tools under it. */
.send-tile { position: relative; }
.send-edit { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-pill);
  background: color-mix(in srgb, #000 58%, transparent); color: #fff; font-size: var(--fs-sm); font-weight: 600; backdrop-filter: blur(6px); }
.send-edit:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 2px; }
.small-sheet.edit-sheet { width: min(720px, calc(100vw - 24px)); }
.edit-stage { display: grid; place-items: center; padding: var(--s3); border-radius: var(--r-m); background: #0b0f14; overflow: hidden; }
.edit-pic { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.edit-canvas { display: block; max-width: 100%; max-height: min(58vh, 560px); width: auto; height: auto; touch-action: none; }
.edit-canvas.drawing { cursor: crosshair; }
.edit-frame { position: absolute; box-sizing: border-box; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .52); cursor: move; touch-action: none;
  background-image: linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px);
  background-size: 33.34% 33.34%; background-position: -1px -1px; }
.edit-frame[hidden] { display: none; }
.edit-frame:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 3px; }
.edit-handle { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; }
.edit-handle::after { content: ""; position: absolute; inset: -12px; } /* a finger-sized grip, the corner stays slim */
.edit-handle.nw { left: -4px; top: -4px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.edit-handle.ne { right: -4px; top: -4px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.edit-handle.sw { left: -4px; bottom: -4px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.edit-handle.se { right: -4px; bottom: -4px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.edit-tools, .edit-choices { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2); margin-top: var(--s3); }
.edit-choices { min-height: 34px; margin-top: var(--s2); }
.edit-tool { display: inline-flex; align-items: center; gap: 6px; }
.edit-tool:disabled { opacity: .45; }
.edit-ink { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--ink); box-shadow: inset 0 0 0 2px var(--raised); }
.edit-ink.on { border-color: var(--accent); }
@media (pointer: coarse) { .edit-ink { width: 44px; height: 44px; } .send-edit { height: 36px; } }
@media (max-width: 520px) { .edit-tool span { display: none; } .edit-tool { padding: 0 12px; } .edit-canvas { max-height: 50vh; } }

/* Forward picker sections: "Recent", then "All chats". */
.fw-head { margin: var(--s3) var(--s2) var(--s1); font-size: var(--fs-sm); font-weight: 600; color: var(--fg2); }
.fw-head:first-child { margin-top: 0; }

/* Before linking (start, link, code and "look at your phone" screens) every size follows the browser's own font size:
   rem, never px, so its font setting and zoom both reach them. The app's Text size still multiplies on top. */
main:not(.full) { --fs-cap: calc(.71875rem * var(--ts)); --fs-sm: calc(.78125rem * var(--ts)); --fs-row: calc(.84375rem * var(--ts));
  --fs-body: calc(.9375rem * var(--ts)); --fs-title: calc(1rem * var(--ts)); --fs-h2: calc(1.25rem * var(--ts)); --fs-h1: calc(1.375rem * var(--ts)); font-size: var(--fs-body); }
/* ── W1, the start page (batch W premium, Design 11-17): one loud thing, the picture in the dial's rings ── */
main:has(> .start) { max-width: 1280px; padding: 0; display: flex; flex-direction: column; }
/* Owner 11-18 ("not adjustable with the size of the window"): the picture follows the window, its width and its height,
   between a size a phone camera still reads (300 px) and the full 440 px; the gaps and the heading follow too. */
.card.start { --stage: clamp(300px, min(34vw, calc(100vh - 200px)), 440px);
  flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 64px) 24px; background: none; box-shadow: none; border-radius: 0; text-align: left;
  animation: start-in 280ms var(--ease-out) both; }
@keyframes start-in { from { opacity: 0; transform: translateY(12px); } }
.start-top { min-height: 72px; display: flex; align-items: center; gap: 12px; }
.start-brand { font: 650 1.3125rem/1 var(--font-display); letter-spacing: -.01em; color: var(--fg); }
/* A tall window centres the words and the code under the brand; when they do not fit, the auto margins are 0 and the
   page starts at the top (Manager 11-18: 1920x950 left the lower half empty). */
.card.start > .start-main { margin-block: auto; }
.start-main { display: grid; grid-template-columns: minmax(0, 1fr) var(--stage); column-gap: clamp(24px, 5vw, 64px); align-items: center; }
.card.start .start-h { margin: 0; font: 650 clamp(2rem, 1.25rem + 1.4vw, 2.5rem)/1.2 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.card.start .start-sub { margin-top: 10px; font-size: 1.125rem; line-height: 1.5; color: var(--fg2); max-width: 34em; }
.start-steps { counter-reset: s; position: relative; max-width: none; margin: 24px 0 0; display: grid; gap: 12px; }
.start-steps::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--accent-soft); }
.start-steps li { position: relative; gap: 16px; margin: 0; font-size: 1.125rem; line-height: 1.5; }
.start-steps li::before { width: 2.25rem; height: 2.25rem; font: 650 1rem/2.25rem var(--font-display); box-shadow: 0 0 0 5px var(--ground); }
.start-steps strong { font-weight: 650; color: var(--fg); }
.card.start button.quiet { min-height: 48px; margin-top: 8px; font-size: 1rem; }
.start-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 12px; }
.start-dl span { font-size: 1rem; line-height: 1.375; color: var(--fg2); }
.card .start-b2 { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 30px; border-radius: 28px; background: none;
  border: 1.5px solid var(--line-strong, var(--fg2)); color: var(--fg); font: 600 1.0625rem/1.2 var(--font-display); }
.card.start .start-getapp { margin-top: 4px; font-size: 1rem; color: var(--fg2); }
/* R2: the "Keep me signed in" box, a whole-row 48 px target with a 24 px box (senior-friendly). */
.keep-row { display: flex; align-items: flex-start; gap: 14px; min-height: 48px; margin-top: 20px; padding: 10px 0; max-width: 600px; cursor: pointer; }
.keep-row input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0.125rem 0 0; accent-color: var(--accent); cursor: pointer; }
.keep-row strong { display: block; font-size: 1.125rem; font-weight: 650; line-height: 1.5; color: var(--fg); }
.keep-row .keep-sub { display: block; font-size: 1rem; line-height: 1.5; color: var(--fg2); }
.card.start .start-getapp button { margin: 0 0 0 4px; }
/* Design 11-18: under 600 px the page starts with the app (a phone cannot scan its own screen); wider, it is not shown. */
.start-onphone { display: none; }
@media (max-width: 599px) {
  .start-onphone { display: grid; gap: 12px; margin: 0 0 24px; }
  .start-onphone p { margin: 0; font: 650 calc(1.25rem * var(--ts, 1))/1.3 var(--font-display); color: var(--fg); }
  .start-onphone button.primary { min-height: 48px; }
  .card.start .start-getapp { display: none; }
}
/* Design 11-18: in dark the start page stands on the desktop's calm ink, not pure black (the step circles are already
   --accent-soft, #0a2529). */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):has(.card.start:not(.card-out)) { --ground: #0b1220; } }
:root[data-theme="dark"]:has(.card.start:not(.card-out)) { --ground: #0b1220; }
.card.start .start-cleared { margin-top: 12px; font-size: 1rem; line-height: 1.5; color: var(--fg2); max-width: 34em; }
.start .link-qr { display: flex; flex-direction: column; align-items: center; }
/* Owner 11-18 ("it should be dynamic"): the code is never pushed below the fold by a tall text column. It sits at the top
   of its column and, in two columns, stays in view while the words scroll; one column puts it first (40em and less). */
.start-main > .link-qr:not(.look-side) { align-self: start; }
/* Sticky only beside the words (two columns): in one column the code would ride over the buttons as they scroll under
   it (D-WD63c at 200% zoom, 640x340: "Can't scan?" and "Get the app" covered). */
@media (min-width: 40.0625em) { .start-main > .link-qr:not(.look-side) { position: sticky; top: 16px; } }
.start-stage { position: relative; width: var(--stage); height: var(--stage); display: grid; place-items: center; }
/* Two of the dial's rings: a thin grey ring, and the Lagoon rim only beside the card's sides ("point here"). They never move after the page arrives. */
.start-stage::before, .start-stage::after { content: ""; position: absolute; border-radius: 50%; animation: fade-in 320ms var(--ease-out) 160ms both; }
.start-stage::before { inset: 4px; border: 1px solid var(--line); }
.start-stage::after { inset: calc(var(--stage) * .095); border: 3px solid transparent; border-left-color: var(--lagoon); border-right-color: var(--lagoon); }
.start .qr-frame { position: relative; z-index: 1; margin: 0; padding: 18px; border-radius: 30px; background: #fff;
  box-shadow: 0 0 0 1px rgba(11, 18, 32, .06), 0 2px 4px -2px rgba(11, 18, 32, .08), 0 30px 60px -34px rgba(11, 18, 32, .34); animation: start-pic 320ms var(--ease-out) 160ms both; }
.start .qr-frame::after { content: none; } /* nothing loops: a wait is a still picture */
@keyframes start-pic { from { opacity: 0; transform: scale(.92); } }
.start .qr-code { width: clamp(220px, calc(var(--stage) * .636), 280px); animation: fade-in 240ms var(--ease-std) both; }
.start .renew { max-width: clamp(220px, calc(var(--stage) * .636), 280px); margin: 2px 0 6px; }
.start-cap { text-align: center; }
.card.start .start-cap h3 { margin: 0; font: 650 1.25rem/1.3 var(--font-display); letter-spacing: -.01em; }
.card.start .start-cap p { margin-top: 4px; font-size: 1rem; line-height: 1.5; }
/* Narrow, a 200% zoom or a big browser font (em, so the browser's own font size moves it too): one column, the code
   first (owner 11-18); the picture keeps its size while it fits, then shrinks with the screen. Wider than 40em the code
   stays on the right and shrinks with the window instead. */
@media (max-width: 40em) {
  .card.start { padding: 0 16px 24px; }
  /* Owner 11-18: on a narrow window the code comes FIRST, at the top, where it is easy to scan; the words follow. */
  .start-main > .link-qr:not(.look-side) { order: -1; }
  .start-main { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .card.start .start-h { font-size: 2rem; line-height: 1.25; }
  /* One column: the picture as wide as the screen allows, and never taller than the window leaves room for. */
  .card.start { --stage: clamp(240px, min(calc(100vw - 32px), calc(100vh - 140px)), 360px); }
  .start .qr-code { width: clamp(200px, calc(var(--stage) - 80px), 280px); } /* a phone camera still reads it */
}
@media (prefers-reduced-motion: reduce) {
  .card.start, .start .qr-code { animation: fade-in 170ms var(--ease-std) both; }
  .start .qr-frame, .start-stage::before, .start-stage::after { animation: none; }
}

/* ── W2a, "Now look at your phone": the phone drawn in grey lines, no shadow and no button shape; a real 56 px Cancel ── */
.look-phone { position: relative; z-index: 1; width: min(14rem, 100%); min-height: 24.5rem; border-radius: 38px; border: 2px solid var(--fg3, var(--fg2)); background: var(--ground);
  animation: fade-in 240ms var(--ease-std) 180ms both; }
.look-screen { position: absolute; inset: 8px; border-radius: 30px; border: 1.5px solid var(--fg3, var(--fg2)); overflow: hidden; }
.look-cam { position: absolute; top: 10px; left: 50%; width: 48px; height: 14px; margin-left: -24px; border-radius: 7px; border: 1.5px solid var(--fg3, var(--fg2)); }
.look-behind { position: absolute; left: 16px; right: 16px; top: 40px; display: grid; gap: 12px; opacity: .6; }
.look-behind span { height: 12px; border-radius: 6px; border: 1.5px solid var(--fg3, var(--fg2)); }
.look-behind span:nth-child(2) { width: 62%; margin-left: auto; }
.look-behind span:nth-child(3) { width: 74%; }
.look-sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 14px 26px; border-top: 1.5px solid var(--fg3, var(--fg2)); border-radius: 24px 24px 0 0;
  text-align: center; color: var(--fg2); }
.look-sheet .ic { width: 30px; height: 30px; }
.look-q { margin-top: 8px; font: 650 1.0625rem/1.3 var(--font-display); }
.look-n { margin-top: 6px; font-size: 1rem; line-height: 1.375; font-weight: 600; }
.look-name { display: inline-flex; align-items: center; gap: 16px; margin-top: 26px; padding: 16px 24px 16px 20px; border-radius: 22px; background: var(--raised);
  box-shadow: 0 0 0 1px var(--line); }
.look-name .ic { width: 30px; height: 30px; color: var(--accent-text); }
.look-name b { display: block; font: 650 1.125rem/1.33 var(--font-display); color: var(--fg); }
.look-name span { font-size: 1rem; line-height: 1.375; color: var(--fg2); }
.card.start .look-code-note { margin-top: 16px; font-size: 1rem; }
.look .code { justify-content: flex-start; margin: 8px 0 0; }
.card .look-cancel { display: flex; justify-content: center; width: auto; min-width: min(12.5rem, 100%); margin-top: 26px; }
@media (prefers-reduced-motion: reduce) { .look-phone { animation: fade-in 170ms var(--ease-std) both; } }
/* Manager 11-17: the drawn phone is decoration. On a short screen (e.g. 200% zoom at 1280x680) it goes, so the words and
   Cancel stay on screen without scrolling. */
@media (max-height: 30em) { .look-side { display: none; } }

/* A shared contact, compact (Design 11-18): a 40 px picture, name, @username, Message and Add. */
.person-card { align-items: center; gap: var(--s3); }
.person-card > .avatar { width: 40px; height: 40px; font-size: 14px; }
.person-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
