/* Coffeetime — app styles ("Café Editorial", spec docs/superpowers/specs/2026-09-06-design-refresh-design.md)
   Counterpart: MobileApp/Resources/Styles/Colors.xaml — change tokens in both files in the same commit. */

/* ── Fonts (UX-35) ──────────────────────────────────────────────────────────────
   Self-hosted — no request to Google Fonts (a known GDPR issue in Germany). The same static
   OFL faces as the phone app (MobileApp/Resources/Fonts), subset to Latin + Latin Extended-A as
   woff2 (licence name records kept). Fraunces ships one static weight: 400–500 map to it, as on
   mobile, so nothing is synthesised for the 500 headings. swap: text is never invisible. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/Fraunces-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/Fraunces-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Lato-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Lato-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Lato-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/DMMono-Medium.woff2") format("woff2");
}

/* ── Tokens (§4A, verbatim) ─────────────────────────────────────────────────── */

:root {
  /* ground & surfaces */
  --color-bg:                 #F6F0E7;
  --color-surface:            #FFFBF5;
  --color-surface-elevated:   #FFFFFF;
  --color-border:             #E6DACB;
  --color-border-strong:      #C9B69F;
  /* UX-26 — boundaries you act on (fields, drop zone, open seats): ≥ 3:1 on bg, surface and
     elevated (3.18 / 3.49 / 3.60). Checked by Frontend.Tests ContrastTests. */
  --color-border-input:       #9A836C;
  /* text */
  --color-text:               #2B1B12;
  --color-text-muted:         #7C6555;
  /* primary (espresso) */
  --color-primary:            #5B3A21;
  --color-primary-hover:      #46291A;
  --color-primary-soft:       #F0E3D3;
  --color-on-primary:         #FFFBF5;
  /* accent (caramel) — never body text; use --color-accent-text */
  --color-accent:             #C98A4B;
  --color-accent-soft:        #F7E6D0;
  --color-accent-text:        #8A5524;
  /* semantic */
  --color-success:            #3F6B42;
  --color-success-soft:       #E4EFE2;
  --color-warning:            #8C5A0F;
  --color-warning-soft:       #FBEFD6;
  --color-danger:             #A83A2E;
  --color-danger-soft:        #F9E4DF;
  --color-info:               #3F6F73;
  --color-info-soft:          #E1EEEF;
  --color-overlay:            rgba(43,27,18,.45);
  /* chat bubbles */
  --bubble-mine-bg:           var(--color-primary);
  --bubble-mine-text:         var(--color-on-primary);
  --bubble-mine-stamp:        rgba(255,251,245,.72);
  --bubble-theirs-bg:         var(--color-surface);
  --bubble-theirs-text:       var(--color-text);
  --bubble-theirs-stamp:      var(--color-text-muted);
  --bubble-stroke:            var(--color-border);
  /* grain */
  --grain-opacity:            .035;
  /* background video — strength per treatment, and the band that protects the bar and
     the footer link, which sit on the ground rather than on a card */
  --bg-video-auth:            .55;
  --bg-video-app:             .12;
  --bg-video-band:            rgba(246,240,231,.88);
  /* type */
  --font-display:  "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body:     "Lato", "Segoe UI", -apple-system, system-ui, Roboto, sans-serif;
  --font-mono:     "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-display:  40px;
  --text-h1:       30px;
  --text-h2:       22px;
  --text-eyebrow:  11px;
  --text-body:     16px;
  --text-small:    13px;
  --text-caption:  12px;
  --text-timer:    64px;
  --text-button:   15px;
  /* UX-34 — the three sizes that sat off the scale: the lede under a title, the italic line of an
     empty or loading state, and the monospaced timestamp */
  --text-lede:     17px;
  --text-empty:    18px;
  --text-stamp:    11px;
  /* radius */
  --radius-xs:     4px;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     18px;
  --radius-xl:     28px;
  --radius-pill:   999px;
  /* spacing (4-pt) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;
  /* elevation (warm-tinted, never grey) */
  --shadow-sm:     0 1px 2px rgba(43,27,18,.06), 0 1px 1px rgba(43,27,18,.04);
  --shadow-md:     0 4px 12px rgba(43,27,18,.08), 0 1px 3px rgba(43,27,18,.06);
  --shadow-lg:     0 16px 40px rgba(43,27,18,.14), 0 4px 10px rgba(43,27,18,.06);
  --glow-accent:   0 0 0 4px var(--color-accent-soft), 0 10px 30px rgba(201,138,75,.35);
  --glow-success:  0 0 0 4px var(--color-success-soft), 0 10px 30px rgba(63,107,66,.30);
  --inset-paper:   inset 0 1px 0 rgba(255,255,255,.6);
  /* motion */
  --duration-fast:  120ms;
  --duration-base:  200ms;
  --duration-slow:  320ms;
  --duration-seal:  480ms;
  --duration-steam: 7s;
  --ease-standard:  cubic-bezier(.2,.7,.2,1);
  --ease-out-soft:  cubic-bezier(.16,1,.3,1);
  --ease-spring:    cubic-bezier(.34,1.4,.64,1);
  /* layout */
  --content-max:    640px;
  --nav-height:     64px;
  --touch-min:      44px;

  color-scheme: light dark;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-text);
  background: var(--color-bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:                 #1A120D;
    --color-surface:            #241912;
    --color-surface-elevated:   #2E2118;
    --color-border:             #3E2E22;
    --color-border-strong:      #5A4636;
    --color-border-input:       #8A7461;   /* 4.18 / 3.89 / 3.53 on bg / surface / elevated */
    --color-text:               #F3E9DD;
    --color-text-muted:         #B49C89;
    --color-primary:            #D9A86C;
    --color-primary-hover:      #E6B97E;
    --color-primary-soft:       #3A2A1C;
    --color-on-primary:         #2B1B12;
    --color-accent:             #E0B27A;
    --color-accent-soft:        #3F2E1E;
    --color-accent-text:        #E0B27A;
    --color-success:            #8FC495;
    --color-success-soft:       #22301F;
    --color-warning:            #E3B25B;
    --color-warning-soft:       #3D2E12;
    --color-danger:             #E8857A;
    --color-danger-soft:        #3D211D;
    --color-info:               #8CC3C7;
    --color-info-soft:          #1E2F30;
    --color-overlay:            rgba(0,0,0,.6);
    --bubble-mine-stamp:        rgba(43,27,18,.8);   /* .72 measures 4.30:1 on the dark primary; .8 is 5.15:1 */
    --grain-opacity:            .06;
    /* the clips are lit warm, so dark mode needs less of them, not the same amount */
    --bg-video-auth:            .38;
    --bg-video-app:             .08;
    --bg-video-band:            rgba(26,18,13,.9);
    --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
    --shadow-md:     0 4px 14px rgba(0,0,0,.5);
    --shadow-lg:     0 16px 40px rgba(0,0,0,.6);
    --glow-accent:   0 0 0 4px var(--color-accent-soft), 0 10px 30px rgba(224,178,122,.35);
    --glow-success:  0 0 0 4px var(--color-success-soft), 0 10px 30px rgba(143,196,149,.30);
    --inset-paper:   inset 0 1px 0 rgba(255,255,255,.04);
  }
}

/* ── Web-only assets (NOT §4A tokens — see the §4C platform-only list) ──────────
   --shadow-up is web-only elevation: an upward cast for the bottom-anchored nav bar
   at ≤480 (mobile has no bottom bar; its composer uses ShadowMd). The glyphs are
   24×24 stroked SVGs used through `mask-image`, so their colour is whatever
   `background` the host paints; the cup family (--icon-cup/-mug/-mug-fill/
   -cracked-cup/-cup-alert) reuses the ic_cup.svg body + handle paths verbatim so
   every cup on the web is the same drawing as the brand mark. The grain tile bakes
   --grain-opacity into its alpha (light .035 / dark .06) so no compositing layer is
   needed. ──────────────────────────────────────────────────────────────────────── */

:root {
  --shadow-up:        0 -8px 24px rgba(43,27,18,.08);   /* cast upward: bottom-anchored bars */
  --icon-cup:         url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.75c0 .9-1 1.1-1 2s1 1.1 1 2'/%3E%3Cpath d='M12 2.75c0 .9 1 1.1 1 2s-1 1.1-1 2'/%3E%3Cpath d='M4 9.25h12v5.5A4.25 4.25 0 0 1 11.75 19h-3.5A4.25 4.25 0 0 1 4 14.75z'/%3E%3Cpath d='M16 11.25h1a2.75 2.75 0 0 1 0 5.5h-1'/%3E%3C/svg%3E");
  --icon-mug:         url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.25h12v5.5A4.25 4.25 0 0 1 11.75 19h-3.5A4.25 4.25 0 0 1 4 14.75z'/%3E%3Cpath d='M16 11.25h1a2.75 2.75 0 0 1 0 5.5h-1'/%3E%3C/svg%3E");
  --icon-mug-fill:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.25h12v5.5A4.25 4.25 0 0 1 11.75 19h-3.5A4.25 4.25 0 0 1 4 14.75z' fill='%23000'/%3E%3Cpath d='M16 11.25h1a2.75 2.75 0 0 1 0 5.5h-1'/%3E%3C/svg%3E");   /* filled body + strokes: the upload cup's rising liquid */
  --icon-cracked-cup: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.25h12v5.5A4.25 4.25 0 0 1 11.75 19h-3.5A4.25 4.25 0 0 1 4 14.75z'/%3E%3Cpath d='M16 11.25h1a2.75 2.75 0 0 1 0 5.5h-1'/%3E%3Cpath d='M9.5 9.25l1.5 3-1.5 2.5 1.5 3.5'/%3E%3C/svg%3E");
  --icon-cup-alert:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.25h12v5.5A4.25 4.25 0 0 1 11.75 19h-3.5A4.25 4.25 0 0 1 4 14.75z'/%3E%3Cpath d='M16 11.25h1a2.75 2.75 0 0 1 0 5.5h-1'/%3E%3Cpath d='M21 2.5v5M21 10.5h.01'/%3E%3C/svg%3E");
  --icon-cloud-slash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 18H17a4 4 0 0 0 .6-7.95A6 6 0 0 0 6.3 12.6 3 3 0 0 0 7.5 18z'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E");
  --icon-clock:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
  --icon-plane:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 3.5L3.5 10.5l7.5 2.5 2.5 7.5z'/%3E%3Cpath d='M20.5 3.5L11 13'/%3E%3C/svg%3E");
  --icon-check:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  --icon-hourglass:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3h11M6.5 21h11M8 3v3.5a4 4 0 0 0 1.6 3.2L12 12l-2.4 2.3A4 4 0 0 0 8 17.5V21M16 3v3.5a4 4 0 0 1-1.6 3.2L12 12l2.4 2.3a4 4 0 0 1 1.6 3.2V21'/%3E%3C/svg%3E");
  --icon-chevron:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  --icon-seal:        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M8 12.5l2.5 2.5L16 9.5'/%3E%3C/svg%3E");
  /* Wave 1 · Table (UX-13/14): call controls, closed card, sheet — same 24-grid, 1.75 stroke */
  --icon-phone:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.2 3.5h3.1l1.6 4.1-2.1 1.3a11.5 11.5 0 0 0 7.3 7.3l1.3-2.1 4.1 1.6v3.1a2 2 0 0 1-2.2 2A16.5 16.5 0 0 1 3.2 5.7a2 2 0 0 1 2-2.2z'/%3E%3C/svg%3E");
  --icon-mic:         url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11.5' rx='3'/%3E%3Cpath d='M18.5 11.5a6.5 6.5 0 0 1-13 0'/%3E%3Cpath d='M12 18v3M8.5 21h7'/%3E%3C/svg%3E");
  --icon-mic-off:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 9.5V6a3 3 0 0 0-5.8-1.1M9 9v2.5a3 3 0 0 0 4.9 2.3'/%3E%3Cpath d='M18.5 11.5a6.5 6.5 0 0 1-1 3.4M5.5 11.5a6.5 6.5 0 0 0 10 5.5'/%3E%3Cpath d='M12 18v3M8.5 21h7M3.5 3.5l17 17'/%3E%3C/svg%3E");
  --icon-camera:      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6.5' width='13' height='11' rx='2'/%3E%3Cpath d='M15.5 10.5l6-3.5v10l-6-3.5z'/%3E%3C/svg%3E");
  --icon-camera-off:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6.5h4.5a2 2 0 0 1 2 2v3M15.5 15.5a2 2 0 0 1-2 2h-9a2 2 0 0 1-2-2v-7a2 2 0 0 1 1.5-1.9'/%3E%3Cpath d='M15.5 10.5l6-3.5v10l-3-1.75M3.5 3.5l17 17'/%3E%3C/svg%3E");
  --icon-bell:        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16.5v-5.5a6 6 0 0 1 12 0v5.5l1.5 2h-15z'/%3E%3Cpath d='M10 21a2.2 2.2 0 0 0 4 0'/%3E%3C/svg%3E");
  --icon-bell-off:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.2 6.2A6 6 0 0 1 18 11v4M16.5 18.5h-12L6 16.5v-5.5'/%3E%3Cpath d='M10 21a2.2 2.2 0 0 0 4 0M3.5 3.5l17 17'/%3E%3C/svg%3E");
  --icon-lock:        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2'/%3E%3Cpath d='M8.5 10.5V7.5a3.5 3.5 0 0 1 7 0v3'/%3E%3Cpath d='M12 14.5v2'/%3E%3C/svg%3E");
  --icon-close:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E");
  --illus-two-cups:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 26h20v12a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8z'/%3E%3Cpath d='M24 30h2.5a4 4 0 0 1 0 8H24'/%3E%3Cpath d='M35 26h20v12a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8z'/%3E%3Cpath d='M55 30h2.5a4 4 0 0 1 0 8H55'/%3E%3Cpath d='M4 54h58'/%3E%3C/svg%3E");
  --grain-tile:       url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .11 0 0 0 0 .07 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --shadow-up:      0 -8px 24px rgba(0,0,0,.45);
    --grain-tile:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .93 0 0 0 0 .85 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  }
}

/* ── Registered properties (§6.8 — the only @property transition on any page) ── */

@property --pct {
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}

/* ── Reset & base (§6.0) ────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;   /* never `hidden`: hidden on html+body makes body the scroll container and disables every position: sticky */
}

body {
    margin: 0;
    min-height: 100dvh;
    overflow-x: clip;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    /* ground: static grain tile + window light + paper (no blend modes, no fixed layers) */
    background:
        var(--grain-tile) 0 0 / 180px 180px,
        radial-gradient(120% 60% at 50% -10%, var(--color-accent-soft) 0%, transparent 60%),
        var(--color-bg);
}

/* ── Background video (§6.0a) ────────────────────────────────────────────────
   A fixed pane between the paper ground and the page.

   Layering is done by lifting .page, NOT by pushing the video to `z-index: -1`.
   Negative z-index paints in step 2 of the painting algorithm and the in-flow
   backgrounds of block-level descendants paint in step 3, so a negative layer
   ends up UNDER body's paper and is invisible — measured on the live page, not
   assumed. Giving the pane `z-index: 0` and .page `z-index: 1` puts both in the
   positioned pass, in the order we want.

   The grain tile is repainted on the scrim so the texture reads OVER the footage
   rather than under it — that is what keeps the clip looking like something
   printed on the paper instead of a screen behind it. No blend modes and no
   filters: §3 decision 5 rules those out on the WASM compositing path, and
   nothing here needs them.
   ──────────────────────────────────────────────────────────────────────────── */

.bg-video {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Held under the video: covers the gap before the first frame paints, and is the
   entire layer when reduced motion leaves no <source> selected. */
.bg-video::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-video-poster) center / cover no-repeat;
}

.bg-video-el {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-video::before,
.bg-video-el { opacity: var(--bg-video-app); }

.bg-video[data-variant="auth"]::before,
.bg-video[data-variant="auth"] .bg-video-el { opacity: var(--bg-video-auth); }

/* Grain over the footage, plus a band top and bottom: the nav bar and the auth
   footer link sit on the ground rather than on a card, so they need a floor
   under their contrast that does not depend on which frame is playing. */
.bg-video::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        var(--grain-tile) 0 0 / 180px 180px,
        linear-gradient(180deg,
            var(--bg-video-band) 0,
            transparent 22%,
            transparent 74%,
            var(--bg-video-band) 100%);
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--color-text);
    margin: 0 0 var(--space-3);
    text-wrap: balance;
}

h1 {
    font-size: var(--text-h1);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -.005em;
}

h2 {
    font-size: var(--text-h2);
    line-height: 1.25;
    letter-spacing: 0;
}

p { margin: 0 0 var(--space-3); }

a {
    color: var(--color-accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--duration-fast) var(--ease-standard);
}
a:hover { color: var(--color-primary); }

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

pre, table {
    max-width: 100%;
    overflow-x: auto;
}

/* ── Type utilities (§5) ────────────────────────────────────────────────────── */

.display {
    font-family: var(--font-display);
    font-size: var(--text-display);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -.01em;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: var(--text-eyebrow);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-2);
}

.lede {
    font-size: var(--text-lede);
    line-height: 1.55;
    color: var(--color-text-muted);
    max-width: 36ch;
    margin: 0 0 var(--space-6);
    text-wrap: balance;
}

.small {
    font-size: var(--text-small);
    line-height: 1.45;
}

.muted { color: var(--color-text-muted); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Boot screen (§6.2 — contract: #app > svg.loading-progress with two circles) ── */

#app {
    min-height: 100dvh;
}

#app:has(> .loading-progress) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.boot-mark {
    position: relative;
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}

.boot-mark svg {
    width: 48px;
    height: 48px;
}

/* three steam wisps: soft radial ellipses, animated on transform/opacity only */
.boot-steam {
    position: absolute;
    top: -14px;
    width: 12px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, var(--color-border-strong) 0%, var(--color-border-strong) 30%, transparent 75%);
    opacity: 0;
    animation: steam-rise var(--duration-steam) ease-in-out infinite;
}
.boot-steam:nth-child(1) { left: 10px; animation-delay: 0s; }
.boot-steam:nth-child(2) { left: 18px; animation-delay: 2.3s; }
.boot-steam:nth-child(3) { left: 26px; animation-delay: 4.6s; }

#app > .loading-progress {
    position: relative;
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--color-accent-soft);
    stroke-width: 6px;
    stroke-linecap: round;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--color-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.boot-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-text);
    margin: var(--space-2) 0 0;
}

.loading-progress-text {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: .02em;
    color: var(--color-text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.loading-progress-text::after {
    content: "Warming up\2026  " var(--blazor-load-percentage-text, "");
}

/* ── Blazor error UI (§6.2 — .reload and .dismiss keep their names) ────────── */

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - var(--space-8));
    max-width: 560px;
    padding: var(--space-4) var(--space-12) var(--space-4) var(--space-5);
    background: var(--color-danger-soft);
    color: var(--color-text);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-small);
    line-height: 1.45;
}

#blazor-error-ui .reload {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-min);
    margin-left: var(--space-3);
    padding: 0 var(--space-4);
    border: 1px solid transparent;   /* a true ghost, not the secondary outline (§6.2) */
    border-radius: var(--radius-pill);
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
    background: transparent;
    transition: background var(--duration-fast), color var(--duration-fast);
}
#blazor-error-ui .reload:hover { background: var(--color-surface); color: var(--color-danger); }

#blazor-error-ui .dismiss {
    position: absolute;
    top: 50%;
    right: var(--space-2);
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--color-text);   /* ghost-on-danger-soft: text, never text-muted (§10) */
    cursor: pointer;
    font-size: 18px;
    transition: background var(--duration-fast), color var(--duration-fast);
}
/* 44 px hit area around the 40 px disc (the element is already positioned) */
#blazor-error-ui .dismiss::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
}
#blazor-error-ui .dismiss:hover { background: var(--color-surface); color: var(--color-danger); }

/* ── Page shell (§6.1) ──────────────────────────────────────────────────────── */

.page {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100dvh;
    /* above .bg-video, which is fixed at z-index 0; the nav bar's z-index 1000 is
       scoped to this stacking context and keeps working unchanged */
    position: relative;
    z-index: 1;
}

main {
    flex: 1 0 auto;
}

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }

.content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-8) var(--space-5) var(--space-12);
}

/* ── Nav bar (§6.1) ─────────────────────────────────────────────────────────── */

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    height: var(--nav-height);
    padding: 0 var(--space-6);
    background: var(--color-bg);
    background: color-mix(in srgb, var(--color-bg) 96%, transparent);
    border-bottom: 1px solid var(--color-border);
}

.nav-bar .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -.005em;
    min-height: var(--touch-min);
}

.nav-bar .brand svg {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
    flex: none;
}

.nav-bar .brand:hover { color: var(--color-primary); }

.nav-bar nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-bar nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-min);
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) var(--ease-standard);
}

.nav-bar nav a::after {
    content: "";
    position: absolute;
    left: var(--space-3);
    right: var(--space-3);
    bottom: 4px;
    height: 2px;
    border-radius: 1px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--duration-base) var(--ease-standard);
}

.nav-bar nav a:hover { color: var(--color-text); }
.nav-bar nav a:hover::after { transform: scaleX(1); }

.nav-bar nav a.active {
    color: var(--color-text);
}
.nav-bar nav a.active::after { transform: scaleX(1); }

/* NotAuthorized pills (classes added in MainLayout.razor; hrefs/strings unchanged) */
.nav-bar nav a.btn-primary,
.nav-bar nav a.btn-ghost {
    border-radius: var(--radius-pill);
    padding: 0 var(--space-4);
}
.nav-bar nav a.btn-primary::after,
.nav-bar nav a.btn-ghost::after { content: none; }
.nav-bar nav a.btn-primary { color: var(--color-on-primary); }
.nav-bar nav a.btn-primary:hover { color: var(--color-on-primary); }

/* Sign out — ghost pill */
.nav-bar nav .btn-link {
    color: var(--color-text-muted);
    padding: 0 var(--space-3);
    min-height: var(--touch-min);
    border-radius: var(--radius-pill);
    font-size: 14px;
    text-decoration: none;
}
.nav-bar nav .btn-link:hover:not(:disabled) {
    background: var(--color-primary-soft);
    color: var(--color-text);
    text-decoration: none;
}

/* Account menu: profile, sign-in, and the legal pages in one control.
   The trigger is a button, not a <summary>: a bare button is the primary pill,
   so these rules outrank button and button:hover. */
.nav-menu { position: relative; }
.nav-bar nav .nav-menu > .nav-menu-summary {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--touch-min);
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: none;
    cursor: pointer;
    transform: none;
}
.nav-bar nav .nav-menu > .nav-menu-summary:hover,
.nav-bar nav .nav-menu > .nav-menu-summary:active,
.nav-bar nav .nav-menu.is-open > .nav-menu-summary {
    background: transparent;
    color: var(--color-text);
    transform: none;
}
.nav-bar nav .nav-menu > .nav-menu-summary .nav-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}
.nav-menu-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    min-width: 15rem;
    display: flex;
    flex-direction: column;
    padding: var(--space-2);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-up);
}
.nav-bar nav .nav-menu-panel a,
.nav-bar nav .nav-menu-panel .btn-link {
    justify-content: flex-start;
    width: 100%;
    border-radius: var(--radius-sm);
}
.nav-bar nav .nav-menu-panel a::after { content: none; }
.nav-bar nav .nav-menu-panel .btn-link {
    padding: 0 var(--space-3);
    text-decoration: none;
}

.legal-footer {
    border-top: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6) var(--space-6);
}
.legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
    max-width: var(--content-max);
    margin: 0 auto;
}
.legal-footer a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-min);
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.legal-footer a:hover { color: var(--color-text); }
.legal-version {
    color: color-mix(in srgb, var(--color-text-muted) 78%, white);
    font-size: 14px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.legal-doc {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 40rem;
}
.legal-doc h1,
.legal-doc p { margin: 0; }
.legal-doc-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.legal-doc-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-min);
    padding: 0 var(--space-3);
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    font-weight: 700;
    text-decoration: none;
}
.legal-doc-nav a.active {
    background: var(--color-primary-soft);
    color: var(--color-text);
}

/* ── Buttons (§6.0 — the root fix: a bare <button> is primary) ─────────────── */

button, .btn-primary, .btn-secondary, .btn-ghost, .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font: 700 var(--text-button)/1 var(--font-body);
    letter-spacing: .01em;
    min-height: var(--touch-min);
    padding: 0 var(--space-5);
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition:
        background var(--duration-fast) var(--ease-standard),
        color var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-base) var(--ease-standard),
        transform var(--duration-fast) var(--ease-standard);
}

/* default = primary */
button,
.btn-primary,
button[type="submit"],
.candidate-join-btn,
.table-composer-send,
.table-keep-button {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

button:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled),
.candidate-join-btn:hover:not(:disabled),
.table-composer-send:hover:not(:disabled),
.table-keep-button:hover:not(:disabled) {
    background: var(--color-primary-hover);
    color: var(--color-on-primary);
}

a.btn-primary { color: var(--color-on-primary); }
a.btn-primary:hover { color: var(--color-on-primary); }

.candidate-join-btn:hover:not(:disabled),
.candidate-join-btn:focus-visible,
.table-keep-button:hover:not(:disabled),
.table-keep-button:focus-visible {
    box-shadow: var(--glow-accent);
}

/* secondary */
.btn-secondary,
button.btn-secondary {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled),
button.btn-secondary:hover:not(:disabled) {
    background: var(--color-accent-soft);
    color: var(--color-primary);
    border-color: var(--color-border-strong);
}

/* ghost */
.btn-ghost,
button.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}
.btn-ghost:hover:not(:disabled),
button.btn-ghost:hover:not(:disabled) {
    background: var(--color-primary-soft);
    color: var(--color-text);
}
.break-actions .btn-ghost:hover:not(:disabled) {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* link */
.btn-link,
button.btn-link {
    background: transparent;
    color: var(--color-accent-text);
    padding: 0 var(--space-2);
    text-decoration: none;
}
.btn-link:hover:not(:disabled),
button.btn-link:hover:not(:disabled) {
    background: transparent;
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

a.btn-primary, a.btn-secondary, a.btn-ghost, .nav-bar a { text-decoration: none; }

button:active:not(:disabled),
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active {
    transform: scale(.98);
}

button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* busy spinner: a disabled primary keeps its label and gains a 16 px ring before it */
button[disabled].btn-primary::before,
button[disabled].table-keep-button::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: spin .8s linear infinite;
}

/* ── Inputs & forms (§6.0, §6.4) ────────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.form-group label,
.form-label {
    font-size: var(--text-small);
    font-weight: 700;
    line-height: 1.45;
    color: var(--color-text-muted);
}

/* optional, private fields folded away so they do not stand between a new user and a break */
.form-details {
    margin: 0 0 var(--space-5);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.form-details > summary {
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    color: var(--color-text-muted);
    font-weight: 700;
    cursor: pointer;
}
.form-details > summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.form-details > summary::-webkit-details-marker { display: none; }
/* Disclosure chevron: display:flex drops the native marker, so the open/closed cue is drawn here. */
.form-details > summary::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: none;
    background: currentColor;
    -webkit-mask: var(--icon-chevron) center / contain no-repeat;
            mask: var(--icon-chevron) center / contain no-repeat;
    transition: transform var(--duration-base) var(--ease-standard);
}
.form-details[open] > summary::before { transform: rotate(90deg); }
.form-details[open] > summary { margin-bottom: var(--space-3); }
.form-details > .form-group:last-child,
.form-details > .form-row:last-child { margin-bottom: 0; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-4);
}

.form-hint {
    margin: 0;
    color: var(--color-text-muted);
}

.choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-elevated);
    cursor: pointer;
    font-weight: 400;
}

.choice.is-on {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.choice input {
    margin: 0;
}

.lang-open {
    min-height: var(--touch-min);
    margin-left: var(--space-3);
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
    font: 600 var(--text-small)/1 var(--font-body);
    cursor: pointer;
}

.lang-open:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.lang-dialog {
    width: min(22rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-elevated);
    color: var(--color-text);
    overflow: auto;
}

.lang-dialog::backdrop {
    background: rgba(43, 27, 18, 0.45);
}

.lang-dialog-title {
    margin: 0 0 var(--space-3);
    font: 600 var(--text-h2)/1.2 var(--font-display);
}

.lang-dialog-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lang-dialog-option,
.lang-dialog-close {
    min-height: var(--touch-min);
    border-radius: var(--radius-pill);
    font: 600 var(--text-small)/1 var(--font-body);
    cursor: pointer;
}

.lang-dialog-option {
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    text-align: start;
}

.lang-dialog-option.is-on {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.lang-dialog-option:focus-visible,
.lang-dialog-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.lang-dialog-close {
    margin-top: var(--space-3);
    padding: 0 14px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
}

.drop-zone--compact {
    min-height: 72px;
    padding: var(--space-4);
}

.avatar-preview {
    display: block;
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin: 0 0 var(--space-3);
    background: var(--color-surface);
}

.form-control,
.break-mood input,
.table-composer-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: 400 var(--text-body)/1.4 var(--font-body);
    color: var(--color-text);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--inset-paper);
    appearance: none;
    transition: border-color var(--duration-fast) var(--ease-standard);   /* the glow swaps, not tweens (§8) */
}

.form-control::placeholder,
.break-mood input::placeholder,
.table-composer-input::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

.form-control:focus,
.break-mood input:focus,
.table-composer-input:focus {
    outline: none;
    border-color: var(--color-border-strong);
    box-shadow: var(--glow-accent);
}
/* keyboard focus: the primary ring (9.8:1) — the glow alone is ~1.2:1 on the field */
.form-control:focus-visible,
.break-mood input:focus-visible,
.table-composer-input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.form-control.invalid,
.break-mood input.invalid {
    border-color: var(--color-danger);
}

.form-control:disabled,
.break-mood input:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.validation-message {
    color: var(--color-danger);
    font-size: var(--text-small);
    line-height: 1.45;
    animation: slide-in var(--duration-base) var(--ease-out-soft) both;
}

/* ── Alerts (§6.0 — one pattern, five classes; warning variants beneath) ───── */

.error-message,
.break-error,
.tables-error,
.table-error,
.table-keep-error,
.break-refresh-error,
.table-live-paused,
.profile-reason,
.break-empty--failed {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-danger-soft);
    color: var(--color-text);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-md);
    font-size: var(--text-body);
    line-height: 1.5;
    animation: slide-in var(--duration-base) var(--ease-out-soft) both;
}

.error-message::before,
.break-error::before,
.tables-error::before,
.table-error::before,
.table-keep-error::before,
.break-refresh-error::before,
.table-live-paused::before,
.profile-reason::before,
.break-empty--failed::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--color-danger);
    -webkit-mask: var(--icon-cracked-cup) center / contain no-repeat;
    mask: var(--icon-cracked-cup) center / contain no-repeat;
}

/* stale but real → warning (honey) */
.break-refresh-error,
.table-live-paused,
.profile-reason {
    background: var(--color-warning-soft);
    border-left-color: var(--color-warning);
}
.break-refresh-error::before,
.table-live-paused::before,
.profile-reason::before {
    background: var(--color-warning);
}
.break-refresh-error::before,
.table-live-paused::before {
    -webkit-mask-image: var(--icon-cloud-slash);
    mask-image: var(--icon-cloud-slash);
}

/* the history is real, only the push is missing: text first, Retry at the end of the row */
.table-live-paused { align-items: center; }
.table-live-paused-text { flex: 1 1 auto; }
.table-live-paused .btn-ghost { flex: none; }
/* A failed load with its own Retry (Break, Table): the alert carries the action. */
.load-retry { align-items: center; }
.load-retry-text { flex: 1 1 auto; }
.load-retry .btn-ghost { flex: none; }
.profile-reason::before {
    -webkit-mask-image: var(--icon-cup-alert);
    mask-image: var(--icon-cup-alert);
}

/* ── Empty pattern (§6.0) ───────────────────────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-4);
    padding: var(--space-10) var(--space-4);
    margin: 0 0 var(--space-6);
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-empty);
    line-height: 1.4;
    color: var(--color-text-muted);
    background: none;
    border: 0;
}

.empty-state::before {
    content: "";
    width: 64px;
    height: 64px;
    background: var(--color-border-strong);
    -webkit-mask: var(--illus-two-cups) center / contain no-repeat;
    mask: var(--illus-two-cups) center / contain no-repeat;
}

/* ── Loading pattern & skeletons (§6.0) ────────────────────────────────────── */

.loading-state {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0 0 var(--space-6);
}

.loading-state > p,
.loading-state > span:not(.sr-only) {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-empty);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-1);
}

.skeleton {
    display: block;
    background: linear-gradient(90deg,
        var(--color-primary-soft) 0%,
        var(--color-surface) 40%,
        var(--color-primary-soft) 80%);
    background-size: 400% 100%;
    border-radius: var(--radius-xs);
    animation: shimmer 1.6s linear infinite;
}

.skeleton-line   { height: 16px; width: 60%; }
.skeleton-line + .skeleton-line { width: 40%; }
.skeleton-card   { height: 96px; border-radius: var(--radius-md); }
.skeleton-row    { height: 64px; border-radius: var(--radius-md); }
.skeleton-bubble {
    height: 44px;
    width: 62%;
    border-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-xs);
}
.skeleton-bubble:nth-of-type(even) {
    align-self: flex-end;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-xs);
}

/* ── Cards (§6.0) ───────────────────────────────────────────────────────────── */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    transition:
        border-color var(--duration-base) var(--ease-standard),
        transform var(--duration-base) var(--ease-standard),
        background-color var(--duration-slow) var(--ease-standard);   /* shadow swaps statically (§8) */
}

/* ── Chips (§6.0, §6.5, §6.6) ───────────────────────────────────────────────── */

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) 10px;
    background: var(--color-primary-soft);
    color: var(--color-text);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: var(--text-small);
    font-weight: 400;
    line-height: 1.45;
}

.candidate-interests .chip {
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
}

.chip--ghost {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) 10px;
    background: transparent;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    font-size: var(--text-small);
    line-height: 1.45;
}

/* ── Auth: Login / Register (§6.4) ─────────────────────────────────────────── */

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto var(--space-4);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* 40 px cup mark above the h1: the inline svg.cup-mark in Login/Register.razor */
.auth-card .cup-mark {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-4);
    color: var(--color-primary);
}

.auth-card h1 {
    font-size: var(--text-display);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -.01em;
    text-align: center;
}

.auth-card .lede {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.auth-card .btn-primary,
.auth-card button[type="submit"] {
    width: 100%;
    margin-top: var(--space-2);
}

.auth-footer {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 440px;
    margin: 0 auto;
    /* This line sits on the ground rather than on the card, and on the signed-out
       screens that ground is moving footage. At phone width it lands in the clear
       middle of the scrim, over whatever the clip is doing, so it carries its own
       paper. fit-content keeps the strip as wide as the sentence while the existing
       `margin: 0 auto` still centres it — inline-block would have handed centring
       back to the parent column. */
    width: fit-content;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-bg) 82%, transparent);
}
.auth-footer a { color: var(--color-accent-text); }

/* ── Profile view (§6.5) ────────────────────────────────────────────────────── */

/* UX-37: Sign out's home below 768 px — quiet, set apart from the edit action */
.profile-signout {
    margin-top: var(--space-10);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
}

.profile-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 0;               /* the dt/dd border-tops meet: one continuous hairline per row */
    row-gap: 0;
    margin: 0 0 var(--space-6);
}

.card > .profile-details,
.card.profile-details { margin-bottom: 0; }

.profile-details dt {
    font-size: var(--text-eyebrow);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: var(--space-3) var(--space-6) var(--space-3) 0;   /* the 24 px column gap lives here */
    min-height: 48px;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--color-border);
}

.profile-details dd {
    margin: 0;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-height: 48px;
}

.profile-details dt:first-of-type,
.profile-details dt:first-of-type + dd {
    border-top: 0;
    padding-top: 0;
}

.profile-details + .btn-primary,
.card + .btn-primary,
.card + a.btn-primary {
    margin-top: var(--space-6);
    align-self: flex-start;
}

/* ── Profile editor (§6.6) ──────────────────────────────────────────────────── */

.card form, form.card { display: block; }

form .btn-primary + .btn-link,
form .btn-primary + .btn-ghost {
    margin-left: var(--space-2);
}

button.photo-remove {
    margin-top: var(--space-2);
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

/* ── Break — idle (§6.7) ────────────────────────────────────────────────────── */

.break-idle {
    max-width: 480px;
    margin: var(--space-6) auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.break-idle .lede { margin-left: auto; margin-right: auto; }
.break-idle > .break-error { align-self: stretch; text-align: left; }

.break-idle h1 { margin-bottom: var(--space-3); }

.break-mood {
    width: 100%;
    max-width: 420px;
    margin: 0 auto var(--space-5);
}

.drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 200px;
    padding: var(--space-6);
    background: var(--color-surface);
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: center;
    transition:
        border-color var(--duration-base) var(--ease-standard),
        opacity var(--duration-base) var(--ease-standard);   /* the glow swaps statically (§8) */
}

.drop-zone svg,
.drop-zone .drop-zone-icon {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
    transition: transform var(--duration-base) var(--ease-out-soft);
}

.drop-zone-title {
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: 400;
    line-height: 1.25;
    color: var(--color-text);
}

.drop-zone-hint {
    color: var(--color-text-muted);
}

.drop-zone:hover,
.drop-zone:focus-within {
    border-color: var(--color-accent);
    box-shadow: var(--glow-accent);
}
.drop-zone:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}
.drop-zone:hover svg,
.drop-zone:hover .drop-zone-icon,
.drop-zone:focus-within svg,
.drop-zone:focus-within .drop-zone-icon {
    transform: translateY(-4px);
}

.drop-zone:has(input:disabled) {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
    border-color: var(--color-border-strong);
}
.drop-zone:has(input:disabled) svg,
.drop-zone:has(input:disabled) .drop-zone-icon { transform: none; }

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
    border: 0;
}

/* while uploading, the busy panel takes the drop zone's slot (the InputFile stays in the DOM) */
.break-idle:has(.upload-state) .drop-zone { display: none; }

.upload-state {
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
    margin: 0;
    padding: var(--space-6);
    background: linear-gradient(90deg,
        var(--color-primary-soft) 0%,
        var(--color-surface) 40%,
        var(--color-primary-soft) 80%);
    background-size: 400% 100%;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    animation: shimmer 1.6s linear infinite;
    text-align: center;
}

/* the cup fills from the bottom: a two-tone gradient scrolls up behind a filled cup
   silhouette (--icon-mug-fill), so the accent half reads as liquid and the empty half
   as a faint cup — a stroke-only mask would only recolour the outline */
.upload-state::before {
    content: "";
    width: 40px;
    height: 40px;
    background: linear-gradient(to top,
        var(--color-accent) 50%,
        color-mix(in srgb, var(--color-border-strong) 45%, transparent) 50%);
    background-size: 100% 200%;
    background-position: 0 0;
    -webkit-mask: var(--icon-mug-fill) center / contain no-repeat;
    mask: var(--icon-mug-fill) center / contain no-repeat;
    animation: coffee-rise 1.6s ease-in-out infinite;
}

.loading-state.upload-state > span:not(.sr-only) {
    font-family: var(--font-body);
    font-style: italic;
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-text);
    margin: 0;
}

/* ── Break — live (§6.8) ────────────────────────────────────────────────────── */

.break-live {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}
/* the stale-data banner is rendered after the list but must sit above it (§6.8) */
.break-live > .break-live-head { order: 0; }
.break-live > .eyebrow { order: 1; }
.break-live > .break-live-chip { order: 1; }
.break-live > .break-refresh-error { order: 2; }
.break-live > .candidate-list,
.break-live > .loading-state,
.break-live > .break-empty { order: 3; }
.break-live > .break-error { order: 4; }

.break-live-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-6);
    padding: var(--space-6) var(--space-5);
}

.break-live-head h1 { margin-bottom: var(--space-2); }

.break-timer-block {
    display: grid;
    place-items: center;
    margin: var(--space-8) 0 var(--space-5);   /* 32 px: the wisps travel 34 px above the ring */
}

/* the brewing ring: --pct is registered so the arc sweeps between ticks */
.break-timer-ring {
    --pct: clamp(0, calc(var(--remaining-s, 1500) / var(--total-s, 1500)), 1);
    --text-timer: 56px;               /* fits the 164 px plate; the root token stays 64 for the mobile map */
    position: relative;
    display: grid;
    grid-template-columns: 100%;      /* the track never grows past the ring */
    place-items: center;
    width: 176px;
    aspect-ratio: 1;
    border-radius: 50%;
    /* the arc is painted in currentColor: gradient images never interpolate, so --low
       crossfades caramel→honey by transitioning `color` instead of swapping the background */
    color: var(--color-accent);
    background: conic-gradient(from -90deg,
        currentColor calc(var(--pct) * 360deg),
        var(--color-accent-soft) 0);
    transition: --pct 1s linear, color var(--duration-slow) var(--ease-standard);
}

/* inner plate */
.break-timer-ring::before {
    content: "";
    grid-area: 1 / 1;
    width: calc(100% - 12px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--color-surface);
    box-shadow: var(--inset-paper);
}

/* three steam wisps rising from the top of the ring */
.break-timer-ring::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -34px;
    width: 56px;
    height: 40px;
    transform: translateX(-50%);
    pointer-events: none;
    background:
        radial-gradient(6px 12px at 10px 100%, var(--color-border-strong) 0%, transparent 70%),
        radial-gradient(6px 12px at 28px 100%, var(--color-border-strong) 0%, transparent 70%),
        radial-gradient(6px 12px at 46px 100%, var(--color-border-strong) 0%, transparent 70%);
    background-repeat: no-repeat;
    background-size: 56px 40px;
    background-position: 0 40px, 0 40px, 0 40px;
    opacity: 0;
    animation:
        steam-wisps var(--duration-steam) ease-in-out infinite,
        steam-fade var(--duration-steam) ease-in-out infinite;
}

.break-timer {
    grid-area: 1 / 1;
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--text-timer);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--color-primary);
    transition: color var(--duration-slow) var(--ease-standard);
}

/* last five minutes: honey, breathing (the arc follows `color`) */
.break-timer-ring--low {
    color: var(--color-warning);
    animation: ring-breathe 2s ease-in-out infinite;
}
.break-timer-ring--low .break-timer { color: var(--color-warning); }

/* 00:00: quiet */
.break-timer-ring--done {
    background: var(--color-border-strong);
    animation: none;
    transition: none;
}
.break-timer-ring--done .break-timer { color: var(--color-text-muted); }
.break-timer-ring--done::after { display: none; }

.break-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-2);
}

/* candidate list */
.candidate-list {
    list-style: none;
    margin: 0 0 var(--space-5);
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.candidate-list > li {
    animation: card-in var(--duration-slow) var(--ease-out-soft) both;
}
.candidate-list > li:nth-child(1) { animation-delay: 0ms; }
.candidate-list > li:nth-child(2) { animation-delay: 40ms; }
.candidate-list > li:nth-child(3) { animation-delay: 80ms; }
.candidate-list > li:nth-child(4) { animation-delay: 120ms; }
.candidate-list > li:nth-child(5) { animation-delay: 160ms; }
.candidate-list > li:nth-child(6) { animation-delay: 200ms; }
.candidate-list > li:nth-child(7) { animation-delay: 240ms; }
.candidate-list > li:nth-child(8) { animation-delay: 280ms; }

.candidate-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: start;
    gap: var(--space-4);
    padding: var(--space-4);
    /* .card is added in markup; restated so the card look never depends on it */
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition:
        border-color var(--duration-base) var(--ease-standard),
        transform var(--duration-base) var(--ease-standard),
        background-color var(--duration-slow) var(--ease-standard);
}

.candidate-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.candidate-name {
    font-weight: 700;
    font-size: var(--text-body);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.candidate-interests {
    list-style: none;
    margin: var(--space-1) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
}

.candidate-join-btn {
    align-self: flex-start;
    margin-top: var(--space-2);
    min-height: var(--touch-min);
}

/* waiting: the card you joined pours to slate */
.candidate-card--waiting {
    background: var(--color-info-soft);
    border-color: var(--color-info);
}
.candidate-card--waiting:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--color-info);
}

.candidate-waiting {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    min-height: var(--touch-min);
    font-size: var(--text-small);
    font-weight: 700;
    line-height: 1.45;
    color: var(--color-info);
}
.candidate-waiting::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-info);
    animation: breathe 1.6s ease-in-out infinite;
}

/* empty vs failed */
.break-empty {
    margin-bottom: var(--space-5);
    /* base empty look, in case .empty-state is not yet on the element */
    text-align: center;
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-empty);
}

.break-empty--failed,
.break-empty.empty-state.break-empty--failed {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--text-body);
    color: var(--color-text);
    background: var(--color-danger-soft);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-md);
}
.break-empty.empty-state.break-empty--failed::before {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--color-danger);
    -webkit-mask: var(--icon-cracked-cup) center / contain no-repeat;
    mask: var(--icon-cracked-cup) center / contain no-repeat;
}

/* hub down or reconnecting: the list is polled, not pushed — stale but real → warning (honey) */
.break-live-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    padding: var(--space-1) 10px;
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-pill);
    font-size: var(--text-small);
    font-weight: 700;
    line-height: 1.45;
    animation: slide-in var(--duration-base) var(--ease-out-soft) both;
}
.break-live-chip::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background: var(--color-warning);
    -webkit-mask: var(--icon-cloud-slash) center / contain no-repeat;
    mask: var(--icon-cloud-slash) center / contain no-repeat;
}

/* Break idle without a usable profile: the card stands where the photo picker would */
.break-profile-needed {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    text-align: center;
}
.break-profile-needed h2 { margin: 0; }
.break-profile-needed p { margin: 0; color: var(--color-text-muted); }

/* ── Tables list (§6.9) ─────────────────────────────────────────────────────── */

.tables-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.tables-empty { /* empty pattern via .empty-state; base kept for the bare class */
    text-align: center;
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-empty);
}

/* ── Table / chat (§6.10) ───────────────────────────────────────────────────── */

/* The offer, said before anyone decides to start: the spec requires the AI label in the offer,
   the header and the transcript. The hint sits under the button and is read out with it. */

/* AI companion transparency badge — always rendered, not dismissible */
.companion-badge {
    display: inline-block;
    padding: 2px var(--space-2);
    background: var(--color-info-soft);
    color: var(--color-info);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* newest message pinned to the bottom with CSS only: reversed scroller, normal-order inner */
.table-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column-reverse;
    padding: var(--space-3) var(--space-1) var(--space-2);
}

.table-messages-inner {
    flex: none;            /* never shrink: the thread overflows the scroller, which starts at the bottom */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* empty conversation: the inner grows to fill the scroller (only then — a short thread must still
   start at the bottom) and shows a quiet cup watermark, centred by its auto margins, no text */
.table-messages-inner:not(:has(.table-message)) { flex: 1 0 auto; }
.table-messages-inner:not(:has(.table-message))::before {
    content: "";
    width: 48px;
    height: 48px;
    margin: auto;
    background: var(--color-border);
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}

.table-message {
    display: flex;
    flex-direction: column;
    max-width: 78%;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    line-height: 1.45;
    overflow-wrap: anywhere;
    animation: bubble-in var(--duration-slow) var(--ease-out-soft) both;
    transition:
        opacity var(--duration-slow) var(--ease-standard),
        border-color var(--duration-slow) var(--ease-standard);
}

.table-message--mine {
    align-self: flex-end;
    background: var(--bubble-mine-bg);
    color: var(--bubble-mine-text);
    border-bottom-right-radius: 4px;
}

.table-message--theirs {
    align-self: flex-start;
    background: var(--bubble-theirs-bg);
    color: var(--bubble-theirs-text);
    border-color: var(--bubble-stroke);
    border-bottom-left-radius: 4px;
}

.table-message--pending {
    opacity: .9;
    border: 1px dotted var(--color-border-strong);
}

/* Transparency, not styling: the conversation header is lost to a screenshot or a scrolled view,
   so every bubble the companion speaks in carries its own permanent AI marker. Palette tokens
   only — the same info pair the header badge uses, so the two read as one label. */
.table-message--companion {
    border-color: var(--color-info-soft);
}

.table-message-ai {
    display: block;
    align-self: flex-start;
    margin-bottom: 4px;
    padding: 1px var(--space-2);
    background: var(--color-info-soft);
    color: var(--color-info);
    border-radius: var(--radius-pill);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.6;
}

.table-message-body { display: block; }

.table-message-time {
    display: block;
    align-self: flex-end;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: var(--text-stamp);
    font-weight: 500;
    letter-spacing: .02em;
    line-height: 1.3;
    color: var(--bubble-theirs-stamp);
    text-align: right;
}
.table-message--mine .table-message-time { color: var(--bubble-mine-stamp); }

/* pending: a caramel dot after the time, pulsing until the echo lands */
.table-message--pending .table-message-time::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    vertical-align: middle;
    animation: pulse 1.2s ease-in-out infinite;
    content: "" / "sending";
}

/* failed: danger (cherry) — not sent, and the one bubble state that asks for a click */
.table-message--failed {
    background: var(--color-danger-soft);
    color: var(--color-text);
    border: 1px solid var(--color-danger);
}
.table-message--failed .table-message-time { color: var(--color-text-muted); }

.table-message-retry {
    align-self: flex-end;
    min-height: var(--touch-min);
    margin: var(--space-1) calc(-1 * var(--space-2)) calc(-1 * var(--space-2));
    padding: 0 var(--space-2);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--color-danger);
    font: inherit;
    font-size: var(--text-small);
    font-weight: 700;
    cursor: pointer;
}
.table-message-retry:hover { text-decoration: underline; }
.table-message-retry:focus-visible {
    outline: 2px solid var(--color-danger);
    outline-offset: 2px;
}

.table-composer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.table-composer-tools {
    display: flex;
    align-items: center;
}
/* Upload controls are labels. An inline label gives the empty masked span no box, so the glyph vanishes. */
button.table-composer-tool,
label.table-composer-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: var(--touch-min);
    min-height: var(--touch-min);
    padding: 0;
    background: transparent;
    color: var(--color-text);
    border-color: transparent;
    cursor: pointer;
}
button.table-composer-tool .emoji,
button.composer-emoji-choice .emoji {
    font-size: var(--text-h1);
    font-weight: 400;
    line-height: 1;
}
.table-composer-tool .photo-action-icon {
    display: block;
    width: var(--space-6);
    height: var(--space-6);
}
button.table-composer-tool:hover:not(:disabled),
label.table-composer-tool:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
button.table-composer-tool[aria-expanded="true"] {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
button.table-composer-tool:disabled,
label.table-composer-tool.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}
.composer-emoji {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}
button.composer-emoji-choice {
    width: var(--touch-min);
    min-height: var(--touch-min);
    padding: 0;
    background: transparent;
    color: inherit;
    border-color: transparent;
    font-size: var(--text-h1);
    line-height: 1;
}
button.composer-emoji-choice:hover:not(:disabled) {
    background: var(--color-primary-soft);
    color: inherit;
}
.table-message-photo {
    display: block;
    width: min(240px, 100%);
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--color-surface);
}
.table-photo-status {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-small);
}

.table-composer-input {
    height: var(--touch-min);
    min-width: 0;
    padding: 0 var(--space-4);
    background: transparent;
    border-color: transparent;
    border-radius: var(--radius-pill);
    box-shadow: none;
}
.table-composer-input:focus {
    border-color: transparent;
    box-shadow: var(--glow-accent);
}

.table-composer-send {
    min-height: var(--touch-min);
    padding: 0 var(--space-5) 0 var(--space-4);
}
.table-composer-send::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--icon-plane) center / contain no-repeat;
    mask: var(--icon-plane) center / contain no-repeat;
}
/* disabled most of the time: readable (8.03:1), not dimmed */
.table-composer-send:disabled {
    opacity: 1;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-border);
}

/* keep panel */
.table-keep {
    position: relative;
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition:
        background-color var(--duration-slow) var(--ease-standard),
        border-color var(--duration-slow) var(--ease-standard);
}

.keep-seats {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
    gap: var(--space-6);
    margin: var(--space-2) 0 var(--space-4);
}

.keep-seat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    min-width: 48px;
    max-width: 120px;
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-text-muted);
    text-align: center;
    overflow-wrap: anywhere;
}

/* coaster ring */
.keep-seat::before {
    content: "";
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px dashed var(--color-border-strong);
    background: transparent;
    transition:
        background-color var(--duration-slow) var(--ease-standard),
        border-color var(--duration-slow) var(--ease-standard);
}

/* cup glyph or breathing dot, centred on the ring */
.keep-seat::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translateX(-50%);
    opacity: 0;
}

.keep-seat--filled { color: var(--color-text); font-weight: 700; }
.keep-seat--filled::before {
    border-style: solid;
    border-color: var(--color-primary);
    background: var(--color-primary);
}
.keep-seat--filled::after {
    opacity: 1;
    background: var(--color-on-primary);
    -webkit-mask: var(--icon-mug) center / contain no-repeat;
    mask: var(--icon-mug) center / contain no-repeat;
}

.table-retention-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-text-muted);
    transition: opacity var(--duration-slow) var(--ease-standard);
}
.table-retention-notice::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    background: currentColor;
    -webkit-mask: var(--icon-clock) center / contain no-repeat;
    mask: var(--icon-clock) center / contain no-repeat;
}

.table-keep-state {
    font-size: var(--text-body);
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

.table-keep-button {
    min-height: var(--touch-min);
    transition:
        background var(--duration-fast) var(--ease-standard),
        color var(--duration-fast) var(--ease-standard),
        transform var(--duration-fast) var(--ease-standard);   /* the glow swaps statically (§8) */
}
.table-keep-button::after {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--icon-mug) center / contain no-repeat;
    mask: var(--icon-mug) center / contain no-repeat;
}

.table-keep-error { margin: var(--space-4) 0 0; }

/* --mine: I kept, waiting on them (slate) */
.table-keep--mine {
    background: var(--color-info-soft);
    border-color: var(--color-info);
}
.table-keep--mine .keep-seat:not(.keep-seat--filled)::before { border-color: var(--color-info); }
.table-keep--mine .keep-seat:not(.keep-seat--filled)::after {
    opacity: 1;
    width: 8px;
    height: 8px;
    top: 12px;
    border-radius: 50%;
    background: var(--color-info);
    -webkit-mask: none;
    mask: none;
    animation: breathe 1.6s ease-in-out infinite;
}
.table-keep-state--mine { color: var(--color-info); }

/* --theirs: they kept first, your move (caramel) */
.table-keep--theirs {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}
.table-keep--theirs .eyebrow,
.table-keep--theirs .table-retention-notice,
.table-keep--theirs .keep-seat { color: var(--color-accent-text); }   /* muted is 4.46:1 on accent-soft */
.table-keep-state--theirs {
    color: var(--color-accent-text);
    font-weight: 700;
}
.table-keep--theirs .table-keep-button {
    box-shadow: var(--glow-accent);
    animation: nudge var(--duration-seal) var(--ease-spring) 1 both;
    animation-delay: var(--duration-slow);
}

/* --both: kept by both (sage) + the seal */
.table-keep--both {
    background: var(--color-success-soft);
    border-color: var(--color-success);
    border-width: 2px;
}
.table-keep--both .keep-seats { padding-right: 56px; }
.table-keep--both .keep-seat { color: var(--color-text); }
.table-keep--both .keep-seat::before {
    border-style: solid;
    border-color: var(--color-success);
    background: var(--color-success);
}
.table-keep--both .keep-seat::after {
    opacity: 1;
    background: var(--color-success-soft);
    -webkit-mask: var(--icon-mug) center / contain no-repeat;
    mask: var(--icon-mug) center / contain no-repeat;
}
/* the seal — ring + check — springs in at the right of the seats */
.table-keep--both .keep-seats::after {
    content: "";
    position: absolute;
    right: 0;
    top: -4px;
    width: 40px;
    height: 40px;
    background: var(--color-success);
    -webkit-mask: var(--icon-seal) center / contain no-repeat;
    mask: var(--icon-seal) center / contain no-repeat;
    animation: seal-in var(--duration-seal) var(--ease-spring) both;
}
/* its glow, on a separate layer so only opacity animates */
.table-keep--both .keep-seats::before {
    content: "";
    position: absolute;
    right: 0;
    top: -4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: var(--glow-success);
    animation: glow-fade 1.6s var(--ease-standard) var(--duration-seal) both;
}
.table-keep-state--both {
    color: var(--color-success);
    font-weight: 700;
}

/* --none: as the base (the button has no rest shadow, so nothing to clear — a box-shadow:none here would kill the focus halo) */
.table-keep-state--none { color: var(--color-text); }

/* ── Motion (§8) ────────────────────────────────────────────────────────────── */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes chip-in {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes breathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .5; transform: scale(.7); }
}

@keyframes ring-breathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: .85; }
}

@keyframes steam-rise {
    0%   { opacity: 0;   transform: translateY(6px) scale(.8); }
    20%  { opacity: .9; }
    60%  { opacity: .4;  transform: translateY(-14px) scale(1.1); }
    100% { opacity: 0;   transform: translateY(-26px) scale(1.2); }
}

@keyframes steam-wisps {
    0%   { background-position: 0 40px, 0 40px, 0 40px; }
    100% { background-position: 4px -40px, -4px -34px, 3px -38px; }
}

@keyframes steam-fade {
    0%   { opacity: 0; }
    15%  { opacity: .9; }
    70%  { opacity: .5; }
    100% { opacity: 0; }
}

@keyframes coffee-rise {
    0%   { background-position: 0 0; }
    80%  { background-position: 0 100%; }
    100% { background-position: 0 100%; }
}

@keyframes seal-in {
    from { opacity: 0; transform: scale(1.3) rotate(-8deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes glow-fade {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes nudge {
    0%   { transform: translateY(0); }
    40%  { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

/* ── Responsive (§6.0, §6.1) ────────────────────────────────────────────────── */

@media (min-width: 640px) and (max-width: 767.98px) {
    .candidate-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
    .content { padding: var(--space-10) var(--space-5) var(--space-16); }

    /* Break live: timer block 240 px sticky on the left, candidates on the right */
    .break-live {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: var(--space-6);
        row-gap: 0;
        align-items: start;
    }
    .break-live > * { grid-column: 2; }
    .break-live > .break-live-head {
        grid-column: 1;
        grid-row: 1 / span 12;
        position: sticky;
        top: calc(var(--nav-height) + var(--space-4));
        margin-bottom: 0;
        padding: var(--space-5) var(--space-4);
        min-width: 0;
    }
    .break-live-head > .eyebrow,
    .break-live-head > h1 { max-width: 100%; overflow-wrap: break-word; }
    .break-live-head .break-actions { flex-direction: column; align-items: stretch; width: 100%; min-width: 0; }
    .break-live-head .break-actions > * {
        width: 100%;
        min-width: 0;
        white-space: normal;
        height: auto;
        line-height: 1.15;
        text-align: center;
    }
    .break-live > .eyebrow { margin-top: 0; }
}

/* The shared sign-in (Account), kept apart from the Coffeetime profile. */
.account-check { margin-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.account-check-title { margin: 0; font-size: var(--text-lede); }
.account-check-state { margin: 0; display: flex; align-items: center; gap: var(--space-2); }
.account-check.is-done .account-check-state::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    background: var(--color-success);
    -webkit-mask: var(--icon-check) center / 14px no-repeat, linear-gradient(#000 0 0);
    mask: var(--icon-check) center / 14px no-repeat, linear-gradient(#000 0 0);
}
.account-form { display: flex; flex-direction: column; gap: var(--space-2); }
.account-code { max-width: 12ch; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.account-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.account-note, .account-honest { margin: 0; }
.profile-account { margin-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.profile-account h2, .profile-account p { margin: 0; }

@media (max-width: 767.98px) {
    /* A long translation stays one line; the bar grows a row instead of clipping it. */
    .nav-bar { height: auto; min-height: var(--nav-height); padding: 0 var(--space-4); }
    .nav-bar nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; }
    .nav-bar nav a,
    .nav-bar nav .btn-link,
    .nav-bar nav .nav-menu > .nav-menu-summary,
    .nav-bar .lang-open {
        min-width: min(100%, max-content);
        max-width: 100%;
        white-space: nowrap;
    }

    .profile-details { grid-template-columns: 1fr; }
    .profile-details dt { padding-bottom: var(--space-1); padding-right: 0; }
    .profile-details dd { border-top: 0; padding-top: 0; }
}

@media (max-width: 480px) {
    .content { padding: var(--space-4) var(--space-4) var(--space-8); }
    .px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }

    /* nav becomes a bottom bar */
    .nav-bar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        min-height: 56px;
        padding: 0 var(--space-2);
        padding-bottom: env(safe-area-inset-bottom);
        gap: var(--space-2);
        background: var(--color-surface-elevated);
        border-bottom: 0;
        border-top: 1px solid var(--color-border);
        box-shadow: var(--shadow-up);
    }
    .nav-bar .brand {
        flex: none;
        min-width: 56px;
        min-height: 56px;
        justify-content: center;
    }
    .nav-bar .brand svg { width: 26px; height: 26px; }
    /* UX-51: hidden visually, never from assistive tech — the home link keeps its name (axe link-name) */
    .nav-bar .brand-text {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .nav-bar nav {
        flex: 1 1 auto;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
        row-gap: 2px;
    }
    .nav-bar nav a,
    .nav-bar nav .btn-link,
    .nav-bar .lang-open {
        flex: 1 1 auto;
        justify-content: center;
        width: auto;
        min-width: min(100%, max-content);
        max-width: 100%;
        min-height: 44px;
        height: auto;
        padding: 6px var(--space-2);
        border-radius: var(--radius-sm);
        font-size: 13px;
        line-height: 1.15;
        text-align: center;
        white-space: nowrap;
    }
    .nav-bar .lang-open { margin-left: 0; }
    .nav-bar nav .nav-menu { flex: 1 1 auto; display: flex; min-width: min(100%, max-content); max-width: 100%; }
    .nav-bar nav .nav-menu > .nav-menu-summary {
        flex: 1 1 auto;
        justify-content: center;
        width: auto;
        min-width: min(100%, max-content);
        max-width: 100%;
        min-height: 44px;
        height: auto;
        padding: 6px var(--space-2);
        font-size: 13px;
        line-height: 1.15;
        text-align: center;
        white-space: nowrap;
    }
    .nav-menu-panel { top: auto; bottom: calc(100% + 8px); }
    .nav-bar nav .nav-menu-panel a,
    .nav-bar nav .nav-menu-panel .btn-link {
        flex: none;
        min-height: var(--touch-min);
        font-size: 14px;
    }
    /* Signed-in bar measures 91 px at 320 px (Greek). The guest bar, with four long pills, measures 161 px. */
    .legal-footer { margin-bottom: calc(104px + env(safe-area-inset-bottom)); }
    .page:has(.nav-bar a[href="register"]) .legal-footer { margin-bottom: calc(176px + env(safe-area-inset-bottom)); }
    .nav-bar nav a::after {
        left: 25%;
        right: 25%;
        bottom: 8px;
    }
    .nav-bar nav a.btn-primary,
    .nav-bar nav a.btn-ghost {
        min-height: 44px;
        margin: 6px 0;
        border-radius: var(--radius-pill);
    }
    main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
    .page:has(.nav-bar a[href="register"]) main { padding-bottom: calc(176px + env(safe-area-inset-bottom)); }

    :root { --text-timer: 48px; }
    .break-timer-ring { --text-timer: 44px; width: 144px; }
    .break-timer-ring::before { width: calc(100% - 10px); }
    .break-timer-ring::after { top: -30px; }

    .break-live-head { padding: var(--space-5) var(--space-4); }

    .candidate-list { gap: var(--space-3); }
    .candidate-card { padding: var(--space-3); border-radius: var(--radius-md); }
    .candidate-join-btn { align-self: stretch; }

    .auth-card { padding: var(--space-6) var(--space-5); }
    .auth-card h1 { font-size: 32px; }

    .drop-zone { min-height: 180px; padding: var(--space-5); }
    .upload-state { min-height: 180px; }

    .keep-seats { gap: var(--space-5); }
    .table-keep { border-radius: var(--radius-lg); }
}

/* ── Reduced motion (§8) ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-fast:  1ms;
        --duration-base:  1ms;
        --duration-slow:  1ms;
        --duration-seal:  1ms;
        --duration-steam: 1ms;
    }

    *, *::before, *::after {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    /* The background clip already resolves to nothing: its <source> elements carry
       media="(prefers-reduced-motion: no-preference)", so no source is selected and
       no bytes are fetched — verified in Chromium, where a non-matching query leaves
       networkState at NETWORK_NO_SOURCE. Firefox has historically ignored `media` on
       a video's sources, so hide the element too and let the poster stand in. */
    .bg-video-el { display: none; }

    /* the ring keeps its static progress; no sweep, no breathe, no steam */
    .break-timer-ring { transition: none; animation: none; }
    .break-timer-ring::after,
    .boot-steam { display: none; }

    /* loops become static: skeletons are hard-stop two-tone blocks, the upload panel stays flat */
    .skeleton {
        animation: none;
        background: linear-gradient(90deg, var(--color-primary-soft) 0 65%, var(--color-surface) 65%);
        background-size: 100% 100%;
    }
    .upload-state {
        animation: none;
        background: var(--color-primary-soft);
    }
    .upload-state::before { animation: none; background-position: 0 100%; }
    .candidate-waiting::before,
    .table-keep--mine .keep-seat:not(.keep-seat--filled)::after,
    .table-message--pending .table-message-time::after {
        animation: none;
        opacity: 1;
    }
    .table-keep--both .keep-seats::before { animation: none; opacity: 0; }
    .table-keep--theirs .table-keep-button { animation: none; }
    }

/* ── Wave 1 · Break & match moment ──────────────────────────────────────────────
   UX-10 match moment · UX-11 attention opt-in · UX-15 your cup in the ring ·
   UX-16 candidate cards · UX-17 break-over. Tokens only; dark mode via the tokens.
   Motion: transform/opacity only; reduced motion at the end of this block.        */

/* UX-15 — your coffee inside the brewing ring; the digits sit on a saucer on the lower rim */
.break-timer-ring--cup {
    width: 196px;
    --text-timer: 30px;
}
.break-timer-ring--cup::before { display: none; }   /* the cup replaces the plate */
.break-timer-cup {
    grid-area: 1 / 1;
    width: calc(100% - 14px);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--color-primary-soft);
    box-shadow: 0 0 0 3px var(--color-surface);
}
.break-timer-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.break-timer-cupmark {
    width: 42%;
    aspect-ratio: 1;
    background: var(--color-primary);
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}
.break-timer-ring--cup .break-timer {
    grid-area: auto;
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    line-height: 1;
}
.break-timer-ring--cup.break-timer-ring--low .break-timer {
    border-color: var(--color-warning);
    background: var(--color-warning-soft);
}
.break-timer-block:has(.break-timer-ring--cup) { margin-bottom: var(--space-10); }

/* UX-16 — candidate card: photo hero, note, honest time chip; not a button, so no lift */
.candidate-card.candidate-card--hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.candidate-card--hero:hover { transform: none; }
.candidate-hero {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    background: var(--color-primary-soft);
    overflow: hidden;
}
.candidate-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.candidate-photo--placeholder {
    display: grid;
    place-items: center;
    background: var(--color-primary-soft);
}
.candidate-photo--placeholder::before {
    content: "";
    width: 72px;
    height: 72px;
    background: var(--color-primary);
    opacity: .55;
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}
.candidate-time {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-1) 10px;
    background: var(--color-surface-elevated);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    font-size: var(--text-small);
    font-weight: 700;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}
.candidate-time::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: var(--icon-clock) center / contain no-repeat;
    mask: var(--icon-clock) center / contain no-repeat;
}
.candidate-time--low {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: var(--color-warning);
}
.candidate-note {
    position: absolute;
    left: var(--space-3);
    bottom: var(--space-3);
    max-width: calc(100% - var(--space-6));
    padding: 6px var(--space-3);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 17px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    transform: rotate(-1.5deg);
    transform-origin: left bottom;
}
.candidate-card--hero .candidate-info {
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-5);
}
.candidate-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}
.candidate-card--hero .candidate-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: 500;
    line-height: 1.2;
}
.candidate-shared-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    border-radius: var(--radius-pill);
    font-size: var(--text-small);
    font-weight: 700;
    line-height: 1.45;
    white-space: nowrap;
}
.candidate-nearby {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 1px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    background: transparent;
    font-family: var(--font-body);
    font-size: var(--text-small);
    font-style: normal;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
}
.candidate-langs,
.candidate-card--hero .candidate-interests {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip.chip--lang {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-strong);
    font-size: var(--text-caption);
    font-weight: 700;
    letter-spacing: .02em;
}
.candidate-card--hero .candidate-interests .chip.chip--shared {
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    font-weight: 700;
}
.candidate-card--hero .candidate-interests .chip.chip--other {
    background: var(--color-primary-soft);
    color: var(--color-text);
}
.candidate-card--hero .candidate-join-btn {
    align-self: stretch;
    margin-top: var(--space-2);
}
.candidate-join-btn--busy::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: spin .8s linear infinite;
}
.candidate-join-btn.candidate-join-btn--busy:disabled { opacity: .85; cursor: progress; }
.candidate-waiting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-1);
}
.candidate-waiting-row .candidate-waiting { margin-top: 0; }
.candidate-card--waiting .candidate-cancel-btn { color: var(--color-info); }
.candidate-card--waiting .candidate-cancel-btn:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
}
.candidate-card--waiting .candidate-note { box-shadow: var(--shadow-sm); }

/* arrival (existing card-in) and exit: a person leaving fades out in place before removal */
.candidate-list > li.is-leaving {
    animation: w1-card-out var(--duration-slow) var(--ease-standard) forwards;
    pointer-events: none;
}

/* UX-11 — opt-in, asked while you wait; and its quiet status line */
.break-live > .attention-offer { order: 2; }
.break-live > .attention-status { order: 4; }
.attention-offer {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: var(--space-3);
    row-gap: var(--space-3);
    align-items: start;
    margin: 0 0 var(--space-4);
    padding: var(--space-4);
    animation: slide-in var(--duration-base) var(--ease-out-soft) both;
}
.attention-offer-icon {
    width: 22px;
    height: 22px;
    margin-top: 1px;
    background: var(--color-accent-text);
    -webkit-mask: var(--icon-bell) center / contain no-repeat;
    mask: var(--icon-bell) center / contain no-repeat;
}
.attention-offer-text { margin: 0; line-height: 1.45; }
.attention-offer-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.attention-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: var(--space-1);
    margin: 0 0 var(--space-4);
    font-size: var(--text-small);
    color: var(--color-text-muted);
}
.attention-status-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: var(--space-2);
}
.attention-status-text::before {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--icon-bell) center / contain no-repeat;
    mask: var(--icon-bell) center / contain no-repeat;
}
.attention-status .btn-link { font-size: var(--text-small); }
.attention-status .btn-link[aria-pressed]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid currentColor;
}
.attention-status .btn-link[aria-pressed="true"]::before { background: currentColor; }

/* UX-10 — the match moment: an opaque paper scene, two cups meet, a sage seal lands */
.match-moment {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: var(--space-6) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));
    background-color: var(--color-bg);
    background-image:
        radial-gradient(56% 38% at 50% 34%, var(--color-success-soft), transparent 72%),
        var(--grain-tile);
    cursor: pointer;
    animation: w1-fade-in var(--duration-slow) var(--ease-standard) both;
}
.match-moment-stage {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
}
.match-cups {
    position: relative;
    width: 284px;
    height: 188px;
    margin-bottom: var(--space-6);
}
.match-cup {
    position: absolute;
    top: 0;
    width: 156px;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--color-primary-soft);
    box-shadow: 0 0 0 5px var(--color-surface), var(--shadow-lg);
}
.match-cup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.match-cup:not(:has(img))::before {
    content: "";
    width: 40%;
    aspect-ratio: 1;
    background: var(--color-primary);
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}
.match-cup--mine {
    left: 0;
    z-index: 1;
    transform: rotate(-5deg);
    animation: w1-cup-left 760ms var(--ease-out-soft) both;
}
.match-cup--theirs {
    right: 0;
    transform: rotate(5deg);
    animation: w1-cup-right 760ms var(--ease-out-soft) both;
}
.match-seal {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 2;
    width: 60px;
    height: 60px;
    margin-left: -30px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 5px var(--color-surface), var(--glow-success);
    animation: seal-in var(--duration-seal) var(--ease-spring) 620ms both;
}
.match-seal::before {
    content: "";
    position: absolute;
    inset: 14px;
    background: var(--color-surface);
    -webkit-mask: var(--icon-check) center / contain no-repeat;
    mask: var(--icon-check) center / contain no-repeat;
}
.match-eyebrow {
    color: var(--color-success);
    animation: w1-rise var(--duration-slow) var(--ease-out-soft) 380ms both;
}
.match-title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-h1);
    font-weight: 500;
    line-height: 1.15;
    max-width: 18ch;
    animation: w1-rise var(--duration-seal) var(--ease-out-soft) 420ms both;
}
.match-shared {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    animation: w1-rise var(--duration-seal) var(--ease-out-soft) 560ms both;
}
.match-shared-label {
    margin: 0;
    color: var(--color-text-muted);
}
.match-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
}
.match-chip {
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    font-weight: 700;
}
.match-cta {
    position: relative;
    overflow: hidden;
    min-width: 220px;
    margin-top: var(--space-6);
    animation: w1-rise var(--duration-seal) var(--ease-out-soft) 640ms both;
}
/* the tab is hidden: the scene waits for the person */
.match-moment--paused,
.match-moment--paused * { animation-play-state: paused; }

/* UX-17 — break-over: the ending as a scene */
.break-over {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.break-over-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
    animation: card-in var(--duration-slow) var(--ease-out-soft) both;
}
.break-over-cup {
    width: 116px;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    margin-bottom: var(--space-5);
    background: var(--color-primary-soft);
    box-shadow: 0 0 0 5px var(--color-surface), 0 0 0 7px var(--color-border-strong);
}
.break-over-cup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.break-over-card h1 { margin-bottom: var(--space-3); }
.break-over-card .loading-state { width: 100%; align-items: center; }
.break-over-lede {
    margin: 0 auto var(--space-4);
    color: var(--color-text);
    font-size: 18px;
}
.break-over-kept {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--color-success-soft);
    color: var(--color-success);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: var(--text-small);
    text-align: left;
}
.break-over-kept::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-seal) center / contain no-repeat;
    mask: var(--icon-seal) center / contain no-repeat;
}
.break-over-note {
    max-width: 38ch;
    margin: 0 auto var(--space-3);
    color: var(--color-text-muted);
}
.break-over-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}
.break-over-barista {
    align-items: center;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
    width: 100%;
}

@keyframes w1-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes w1-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes w1-cup-left {
    0%   { opacity: 0; transform: translateX(-70vw) rotate(-22deg); }
    72%  { opacity: 1; transform: translateX(8px) rotate(-3deg); }
    100% { opacity: 1; transform: translateX(0) rotate(-5deg); }
}
@keyframes w1-cup-right {
    0%   { opacity: 0; transform: translateX(70vw) rotate(22deg); }
    72%  { opacity: 1; transform: translateX(-8px) rotate(3deg); }
    100% { opacity: 1; transform: translateX(0) rotate(5deg); }
}
@keyframes w1-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes w1-card-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(.97); }
}

@media (max-width: 480px) {
    .match-cups { width: 248px; height: 164px; }
    .match-cup { width: 136px; }
    .match-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    /* the match moment is a static card that cross-fades in — no sliding cups, no seal spring */
    .match-moment { animation: w1-fade-in 240ms var(--ease-standard) both !important; }
    .match-cup, .match-seal, .match-eyebrow, .match-title, .match-shared, .match-cta {
        animation: none !important;
    }
    .candidate-list > li.is-leaving { animation: none; opacity: 0; }
    .candidate-join-btn--busy::before { animation: none; border-top-color: currentColor; opacity: .6; }
    .attention-offer, .break-over-card { animation: none; }
}
/* ── end Wave 1 · Break & match moment ── */

/* ── Wave 2 · Break ──────────────────────────────────────────────────────────────
   Stop waiting (busy + inline error) · UX-19 live-room cue · UX-30 barista card and mark.
   Tokens only; dark mode via the tokens. Motion: one breathing dot while the hub is live,
   three steam drifts on the barista's mark, both off under reduced motion.          */

/* UX-19 — the live-room line takes the eyebrow's slot above the list */
.break-live > .live-room { order: 1; }
.live-room {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 20px;
    margin: 0 0 var(--space-3);
}
.live-room > .eyebrow { margin: 0; }
/* live = the hub is connected (sage: it is safe to trust the list); the halo breathes, the dot does not */
.live-room-dot {
    flex: none;
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
}
.live-room-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: var(--color-success);
    opacity: 0;
    animation: w2-live-breathe 2.8s ease-in-out infinite;
}
.live-room-cue {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-2);
    row-gap: 2px;
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}
/* with a count the line can wrap: the dot sits on the first line, not in the middle of two */
.live-room:has(.live-room-cue) { align-items: flex-start; }
.live-room:has(.live-room-cue) > .live-room-dot { margin-top: 6px; }
/* a clause never breaks inside; the separator trails its clause so no line starts with it */
.live-room-clause { white-space: nowrap; }
.live-room-clause:first-child { color: var(--color-text); font-weight: 700; }
.live-room-clause:not(:last-child)::after {
    content: "·" / ",";
    margin-left: var(--space-2);
    color: var(--color-border-strong);
    font-weight: 700;
}

/* Stop waiting — its own busy state, and a small inline failure while the card keeps waiting */
.candidate-cancel-btn--busy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.candidate-cancel-btn--busy::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: spin .8s linear infinite;
}
.candidate-card--waiting .candidate-cancel-btn--busy:disabled { opacity: .85; cursor: progress; }
.candidate-stop-error {
    margin: var(--space-2) 0 0;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-text);
    background: var(--color-danger-soft);
    border-left: 3px solid var(--color-danger);
    border-radius: var(--radius-sm);
    animation: slide-in var(--duration-base) var(--ease-out-soft) both;
}

/* UX-30 — the barista card: mark, name + AI label, voice, disclosure, CTA */
.break-live > .break-live-barista { order: 5; margin-top: var(--space-4); }
.break-live > .break-live-barista--next { order: 3; margin-top: 0; margin-bottom: var(--space-5); }
.break-idle-barista { align-self: stretch; margin-top: var(--space-8); }
.barista-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    text-align: left;
    padding: var(--space-5);
}
.barista-card--compact { gap: var(--space-3); padding: var(--space-4); }
.barista-card--primary {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
}
.barista-card-avatar { flex: none; }
.barista-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}
.barista-card-name {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
}
.barista-card-badge { font-family: var(--font-body); font-size: var(--text-caption); line-height: 1.5; }
.barista-card-voice {
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    line-height: 1.45;
    color: var(--color-text);
}
.barista-card-disclosure {
    margin: 0;
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-info);
}
.barista-card-cta { margin-top: var(--space-3); }
.barista-card--compact .barista-card-name { font-size: 17px; }
.barista-card--compact .barista-card-voice { font-size: 15px; }
/* inside the break-over card it is a section of that card, not a second card */
.break-over-barista .barista-card {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

/* the mark — every colour a token, so dark mode follows */
.barista-avatar { display: block; overflow: visible; }
.barista-avatar-disc { fill: var(--color-accent-soft); }
.barista-avatar-steam { stroke: var(--color-accent); }
.barista-avatar-steam path { animation: w2-steam 3.2s ease-in-out 3 both; }
.barista-avatar-steam path + path { animation-delay: .5s; }
.barista-avatar-saucer { fill: var(--color-border-strong); }
.barista-avatar-body { fill: var(--color-surface-elevated); }
.barista-avatar-cup { stroke: var(--color-primary); }
.barista-avatar-handle { stroke: var(--color-primary); }
.barista-avatar-coffee { fill: var(--color-primary); }
.barista-avatar-apron { fill: var(--color-accent); }
.barista-avatar-bow { fill: var(--color-accent-text); stroke: var(--color-accent-text); }

@keyframes w2-live-breathe {
    0%, 100% { opacity: 0;   transform: scale(.5); }
    50%      { opacity: .28; transform: scale(1); }
}
@keyframes w2-steam {
    0%, 100% { opacity: 1;  transform: translateY(0); }
    50%      { opacity: .45; transform: translateY(-2px); }
}

@media (max-width: 480px) {
    .barista-card { padding: var(--space-4); gap: var(--space-3); }
    .break-idle-barista { margin-top: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
    .live-room-dot::after, .barista-avatar-steam path { animation: none; }
    .live-room-dot::after { opacity: .2; transform: none; }
    .candidate-cancel-btn--busy::before { animation: none; border-top-color: currentColor; opacity: .6; }
    .candidate-stop-error { animation: none; }
}
/* ── end Wave 2 · Break ── */

/* ── Wave 1 · Table ──────────────────────────────────────────────────────────────
   UX-12 clock, UX-13 hierarchy, UX-14 incoming call + call controls, UX-18 icebreakers.
   One full-height column: header → transcript (every remaining pixel) → composer. The page
   shell hands the Table the viewport through :has() — no magic max-height sums; the ≤480
   bottom bar is already reserved by main's padding. Tokens only; dark mode via the tokens.
   ──────────────────────────────────────────────────────────────────────────────── */

.page:has(.table-screen) {
    height: 100dvh;
    min-height: 0;
}
.page:has(.table-screen) main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.content:has(> .table-screen) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: var(--space-4);
    padding-bottom: var(--space-3);
}

.table-screen {
    --call-screen: #1A120D;        /* a video well is dark in both themes */
    --call-screen-text: #F3E9DD;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}
.table-screen > * { flex: none; }

/* header: avatar · name · actions, the clock on its own row beneath */
.table-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "avatar name actions"
        "avatar meta meta";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: 2px;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}
.table-head:not(:has(.table-head-meta)) { grid-template-areas: "avatar name actions"; }

.table-avatar {
    grid-area: avatar;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-border);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}

.table-head-text { grid-area: name; min-width: 0; }
.table-head .table-bell {
    grid-column: 1 / -1;
    margin: var(--space-1) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-lede);
}
.table-bell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-1);
}
.bell-days {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
/* Ghost buttons ignore aria-pressed, and button.btn-ghost:hover repaints every day the same.
   These selectors stay ahead of that pair so a chosen day stays a filled chip. */
button.btn-ghost.bell-day {
    min-height: var(--touch-min);
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border-input);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 700;
}
button.btn-ghost.bell-day:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
button.btn-ghost.bell-day[aria-pressed="true"] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}
button.btn-ghost.bell-day[aria-pressed="true"]:hover:not(:disabled) {
    border-color: var(--color-primary-hover);
    background: var(--color-primary-hover);
    color: var(--color-on-primary);
}
button.btn-ghost.bell-day[aria-pressed="true"]::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: none;
    background: currentColor;
    -webkit-mask: var(--icon-check) center / contain no-repeat;
    mask: var(--icon-check) center / contain no-repeat;
}
.bell-preview {
    margin: 0;
    color: var(--color-text);
    font-weight: 700;
}
.bell-slot {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.bell-slot + .bell-slot {
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}
.bell-suggest {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.bell-suggest::before {
    content: "";
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    background: currentColor;
    -webkit-mask: var(--icon-clock) center / contain no-repeat;
    mask: var(--icon-clock) center / contain no-repeat;
}
.bell-suggest:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-on-primary, #fff);
}
.bell-suggest:disabled {
    opacity: 0.55;
    cursor: default;
}
.table-head-eyebrow { margin: 0; }
.table-head .table-partner {
    margin: 0;
    font-size: var(--text-h2);
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The AI label is a required phrase, not a person's name: it wraps inside the column
   instead of being clipped by the name's ellipsis. */
.table-head .table-partner:has(.companion-badge) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
.table-head .companion-badge {
    max-width: 100%;
    margin-left: 0;
    font-family: var(--font-body);
    line-height: 1.3;
    overflow-wrap: break-word;
    white-space: normal;
}
.table-head-meta { grid-area: meta; min-width: 0; }
.table-head-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: var(--text-small);
    color: var(--color-text-muted);
}
.table-head-status::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: var(--icon-lock) center / contain no-repeat;
    mask: var(--icon-lock) center / contain no-repeat;
}
.table-head-status--kept { color: var(--color-success); font-weight: 700; }
.table-head-status--kept::before {
    -webkit-mask-image: var(--icon-seal);
    mask-image: var(--icon-seal);
}

.table-head-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* UX-12 — the mini ring and its line */
.table-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: var(--text-small);
    line-height: 1.35;
    color: var(--color-text-muted);
}
.table-countdown-ring {
    flex: none;
    width: 18px;
    height: 18px;
    transform: rotate(-90deg);
}
.table-countdown-track,
.table-countdown-arc {
    fill: none;
    stroke-width: 3;
}
.table-countdown-track { stroke: var(--color-border); }
.table-countdown-arc {
    stroke: var(--color-accent);
    stroke-linecap: round;
    stroke-dasharray: 100;
    transition: stroke-dashoffset 1s linear, stroke var(--duration-slow) var(--ease-standard);
}
.table-countdown-clock {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}
/* last five minutes: honey, and the ring breathes */
.table-countdown--low { color: var(--color-warning); }
.table-countdown--low .table-countdown-clock { color: var(--color-warning); }
.table-countdown--low .table-countdown-arc {
    stroke: var(--color-warning);
    animation: ring-breathe 2s ease-in-out infinite;
}
.table-countdown--zero .table-countdown-arc { stroke: var(--color-border-strong); }

/* the seat chip: two coasters + the keep state in words — opens the keep sheet */
.seat-chip,
.seat-chip:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.seat-chip {
    gap: var(--space-2);
    min-height: var(--touch-min);
    padding: 0 var(--space-3) 0 var(--space-2);
    font-size: var(--text-small);
    letter-spacing: 0;
}
.seat-chip:hover:not(:disabled) { border-color: var(--color-border-strong); }
.seat-chip-dots { display: inline-flex; }
.seat-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px dashed var(--color-border-strong);
    background: var(--color-surface);
}
.seat-dot + .seat-dot { margin-left: -5px; }
.seat-dot--filled {
    border-style: solid;
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.seat-chip--mine,
.seat-chip--mine:hover:not(:disabled) {
    background: var(--color-info-soft);
    color: var(--color-info);
    border-color: var(--color-info);
}
.seat-chip--mine .seat-dot { border-color: var(--color-info); background: var(--color-info-soft); }
.seat-chip--mine .seat-dot--filled { background: var(--color-info); }
.seat-chip--mine .seat-dot:not(.seat-dot--filled) { animation: breathe 1.6s ease-in-out infinite; }

.seat-chip--theirs,
.seat-chip--theirs:hover:not(:disabled) {
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    border-color: var(--color-accent);
}
.seat-chip--theirs { box-shadow: 0 0 0 3px var(--color-accent-soft); }
.seat-chip--theirs .seat-dot { border-color: var(--color-accent-text); background: var(--color-accent-soft); }
.seat-chip--theirs .seat-dot--filled { background: var(--color-accent-text); }

.seat-chip--both,
.seat-chip--both:hover:not(:disabled) {
    background: var(--color-success-soft);
    color: var(--color-success);
    border-color: var(--color-success);
}
.seat-chip--both .seat-dot { border-color: var(--color-success); background: var(--color-success); }
.seat-chip--both .seat-chip-label::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: var(--icon-check) center / contain no-repeat;
    mask: var(--icon-check) center / contain no-repeat;
}

/* the Call icon button in the header */
.table-call-btn,
.table-call-btn:hover:not(:disabled) {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-border);
}
.table-call-btn {
    width: var(--touch-min);
    padding: 0;
}
.table-call-btn:hover:not(:disabled) { background: var(--color-accent-soft); border-color: var(--color-border-strong); }
.table-call-btn::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--icon-phone) center / contain no-repeat;
    mask: var(--icon-phone) center / contain no-repeat;
}

/* companion: talk, speak, erase — one compact row under the header */
.companion-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}
.companion-tools-spacer { flex: 1 1 auto; }
.companion-tool { min-height: var(--touch-min); padding: 0 var(--space-4); }
.btn-ghost.companion-tool--talk[aria-pressed="true"] {
    background: var(--color-info-soft);
    color: var(--color-info);
}
.btn-ghost.companion-tool--danger:hover:not(:disabled) {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
.companion-tool-note { color: var(--color-text-muted); }
.companion-notice { margin: 0; }

/* the transcript takes all remaining height */
.table-screen > .table-messages {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    border-top: 0;
    padding: var(--space-2) var(--space-1);
}
.table-loading { flex: 1 1 auto; }

/* the composer sits at the foot of the column — pinned by the layout, not by sticky */
.table-screen > .table-composer {
    position: static;
    margin: 0;
    box-shadow: var(--shadow-md);
}

/* compact bubbles (UX-13 acceptance: five on a 360×640 screen): the stamp floats into the
   last line when there is room, as in every messenger, instead of always taking its own line */
.table-screen .table-message {
    display: flow-root;
    padding: 8px 12px 7px 14px;
    line-height: 1.4;
}
.table-screen .table-message-ai { display: table; margin-bottom: 4px; }
.table-screen .table-message-body { display: inline; }
.table-screen .table-message-time {
    float: right;
    margin: 8px 0 -3px 12px;
}
.table-screen .table-message-retry {
    display: flex;
    width: fit-content;
    clear: both;
    margin: var(--space-1) calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) auto;
}

/* UX-18 — icebreakers in the empty chat (they replace the bare cup watermark) */
.table-messages-inner:has(.icebreakers)::before { content: none; }
.icebreakers {
    margin: auto 0;
    padding: var(--space-4) var(--space-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.icebreakers::before {
    content: "";
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-3);
    background: var(--color-border-strong);
    -webkit-mask: var(--illus-two-cups) center / contain no-repeat;
    mask: var(--illus-two-cups) center / contain no-repeat;
}
.icebreakers-title {
    margin: 0 0 var(--space-1);
    font-family: var(--font-display);
    font-size: var(--text-h2);
    line-height: 1.25;
    color: var(--color-text);
}
.icebreakers-lede {
    max-width: 34ch;
    margin: 0 0 var(--space-4);
    color: var(--color-text-muted);
}
.icebreakers-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.icebreaker,
.icebreaker:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.icebreaker {
    width: 100%;
    justify-content: space-between;
    min-height: 48px;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-weight: 400;
    font-size: var(--text-body);
    line-height: 1.35;
    letter-spacing: 0;
    white-space: normal;
    text-align: left;
    animation: card-in var(--duration-slow) var(--ease-out-soft) both;
}
.icebreakers-list li:nth-child(2) .icebreaker { animation-delay: 60ms; }
.icebreakers-list li:nth-child(3) .icebreaker { animation-delay: 120ms; }
.icebreaker:hover:not(:disabled) {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}
.icebreaker::after {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: var(--color-accent-text);
    -webkit-mask: var(--icon-chevron) center / contain no-repeat;
    mask: var(--icon-chevron) center / contain no-repeat;
}

/* An empty seat: consent, the offer, or who was asked. Sits under the header. */
.seat-panel {
    margin: 0 var(--space-3) var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.seat-panel p { margin: 0; flex: 1 1 12rem; }
.seat-people { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* After the coffee: the questionnaire takes the composer's place. */
.table-review {
    margin: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}
.table-review-title {
    margin: 0 0 var(--space-2);
    font-family: var(--font-display);
    font-size: 1.25rem;
}
.review-mugs, .review-keep-choices {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-2) 0 var(--space-3);
}
.review-mug, .review-choice {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
}
.review-mug.is-on, .review-choice.is-on {
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    border-color: transparent;
}
.review-note-label, .review-keep-label { display: block; margin-bottom: var(--space-1); }
.review-note {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    resize: vertical;
}
.inbox-state--review { background: var(--color-accent-soft); color: var(--color-accent-text); }
.inbox-state--waiting { background: var(--color-info-soft); color: var(--color-info); }

/* UX-12 — the closing card takes the composer's place */
.table-closed {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    animation: card-in var(--duration-slow) var(--ease-out-soft) both;
}
.table-closed { position: relative; }
/* a paper disc with the lock drawn in the text colour on top of it */
.table-closed::before {
    content: "";
    grid-row: 1 / span 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    box-shadow: inset 0 0 0 1px var(--color-border);
}
.table-closed::after {
    content: "";
    position: absolute;
    left: calc(var(--space-5) + 10px);
    top: calc(var(--space-4) + 10px);
    width: 20px;
    height: 20px;
    background: var(--color-text);
    -webkit-mask: var(--icon-lock) center / contain no-repeat;
    mask: var(--icon-lock) center / contain no-repeat;
}
.table-closed-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1.3;
    color: var(--color-text);
}
.table-closed-body {
    margin: var(--space-1) 0 var(--space-3);
    color: var(--color-text-muted);
}
.table-closed-actions {
    grid-column: 1 / -1;
    margin-top: var(--space-1);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* UX-14 — incoming call: prominent, calm, an answer is asked for (caramel = act) */
.incoming-call {
    padding: var(--space-4);
    background: var(--color-surface-elevated);
    border: 2px solid var(--color-accent);
    border-radius: var(--radius-xl);
    box-shadow: var(--glow-accent);
    animation: card-in var(--duration-slow) var(--ease-out-soft) both;
}
.incoming-call-who {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.incoming-call-avatar {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1;
}
/* a ring that ripples out while it rings — transform + opacity only */
.incoming-call-avatar::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    animation: call-ripple 1.6s var(--ease-out-soft) infinite;
}
.incoming-call-text { flex: 1 1 auto; min-width: 0; }
.incoming-call-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h2);
    line-height: 1.2;
    color: var(--color-text);
    overflow-wrap: anywhere;
}
.incoming-call-body { margin: 2px 0 0; color: var(--color-text-muted); }

.incoming-call-mute,
.incoming-call-mute:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.incoming-call-mute {
    flex: none;
    width: var(--touch-min);
    padding: 0;
}
.incoming-call-mute:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }
.incoming-call-mute::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--icon-bell) center / contain no-repeat;
    mask: var(--icon-bell) center / contain no-repeat;
}
.incoming-call-mute.is-muted::before {
    -webkit-mask-image: var(--icon-bell-off);
    mask-image: var(--icon-bell-off);
}

.incoming-call-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-4);
}
.call-answer {
    min-width: 0;
    min-height: 48px;
    height: auto;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    padding: 8px 10px;
}
.call-answer::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-phone) center / contain no-repeat;
    mask: var(--icon-phone) center / contain no-repeat;
}
.call-answer--accept,
.call-answer--accept:hover:not(:disabled) {
    background: var(--color-success);
    color: var(--color-surface);
}
.call-answer--accept:hover:not(:disabled) { box-shadow: var(--glow-success); }
.call-answer--decline,
.call-answer--decline:hover:not(:disabled) {
    background: var(--color-danger);
    color: var(--color-surface);
}
.call-answer--decline::before { transform: rotate(135deg); }
.call-answer--decline:focus-visible { outline-color: var(--color-danger); }
.call-answer--accept:focus-visible { outline-color: var(--color-success); }

/* UX-14 — the call stage: remote video, your picture-in-picture, round icon controls */
.call-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}
.call-stage--idle { display: none; }
.call-videos {
    position: relative;
    width: 100%;
    height: min(38dvh, 360px);
    background: var(--call-screen);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.call-remote {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--call-screen);
}
.call-local {
    position: absolute;
    right: var(--space-3);
    bottom: var(--space-3);
    width: 28%;
    max-width: 120px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--call-screen-text);
    background: var(--call-screen);
}
.call-connecting {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--call-screen-text);
    font-size: var(--text-small);
    font-weight: 700;
    letter-spacing: .04em;
}
.call-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
}
.call-ctl,
.call-ctl:hover:not(:disabled) {
    background: var(--color-surface-elevated);
    color: var(--color-text);
    border-color: var(--color-border);
}
.call-ctl {
    width: 52px;
    height: 52px;
    padding: 0;
    box-shadow: var(--shadow-sm);
}
.call-ctl:hover:not(:disabled) { border-color: var(--color-border-strong); background: var(--color-primary-soft); }
.call-ctl::before {
    content: "";
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: var(--icon-mic) center / contain no-repeat;
    mask: var(--icon-mic) center / contain no-repeat;
}
.call-ctl--cam::before {
    -webkit-mask-image: var(--icon-camera);
    mask-image: var(--icon-camera);
}
.call-ctl--mic.is-off::before {
    -webkit-mask-image: var(--icon-mic-off);
    mask-image: var(--icon-mic-off);
}
.call-ctl--cam.is-off::before {
    -webkit-mask-image: var(--icon-camera-off);
    mask-image: var(--icon-camera-off);
}
/* off: inverted, so muted is unmistakable at a glance (and the glyph carries the slash) */
.call-ctl.is-off,
.call-ctl.is-off:hover:not(:disabled) {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}
/* hang up: cherry, with the handset turned down */
.call-ctl--hangup,
.call-ctl--hangup:hover:not(:disabled) {
    background: var(--color-danger);
    color: var(--color-surface);
    border-color: var(--color-danger);
}
.call-ctl--hangup { width: 72px; border-radius: var(--radius-pill); }
.call-ctl--hangup::before {
    -webkit-mask-image: var(--icon-phone);
    mask-image: var(--icon-phone);
    transform: rotate(135deg);
}
.call-ctl--hangup:focus-visible { outline-color: var(--color-danger); }
.table-screen--in-call .table-messages { min-height: 120px; }

/* A live call keeps a way back, and a way to mute or hang up, on every other screen. */
.page--call-carry { padding-bottom: 6.5rem; }
.call-carry {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: calc(100% - 1.5rem);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    background: var(--color-surface-elevated);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
}
.call-carry-back {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.call-carry-kicker {
    font-size: var(--text-caption, 0.75rem);
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--color-text-muted);
}
.call-carry-who {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}
.call-carry-controls { display: flex; align-items: center; gap: var(--space-2); }
.call-carry .call-ctl { width: 44px; height: 44px; min-height: 44px; padding: 0; }
.call-carry .call-ctl--hangup { width: 56px; }

/* the bottom sheet (keep) — slides up, scrim closes it; no blur, transform + opacity only */
.sheet-root {
    position: fixed;
    inset: 0;
    z-index: 60;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear var(--duration-slow);
}
.sheet-root.is-open {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s;
}
.sheet-scrim {
    position: absolute;
    inset: 0;
    background: var(--color-overlay);
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-standard);
}
.sheet-root.is-open .sheet-scrim { opacity: 1; }
.sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - var(--space-12));
    margin: 0 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-2) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-out-soft);
}
.sheet-root.is-open .sheet { transform: translateY(0); }
.sheet:focus { outline: none; }
.sheet-grip {
    width: 40px;
    height: 4px;
    margin: var(--space-1) auto var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
}
.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.sheet-title { margin: 0; }
.sheet-close,
.sheet-close:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.sheet-close {
    flex: none;
    width: var(--touch-min);
    padding: 0;
    margin-right: calc(-1 * var(--space-2));
}
.sheet-close:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }
.sheet-close::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-close) center / contain no-repeat;
    mask: var(--icon-close) center / contain no-repeat;
}
.keep-sheet .table-keep { box-shadow: none; }
.keep-sheet .keep-seats { margin-top: 0; }
.keep-sheet .table-keep-button { width: 100%; }

@media (min-width: 768px) {
    .sheet {
        bottom: var(--space-6);
        border-radius: var(--radius-xl);
        padding-bottom: var(--space-6);
    }
    .call-videos { height: min(42dvh, 420px); }
}

@media (max-width: 480px) {
    .content:has(> .table-screen) { padding-top: var(--space-3); padding-bottom: var(--space-2); }
    .table-head { column-gap: var(--space-2); padding-bottom: var(--space-2); }
    .table-avatar { width: 40px; height: 40px; font-size: 18px; }
    .table-head .table-partner { font-size: 20px; }
    .seat-chip { padding: 0 var(--space-2); }
    .incoming-call { padding: var(--space-3) var(--space-4) var(--space-4); }
    .icebreakers { padding-top: var(--space-2); }
    .table-closed { padding: var(--space-4); }
    .table-closed-actions { gap: var(--space-1); }
    .table-closed-actions > a { padding: 0 var(--space-3); }
    .table-closed::after { left: calc(var(--space-4) + 10px); }
    /* the bottom bar is 56 px + its border; main's generic 72 px leaves a gap the chat needs */
    .page:has(.table-screen) main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
    .table-screen .table-message { max-width: 84%; font-size: 15px; line-height: 1.38; }
}

@keyframes call-ripple {
    from { opacity: .9; transform: scale(1); }
    to   { opacity: 0;  transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
    .table-countdown--low .table-countdown-arc,
    .seat-chip--mine .seat-dot:not(.seat-dot--filled),
    .incoming-call-avatar::after {
        animation: none;
        opacity: 1;
    }
    .table-countdown-arc { transition: none; }
}

/* ── end Wave 1 · Table ── */

/* ── Wave 2 · Desktop ─────────────────────────────────────────────────────────────
   UX-31 "café counter" (≥ 1200 px only). MainLayout adds main.desk + the side zones only while
   the viewport is ≥ 1200 px, so nothing here can reach a phone or a tablet.
   Break (/):         your cup (timer + actions) · the room (people / break over) · your tables dock
   Table (/tables/x): a narrow tables rail · the chat, centred at a comfortable measure.
   Colour grammar: caramel = act (Open), honey = last five minutes, the rest stays quiet.
   ──────────────────────────────────────────────────────────────────────────────── */

@media (min-width: 1200px) {
    main.desk {
        --desk-max:  1440px;
        --desk-dock: 320px;
        --desk-rail: 264px;
        --desk-cup:  296px;
        --desk-chat: 760px;
        width: 100%;
        max-width: var(--desk-max);
        margin: 0 auto;
        padding: 0 var(--space-8);
    }

    /* Break: the room and the dock side by side; the page's own column loses its 640 px cap */
    main.desk--break:has(> .desk-dock) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--desk-dock);
        column-gap: var(--space-10);
        align-items: start;
    }
    main.desk--break > .content {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }
    main.desk--break .break-live {
        max-width: none;
        grid-template-columns: var(--desk-cup) minmax(0, 1fr);
        column-gap: var(--space-10);
    }
    main.desk--break .break-live > .break-live-head { padding: var(--space-6) var(--space-5); }
    /* the room: cards keep their phone proportions and sit side by side once there is space */
    main.desk--break .candidate-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

    /* the dock: sticky beside the room, scrolls on its own if the list is long */
    .desk-dock {
        position: sticky;
        top: calc(var(--nav-height) + var(--space-10));
        margin-top: var(--space-10);
        max-height: calc(100dvh - var(--nav-height) - var(--space-16));
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        padding: var(--space-5);
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
    }
    .desk-dock-title { margin: 0; color: var(--color-text-muted); }
    .desk-dock-list,
    .desk-rail-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }
    .desk-dock-list { gap: var(--space-2); }
    .desk-dock-item {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr) auto;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3) 0;
        border-top: 1px solid var(--color-border);
    }
    .desk-dock-item:first-child { border-top: 0; padding-top: 0; }
    .desk-dock-open { padding: 0 var(--space-4); }
    .desk-dock-all {
        align-self: flex-start;
        color: var(--color-accent-text);
        font-weight: 700;
    }

    .desk-avatar {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--color-primary-soft);
        color: var(--color-primary);
        font: 500 18px/1 var(--font-display);
    }
    .desk-item--open .desk-avatar { box-shadow: 0 0 0 2px var(--color-accent); }
    .desk-item--low .desk-avatar { box-shadow: 0 0 0 2px var(--color-warning); }
    .desk-item--kept .desk-avatar { background: var(--color-success-soft); color: var(--color-success); }

    .desk-item-text { display: flex; flex-direction: column; min-width: 0; }
    .desk-item-name {
        font-weight: 700;
        color: var(--color-text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .desk-item-meta {
        font-size: var(--text-small);
        color: var(--color-text-muted);
        font-variant-numeric: tabular-nums;
    }
    .desk-item--low .desk-item-meta { color: var(--color-warning); font-weight: 700; }

    .desk-note { margin: 0; color: var(--color-text-muted); }
    .desk-note--failed,
    .desk-note--stale { color: var(--color-warning); }

    /* Table: rail on the left, the chat in the middle of what is left */
    .page main.desk--table:has(> .desk-rail) {
        display: grid;
        grid-template-columns: var(--desk-rail) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        column-gap: var(--space-8);
    }
    main.desk--table > .content {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }
    main.desk--table .table-screen { max-width: var(--desk-chat); }

    .desk-rail {
        min-height: 0;
        overflow-y: auto;
        padding: var(--space-4) var(--space-4) var(--space-4) 0;
        border-right: 1px solid var(--color-border);
    }
    .desk-rail-title { margin: 0 0 var(--space-3) var(--space-3); }
    .desk-rail-title a { color: var(--color-text-muted); text-decoration: none; }
    .desk-rail-title a:hover { color: var(--color-text); }
    .desk-rail-list { gap: var(--space-1); }
    .desk-rail-item {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        align-items: center;
        gap: var(--space-3);
        min-height: 56px;
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-md);
        color: var(--color-text);
        text-decoration: none;
        transition: background-color var(--duration-fast) var(--ease-standard);
    }
    .desk-rail-item:hover { background: var(--color-primary-soft); }
    .desk-rail-item.is-active {
        background: var(--color-surface-elevated);
        box-shadow: var(--shadow-sm), inset 3px 0 0 var(--color-accent);
    }
}

@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
    .desk-rail-item { transition: none; }
}

/* ── end Wave 2 · Desktop ── */

/* ── Wave 2 · Table ──────────────────────────────────────────────────────────────
   UX-20 typing dots + sent/pending receipts, UX-21 grouped bubbles, day separators, the
   multi-line composer and reactions, UX-22 the Tables inbox. Tokens only; dark mode via the
   tokens. Colour grammar: caramel = act (unread, your reaction, "your move"), slate = waiting,
   sage = kept, honey = the last five minutes. Motion is rationed and off under reduced motion.
   ──────────────────────────────────────────────────────────────────────────────── */

:root {
    /* same 24-grid, 1.75 stroke: a smile with a small plus — "add a reaction" */
    --icon-react: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 11.5a8.5 8.5 0 1 1-8-8'/%3E%3Cpath d='M8.5 14.5a4.5 4.5 0 0 0 7 0'/%3E%3Cpath d='M9 9.5h.01M15 9.5h.01'/%3E%3Cpath d='M19 2.5v5M16.5 5h5'/%3E%3C/svg%3E");
}

/* the scroller holds starters · log · typing; the log is the only live region */
.table-log {
    display: flex;
    flex-direction: column;
}

/* one sender's run: 2 px inside a group, a real gap between groups */
.chat-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 2px;
}
.chat-row.is-group-start { margin-top: var(--space-2); }
.chat-row:first-child { margin-top: 0; }
.chat-row--mine { align-items: flex-end; }

.chat-line {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    width: 100%;
}
.chat-row--mine .chat-line { flex-direction: row-reverse; }
.chat-line > .table-message { align-self: auto; }

/* tail only on the last bubble of a group; joined corners tighten */
.chat-row:not(.is-group-end) .table-message--mine { border-bottom-right-radius: var(--radius-lg); }
.chat-row:not(.is-group-end) .table-message--theirs { border-bottom-left-radius: var(--radius-lg); }
.chat-row:not(.is-group-start) .table-message--mine { border-top-right-radius: 6px; }
.chat-row:not(.is-group-start) .table-message--theirs { border-top-left-radius: 6px; }
.chat-row:not(.is-group-end) .table-message { box-shadow: none; }

/* the multi-line composer keeps the author's line breaks */
.table-screen .table-message-body { white-space: pre-wrap; }

/* day separators (kept tables and the barista): a quiet rule with the day in the middle */
.chat-day {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-eyebrow);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.chat-row:first-child .chat-day { margin-top: var(--space-1); }
.chat-day::before,
.chat-day::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--color-border);
}

/* UX-20 receipts: ✓ once the echo settled it, a clock while pending — never "read" */
.table-message--pending .table-message-time::after { content: none; animation: none; }
.table-message-receipt {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: -3px;
    background: currentColor;
    -webkit-mask: var(--icon-check) center / contain no-repeat;
    mask: var(--icon-check) center / contain no-repeat;
}
.table-message-receipt--sending {
    -webkit-mask-image: var(--icon-clock);
    mask-image: var(--icon-clock);
    opacity: .85;
}

/* UX-20 typing: three dots in their bubble, the name beside it */
.typing-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-1);
    animation: bubble-in var(--duration-base) var(--ease-out-soft) both;
}
.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 12px;
    background: var(--bubble-theirs-bg);
    border: 1px solid var(--bubble-stroke);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 4px;
}
.typing-bubble > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bubble-theirs-stamp);
    animation: w2-typing 1.2s ease-in-out infinite;
}
.typing-bubble > span:nth-child(2) { animation-delay: .15s; }
.typing-bubble > span:nth-child(3) { animation-delay: .3s; }
.typing-label {
    font-size: var(--text-small);
    color: var(--color-text-muted);
}
@keyframes w2-typing {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30%           { opacity: 1;   transform: translateY(-2px); }
}

/* UX-21 reactions: the add button appears on hover or focus (pointer), long-press on touch */
.reaction-add,
.reaction-add:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
}
.reaction-add {
    flex: none;
    width: 32px;
    min-height: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    opacity: 0;
}
.reaction-add::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-react) center / contain no-repeat;
    mask: var(--icon-react) center / contain no-repeat;
}
.reaction-add:hover:not(:disabled) { background: var(--color-accent-soft); color: var(--color-accent-text); }
.chat-line:hover .reaction-add,
.reaction-add:focus-visible,
.reaction-add[aria-expanded="true"] { opacity: 1; }
.reaction-add:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
/* touch: no hover, so no floating button — still in the reading order for screen readers */
@media (hover: none) {
    .reaction-add:not(:focus-visible):not([aria-expanded="true"]) {
        position: absolute;
        width: 1px;
        height: 1px;
        min-height: 0;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .chat-line > .table-message[data-react-id] { -webkit-user-select: none; user-select: none; }
}

.reaction-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2;
}
.reaction-menu {
    position: relative;
    z-index: 3;
    display: inline-flex;
    gap: 2px;
    margin-top: var(--space-1);
    padding: 4px;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    animation: chip-in var(--duration-base) var(--ease-out-soft) both;
}
.reaction-choice,
.reaction-choice:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text);
    border-color: transparent;
}
.reaction-choice {
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font: 400 20px/1 var(--font-body);
}
.reaction-choice:hover:not(:disabled) { background: var(--color-accent-soft); }
.reaction-choice.is-mine,
.reaction-choice.is-mine:hover:not(:disabled) {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}
.reaction-choice:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.reaction-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
    padding: 0 var(--space-1);
}
.reaction-pill,
.reaction-pill:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font: 400 14px/1 var(--font-body);
    letter-spacing: 0;
    box-shadow: none;
    animation: chip-in var(--duration-base) var(--ease-out-soft) both;
}
.reaction-pill-count {
    font: 600 12px/1 var(--font-mono);
    color: var(--color-text-muted);
}
.reaction-pill.is-mine,
.reaction-pill.is-mine:hover:not(:disabled) {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}
.reaction-pill.is-mine .reaction-pill-count { color: var(--color-accent-text); }
button.reaction-pill:hover:not(:disabled) { border-color: var(--color-border-strong); }
button.reaction-pill.is-mine:hover:not(:disabled) { border-color: var(--color-accent); }
.reaction-pill:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* UX-21 composer: a textarea that grows to five lines (JS sets the height) */
.table-screen > .table-composer { align-items: end; }
textarea.table-composer-input {
    height: var(--touch-min);
    min-height: var(--touch-min);
    padding: 11px var(--space-4);
    line-height: 1.4;
    border-radius: 22px;
    resize: none;
    overflow-y: hidden;
    scrollbar-width: thin;
}

/* ── UX-22 Tables as a living inbox ── */
.inbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.inbox-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
        "avatar name    time"
        "avatar preview unread"
        "avatar state   state";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: 2px;
    min-height: 76px;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    text-decoration: none;
    transition:
        border-color var(--duration-fast) var(--ease-standard),
        box-shadow var(--duration-base) var(--ease-standard);
}
.inbox-row:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
}
.inbox-row:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.inbox-row--theirs { border-color: var(--color-accent); }

.inbox-avatar {
    grid-area: avatar;
    align-self: start;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font: 500 18px/1 var(--font-display);
}
.inbox-name {
    grid-area: name;
    min-width: 0;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inbox-time {
    grid-area: time;
    justify-self: end;
    font-family: var(--font-mono);
    font-size: var(--text-stamp);
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.inbox-preview {
    grid-area: preview;
    min-width: 0;
    font-size: var(--text-small);
    line-height: 1.4;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inbox-preview--unknown { min-height: 1.4em; }
.inbox-preview--bell { white-space: normal; }
.inbox-bell {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--text-small);
}
.inbox-row--unread .inbox-preview { color: var(--color-text); font-weight: 600; }
.inbox-unread {
    grid-area: unread;
    justify-self: end;
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--color-accent-soft);
    border: 1px solid var(--color-accent);
    color: var(--color-accent-text);
    font: 700 12px/1 var(--font-mono);
}
.inbox-state {
    grid-area: state;
    justify-self: start;
    max-width: 100%;
    display: inline-flex;
    flex-wrap: wrap;           /* a long German state wraps as one phrase; the time drops below */
    align-items: center;
    column-gap: 6px;
    row-gap: 0;
    margin-top: var(--space-1);
    padding: 3px 10px 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    background: var(--color-primary-soft);
    color: var(--color-text);
}
.inbox-state::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}
.inbox-state-time { font-weight: 500; white-space: nowrap; }
.inbox-state--mine { background: var(--color-info-soft); color: var(--color-info); }
.inbox-state--mine::before { -webkit-mask-image: var(--icon-hourglass); mask-image: var(--icon-hourglass); }
.inbox-state--theirs { background: var(--color-accent-soft); color: var(--color-accent-text); }
.inbox-state--theirs::before { -webkit-mask-image: var(--icon-mug); mask-image: var(--icon-mug); }
.inbox-state--both { background: var(--color-success-soft); color: var(--color-success); }
.inbox-state--both::before { -webkit-mask-image: var(--icon-check); mask-image: var(--icon-check); }
.inbox-state-time--low { color: var(--color-warning); }

@media (min-width: 768px) {
    .inbox-row {
        grid-template-columns: 44px minmax(0, 1fr) auto auto;
        grid-template-areas:
            "avatar name    state  time"
            "avatar preview state  unread";
    }
    .inbox-state { margin-top: 0; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
    .typing-bubble > span {
        animation: none;
        opacity: .7;
        transform: none;
    }
    .typing-row,
    .reaction-menu,
    .reaction-pill { animation: none; }
}

/* ── end Wave 2 · Table ── */

/* ── Wave 2 · Sweep (UX-23 / UX-26 / UX-38) ──────────────────────────────────────
   Contrast for the boundaries you act on, a quiet h1 after navigation, the boot and error
   copy in German, and the barista's mark in the companion header. Tokens only. */

/* UX-26 — WCAG 1.4.11: a field's edge must be findable (≥ 3:1). --color-border was 1.38:1. */
.form-control,
.break-mood input,
.choice,
.table-composer {
    border-color: var(--color-border-input);
}
.drop-zone { border-color: var(--color-border-input); }
.choice.is-on { border-color: var(--color-primary); }
.form-control.invalid,
.break-mood input.invalid { border-color: var(--color-danger); }
/* the open seat you could still fill: the ring is the affordance */
.keep-seat:not(.keep-seat--filled)::before { border-color: var(--color-border-input); }
.table-keep--mine .keep-seat:not(.keep-seat--filled)::before { border-color: var(--color-info); }
/* their seat is taken and yours is the move — caramel = act (2.9:1 would be too faint here) */
.table-keep--theirs .keep-seat:not(.keep-seat--filled)::before { border-color: var(--color-accent-text); }

/* UX-38 — FocusOnNavigate gives the page's h1 tabindex=-1 and focuses it so a screen reader
   announces the new page. That is programmatic focus on a non-control: no box. Every control
   keeps its :focus-visible ring, and a heading can never be reached with Tab. */
h1[tabindex="-1"]:focus,
h1[tabindex="-1"]:focus-visible { outline: none; }

/* UX-23 — the boot line and the error bar before Blazor's strings exist. index.html sets
   <html lang> from the stored toggle (or the browser) before first paint. */
html:lang(de) .loading-progress-text::after {
    content: "Wird aufgewärmt\2026  " var(--blazor-load-percentage-text, "");
}
html:lang(el) .loading-progress-text::after {
    content: "Ζεσταίνεται\2026  " var(--blazor-load-percentage-text, "");
}
html:lang(es) .loading-progress-text::after {
    content: "Calentando\2026  " var(--blazor-load-percentage-text, "");
}
html:lang(fr) .loading-progress-text::after {
    content: "Ça chauffe\2026  " var(--blazor-load-percentage-text, "");
}
html:lang(it) .loading-progress-text::after {
    content: "Si sta scaldando\2026  " var(--blazor-load-percentage-text, "");
}

/* UX-30 — the barista mark in the companion header takes the avatar's slot */
.table-head .table-head-barista {
    grid-area: avatar;
    width: 44px;
    height: 44px;
}
@media (max-width: 480px) {
    .table-head .table-head-barista { width: 40px; height: 40px; }
}

.empty-state + .btn-secondary { margin-top: var(--space-2); }

/* ── end Wave 2 · Sweep ── */

/* ── Wave 3 · Rituals & hygiene ──────────────────────────────────────────────────
   UX-32 the Notifications section and the reminder banner, UX-33 the kept seal and the coaster,
   the desktop dock's unread/preview, and reaction glyphs that always draw in colour. Tokens only;
   dark mode via the tokens. Motion is rationed and off under reduced motion.
   ──────────────────────────────────────────────────────────────────────────────── */

:root {
    /* a reaction is a picture, not a letter: the colour emoji faces first, whatever the body font */
    --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    /* how long the kept seal holds before it fades — KeptAfterglow.SealFor (2.8 s) minus --duration-slow */
    --duration-seal-hold: 2480ms;
    /* same 24-grid, 1.75 stroke: a coaster — a rim and a dashed inner ring */
    --icon-coaster: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Ccircle cx='12' cy='12' r='5.5' stroke-dasharray='1.6 2.4'/%3E%3C/svg%3E");
}

/* reactions: the glyph gets the emoji faces (the server's canonical string is untouched —
   ChatReactions.Display only adds U+FE0F for drawing) */
.emoji {
    font-family: var(--font-emoji);
    font-style: normal;
    font-weight: 400;
    line-height: 1;
}
.reaction-pill .emoji { font-size: var(--text-body); }

/* UX-31 dock/rail: the Tables page's preview and unread badge, in the side zones too */
@media (min-width: 1200px) {
    .desk-item-top {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        min-width: 0;
    }
    .desk-item-top .desk-item-name { flex: 0 1 auto; }
    .desk-unread {
        flex: none;
        margin-left: auto;
        display: inline-grid;
        place-items: center;
        min-width: var(--space-6);
        height: var(--space-5);
        padding: 0 var(--space-2);
        border-radius: var(--radius-pill);
        background: var(--color-accent-soft);
        border: 1px solid var(--color-accent);
        color: var(--color-accent-text);
        font: 700 var(--text-caption)/1 var(--font-mono);
    }
    .desk-item-preview {
        font-size: var(--text-small);
        line-height: 1.4;
        color: var(--color-text-muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .desk-item--unread .desk-item-preview { color: var(--color-text); font-weight: 700; }
}

/* UX-32 — Profile › Notifications */
a.btn-primary + .notify { margin-top: var(--space-8); }
.notify {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.notify-title { margin: 0; font-size: var(--text-h2); }
.notify-subtitle { margin: 0; }
.notify-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.notify-group + .notify-group {
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}
.notify-push-hint,
.notify-suggest { margin: 0; color: var(--color-text-muted); }
.notify-time {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}
.notify-time-label { font-weight: 700; color: var(--color-text-muted); }
.notify-time-input { width: auto; min-width: calc(var(--space-16) + var(--space-12)); }
.notify-suggest { flex: 1 1 100%; }
.notify-use { margin-left: var(--space-1); }
.notify-status { min-height: 1.45em; margin: 0; color: var(--color-success); }
.notify-status--error { color: var(--color-danger); }
/* Web Push — "In this browser": one sentence, then its one action */
.notify-browser { align-items: flex-start; }
.notify-browser-state { margin: 0; color: var(--color-text-muted); }

/* Web Push — the reminder's Snooze page (/reminder/snooze) */
.snooze {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    max-width: var(--content-max);
}
.snooze-title { margin: 0; font-size: var(--text-h2); }
.snooze-text { margin: 0; }

/* a switch is a checkbox with role="switch": the whole row is the label (≥ 44 px) */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--touch-min);
    cursor: pointer;
}
.switch-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}
.switch-label { font-weight: 700; }
.switch-hint { color: var(--color-text-muted); }
input.switch {
    --switch-knob: calc(var(--space-4) + var(--space-1));
    appearance: none;
    flex: none;
    position: relative;
    width: var(--touch-min);
    height: var(--space-6);
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: var(--radius-pill);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border-input);
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
input.switch::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 1px;
    width: var(--switch-knob);
    height: var(--switch-knob);
    border-radius: 50%;
    background: var(--color-border-input);
    transform: translateY(-50%);
    transition: transform var(--duration-base) var(--ease-out-soft), background-color var(--duration-fast) var(--ease-standard);
}
input.switch:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
input.switch:checked::before {
    background: var(--color-on-primary);
    transform: translate(calc(var(--touch-min) - var(--switch-knob) - 4px), -50%);
}
input.switch:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
input.switch:disabled { opacity: .6; cursor: progress; }

/* UX-32 — the reminder banner on Break: caramel = an invitation, never a warning */
.nudge {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "mark text"
        "mark actions";
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin: 0 0 var(--space-5);
    padding: var(--space-4);
    text-align: left;
    background: var(--color-accent-soft);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-md);
    animation: chip-in var(--duration-base) var(--ease-out-soft) both;
}
.nudge-mark {
    grid-area: mark;
    align-self: start;
    width: var(--space-8);
    height: var(--space-8);
    background: var(--color-accent-text);
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}
.nudge-text {
    grid-area: text;
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-lede);
    line-height: 1.35;
    color: var(--color-text);
}
.nudge-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
}
/* Both actions are text buttons: flush with the copy above, one touch-row high, so a wrapped
   German pair stacks tightly instead of floating in two indented 44 px bands. */
.nudge-actions > button {
    min-height: var(--touch-min);
    padding-inline: 0;
    margin: 0;
}
.nudge-actions { row-gap: 0; }
.nudge-off { color: var(--color-accent-text); }
.nudge-note { margin: 0 0 var(--space-5); color: var(--color-text-muted); }

/* UX-33 — the kept seal: a stamp pressed once over the top of the chat, then lifted */
.table-screen { position: relative; }
.kept-seal {
    position: absolute;
    z-index: 4;
    top: var(--space-16);
    left: 50%;
    width: max-content;
    max-width: calc(100% - var(--space-8));
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5) var(--space-3) var(--space-3);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-pill);
    box-shadow: var(--glow-success);
    cursor: pointer;
    transform: translateX(-50%);
    animation:
        kept-seal-in var(--duration-seal) var(--ease-spring) both,
        kept-seal-out var(--duration-slow) var(--ease-standard) var(--duration-seal-hold) forwards;
}
.kept-seal-mark {
    flex: none;
    position: relative;
    width: var(--space-10);
    height: var(--space-10);
    border-radius: 50%;
    background: var(--color-success-soft);
}
.kept-seal-mark::before {
    content: "";
    position: absolute;
    inset: var(--space-2);
    background: var(--color-success);
    -webkit-mask: var(--icon-seal) center / contain no-repeat;
    mask: var(--icon-seal) center / contain no-repeat;
}
.kept-seal-text { display: flex; flex-direction: column; }
.kept-seal-title {
    font-family: var(--font-display);
    font-size: var(--text-h2);
    line-height: 1.1;
    color: var(--color-success);
}
.kept-seal-body { color: var(--color-text-muted); }
@keyframes kept-seal-in {
    from { opacity: 0; transform: translateX(-50%) scale(1.25) rotate(-6deg); }
    to   { opacity: 1; transform: translateX(-50%) scale(1) rotate(0); }
}
@keyframes kept-seal-out {
    to { opacity: 0; transform: translateX(-50%) translateY(calc(-1 * var(--space-2))); }
}

/* UX-33 — the coaster: the exact number of tables kept by both */
.kept-coaster {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-5);
    padding: var(--space-1) var(--space-3) var(--space-1) var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--color-success-soft);
    color: var(--color-success);
    font-size: var(--text-small);
    font-weight: 700;
}
.kept-coaster-mark {
    flex: none;
    width: var(--space-5);
    height: var(--space-5);
    background: currentColor;
    -webkit-mask: var(--icon-coaster) center / contain no-repeat;
    mask: var(--icon-coaster) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
    .nudge,
    .kept-seal { animation: none; }
    input.switch,
    input.switch::before { transition: none; }
}

/* ── end Wave 3 · Rituals & hygiene ── */

/* ── Wave 4 · Web (UX-45 – UX-54) ────────────────────────────────────────────────
   Live keep state, report and block, layout under pressure, accessibility, data minimisation. */
.table-head-status--theirs { color: var(--color-accent-text); font-weight: 700; }
.table-head-status--theirs::before {
    -webkit-mask-image: var(--icon-seal);
    mask-image: var(--icon-seal);
}
:root {
  --icon-more: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='5.5' cy='12' r='1.9'/%3E%3Ccircle cx='12' cy='12' r='1.9'/%3E%3Ccircle cx='18.5' cy='12' r='1.9'/%3E%3C/svg%3E");
}

/* UX-51 — the match moment waits: "Not now" sits under "Sit down", quiet but a full target */
.match-later { margin-top: var(--space-2); }

/* UX-53 — the break-over scene: "Start another" and "Done for now" weigh the same */
.break-over-actions--even {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    width: 100%;
}
.break-over-actions--even > button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    height: auto;
    line-height: 1.2;
    text-align: center;
    padding: 8px var(--space-3);
}
@media (max-width: 420px) {
    .break-over-actions--even { grid-template-columns: 1fr; }
}
.break-over-tables { margin-top: var(--space-2); }
.break-farewell { margin: calc(-1 * var(--space-2)) 0 var(--space-4); color: var(--color-text-muted); }

/* UX-48 — report, block, help: a "…" disclosure with three plain actions, then a calm sheet */
.trust-actions { position: relative; display: inline-flex; flex: none; }
.trust-more,
.trust-more:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.trust-more {
    width: var(--touch-min);
    padding: 0;
    border-radius: 50%;
}
.trust-more:hover:not(:disabled),
.trust-more[aria-expanded="true"] { background: var(--color-primary-soft); color: var(--color-text); }
.trust-more::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--icon-more) center / contain no-repeat;
    mask: var(--icon-more) center / contain no-repeat;
}
.trust-menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.trust-menu {
    position: absolute;
    top: calc(100% + var(--space-1));
    right: 0;
    z-index: 41;
    min-width: 220px;
    margin: 0;
    padding: var(--space-1);
    list-style: none;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.trust-menu-item,
.trust-menu-item:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text);
}
.trust-menu-item {
    width: 100%;
    justify-content: flex-start;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.trust-menu-item:hover:not(:disabled) { background: var(--color-primary-soft); }
.trust-menu-item--block,
.trust-menu-item--block:hover:not(:disabled) { color: var(--color-danger); }
.trust-sheet .sheet-body { display: flex; flex-direction: column; gap: var(--space-3); }
.trust-lede { margin: 0; font-weight: 600; }
.trust-reasons {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    border: 0;
}
.trust-reasons > legend { margin-bottom: var(--space-2); padding: 0; }
.trust-reason {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: var(--touch-min);
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-md);
    background: var(--color-surface-elevated);
    cursor: pointer;
}
.trust-reason.is-on { border-color: var(--color-primary); background: var(--color-primary-soft); }
.trust-reason input { accent-color: var(--color-primary); margin: 0; }
.trust-note-label { margin-bottom: calc(-1 * var(--space-2)); }
.trust-note { resize: vertical; min-height: 72px; }
.trust-done { margin: 0; font-size: var(--text-lede); line-height: 1.5; }
.trust-error { margin: 0; color: var(--color-danger); font-weight: 600; }
.trust-actions-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.trust-block-confirm,
.trust-block-confirm:hover:not(:disabled) {
    background: var(--color-danger);
    color: var(--color-on-primary);
}
.trust-help {
    margin: 0;
    padding-left: var(--space-5);
    display: grid;
    gap: var(--space-2);
    line-height: 1.5;
}
.table-head-trust { margin-right: calc(-1 * var(--space-1)); }
.inbox-item { position: relative; }
.inbox-item .inbox-row { padding-right: calc(var(--space-2) + var(--touch-min)); }
.inbox-trust { position: absolute; top: 50%; right: var(--space-1); transform: translateY(-50%); }
/* UX-51 — the skip link: invisible until focused, then a clear chip at the top */
.skip-link {
    position: fixed;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 1100;
    transform: translateY(calc(-100% - var(--space-4)));
    box-shadow: var(--shadow-lg);
}
.skip-link:focus,
.skip-link:focus-visible { transform: none; }
#main-content:focus { outline: none; }

/* UX-51 — the error bar's dismiss is a real button, styled as the old glyph disc */
#blazor-error-ui button.dismiss,
#blazor-error-ui button.dismiss:hover:not(:disabled) {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 18px;
}
#blazor-error-ui button.dismiss:hover:not(:disabled) { background: var(--color-surface); color: var(--color-danger); }

/* UX-51 — the signed-out clip can be paused (WCAG 2.2.2) */
.bg-video-toggle,
.bg-video-toggle:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.bg-video-toggle {
    position: fixed;
    right: var(--space-4);
    bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
    z-index: 2;
    min-height: var(--touch-min);
    font-size: var(--text-small);
    box-shadow: var(--shadow-sm);
}

/* UX-51 — incoming call: Accept first (it has the focus), Decline, then the ring's mute */
.incoming-call-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--touch-min); }
/* 320 px: "Annehmen" and "Απόρριψη" are wider than half the row once the icon and the mute button take their share. */
@media (max-width: 359px) {
    .incoming-call-actions { grid-template-columns: minmax(0, 1fr) var(--touch-min); }
    .incoming-call-actions .incoming-call-mute { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; height: auto; }
}

/* UX-49 — a long transcript keeps its newest rows in the DOM; older ones are a tap away */
.chat-earlier { align-self: center; margin: 0 auto var(--space-2); font-size: var(--text-small); }
/* UX-50 — the Table under pressure (360 × 640, keyboard up, a call running) */
.table-countdown-short { display: none; }
/* one focus ring on the composer: the pill's own edge turns primary and thickens to 2 px (9.8:1);
   never a second ring on the field inside, never an outline around the outline */
.table-composer:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
}
.table-composer-input:focus,
.table-composer-input:focus-visible { outline: none; box-shadow: none; }
/* a short conversation starts under the header, not at the foot of an empty well */
.table-messages-inner { margin-bottom: auto; }
/* "Kept." sits in the flow under the header, never over the first bubble */
.kept-seal { position: relative; top: auto; flex: none; }
/* the call stage as a strip: the video small beside its controls */
.call-stage--strip { flex-direction: row; align-items: center; gap: var(--space-2); }
.call-stage--strip .call-videos { flex: 1 1 auto; height: 72px; border-radius: var(--radius-md); }
.call-stage--strip .call-local { width: auto; height: calc(100% - var(--space-2)); right: var(--space-1); bottom: var(--space-1); border-width: 1px; }
.call-stage--strip .call-controls { gap: var(--space-1); }
.call-ctl--size::before {
    -webkit-mask-image: var(--icon-chevron);
    mask-image: var(--icon-chevron);
    transform: rotate(-90deg);
}
.call-stage--strip .call-ctl--size::before { transform: rotate(90deg); }

@media (max-width: 480px) {
    .table-head {
        grid-template-areas:
            "avatar name actions"
            "avatar meta actions";
        row-gap: 0;
        min-height: 56px;
        padding-bottom: var(--space-1);
    }
    .table-head:not(:has(.table-head-meta)) { grid-template-areas: "avatar name actions"; }
    .table-avatar { width: 36px; height: 36px; font-size: 16px; }
    .table-head .table-partner { font-size: 18px; line-height: 1.2; }
    .table-head-actions { gap: var(--space-1); }
    .table-countdown-text { display: none; }
    .table-countdown-short { display: inline; font-variant-numeric: tabular-nums; white-space: nowrap; }
    /* the chip already says "Your move" on a phone; the long line returns on wider screens */
    .table-head-status--theirs { display: none; }
    .table-head-meta:not(:has(> :not(.table-head-status--theirs))) { display: none; }
    /* the keyboard is up: the tab bar steps aside for the conversation */
    .page:has(.table-composer-input:focus) .nav-bar { display: none; }
    .page:has(.table-composer-input:focus) main { padding-bottom: env(safe-area-inset-bottom); }
    .content:has(> .table-screen) { padding-top: var(--space-2); }
    .table-screen { gap: var(--space-1); }
    .table-screen .table-composer { padding: var(--space-1); }
    /* keyboard up: the head shrinks to its 56 px essentials and bubbles tighten a little */
    .page:has(.table-composer-input:focus) .table-avatar { display: none; }
    .page:has(.table-composer-input:focus) .table-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name actions" "meta actions"; min-height: 48px; }
    .page:has(.table-composer-input:focus) .table-head:not(:has(.table-head-meta)) { grid-template-areas: "name actions"; }
    .page:has(.table-composer-input:focus) .table-message { padding-top: 7px; padding-bottom: 7px; }
    .page:has(.table-composer-input:focus) .table-messages-inner { gap: 4px; }
}

/* UX-53 — a short screen (≤ 700 px tall). The desktop head is a 240 px column: a ring
   beside the title leaves ~98 px, and "Kaffeepause" / "Pause beenden" paint outside the card.
   There the ring only shrinks. The phone card is full width, so the ring can sit beside the words. */
@media (max-height: 700px) and (min-width: 768px) {
    .break-live-head { padding: var(--space-4); }
    .break-live-head h1 { margin-bottom: var(--space-2); font-size: var(--text-h2); }
    .break-live-head .break-timer-block { margin: var(--space-2) 0; }
    .break-live-head .break-timer-ring { --text-timer: 22px; width: 104px; }
    .break-live-head .break-timer-ring::after { display: none; }
}
@media (max-height: 700px) and (max-width: 767.98px) {
    .break-live-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "ring eyebrow"
            "ring title"
            "ring actions";
        align-items: center;
        column-gap: var(--space-4);
        row-gap: 2px;
        text-align: left;
        padding: var(--space-4);
        margin-bottom: var(--space-4);
        min-width: 0;
    }
    .break-live-head > .eyebrow { grid-area: eyebrow; margin: 0; min-width: 0; overflow-wrap: break-word; }
    .break-live-head > h1 { grid-area: title; margin: 0; min-width: 0; overflow-wrap: break-word; font-size: var(--text-h2); }
    .break-live-head > .break-timer-block { grid-area: ring; margin: 0; }
    .break-live-head > .break-timer-block:has(.break-timer-ring--cup) { margin: 0; }
    .break-live-head .break-timer-ring { --text-timer: 20px; width: 92px; }
    .break-live-head .break-timer-ring::after { display: none; }
    .break-live-head .break-actions {
        grid-area: actions;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        width: auto;
        min-width: 0;
        max-width: 100%;
        margin-top: var(--space-1);
        gap: var(--space-1);
    }
    .break-live-head .break-actions > * {
        width: auto;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
        height: auto;
        line-height: 1.15;
        text-align: center;
        padding: 8px var(--space-3);
    }
}
/* UX-52 — the chip's checked state is drawn with tokens (no native blue box) */
.choice input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid var(--color-border-input);
    border-radius: var(--radius-xs);
    background: var(--color-surface-elevated);
    cursor: pointer;
}
.choice input[type="checkbox"]::after {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--color-on-primary);
    -webkit-mask: var(--icon-check) center / contain no-repeat;
    mask: var(--icon-check) center / contain no-repeat;
    opacity: 0;
}
.choice input[type="checkbox"]:checked { background: var(--color-primary); border-color: var(--color-primary); }
.choice input[type="checkbox"]:checked::after { opacity: 1; }
.choice input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.choice input[type="checkbox"]:disabled { cursor: progress; opacity: .6; }
.private-purpose { margin: var(--space-2) 0 var(--space-3); }
.photo-note { color: var(--color-warning); font-weight: 600; }
.location-error { margin: var(--space-1) 0 0; color: var(--color-warning); font-weight: 600; }
/* a checked chip's words on its soft fill: text, not muted (4.32:1 → 12:1, axe color-contrast) */
.choice.is-on > span { color: var(--color-text); }
/* on a phone the tab bar is at the bottom: the video toggle sits above it, never over a target */
@media (max-width: 480px) {
    .bg-video-toggle { right: var(--space-3); bottom: calc(104px + env(safe-area-inset-bottom)); }
    .page:has(.nav-bar a[href="register"]) .bg-video-toggle { bottom: calc(176px + env(safe-area-inset-bottom)); }
}
/* UX-49 — the transcript lays out on its own: a keystroke in the composer never re-lays the bubbles */
.table-messages-inner { contain: content; }
/* UX-54 — the Barista hands back: a quiet, non-modal line with one way out and one way on */
.barista-handoff {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "mark text close"
        "mark go   close";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.barista-handoff-mark {
    grid-area: mark;
    width: 22px;
    height: 22px;
    background: var(--color-accent-text);
    -webkit-mask: var(--icon-cup) center / contain no-repeat;
    mask: var(--icon-cup) center / contain no-repeat;
}
.barista-handoff-text { grid-area: text; margin: 0; min-width: 0; overflow-wrap: break-word; font-weight: 700; line-height: 1.35; }
.barista-handoff-go {
    grid-area: go;
    justify-self: stretch;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    height: auto;
    line-height: 1.2;
    text-align: center;
    padding: 8px var(--space-3);
}
.barista-handoff-close,
.barista-handoff-close:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.barista-handoff-close {
    grid-area: close;
    align-self: start;
    width: var(--touch-min);
    padding: 0;
}
.barista-handoff-close:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }
.barista-handoff-close::before {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--icon-close) center / contain no-repeat;
    mask: var(--icon-close) center / contain no-repeat;
}
/* ── end Wave 4 · Web ── */
/* ── Camera + toast spec (2026-10-07) ─────────────────────────────────────────
   The error popup (Components/ToastHost) and the photo actions (PhotoPicker, CameraDialog). */

:root {
  --icon-camera:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5A1.5 1.5 0 0 1 4.5 7H8l1.5-2h5L16 7h3.5A1.5 1.5 0 0 1 21 8.5V18a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E");
  --icon-gallery: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='4.5' width='17' height='15' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.75'/%3E%3Cpath d='M20.5 15.5l-4.5-4.5-8.5 8.5'/%3E%3C/svg%3E");
}

/* the popup: top of the screen on a phone (its tab bar is at the bottom), under the sticky nav on
   a small tablet, bottom right from 768 px. Above sheets, below Blazor's own error bar. */
.toast-stack {
    position: fixed;
    z-index: 80;
    top: calc(env(safe-area-inset-top) + var(--space-3));
    left: var(--space-4);
    right: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 560px;
    margin: 0 auto;
    pointer-events: none;
}
.toast-stack:empty { display: none; }
@media (min-width: 481px) and (max-width: 767px) {
    .toast-stack { top: calc(var(--nav-height) + var(--space-3)); }
}
@media (min-width: 768px) {
    .toast-stack {
        top: auto;
        left: auto;
        right: var(--space-6);
        bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
        width: min(420px, calc(100vw - 2 * var(--space-6)));
        margin: 0;
    }
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
    background: var(--color-danger-soft);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-body);
    line-height: 1.45;
    animation: toast-in var(--duration-base) var(--ease-out-soft) both;
}
.toast--success {
    background: var(--color-success-soft);
    border-left-color: var(--color-success);
}
.toast-icon {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--color-danger);
    -webkit-mask: var(--icon-cracked-cup) center / contain no-repeat;
    mask: var(--icon-cracked-cup) center / contain no-repeat;
}
.toast--success .toast-icon {
    background: var(--color-success);
    -webkit-mask-image: var(--icon-check);
    mask-image: var(--icon-check);
}
.toast-text {
    flex: 1;
    margin: 0;
    padding-top: 1px;
    overflow-wrap: anywhere;
}
.toast-close,
.toast-close:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.toast-close {
    flex: none;
    width: var(--touch-min);
    padding: 0;
    margin: calc(-1 * var(--space-2)) 0;
}
.toast-close:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }
.toast-close::before {
    content: "";
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--icon-close) center / contain no-repeat;
    mask: var(--icon-close) center / contain no-repeat;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

/* a field-level line next to its field (the popup says it too) */
.field-error { color: var(--color-danger); margin: 0 0 var(--space-2); }

/* the photo actions: a phone gets "Take photo" + "Choose photo"; a desktop the drop zone and,
   with a webcam, "Use camera" */
.photo-picker {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
}
.photo-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-5);
    background: var(--color-surface);
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}
.photo-picker--compact .photo-choice { padding: var(--space-4); }
.photo-choice .drop-zone-icon {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
    margin-bottom: var(--space-1);
}
.photo-picker--compact .photo-choice .drop-zone-title { font-size: var(--text-body); font-family: var(--font-body); font-weight: 700; }
.photo-choice-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    margin-top: var(--space-2);
}
.photo-action {
    position: relative;
    padding: 0 var(--space-4);
}
.photo-choice-actions .photo-action {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    height: auto;
    line-height: 1.15;
    text-align: center;
}
/* a label inside .form-group would otherwise take the muted form-label type */
.form-group label.photo-action {
    font: 700 var(--text-button)/1 var(--font-body);
}
.form-group label.photo-action--take { color: var(--color-on-primary); }
.form-group label.photo-action--choose { color: var(--color-primary); }
label.photo-action:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}
.photo-action.is-disabled {
    opacity: .6;
    cursor: not-allowed;
}
.photo-action-icon {
    display: block;
    flex: none;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--icon-camera) center / contain no-repeat;
    mask: var(--icon-camera) center / contain no-repeat;
}
.photo-action-icon--gallery {
    -webkit-mask-image: var(--icon-gallery);
    mask-image: var(--icon-gallery);
}
.photo-action--camera { align-self: center; }
.break-idle:has(.upload-state) .photo-picker { display: none; }

/* the desktop camera: a live preview in the sheet, then the prepared still in its place */
.camera-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}
.camera-video,
.camera-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.camera-frame.is-captured .camera-video { visibility: hidden; }
.camera-status {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--space-3);
    text-align: center;
    color: #fff;
    font-size: var(--text-small);
}
.camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}
.camera-actions > * {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    height: auto;
    line-height: 1.15;
    text-align: center;
}
.camera-actions .btn-primary { flex: 1 1 auto; }
.camera-take[aria-disabled="true"] { opacity: .6; cursor: progress; }
/* ── end camera + toast ── */

/* ── Android download (same offer as Nearby: stores, and the APK when published) ── */

.dl-card { max-width: 36rem; }
.dl-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-5);
}
.dl-soon {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--touch-min);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-text);
    background: var(--color-surface);
    font-weight: 700;
}
.dl-soon-note { color: var(--color-text-muted); font-weight: 400; font-size: var(--text-small); }
.dl-apk { flex-direction: column; gap: 2px; min-height: 56px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.dl-apk-meta { font-weight: 400; font-size: var(--text-small); opacity: .85; }
.dl-steps-wrap {
    max-width: 36rem;
    margin: var(--space-6) auto 0;
    color: var(--color-text);
}
.dl-steps-wrap h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-h2);
}
.dl-steps { margin: var(--space-4) 0; padding-left: 1.25rem; display: grid; gap: var(--space-3); }
.dl-sha {
    font-family: var(--font-mono);
    font-size: var(--text-small);
    word-break: break-all;
    color: var(--color-text-muted);
}
.dl-note { color: var(--color-text-muted); }

/* ── Trophy hall ─────────────────────────────────────────────────────────────── */

.hall-page { max-width: 40rem; }
.hall-rank { margin: 0 0 var(--space-5); }
.hall-rank p { margin: 0; }
.hall-standing-next { margin-top: var(--space-1); color: var(--color-text-muted); font-size: var(--text-small); }
.hall-jump { margin: 0 0 var(--space-4); }
.hall-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    margin-top: var(--space-4);
}
.hall-rail {
    list-style: none;
    margin: var(--space-5) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.hall-stop {
    display: grid;
    grid-template-columns: 16px 1fr;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    position: relative;
}
.hall-stop::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 18px;
    bottom: calc(var(--space-5) * -1);
    width: 2px;
    background: var(--color-border);
}
.hall-stop:last-child::before { display: none; }
.hall-mark {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-bg);
    z-index: 1;
}
.hall-when {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
}
.hall-day {
    font-family: var(--font-display);
    font-size: var(--text-lede);
    font-weight: 500;
    line-height: 1.2;
}
.hall-time {
    color: var(--color-text-muted);
    font-size: var(--text-small);
    font-variant-numeric: tabular-nums;
}
.hall-card {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    width: 100%;
    margin: 0;
    padding: var(--space-4);
    text-align: left;
    color: inherit;
    font: inherit;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.hall-card:hover { border-color: var(--color-border-strong); }
.hall-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}
.hall-mugs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    width: 100%;
}
.hall-tile { flex: 1 1 9rem; min-width: 8rem; max-width: 14rem; }
.hall-mug {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}
.hall-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hall-empty-mug {
    position: absolute;
    inset: 0;
    background: var(--color-text-muted);
    opacity: .35;
    -webkit-mask: var(--icon-mug) center / 42% no-repeat;
    mask: var(--icon-mug) center / 42% no-repeat;
}
.hall-avatar,
.hall-initial {
    position: absolute;
    left: var(--space-2);
    bottom: var(--space-2);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-surface);
    object-fit: cover;
}
.hall-initial {
    display: grid;
    place-items: center;
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    font-weight: 700;
    font-size: var(--text-small);
}
.hall-name {
    display: block;
    margin-top: var(--space-2);
    font-weight: 700;
    line-height: 1.3;
}
.hall-cups { display: flex; gap: 4px; }
.hall-cup {
    width: 16px;
    height: 16px;
    background: var(--color-border-strong);
    -webkit-mask: var(--icon-mug) center / contain no-repeat;
    mask: var(--icon-mug) center / contain no-repeat;
}
.hall-cup--full { background: var(--color-accent); }
.hall-unrated { color: var(--color-text-muted); font-size: var(--text-small); }
.hall-empty {
    margin-top: var(--space-5);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    background: var(--color-surface);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
}
.hall-empty::before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    background: var(--color-accent);
    opacity: .55;
    -webkit-mask: var(--icon-mug) center / contain no-repeat;
    mask: var(--icon-mug) center / contain no-repeat;
}
.hall-empty p { margin: 0 0 var(--space-4); color: var(--color-text-muted); }
.hall-error { color: var(--color-text); }
.hall-more { margin-top: var(--space-5); }
.hall-sheet h3 {
    margin: var(--space-4) 0 var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-lede);
    font-weight: 500;
}
.hall-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.hall-meta { margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: var(--text-small); }
.hall-people { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.hall-partner {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}
.hall-partner:last-child { border-bottom: 0; padding-bottom: 0; }
.hall-partner .hall-name { margin-top: 0; }
