@charset "UTF-8";
/* Dinnertime — app styles ("Evening table", design: docs/superpowers/plans/design.md §6 and §11)
   Counterpart: MobileApp/Resources/Styles/Colors.xaml — change tokens in both files in the same commit.
   The app follows prefers-color-scheme; an explicit choice in Profile sets html[data-theme]. */

/* ── Fonts ──────────────────────────────────────────────────────────────────────
   Self-hosted (no request to any font CDN). Piazzolla (display, headings, the italic voice of
   Olive and empty states) and Commissioner (UI), both OFL with full Greek; subsets per design §3,
   licence in fonts/OFL.txt. swap: text is never invisible. */

@font-face {
  font-family: "Piazzolla";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Piazzolla.woff2") format("woff2");
}
@font-face {
  font-family: "Piazzolla";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Piazzolla-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Commissioner";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Commissioner.woff2") format("woff2");
}

/* ── Tokens (design §11) ────────────────────────────────────────────────────────
   Light "Linen" first; the Evening block follows twice (OS preference, explicit choice) and the
   two must stay identical — Frontend.Tests ContrastTests checks both. */

:root {
  /* ground & surfaces — Linen (light) */
  --color-bg:                 #F7F1EA;
  --color-surface:            #FFFBF6;
  --color-surface-elevated:   #FFFFFF;
  --color-border:             #E7D9D6;   /* decorative only */
  --color-border-strong:      #C8B3B5;   /* decorative only */
  --color-border-input:       #8F7981;   /* operable edges: 3.59 / 3.90 / 4.02 on bg / surface / elevated */
  /* text */
  --color-text:               #2A1219;
  --color-text-muted:         #735C63;
  /* primary — Commandaria */
  --color-primary:            #7A2E3A;
  --color-primary-hover:      #63222D;
  --color-primary-soft:       #F3E3E3;
  --color-on-primary:         #FFFBF6;
  /* accent — Tealight (decorative in light; never text) */
  --color-accent:             #F2B347;
  --color-accent-soft:        #FBEBD2;
  --color-accent-text:        #8A5410;
  /* semantic */
  --color-success:            #4B6A2C;   /* olive leaf */
  --color-success-soft:       #E6EED9;
  --color-warning:            #87520C;
  --color-warning-soft:       #FBEBD2;
  --color-danger:             #AE3626;   /* pomegranate */
  --color-danger-soft:        #F9E2DD;
  --color-info:               #2C6570;   /* sea */
  --color-info-soft:          #DFECEE;
  --color-overlay:            rgba(42,18,25,.45);
  --color-focus:              var(--color-primary);
  /* dinnertime motifs */
  --color-flame:              #F2B347;                  /* the tealight, both themes */
  --color-flame-glow:         rgba(242,179,71,.18);
  --color-seat-dashed:        var(--color-border-input);  /* the +1 place, offered */
  --color-seat-agreed:        var(--color-success);       /* the +1 place, agreed */
  --color-course-done:        var(--color-accent);
  --color-course-todo:        var(--color-border-input);
  --seat-dash:                4 4;
  /* chat bubbles */
  --bubble-mine-bg:           var(--color-primary);
  --bubble-mine-text:         var(--color-on-primary);
  --bubble-mine-stamp:        rgba(255,251,246,.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);
  /* texture */
  --grain-opacity:            .035;
  /* type */
  --font-display:  "Piazzolla", "Noto Serif", Georgia, "Palatino Linotype", serif;
  --font-voice:    "Piazzolla", "Noto Serif", Georgia, serif;          /* with font-style: italic */
  --font-body:     "Commissioner", "Segoe UI", -apple-system, system-ui, Roboto, sans-serif;
  --font-mono:     ui-monospace, "SF Mono", Menlo, Consolas, monospace; /* error codes only */
  --text-display:  40px;
  --text-h1:       30px;
  --text-h2:       22px;
  --text-eyebrow:  11px;
  --text-body:     16px;
  --text-small:    13px;
  --text-caption:  12px;
  --text-button:   15px;
  --text-lede:     17px;
  --text-empty:    18px;
  --text-stamp:    11px;
  --text-courses:  15px;
  /* 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 (wine-tinted, never grey) */
  --shadow-sm:   0 1px 2px rgba(42,18,25,.06), 0 1px 1px rgba(42,18,25,.04);
  --shadow-md:   0 4px 12px rgba(42,18,25,.08), 0 1px 3px rgba(42,18,25,.06);
  --shadow-lg:   0 16px 40px rgba(42,18,25,.14), 0 4px 10px rgba(42,18,25,.06);
  --glow-accent: 0 0 0 4px var(--color-accent-soft), 0 10px 30px rgba(242,179,71,.30);
  --glow-success:0 0 0 4px var(--color-success-soft), 0 10px 30px rgba(75,106,44,.25);
  --inset-paper: inset 0 1px 0 rgba(255,255,255,.6);
  /* motion */
  --duration-fast:    120ms;
  --duration-base:    200ms;
  --duration-slow:    320ms;
  --duration-course:  480ms;
  --duration-set:     600ms;   /* the dashed place drawing solid (+1 agreed) */
  --duration-flicker: 4.2s;
  --duration-seal:    480ms;
  --ease-standard:  cubic-bezier(.2,.7,.2,1);
  --ease-out-soft:  cubic-bezier(.16,1,.3,1);
  --ease-spring:    cubic-bezier(.2,.7,.2,1);   /* no overshoot: nothing in Dinnertime bounces */
  /* 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);
}

/* Evening (dark): when the OS prefers dark and the person has not chosen Linen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:                 #170D12;   /* carob night */
    --color-surface:            #22141B;   /* table */
    --color-surface-elevated:   #2D1C24;   /* table raised */
    --color-border:             #3A2730;
    --color-border-strong:      #563C48;
    --color-border-input:       #8E7680;   /* 4.58 / 4.27 / 3.88 */
    --color-text:               #F6EFE6;   /* linen  16.69 on bg */
    --color-text-muted:         #BDA9AF;   /* ash     8.58 on bg */
    --color-primary:            #F2B347;   /* tealight */
    --color-primary-hover:      #F7C46A;
    --color-primary-soft:       #3A2616;
    --color-on-primary:         #170D12;   /* 10.26 */
    --color-accent:             #F2B347;
    --color-accent-soft:        #3A2616;
    --color-accent-text:        #F2B347;
    --color-success:            #A9BA7C;   /* olive grove */
    --color-success-soft:       #24301C;
    --color-warning:            #E9B862;   /* honey: always with icon + label */
    --color-warning-soft:       #3A2616;
    --color-danger:             #F08C7A;   /* pomegranate */
    --color-danger-soft:        #3D1C1C;
    --color-info:               #8DC2CB;   /* limassol sea */
    --color-info-soft:          #16292E;
    --color-overlay:            rgba(0,0,0,.6);
    --color-focus:              var(--color-primary);
    --bubble-mine-stamp:        rgba(23,13,18,.8);
    --grain-opacity:            .06;
    --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(242,179,71,.30);
    --glow-success:0 0 0 4px var(--color-success-soft), 0 10px 30px rgba(169,186,124,.25);
    --inset-paper: inset 0 1px 0 rgba(255,255,255,.04);
  }
}

/* Evening, chosen explicitly in Profile. Keep identical to the block above. */
:root[data-theme="dark"] {
    --color-bg:                 #170D12;   /* carob night */
    --color-surface:            #22141B;   /* table */
    --color-surface-elevated:   #2D1C24;   /* table raised */
    --color-border:             #3A2730;
    --color-border-strong:      #563C48;
    --color-border-input:       #8E7680;   /* 4.58 / 4.27 / 3.88 */
    --color-text:               #F6EFE6;   /* linen  16.69 on bg */
    --color-text-muted:         #BDA9AF;   /* ash     8.58 on bg */
    --color-primary:            #F2B347;   /* tealight */
    --color-primary-hover:      #F7C46A;
    --color-primary-soft:       #3A2616;
    --color-on-primary:         #170D12;   /* 10.26 */
    --color-accent:             #F2B347;
    --color-accent-soft:        #3A2616;
    --color-accent-text:        #F2B347;
    --color-success:            #A9BA7C;   /* olive grove */
    --color-success-soft:       #24301C;
    --color-warning:            #E9B862;   /* honey: always with icon + label */
    --color-warning-soft:       #3A2616;
    --color-danger:             #F08C7A;   /* pomegranate */
    --color-danger-soft:        #3D1C1C;
    --color-info:               #8DC2CB;   /* limassol sea */
    --color-info-soft:          #16292E;
    --color-overlay:            rgba(0,0,0,.6);
    --color-focus:              var(--color-primary);
    --bubble-mine-stamp:        rgba(23,13,18,.8);
    --grain-opacity:            .06;
    --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(242,179,71,.30);
    --glow-success:0 0 0 4px var(--color-success-soft), 0 10px 30px rgba(169,186,124,.25);
    --inset-paper: inset 0 1px 0 rgba(255,255,255,.04);
}

/* Greek runs ~15–20 % longer: the display sizes step down one notch. */
:lang(el) { --text-display: 34px; --text-h1: 27px; }

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms; --duration-base: 0ms; --duration-slow: 120ms;
    --duration-course: 0ms; --duration-set: 0ms; --duration-seal: 0ms;
  }
  .tealight-flame { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ── Web-only assets ────────────────────────────────────────────────────────────
   --shadow-up is the upward cast for the bottom-anchored nav bar at ≤480. The glyphs are 24×24
   stroked SVGs (1.6 stroke, round caps — design §4) used through `mask-image`, so their colour is
   whatever `background` the host paints. Brand drawings (plate, place, dashed place, tealight,
   venue) follow _dinnertime-plan/brand/svg. No hearts, no glasses, no houses. ───────────── */

:root {
  --shadow-up:        0 -8px 24px rgba(42,18,25,.08);
  /* place setting from above: fork | plate | knife */
  --icon-plate:       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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='3.25'/%3E%3Cpath d='M2.5 5v14M21.5 19V5c-1.2 1-1.8 3-1.8 5.5h1.8'/%3E%3C/svg%3E");
  --icon-plate-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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='6' fill='%23000'/%3E%3Cpath d='M2.5 5v14M21.5 19V5c-1.2 1-1.8 3-1.8 5.5h1.8'/%3E%3C/svg%3E");
  --icon-place-dashed: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.6'%3E%3Ccircle cx='12' cy='12' r='6' stroke-dasharray='4 4'/%3E%3Cpath d='M2.5 5v14M21.5 5v14' stroke-dasharray='4 4'/%3E%3C/svg%3E");
  --icon-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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
  --icon-plate-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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='13' r='6.5'/%3E%3Cpath d='M20.5 3.5v6M20.5 13h.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.6' 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.6' 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.6' 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.6' 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");
  --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.6' 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.6' 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.6' 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.6' 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.6' 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.6' 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.6' 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.6' 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");
  /* safety and +1 set (design §4) */
  --icon-flag:        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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E");
  --icon-ban:         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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E");
  --icon-shield-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='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7.5 3v5.5c0 4.6-3.2 8.2-7.5 9.5-4.3-1.3-7.5-4.9-7.5-9.5V6z'/%3E%3Cpath d='M8.8 12.2l2.3 2.3 4.2-4.6'/%3E%3C/svg%3E");
  --icon-share:       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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5h9.5L17 12v8H4z'/%3E%3Cpath d='M13.5 8.5V12H17M14 3.5h6.5V10M20.5 3.5l-6 6'/%3E%3C/svg%3E");
  --icon-check-in:    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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 20.5v-6.5a2 2 0 0 1 4 0V12a2 2 0 0 1 4 0v1a2 2 0 0 1 4 0v3.5a4 4 0 0 1-4 4z'/%3E%3Cpath d='M4 6.5l2.5 2.5L11 4.5'/%3E%3C/svg%3E");
  --icon-door:        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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21h16M6 21V4h9v17'/%3E%3Cpath d='M15 4l4 2v15M12 12.5v.01'/%3E%3C/svg%3E");
  --icon-leaf:        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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20c4-4 8-7.5 15-9'/%3E%3Cpath d='M10.5 14.5c-1.5-4.5.5-9 6.5-10.5.8 5.6-1.8 9.5-6.5 10.5z'/%3E%3Cellipse cx='17.5' cy='15.5' rx='2' ry='2.6' transform='rotate(-30 17.5 15.5)'/%3E%3C/svg%3E");
  --icon-venue:       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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21.5c-3.5-3.6-6-6.6-6-9.5M12 21.5c3.5-3.6 6-6.6 6-9.5'/%3E%3Cpath d='M5 12h14l-1.6-7.5H6.6z'/%3E%3Cpath d='M5.8 8.25h12.4'/%3E%3C/svg%3E");
  --icon-globe:       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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.3 2.4 3.5 5.2 3.5 8.5s-1.2 6.1-3.5 8.5c-2.3-2.4-3.5-5.2-3.5-8.5S9.7 5.9 12 3.5z'/%3E%3C/svg%3E");
  --icon-chat:        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.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 18.5l1.2-3.6A7.5 7.5 0 1 1 9 18.3z'/%3E%3C/svg%3E");
  --illus-two-places: 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%3Ccircle cx='32' cy='46' r='9'/%3E%3Cpath d='M18 39v14M46 39v14'/%3E%3Ccircle cx='32' cy='16' r='9' stroke-dasharray='4 4' stroke-linecap='butt'/%3E%3Cpath d='M18 9v14M46 9v14' stroke-dasharray='4 4' stroke-linecap='butt'/%3E%3Ccircle cx='32' cy='31' r='2' fill='%23000' stroke='none'/%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 .16 0 0 0 0 .07 0 0 0 0 .10 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:not([data-theme="light"]) {
    --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 .96 0 0 0 0 .94 0 0 0 0 .90 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
    --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 .96 0 0 0 0 .94 0 0 0 0 .90 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 --course-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;
    font-variant-numeric: tabular-nums;
    /* ground: linen grain + one warm light (the tealight) + the table (no blend modes, no fixed layers) */
    background:
        var(--grain-tile) 0 0 / 180px 180px,
        radial-gradient(56rem 40rem at 70% -6%, var(--color-flame-glow) 0%, transparent 70%),
        var(--color-bg);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

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: 400;
    line-height: 1.15;
    letter-spacing: -.005em;
    font-optical-sizing: auto;
}

h2 {
    font-size: var(--text-h2);
    font-weight: 500;
    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-focus);
    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: 400;
    line-height: 1.1;
    letter-spacing: -.01em;
}

/* the voice: Olive, quotes, empty states, "How was it?" (Piazzolla italic) */
.voice {
    font-family: var(--font-voice);
    font-style: italic;
    font-weight: 400;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: var(--text-eyebrow);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-2);
}
/* Greek uppercase drops its accents and reads as shouting: sentence case, a little larger */
:lang(el) .eyebrow,
:lang(el) .profile-details dt {
    text-transform: none;
    letter-spacing: .01em;
    font-size: var(--text-caption);
}

.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;
}

/* the mark's flame dot is the tealight; it does not flicker here (the progress ring moves) */
.boot-mark .mark-flame { fill: var(--color-flame); }

#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-body);
    font-size: 13px;
    letter-spacing: .02em;
    color: var(--color-text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.loading-progress-text::after {
    content: "Laying the table…  " var(--blazor-load-percentage-text, "");
}
html:lang(el) .loading-progress-text::after {
    content: "Στρώνουμε το τραπέζι…  " var(--blazor-load-percentage-text, "");
}
html:lang(es) .loading-progress-text::after {
    content: "Poniendo la mesa…  " var(--blazor-load-percentage-text, "");
}
html:lang(fr) .loading-progress-text::after {
    content: "On met la table…  " var(--blazor-load-percentage-text, "");
}
html:lang(it) .loading-progress-text::after {
    content: "Si apparecchia…  " 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: 600 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"],
.diner-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),
.diner-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); }

.diner-join-btn:hover:not(:disabled),
.diner-join-btn:focus-visible,
.table-keep-button:hover:not(:disabled),
.table-keep-button:focus-visible {
    box-shadow: var(--glow-accent);
}

/* secondary: transparent, a 1.5 px seat-line edge, text colour (design §6.1). Yes and No pairs
   use primary + secondary at the same size, or two secondaries — never a greyed-out "no". */
.btn-secondary,
button.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 1.5px solid var(--color-border-input);
}
.btn-secondary:hover:not(:disabled),
button.btn-secondary:hover:not(:disabled) {
    background: var(--color-primary-soft);
    color: var(--color-text);
    border-color: var(--color-primary);
}

/* quiet danger: Report, Leave, Call it off — text and icon, never a red fill */
.btn-danger-quiet,
button.btn-danger-quiet {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid transparent;
}
.btn-danger-quiet:hover:not(:disabled),
button.btn-danger-quiet:hover:not(:disabled) {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* the one red fill in the product: "Call 112" (Pomegranate with carob text, 7.9:1) */
.btn-emergency,
a.btn-emergency {
    background: var(--color-danger);
    color: var(--color-bg);
    border: 1px solid transparent;
}
.btn-emergency:hover,
a.btn-emergency:hover { color: var(--color-bg); filter: brightness(1.05); }

/* 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);
}
.sitting-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-focus);
    outline-offset: 3px;
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
[aria-disabled="true"].btn-primary,
[aria-disabled="true"].btn-secondary {
    opacity: .45;
    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 sitting */


/* Disclosure chevron: display:flex drops the native marker, so the open/closed cue is drawn here. */


.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);
    min-height: var(--touch-min);
    padding: 8px 12px;
    border: 1.5px solid var(--color-border-input);
    border-radius: var(--radius-pill);
    background: var(--color-surface-elevated);
    cursor: pointer;
    font-weight: 400;
}

.choice.is-on {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);   /* 2 px look without a layout shift */
    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-input);
    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(23, 13, 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,
.sitting-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-input);
    border-radius: var(--radius-md);
    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,
.sitting-mood input::placeholder,
.table-composer-input::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

.form-control:focus,
.sitting-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,
.sitting-mood input:focus-visible,
.table-composer-input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.form-control.invalid,
.sitting-mood input.invalid {
    border-color: var(--color-danger);
}

.form-control:disabled,
.sitting-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,
.sitting-error,
.tables-error,
.table-error,
.table-keep-error,
.sitting-refresh-error,
.table-live-paused,
.profile-reason,
.sitting-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,
.sitting-error::before,
.tables-error::before,
.table-error::before,
.table-keep-error::before,
.sitting-refresh-error::before,
.table-live-paused::before,
.profile-reason::before,
.sitting-empty--failed::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--color-danger);
    -webkit-mask: var(--icon-alert) center / contain no-repeat;
    mask: var(--icon-alert) center / contain no-repeat;
}

/* stale but real → warning (honey) */
.sitting-refresh-error,
.table-live-paused,
.profile-reason {
    background: var(--color-warning-soft);
    border-left-color: var(--color-warning);
}
.sitting-refresh-error::before,
.table-live-paused::before,
.profile-reason::before {
    background: var(--color-warning);
}
.sitting-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 (Sitting, 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-plate-alert);
    mask-image: var(--icon-plate-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-places) center / contain no-repeat;
    mask: var(--illus-two-places) 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-lg);
    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);
    min-height: 32px;
    padding: var(--space-1) 12px;
    background: transparent;
    color: var(--color-text);
    border: 1.5px solid var(--color-border-input);
    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);
    border-color: transparent;
}

.chip--ghost {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) 10px;
    background: transparent;
    border: 1px solid var(--color-border-strong);   /* dashed lines mean "+1 offered" only */
    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);
}

/* the brand mark above the h1 (BrandMark in Login/Register.razor) */
.auth-card .auth-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;
}

/* ── Sitting — idle (§6.7) ────────────────────────────────────────────────────── */

.sitting-idle {
    max-width: 480px;
    margin: var(--space-6) auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sitting-idle .lede { margin-left: auto; margin-right: auto; }
.sitting-idle > .sitting-error { align-self: stretch; text-align: left; }

.sitting-idle h1 { margin-bottom: var(--space-3); }

.sitting-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: 1.5px solid var(--color-border-input);
    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-text);
    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) */
.sitting-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: 1.5px solid var(--color-border-input);
    border-radius: var(--radius-lg);
    animation: shimmer 1.6s linear infinite;
    text-align: center;
}

/* laying your place: the place setting, quietly (the shimmer behind it is the only motion) */
.upload-state::before {
    content: "";
    width: 40px;
    height: 40px;
    background: var(--color-accent-text);
    -webkit-mask: var(--icon-plate) center / contain no-repeat;
    mask: var(--icon-plate) center / contain no-repeat;
}

.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;
}

/* ── Sitting — live (§6.8) ────────────────────────────────────────────────────── */

.sitting-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) */
.sitting-live > .sitting-live-head { order: 0; }
.sitting-live > .eyebrow { order: 1; }
.sitting-live > .sitting-live-chip { order: 1; }
.sitting-live > .sitting-refresh-error { order: 2; }
.sitting-live > .candidate-list,
.sitting-live > .loading-state,
.sitting-live > .sitting-empty { order: 3; }
.sitting-live > .sitting-error { order: 4; }

.sitting-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);
}

.sitting-live-head h1 { margin-bottom: var(--space-2); }


.sitting-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; }

.diner-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);
}

.diner-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.diner-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);
}

.diner-join-btn {
    align-self: flex-start;
    margin-top: var(--space-2);
    min-height: var(--touch-min);
}

/* waiting: the card you joined pours to slate */
.diner-card--waiting {
    background: var(--color-info-soft);
    border-color: var(--color-info);
}
.diner-card--waiting:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--color-info);
}

.diner-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);
}
.diner-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 */
.sitting-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);
}

.sitting-empty--failed,
.sitting-empty.empty-state.sitting-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);
}
.sitting-empty.empty-state.sitting-empty--failed::before {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--color-danger);
    -webkit-mask: var(--icon-alert) center / contain no-repeat;
    mask: var(--icon-alert) center / contain no-repeat;
}

/* hub down or reconnecting: the list is polled, not pushed — stale but real → warning (honey) */
.sitting-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;
}
.sitting-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;
}

/* Sitting idle without a usable profile: the card stands where the photo picker would */
.sitting-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;
}
.sitting-profile-needed h2 { margin: 0; }
.sitting-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 place-setting 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-plate) center / contain no-repeat;
    mask: var(--icon-plate) 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 tealight 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: 1fr auto;
    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-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: 1.5px solid var(--color-border-input);
    background: transparent;
    transition:
        background-color var(--duration-slow) var(--ease-standard),
        border-color var(--duration-slow) var(--ease-standard);
}

/* plate 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-plate) center / contain no-repeat;
    mask: var(--icon-plate) 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-plate) center / contain no-repeat;
    mask: var(--icon-plate) 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 (tealight) */
.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-plate) center / contain no-repeat;
    mask: var(--icon-plate) 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 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); }

    /* Sitting live: timer block 240 px sticky on the left, candidates on the right */
    .sitting-live {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        column-gap: var(--space-6);
        row-gap: 0;
        align-items: start;
    }
    .sitting-live > * { grid-column: 2; }
    .sitting-live > .sitting-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);
    }
    .sitting-live-head .sitting-actions { flex-direction: column; align-items: stretch; width: 100%; }
    .sitting-live-head .sitting-actions > * { width: 100%; }
    .sitting-live > .eyebrow { margin-top: 0; }
}

@media (max-width: 767.98px) {
    /* 481–520 px: the top bar's brand + four links only fit without the 24 px gutters, and a label must never wrap */
    .nav-bar { padding: 0 var(--space-4); }
    .nav-bar nav a,
    .nav-bar nav .btn-link,
    .nav-bar nav .nav-menu > .nav-menu-summary { 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;
        gap: 0;
    }
    .nav-bar nav a,
    .nav-bar nav .btn-link {
        flex: 1 1 0;
        justify-content: center;
        min-height: 56px;
        padding: 0 var(--space-1);
        border-radius: var(--radius-sm);
        font-size: 13px;
    }
    .nav-bar nav .nav-menu { flex: 1 1 0; display: flex; }
    .nav-bar nav .nav-menu > .nav-menu-summary {
        flex: 1 1 auto;
        justify-content: center;
        width: 100%;
        min-height: 56px;
        padding: 0 var(--space-1);
        font-size: 13px;
    }
    .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;
    }
    .legal-footer { margin-bottom: calc(72px + 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(72px + env(safe-area-inset-bottom)); }

    :root { --text-timer: 48px; }
    
    
    

    .sitting-live-head { padding: var(--space-5) var(--space-4); }

    .candidate-list { gap: var(--space-3); }
    .diner-card { padding: var(--space-3); border-radius: var(--radius-md); }
    .diner-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;
    }

    *, *::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. */
    

    /* courses keep their static state; no sweep, no breathe */
    
    

    /* 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%; }
    .diner-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 · Sitting & match moment ──────────────────────────────────────────────
   UX-10 match moment · UX-11 attention opt-in · UX-15 your plate at the head ·
   UX-16 candidate cards · UX-17 sitting-over. Tokens only; dark mode via the tokens.
   Motion: transform/opacity only; reduced motion at the end of this block.        */

/* UX-15 — your plate photo inside the place setting */

   /* the photo fills the plate */


/* UX-16 — candidate card: photo hero, note, honest time chip; not a button, so no lift */
.diner-card.diner-card--hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
.diner-card--hero:hover { transform: none; }
.diner-hero {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    background: var(--color-primary-soft);
    overflow: hidden;
}
.diner-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.diner-photo--placeholder {
    display: grid;
    place-items: center;
    background: var(--color-primary-soft);
}
.diner-photo--placeholder::before {
    content: "";
    width: 72px;
    height: 72px;
    background: var(--color-primary);
    opacity: .55;
    -webkit-mask: var(--icon-plate) center / contain no-repeat;
    mask: var(--icon-plate) center / contain no-repeat;
}


.diner-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;
}
.diner-card--hero .diner-info {
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-5);
}
.diner-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}
.diner-card--hero .diner-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: 500;
    line-height: 1.2;
}
.diner-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;
}
.diner-langs,
.diner-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;
}
.diner-card--hero .candidate-interests .chip.chip--shared {
    background: var(--color-accent-soft);
    color: var(--color-accent-text);
    font-weight: 700;
}
.diner-card--hero .candidate-interests .chip.chip--other {
    background: var(--color-primary-soft);
    color: var(--color-text);
}
.diner-card--hero .diner-join-btn {
    align-self: stretch;
    margin-top: var(--space-2);
}


.diner-waiting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-1);
}
.diner-waiting-row .diner-waiting { margin-top: 0; }
.diner-card--waiting .diner-cancel-btn { color: var(--color-info); }
.diner-card--waiting .diner-cancel-btn:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
}
.diner-card--waiting .diner-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 */
.sitting-live > .attention-offer { order: 2; }
.sitting-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 scene, two places across one table */
.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-places {
    position: relative;
    width: 284px;
    height: 188px;
    margin-bottom: var(--space-6);
}


.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 — sitting-over: the ending as a scene */
.sitting-over {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
.sitting-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;
}


.sitting-over-card h1 { margin-bottom: var(--space-3); }
.sitting-over-card .loading-state { width: 100%; align-items: center; }
.sitting-over-lede {
    margin: 0 auto var(--space-4);
    color: var(--color-text);
    font-size: 18px;
}
.sitting-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;
}
.sitting-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;
}
.sitting-over-note {
    max-width: 38ch;
    margin: 0 auto var(--space-3);
    color: var(--color-text-muted);
}
.sitting-over-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}
.sitting-over-olive {
    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-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-places { width: 248px; height: 164px; }
    
    .match-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    /* the match moment is a static card that cross-fades in — nothing slides or springs */
    .match-moment { animation: w1-fade-in 240ms var(--ease-standard) both !important; }
    .match-eyebrow,
.match-title,
.match-shared,
.match-cta {
        animation: none !important;
    }
    .candidate-list > li.is-leaving { animation: none; opacity: 0; }
    
    .attention-offer, .sitting-over-card { animation: none; }
}
/* ── end Wave 1 · Sitting & match moment ── */

/* ── Wave 2 · Sitting ──────────────────────────────────────────────────────────────
   Stop waiting (busy + inline error) · UX-19 live-room cue · UX-30 Olive card and mark.
   Tokens only; dark mode via the tokens. Motion: one breathing dot while the hub is live,
   the Olive mark is still; nothing loops but the tealight.          */

/* UX-19 — the live-room line takes the eyebrow's slot above the list */
.sitting-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-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; }

/* a clause never sittings 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 */


.diner-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 Olive card: mark, name + AI label, voice, disclosure, CTA */
.sitting-live > .sitting-live-olive { order: 5; margin-top: var(--space-4); }
.sitting-live > .sitting-live-olive--next { order: 3; margin-top: 0; margin-bottom: var(--space-5); }
.sitting-idle-olive { align-self: stretch; margin-top: var(--space-8); }
.olive-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    text-align: left;
    padding: var(--space-5);
}
.olive-card--compact { gap: var(--space-3); padding: var(--space-4); }
.olive-card--primary {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
}
.olive-card-avatar { flex: none; }
.olive-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}
.olive-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);
}
.olive-card-badge { font-family: var(--font-body); font-size: var(--text-caption); line-height: 1.5; }
.olive-card-voice {
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16px;
    line-height: 1.45;
    color: var(--color-text);
}
.olive-card-disclosure {
    margin: 0;
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--color-info);
}
.olive-card-cta { margin-top: var(--space-3); }
.olive-card--compact .olive-card-name { font-size: 17px; }
.olive-card--compact .olive-card-voice { font-size: 15px; }
/* inside the sitting-over card it is a section of that card, not a second card */
.sitting-over-olive .olive-card {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

/* the mark — every colour a token, so dark mode follows */
.olive-avatar { display: block; overflow: visible; }
.olive-avatar-disc { fill: var(--color-accent-soft); }


@keyframes w2-live-breathe {
    0%, 100% { opacity: 0;   transform: scale(.5); }
    50%      { opacity: .28; transform: scale(1); }
}


@media (max-width: 480px) {
    .olive-card { padding: var(--space-4); gap: var(--space-3); }
    .sitting-idle-olive { margin-top: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
    
    
    
    .diner-stop-error { animation: none; }
}
/* ── end Wave 2 · Sitting ── */

/* ── Wave 1 · Table ──────────────────────────────────────────────────────────────
   UX-12 clock, UX-13 hierarchy, UX-14 incoming call + call controls, UX-18 openers.
   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: #170D12;        /* a video well is dark in both themes */
    --call-screen-text: #F6EFE6;
    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-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;
}
.table-head .companion-badge { margin-left: var(--space-1); font-family: var(--font-body); }
.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 */


/* last five minutes: honey, and the ring breathes */


/* 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: 1.5px solid var(--color-border-input);
    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 — openers in the empty chat (they replace the bare place-setting watermark) */
.table-messages-inner:has(.openers)::before { content: none; }
.openers {
    margin: auto 0;
    padding: var(--space-4) var(--space-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.openers::before {
    content: "";
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-3);
    background: var(--color-border-strong);
    -webkit-mask: var(--illus-two-places) center / contain no-repeat;
    mask: var(--illus-two-places) center / contain no-repeat;
}
.openers-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);
}
.openers-lede {
    max-width: 34ch;
    margin: 0 0 var(--space-4);
    color: var(--color-text-muted);
}
.openers-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.opener,
.opener:hover:not(:disabled) {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.opener {
    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;
}
.openers-list li:nth-child(2) .opener { animation-delay: 60ms; }
.openers-list li:nth-child(3) .opener { animation-delay: 120ms; }
.opener:hover:not(:disabled) {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}
.opener::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;
}

/* 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 (tealight = 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-height: 48px; }
.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; }

/* 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); }
    .openers { 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(58px + 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) {
    .seat-chip--mine .seat-dot:not(.seat-dot--filled),
.incoming-call-avatar::after {
        animation: none;
        opacity: 1;
    }
    
}

/* ── 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.
   Sitting (/):         your place (courses + actions) · the room (people / sitting over) · your tables dock
   Table (/tables/x): a narrow tables rail · the chat, centred at a comfortable measure.
   Colour grammar: tealight = 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-plate:  296px;
        --desk-chat: 760px;
        width: 100%;
        max-width: var(--desk-max);
        margin: 0 auto;
        padding: 0 var(--space-8);
    }

    /* Sitting: the room and the dock side by side; the page's own column loses its 640 px cap */
    main.desk--sitting:has(> .desk-dock) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--desk-dock);
        column-gap: var(--space-10);
        align-items: start;
    }
    main.desk--sitting > .content {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }
    main.desk--sitting .sitting-live {
        max-width: none;
        grid-template-columns: var(--desk-plate) minmax(0, 1fr);
        column-gap: var(--space-10);
    }
    main.desk--sitting .sitting-live > .sitting-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--sitting .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: tealight = 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 sittings */
.table-screen .table-message-body { white-space: pre-wrap; }

/* day separators (kept tables and the Olive): 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);
}
/* Greek: no all-caps (accents drop and it reads as shouting; PLAN.md §10) */
:lang(el) .chat-day { text-transform: none; letter-spacing: .01em; font-size: var(--text-caption); }
.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-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 Greek 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-plate) center / contain no-repeat;
    mask: var(--icon-plate) 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-plate); mask-image: var(--icon-plate); }
.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 Greek, and the Olive'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,
.sitting-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,
.sitting-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 — tealight = 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: "Wir decken den Tisch\2026  " var(--blazor-load-percentage-text, "");
}

/* UX-30 — the Olive mark in the companion header takes the avatar's slot */
.table-head .table-head-olive {
    grid-area: avatar;
    width: 44px;
    height: 44px;
}
@media (max-width: 480px) {
    .table-head .table-head-olive { 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: kept tables — a plate on a charger */
    --icon-kept: 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'/%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); }

/* 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 Sitting: tealight = 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-plate) center / contain no-repeat;
    mask: var(--icon-plate) 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
   Greek 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-kept) center / contain no-repeat;
    mask: var(--icon-kept) 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 sitting-over scene: "Start another" and "Done for now" weigh the same */
.sitting-over-actions--even {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    width: 100%;
}
.sitting-over-actions--even > button { width: 100%; padding: 0 var(--space-3); }
.sitting-over-tables { margin-top: var(--space-2); }
.sitting-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) */


/* UX-51 — incoming call: Accept first (it has the focus), Decline, then the ring's mute */
.incoming-call-actions { grid-template-columns: 1fr 1fr var(--touch-min); }

/* 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) */

/* 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); }
    
    
    /* 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 timer card becomes one compact row, so the first
   person on a sitting starts above the fold */
@media (max-height: 700px) {
    .sitting-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);
    }
    .sitting-live-head > .eyebrow { grid-area: eyebrow; margin: 0; }
    .sitting-live-head > h1 { grid-area: title; margin: 0; font-size: var(--text-h2); }
    
    
    
    
    .sitting-live-head .sitting-actions {
        grid-area: actions;
        flex-direction: row;
        justify-content: flex-start;
        width: auto;
        margin-top: var(--space-1);
        gap: var(--space-1);
    }
    .sitting-live-head .sitting-actions > * { width: auto; padding: 0 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; }

.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 */

/* 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 Olive hands back: a quiet, non-modal line with one way out and one way on */
.olive-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);
}
.olive-handoff-mark {
    grid-area: mark;
    width: 22px;
    height: 22px;
    background: var(--color-accent-text);
    -webkit-mask: var(--icon-plate) center / contain no-repeat;
    mask: var(--icon-plate) center / contain no-repeat;
}
.olive-handoff-text { grid-area: text; margin: 0; font-weight: 700; line-height: 1.35; }
.olive-handoff-go { grid-area: go; justify-self: start; }
.olive-handoff-close,
.olive-handoff-close:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.olive-handoff-close {
    grid-area: close;
    align-self: start;
    width: var(--touch-min);
    padding: 0;
}
.olive-handoff-close:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }
.olive-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 ── */


/* ══ Dinnertime layer ═══════════════════════════════════════════════════════════
   The evening-table components (design §4–§6, PLAN.md §6). Tokens only; every status is icon +
   text + colour; one loop on screen at a time (the tealight); reduced motion turns every
   movement into an instant state change. Later rules here refine the inherited ones above.
   ═════════════════════════════════════════════════════════════════════════════════ */

/* ── The mark and the wordmark ── */
.brand-mark .mark-flame,
.boot-mark .mark-flame { fill: var(--color-flame); }
.nav-bar .brand,
.bare-bar .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -.015em;
    color: var(--color-text);
    text-decoration: none;
    min-height: var(--touch-min);
}
.nav-bar .brand .brand-mark,
.bare-bar .brand .brand-mark { width: 24px; height: 24px; color: var(--color-text); }
.boot-title { font-weight: 500; letter-spacing: -.015em; }
.boot-mark { color: var(--color-text); }

/* ── Small icon helper: a 20 px mask in the current colour ── */
.chip-icon {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--chip-icon) center / contain no-repeat;
            mask: var(--chip-icon) center / contain no-repeat;
}
.chip-icon--venue        { --chip-icon: var(--icon-venue); }
.chip-icon--place-dashed { --chip-icon: var(--icon-place-dashed); }
.chip-icon--share        { --chip-icon: var(--icon-share); }
.chip-icon--check-in     { --chip-icon: var(--icon-check-in); }
.chip-icon--door         { --chip-icon: var(--icon-door); }

/* ── The tealight (design §4–5): glass, wick, flame; the only loop ── */
.tealight { display: inline-flex; color: var(--color-text-muted); line-height: 0; }
.tealight svg { overflow: visible; }
.tealight-glow { fill: var(--color-flame-glow); }
.tealight-flame {
    fill: var(--color-flame);
    transform-box: fill-box;
    transform-origin: 50% 100%;
}
.tealight--live .tealight-flame[data-flicker="true"] {
    animation: tealight-flicker var(--duration-flicker) ease-in-out infinite;
}
.tealight--live .tealight-flame.is-paused,
.is-tab-hidden .tealight-flame { animation-play-state: paused !important; }
@keyframes tealight-flicker {
    0%, 100% { opacity: 1;   transform: scaleY(1); }
    23%      { opacity: .94; transform: scaleY(.98); }
    37%      { opacity: .88; transform: scaleY(.97); }
    61%      { opacity: .97; transform: scaleY(1.03); }
    79%      { opacity: .91; transform: scaleY(.99); }
}

/* ── A place laid from above ── */
.place-setting {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: var(--place-size, 48px);
    height: var(--place-size, 48px);
    color: var(--color-text);
    flex: none;
}
.place-setting svg { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.place-setting .place-plate-inner { stroke-opacity: .45; }
.place-setting--olive { color: var(--color-info); }
.place-setting--olive .place-leaf { stroke: var(--color-success); }
.place-photo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--place-size, 48px) * .5);
    height: calc(var(--place-size, 48px) * .5);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--color-surface);
}

/* ── The +1 place: dashed = offered; solid + olive check = agreed (600 ms draw) ── */
.dashed-place { display: inline-flex; flex: none; color: var(--color-seat-dashed); line-height: 0; }
.dashed-place svg { stroke: currentColor; stroke-width: 1.6; }
.dashed-place-line { stroke-dasharray: var(--seat-dash); }
.dashed-place--muted { opacity: .7; }
.dashed-place--agreed { color: var(--color-seat-agreed); }
.dashed-place--agreed .dashed-place-line {
    stroke-dasharray: 100 0;
    animation: seat-draw var(--duration-set) var(--ease-out-soft) both;
}
.dashed-place-check {
    stroke: var(--color-success);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: w1-fade-in var(--duration-set) var(--ease-standard) both;
}
@keyframes seat-draw {
    from { stroke-dasharray: 4 4; }
    to   { stroke-dasharray: 100 0; }
}

/* ── Courses: three plates and approximate words (never seconds) ── */
.courses {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-courses);
    font-weight: 600;
    color: var(--color-accent-text);
    font-variant-numeric: tabular-nums;
}
.courses-plates { display: inline-flex; gap: 6px; }
.course-plate {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.6px solid var(--color-course-todo);
    transition: background-color var(--duration-course) var(--ease-standard), border-color var(--duration-course) var(--ease-standard);
}
.course-plate--current { border-color: var(--color-course-done); }
.course-plate--done { border-color: var(--color-course-done); background: var(--color-course-done); }
.courses--done { color: var(--color-text-muted); }
.sitting-courses { margin: var(--space-2) 0 var(--space-3); }
.table-courses { font-size: var(--text-small); }

/* ── Chips: AI, trust, venue, distance ── */
.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 24px;
    padding: 2px 10px 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-info-soft);
    color: var(--color-info);
    font: 600 var(--text-caption)/1.2 var(--font-body);
    letter-spacing: .02em;
    vertical-align: middle;
}
.ai-chip-icon {
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: var(--icon-leaf) center / contain no-repeat;
            mask: var(--icon-leaf) center / contain no-repeat;
}
.trust-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 28px;
    padding: 2px 10px 2px 8px;
    border-radius: var(--radius-pill);
    font: 600 var(--text-caption)/1.2 var(--font-body);
}
.trust-chip--verified { background: var(--color-success-soft); color: var(--color-success); }
.trust-chip--confirmed { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border-input); }
.trust-chip-icon {
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: var(--icon-shield-check) center / contain no-repeat;
            mask: var(--icon-shield-check) center / contain no-repeat;
}
.chip--venue { background: var(--color-accent-soft); border-color: transparent; color: var(--color-accent-text); }
.chip--distance, .chip--cuisine { font-variant-numeric: tabular-nums; }

/* ── Safety panels (design §6.7): a 4 px stripe, icon + text + colour ── */
.safety-panel {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--panel-stripe, var(--color-info));
    border-radius: var(--radius-md);
    background: var(--panel-ground, var(--color-info-soft));
    color: var(--color-text);
}
.safety-panel p { margin: 0 0 var(--space-2); }
.safety-panel p:last-child { margin-bottom: 0; }
.safety-panel-body { flex: 1 1 auto; min-width: 0; }
.safety-panel-title { font-weight: 600; }
.safety-panel-icon {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    background: var(--panel-stripe, var(--color-info));
    -webkit-mask: var(--panel-icon, var(--icon-alert)) center / contain no-repeat;
            mask: var(--panel-icon, var(--icon-alert)) center / contain no-repeat;
}
.safety-panel--info    { --panel-stripe: var(--color-info);    --panel-ground: var(--color-info-soft);    --panel-icon: var(--icon-share); }
.safety-panel--accent  { --panel-stripe: var(--color-accent-text); --panel-ground: var(--color-accent-soft); --panel-icon: var(--icon-venue); }
.safety-panel--success { --panel-stripe: var(--color-success); --panel-ground: var(--color-success-soft); --panel-icon: var(--icon-shield-check); }
.safety-panel--danger  { --panel-stripe: var(--color-danger);  --panel-ground: var(--color-danger-soft);  --panel-icon: var(--icon-alert); }
.sitting-window { text-align: left; width: 100%; --panel-icon: var(--icon-clock); }

.emergency-line { align-items: center; margin-top: var(--space-5); }
.emergency-line .safety-panel-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.emergency-text { margin: 0 !important; font-weight: 600; }
.btn-emergency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-min);
    padding: 0 var(--space-5);
    border-radius: var(--radius-pill);
    font: 600 var(--text-button)/1 var(--font-body);
    text-decoration: none;
}
.btn-emergency:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* ── Choices that must be ticked ── */
.choice.is-invalid { border-color: var(--color-danger); box-shadow: inset 0 0 0 1px var(--color-danger); }
.choice input { accent-color: var(--color-primary); width: 20px; height: 20px; }
select.form-control { padding-right: 36px; }

/* ── Sitting: idle ── */
.sitting-options {
    width: 100%;
    max-width: 420px;
    margin: 0 auto var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    text-align: left;
}
.sitting-options .form-label { margin-top: var(--space-1); }
.sitting-eating-out-choice { align-self: flex-start; margin-top: var(--space-2); }
.drop-zone .drop-zone-icon { color: var(--color-accent-text); }
.drop-zone { border: 1.5px solid var(--color-border-input); }

/* ── Sitting: live head — your place at the table, and the courses ── */
.sitting-live-head { gap: var(--space-1); }
.sitting-live-table {
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-3);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, var(--color-flame-glow), transparent 70%);
}
.sitting-live-place { color: var(--color-text); }
.sitting-eating-out { color: var(--color-text-muted); margin: 0 0 var(--space-2); }
.live-room {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}
.live-room-tealight { color: var(--color-text-muted); }
.sitting-scope {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-info-soft);
    color: var(--color-text);
}

/* ── The diner card: the plate photo as a 4:3 hero, two equal actions ── */
.diner-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}
.diner-hero {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    background: var(--color-surface-elevated);
}
.diner-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.diner-photo--placeholder { display: grid; place-items: center; color: var(--color-text-muted); }
.diner-note {
    position: absolute;
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
    max-width: max-content;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-surface-elevated) 92%, transparent);
    color: var(--color-text);
    font: italic 400 var(--text-body)/1.35 var(--font-voice);
    box-shadow: var(--shadow-sm);
    overflow-wrap: anywhere;
}
.diner-info { padding: 0 var(--space-5) var(--space-5); gap: var(--space-3); }
.diner-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
.diner-name { margin: 0; font-family: var(--font-display); font-size: var(--text-h2); font-weight: 500; }
.diner-shared-badge {
    font-size: var(--text-small);
    font-weight: 600;
    color: var(--color-accent-text);
}
.diner-facts, .diner-langs, .diner-interests {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.diner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-1);
}
.diner-actions > button { width: 100%; min-height: 48px; }
.diner-waiting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.diner-waiting { color: var(--color-text-muted); font-style: italic; font-family: var(--font-voice); }
.diner-card--waiting { border-color: var(--color-border-input); }
.diner-stop-error { color: var(--color-danger); font-size: var(--text-small); margin: 0; }

/* ── The Table: the tabletop strip ── */
.tabletop-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    min-height: 72px;
    margin: 0 0 var(--space-3);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 50% 50%, var(--color-flame-glow), transparent 60%),
        var(--color-surface);
    border: 1px solid var(--color-border);
}
.tabletop-strip--closed .tealight-flame { opacity: .4; }
.tabletop-tealight { color: var(--color-text-muted); }
.companion-badge { margin-left: var(--space-2); }

/* ── Olive's mark: a sprig on a sea-soft disc, never a face ── */
.olive-avatar-disc { fill: var(--color-info-soft); }
.olive-avatar-twig { stroke: var(--color-success); }
.olive-avatar-leaf { fill: var(--color-success-soft); stroke: var(--color-success); }
.olive-avatar-fruit { fill: var(--color-success); }
.olive-card-voice {
    font-family: var(--font-voice);
    font-style: italic;
    font-size: var(--text-lede);
    line-height: 1.45;
    color: var(--color-text);
}
.olive-card-name { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-h2); font-weight: 500; }

/* ── The match moment: two places across one table ── */
.match-moment {
    background-image:
        radial-gradient(56% 38% at 50% 34%, var(--color-flame-glow), transparent 72%),
        var(--grain-tile);
}
.match-places {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    width: auto;
    height: auto;
    margin-bottom: var(--space-6);
    padding: var(--space-5) var(--space-8);
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.match-eyebrow { color: var(--color-accent-text); }
.match-chip { border-color: transparent; }

/* ── +1 ── */
.plusone-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0 0 var(--space-3);
}
.plusone-yesno {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-3);
}
.plusone-yesno > * { width: 100%; min-height: 48px; white-space: normal; text-align: center; line-height: 1.2; }
.plusone-entry { display: flex; flex-direction: column; gap: var(--space-2); }
.plusone-entry-btn { align-self: flex-start; white-space: normal; text-align: left; }
.plusone-entry-hint { margin: 0; color: var(--color-text-muted); }
.plusone-entry--blocked .plusone-entry-btn { cursor: not-allowed; }

.plusone-slim {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    animation: plusone-in var(--duration-slow) var(--ease-out-soft) both;
}
.plusone-slim .chip-icon { color: var(--color-seat-dashed); }
.plusone-slim-text { flex: 1 1 14rem; margin: 0; }
.plusone-slim-close {
    width: var(--touch-min);
    height: var(--touch-min);
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
}
.plusone-slim-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;
}
.plusone-slim-close:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }

.plusone-status {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    animation: plusone-in var(--duration-slow) var(--ease-out-soft) both;
}
.plusone-status-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.plusone-status-text { margin: 0; font-weight: 600; }
.plusone-status-detail { margin: 0; color: var(--color-text-muted); }
.plusone-status--accepted, .plusone-status--met { border-color: var(--color-success); background: var(--color-success-soft); }
.plusone-status--cancelled { border-left: 4px solid var(--color-info); }

/* the place card: a folded card on a raised surface, with its crease */
.plusone-card {
    position: relative;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    animation: plusone-in var(--duration-slow) var(--ease-out-soft) both;
}
.plusone-card-fold {
    position: absolute;
    left: var(--space-5);
    right: var(--space-5);
    top: 50%;
    border-top: 1px solid var(--color-border);
    opacity: .5;
    pointer-events: none;
}
.plusone-card-head { position: relative; display: flex; gap: var(--space-3); align-items: flex-start; }
.plusone-card-eyebrow { margin-bottom: var(--space-1); }
.plusone-card-title { margin: 0 0 var(--space-2); font-size: var(--text-lede); font-weight: 500; line-height: 1.35; }
.plusone-card-line, .plusone-card-rules, .plusone-card-after { position: relative; margin: 0 0 var(--space-2); color: var(--color-text-muted); }
.plusone-card-rules { color: var(--color-text); font-weight: 600; }
.plusone-card-tags { position: relative; list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.plusone-card-note, .plusone-incoming-note {
    position: relative;
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-left: 2px solid var(--color-border-input);
    color: var(--color-text);
    font-size: var(--text-body);
}
.plusone-card--inline { box-shadow: none; animation: none; margin-bottom: var(--space-4); }

.plusone-incoming {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border-input);
    animation: plusone-in var(--duration-slow) var(--ease-out-soft) both;
}
.plusone-incoming-head { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-3); }
.plusone-incoming-who { position: relative; display: inline-grid; place-items: center; }
.plusone-incoming-photo {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.plusone-incoming-title { margin: 0 0 var(--space-1); font-size: var(--text-lede); font-weight: 500; }
.plusone-incoming-lede { margin: 0; color: var(--color-text-muted); }
.plusone-chat-first { margin-top: var(--space-2); }

@keyframes plusone-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* sheets */
.plusone-sheet .sheet-body { display: flex; flex-direction: column; gap: var(--space-3); }
.plusone-sheet-hero { display: grid; place-items: center; }
.plusone-sheet-lede { margin: 0; color: var(--color-text-muted); }
.plusone-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.plusone-legend { padding: 0; margin-bottom: var(--space-1); font-weight: 600; color: var(--color-text); }
.plusone-sublabel { margin: var(--space-2) 0 0; }
.plusone-rule { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-weight: 600; color: var(--color-accent-text); }
.plusone-offer-form { display: flex; flex-direction: column; gap: var(--space-4); }
.plusone-fixed { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.plusone-fixed dt { font-weight: 600; color: var(--color-text-muted); }
.plusone-fixed dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.plusone-named { margin: 0; color: var(--color-text-muted); }
.plusone-tick { align-items: flex-start; border-radius: var(--radius-md); white-space: normal; }
.plusone-time-input { max-width: 10rem; font-variant-numeric: tabular-nums; }
.plusone-verify { margin-top: var(--space-2); }
.plusone-error { margin-top: var(--space-2); }

/* ── Plans and the plan screen ── */
.plans-list { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.plans-item { display: flex; flex-direction: column; gap: var(--space-4); }
.plans-item .plusone-status { border: 0; padding: 0; background: transparent; }
.plans-item-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.plans-item-head > .plusone-status { flex: 1 1 auto; min-width: 0; }
.plans-trust { flex: none; }

.plan-screen { display: flex; flex-direction: column; gap: var(--space-4); }
.plan-person { display: flex; align-items: center; gap: var(--space-3); }
.plan-person-photo { flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--color-surface-elevated); }
.plan-person-photo img { width: 100%; height: 100%; object-fit: cover; }
.plan-person-text { flex: 1 1 auto; min-width: 0; }
.plan-person-name { margin: 0 0 var(--space-1); }
.plan-trust { flex: none; }
.plan-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: 0; }
.plan-facts dt { color: var(--color-text-muted); font-weight: 600; }
.plan-facts dd { margin: 0; display: flex; flex-direction: column; }
.plan-venue { font-family: var(--font-display); font-size: var(--text-h2); font-weight: 500; line-height: 1.2; }
.plan-time { font-size: var(--text-h2); font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-before-list { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: var(--space-1); }
.plan-card { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.plan-card-title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-h2); }
.plan-card-title .chip-icon { color: var(--color-accent-text); }
.plan-card p { margin: 0; }
.plan-done { font-weight: 600; color: var(--color-success); }
.plan-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); width: 100%; }
.plan-yesno > * { width: 100%; white-space: normal; }
.plan-share-link { display: flex; gap: var(--space-2); width: 100%; }
.plan-share-link .form-control { flex: 1 1 auto; min-width: 0; font-size: var(--text-small); }
.plan-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
.plan-help-list { margin: 0 0 var(--space-4); padding-left: 1.1em; display: flex; flex-direction: column; gap: var(--space-2); }
.plan-help-sheet .sheet-body, .plan-cancel-sheet .sheet-body { display: flex; flex-direction: column; gap: var(--space-3); }
.plan-cancel-reasons { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }

/* ── How was it? ── */
.how-was-it { display: flex; flex-direction: column; gap: var(--space-3); }
.how-was-it-title { margin: 0; font-size: var(--text-h2); }
.how-was-it-answers { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.how-was-it-answer {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 52px;
    padding: var(--space-2) var(--space-3);
    border: 1.5px solid var(--color-border-input);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: pointer;
}
.how-was-it-answer.is-on { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); background: var(--color-primary-soft); }
.how-was-it-answer input { accent-color: var(--color-primary); }
.how-was-it-private { margin: 0; }
.how-was-it-thanks { margin: 0; }

/* ── The friend-link page ── */
.page--bare { min-height: 100dvh; }
.bare-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 var(--space-5);
    border-bottom: 1px solid var(--color-border);
}
.friend-page { display: flex; flex-direction: column; gap: var(--space-4); }
.friend-page--gone { align-items: center; text-align: center; padding-top: var(--space-10); }
.friend-title { margin: 0; }
.friend-card { display: flex; flex-direction: column; gap: var(--space-4); }
.friend-table { display: flex; align-items: center; justify-content: center; gap: var(--space-5); }
.friend-status { margin: 0; text-align: center; }
.friend-other { display: flex; align-items: center; gap: var(--space-3); }
.friend-other-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.friend-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.friend-checks li { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.friend-checks li::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 50%;
    border: 1.6px solid var(--color-border-input);
}
.friend-checks li.is-done { color: var(--color-text); }
.friend-checks li.is-done::before { border-color: var(--color-success); background: var(--color-success); -webkit-mask: var(--icon-check) center / 14px no-repeat, linear-gradient(#000 0 0); }
.friend-expires, .friend-about { margin: 0; }

/* ── Profile: head and settings ── */
.profile-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.profile-avatar { width: 72px; height: 72px; margin: 0; border-radius: 50%; }
.profile-avatar--empty { color: var(--color-text-muted); }
.profile-edit-link { margin: var(--space-5) 0; }
.profile-settings { margin-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.profile-settings h2 { margin: 0; }
.settings-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }

/* ── Reduced motion: every change is instant; the flame is still ── */
@media (prefers-reduced-motion: reduce) {
    .tealight-flame,
    .dashed-place--agreed .dashed-place-line,
    .dashed-place-check,
    .plusone-slim,
    .plusone-status,
    .plusone-card,
    .plusone-incoming { animation: none !important; }
    .course-plate { transition: none; }
}

/* Greek runs longer: the yes/no pairs stack when the words would not fit side by side */
@media (max-width: 380px) {
    .plusone-yesno, .plan-yesno, .diner-actions, .how-was-it-answers { grid-template-columns: 1fr; }
}

/* ── Refinements after the screenshot pass ── */
/* the courses line gets the head's full width on a phone, never squeezed beside the actions */
@media (max-width: 480px) {
    .table-head,
    .table-head:has(.table-head-meta) {
        grid-template-areas:
            "avatar name actions"
            "meta meta meta";
        row-gap: var(--space-1);
    }
    .page:has(.table-composer-input:focus) .table-head { grid-template-areas: "name actions" "meta meta"; }
}
.table-courses { white-space: nowrap; }

/* equal yes / no: same height, same width, side by side */
.diner-actions > .diner-join-btn,
.diner-actions > .diner-skip-btn,
.plusone-yesno > button,
.plan-yesno > button {
    align-self: stretch;
    margin: 0;
    min-height: 48px;
    height: auto;
}

/* the AI chip in the companion header: sentence case in both languages */
.companion-badge.ai-chip,
.olive-card-badge.ai-chip { text-transform: none; letter-spacing: .02em; font-size: var(--text-caption); }

/* Olive speaks in the italic voice; her "AI" label is the AI chip's colours */
.table-message--companion .table-message-body {
    font-family: var(--font-voice);
    font-style: italic;
    font-size: var(--text-lede);
    line-height: 1.45;
}
.table-message-ai {
    background: var(--color-info-soft);
    color: var(--color-info);
}

/* the place card's crease sits under its heading, never through its content */
.plusone-card-fold { top: var(--space-3); left: 40%; right: 40%; opacity: .8; }

/* a primary that is disabled because nothing is chosen yet is not "busy": no spinner */
.how-was-it .btn-primary:disabled:not([aria-busy="true"])::before,
.plusone-sheet .btn-primary:disabled:not([aria-busy="true"])::before { content: none; }
.table-keep-question { margin: var(--space-2) 0 0; font-size: var(--text-lede); }
.table-keep-choices { width: 100%; }

/* ── Account checks, e-mail links, password reset (review finding 1) ── */
.login-forgot { margin: var(--space-3) 0 0; text-align: center; }
.login-forgot a { color: var(--color-accent-text); }
.account-result .btn-primary, .account-result .btn-secondary { display: block; width: 100%; text-align: center; margin-top: var(--space-4); }
.auth-card > .btn-secondary { display: block; width: 100%; text-align: center; margin-top: var(--space-4); }
.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);
}
.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; }
.trust-block-report-hint { margin: var(--space-2) 0 0; }
.trust-block-report { margin-top: var(--space-2); }

/* ── Error popup (Components/ToastHost.razor) ─────────────────────────────────────
   Fixed to the viewport so an error is seen without scrolling: top-centre on a phone (the nav bar
   sits at the bottom there), under the sticky header and right-aligned from 481 px. The alert
   pattern of §6.0 (danger-soft ground, pomegranate rule and icon) lifted onto an elevated card.
   Above the sheets (z 60) and the nav (z 20); never takes the focus. */
.toast-region {
    position: fixed;
    z-index: 90;
    top: calc(var(--space-3) + env(safe-area-inset-top));
    left: var(--space-3);
    right: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
    background: var(--color-surface-elevated);
    background: linear-gradient(var(--color-danger-soft), var(--color-danger-soft)), var(--color-surface-elevated);
    color: var(--color-text);
    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.5;
    animation: slide-in var(--duration-base) var(--ease-out-soft) both;
}
.toast--success {
    background: linear-gradient(var(--color-success-soft), var(--color-success-soft)), var(--color-surface-elevated);
    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-alert) center / contain no-repeat;
    mask: var(--icon-alert) 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 1 auto; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.toast-close,
.toast-close:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text-muted);
}
.toast-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-min);
    min-height: var(--touch-min);
    margin: calc(-1 * var(--space-2)) 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.toast-close:hover:not(:disabled) { background: var(--color-primary-soft); color: var(--color-text); }
.toast-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;
}
@media (min-width: 481px) {
    .toast-region {
        top: calc(var(--nav-height) + var(--space-3));
        left: auto;
        right: var(--space-5);
        width: min(440px, calc(100vw - 2 * var(--space-5)));
    }
}
@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

/* ── Photo pickers: Take photo / Choose photo / Use camera (Components/PhotoPicker.razor) ── */
.drop-zone--actions { cursor: default; }
/* with actions, each button shows its own focus ring: the card stays still */
.drop-zone--actions:hover,
.drop-zone--actions:focus-within {
    border-color: var(--color-border-input);
    box-shadow: none;
    outline: none;
}
.drop-zone--actions:hover .drop-zone-icon,
.drop-zone--actions:focus-within .drop-zone-icon { transform: none; }
.photo-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    margin-top: var(--space-3);
}
.photo-action {
    position: relative;
    flex: 1 1 10rem;
    max-width: 16rem;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
/* a <label> button inside .form-group would otherwise take the small muted form-label type */
.photo-actions .photo-action { font: 600 var(--text-button)/1 var(--font-body); }
.photo-actions .photo-action.btn-primary { color: var(--color-on-primary); }
.photo-actions .photo-action.btn-secondary { color: var(--color-text); }
.photo-action:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}
.drop-zone--actions:has(input:disabled) .photo-action { cursor: not-allowed; }

/* ── The in-page camera (Components/CameraSheet.razor) ── */
.camera-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-text);
}
.camera-video,
.camera-still {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.camera-video.is-hidden { display: none; }
.camera-status {
    position: absolute;
    margin: 0;
    color: var(--color-bg);
}
.camera-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}
.camera-actions .btn-primary,
.camera-actions .btn-secondary { flex: 1 1 10rem; }

/* ── Android download (same offer as Coffeetime: 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); }
