/* SocialTimers TV — dark SocialTimers palette (see MAINTENANCE.md):
 * a violet-charcoal→brand diagonal gradient, translucent surfaces,
 * rounded 14-16px corners, small uppercase tracked
 * labels, capsule chips, and bold monospaced (tabular) figures for anything
 * numeric. Hovers gently lift brightness on interactive surfaces. */

:root {
  /* Viewport-unit factors: every vw/vh/vmin/vmax in this file goes through
     these (calc(N * var(--vw))) so viewport.js can multiply them back when it
     has to fall back to CSS zoom on a width-locked TV WebView (zoom scales
     viewport-relative lengths along with everything else). Write new sizes
     the same way; never a raw vw. */
  --vw: 1vw;
  --vh: 1vh;
  --vmin: 1vmin;
  --vmax: 1vmax;
  /* Dark page, primaryContainer and brand; never slate/navy. */
  --grad-a: #131120;
  --grad-mid: #38246f;
  --grad-b: #4621b9;
  --purple: #a78bfa;
  --purple-soft: #c4c0d4; /* greyish lighter purple for empty backgrounds */
  --bg: #131120;
  --fg: #eceaf4;
  --muted: rgba(255, 255, 255, 0.62);
  --banner-h: 80px;
  --accent: #a78bfa; /* active UI; Programa keeps its own international orange */
  --on-primary: #23114f;
  --primary-container: #38246f;
  --on-primary-container: #eae3fc;
  --success: #34d399;
  --on-success: #0e2b20;
  --danger: #f87171;
  --on-danger: #35191b;
  --warning: #fbbf24;
  --on-warning: #33270f;
  --info: #38bdf8;
  --highlight: #f59e0b;
  --neutral-action: #6e6980;

  /* TV presentation: preserve the original glass over the event's background.
     Semantic fills keep their palette on* pairs; floating panels stay opaque. */
  --surface: rgba(255, 255, 255, 0.09);
  --surface-soft: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.16);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-soft: rgba(255, 255, 255, 0.08);
  --panel: #1a1727;
  --radius: 16px;
  --radius-sm: 12px;
  --blur: saturate(1.25) blur(16px);
  --hover-ease: background 0.22s ease, border-color 0.22s ease,
    filter 0.22s ease, transform 0.15s ease, box-shadow 0.22s ease;

  /* modern-classic text; monospaced digits for timers and figures */
  --font-sans: "Avenir Next", Avenir, Optima, "Segoe UI", -apple-system,
    BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font-display: Optima, "Avenir Next", Avenir, Candara, "Segoe UI",
    -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Roboto Mono", "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win over id selectors like `#pairing`/`#dashboard`
 * (which set `display:flex`); otherwise toggling `.hidden` in JS does nothing and
 * the pairing screen never gives way to the dashboard. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  /* A TV page never scrolls: whatever a shell paints must fit the screen
     (each panel scrolls internally). Without this, any stray pixel of
     overflow grows the document, and on browsers with classic scrollbars
     the bar then eats width and the 100%-wide shells overflow sideways. */
  overflow: hidden;
  /* fixed diagonal wash + a soft radial glow, so scrolling panels never
     "slide" the gradient (mirrors the watch's static backdrop) */
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(167, 139, 250, 0.25), transparent 60%),
    linear-gradient(135deg, var(--grad-a) 0%, var(--grad-mid) 52%, var(--grad-b) 100%);
  background-attachment: fixed;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* 100% of html/body (both 100% tall), not 100vw/100vh: vw includes a
   vertical scrollbar's width and vh, on TV/mobile browsers with a toolbar,
   can exceed the visible area — both leave content past the edge. */
.screen { height: 100%; width: 100%; }

/* ---------- Pairing screen ---------- */
#pairing {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}
.brand {
  /* Match Flutter's home AppBar: platform sans-serif, bold, no tracking. */
  font-family: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(30px, calc(5.2 * var(--vw)), 58px);
  font-weight: 700;
  letter-spacing: normal;
  margin: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.qr-wrap {
  position: relative;
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.07),
    0 24px 70px rgba(0, 0, 0, 0.45);
  transition: opacity 0.6s ease;
  line-height: 0;
}
.qr-wrap.stopped { opacity: 0.30; }
/* Burn-in guard: a stopped QR is dead anyway (stopQR closed the socket), so
   hide the static image instead of etching it into the panel; the Refresh
   button and hint (outside the wrap) stay visible. */
.qr-wrap.stopped .qr-img { visibility: hidden; }
.qr-idle-mark {
  position: absolute;
  top: 18px;
  left: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  display: none;
  opacity: 0.5;
  pointer-events: none;
}
/* Keep the mark out of a live QR and its quiet zone. The stopped wrapper
   retains its existing dimming; only the empty interior gains a mark. */
.qr-wrap.stopped .qr-idle-mark,
.qr-img:not([src]) + .qr-idle-mark { display: block; }
.qr-img {
  width: clamp(220px, calc(32 * var(--vmin)), 360px);
  height: clamp(220px, calc(32 * var(--vmin)), 360px);
  image-rendering: pixelated;
  display: block;
}
/* Before the first QR loads the img has no src; hide it so the browser's
   broken-image icon never flashes. visibility:hidden keeps the img's box, so
   the white .qr-wrap holds its size and the layout doesn't jump. */
.qr-img:not([src]) { visibility: hidden; }
/* Release label, bottom-right of the pairing (QR) screen — same voice as the
   dashboard's .brand-version, so a TV stuck on an old build is identifiable
   from across the room before it ever pairs. */
.pairing-version {
  position: absolute;
  right: 32px;
  bottom: 32px; /* overscan margin: TVs crop the outer edge */
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  user-select: none;
}
.qr-status {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0;
  min-height: 24px;
}
.qr-refresh {
  appearance: none;
  border: 1px solid var(--stroke);
  background: var(--accent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--on-primary);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 12px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--hover-ease);
}
.qr-refresh:hover { background: var(--primary-container); border-color: rgba(255, 255, 255, 0.28); color: var(--on-primary-container); }
.qr-refresh:active { transform: scale(0.97); }

.qr-refresh { min-width: 260px; min-height: 48px; }
.qr-refresh[aria-disabled="true"] { opacity: 0.65; cursor: default; }
.qr-refresh:focus { outline: 3px solid var(--fg); outline-offset: 4px; }

@media (max-height: 600px) {
  #pairing { gap: 14px; }
  #pairing .brand { font-size: 36px; }
  #pairing .qr-status { font-size: 12px; min-height: 18px; text-align: center; }
  #pairing .qr-refresh { min-height: 44px; padding: 10px 30px; }
}

/* ---------- Dashboard ---------- */
#dashboard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.banner {
  position: relative;
  height: var(--banner-h);
  min-height: var(--banner-h);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  overflow: hidden;
  border-bottom: 1px solid var(--stroke-soft);
  background: #4621b9; /* brand fallback; custom headers keep their colors */
}
.banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
/* Subtle darkening scrim so the banner titles stay readable over any header
   image — same spirit as .tl-banner's scrim, lighter for the shallow strip. */
.banner-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 8, 30, 0.50), rgba(10, 8, 30, 0.18));
}
.banner-left, .banner-right { position: relative; z-index: 1; display: flex; align-items: center; }
.banner-left { gap: 12px; min-width: 0; }
.banner-right { gap: 14px; }

.banner-avatar { width: 56px; height: 56px; flex: 0 0 auto; }
.banner-titles { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.group-name {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Give descenders (j, g, y…) room inside the overflow:hidden clip box so
     they aren't cut off; the equal negative margin keeps the block's outer
     height unchanged, so neither title line moves. */
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.local-completion-notice {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--on-warning);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.15;
}

/* avatars (image or initials circle) */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
  user-select: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.22);
}

/* members block: up to 7 per row, right-aligned toward the static QR */
.members {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.members-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  justify-content: flex-end;
}
.member-overflow {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: #fff;
  font-weight: 700;
}

/* owner-presence dot: success while the host is online; warning (retryable
   offline) once the host has been unseen for 4+
   minutes (the page self-closes at 5). */
.owner-presence {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--success);
  box-shadow: 0 0 8px rgba(52,211,153,0.75);
}
.owner-presence--lost {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(251,191,36,0.75);
  animation: presence-blink 1s step-start infinite;
}
@keyframes presence-blink {
  50% { opacity: 0.15; }
}

.static-qr { display: flex; align-items: center; justify-content: center; }
.room-close {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  /* Ending the session: danger with its matching foreground. */
  background: var(--danger);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--on-danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--hover-ease);
}
.room-close svg { width: 26px; height: 26px; display: block; }
.room-close:hover { background: var(--danger); border-color: rgba(255, 255, 255, 0.4); color: var(--on-danger); }
.room-close:active { transform: scale(0.94); }

/* QR invite: primary sharing action, alongside the danger session close. */
.invite-qr-slot { display: flex; align-items: center; justify-content: center; }
.invite-qr-btn {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: var(--accent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--on-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--hover-ease);
}
.invite-qr-btn svg { width: 26px; height: 26px; display: block; }
.invite-qr-btn:hover { background: var(--primary-container); border-color: rgba(255, 255, 255, 0.4); color: var(--on-primary-container); }
.invite-qr-btn:active { transform: scale(0.94); }

/* The dialog sits inside the STAGE, not over the whole page: the banner (which
   says whose group this is) and the program footer stay legible, so the code
   never floats free of the thing it invites you to. */
.invite-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 24, 0.62);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  animation: invite-fade 0.22s ease;
}
@keyframes invite-fade { from { opacity: 0; } to { opacity: 1; } }

.invite-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 36px;
  width: min(720px, calc(100% - 64px));
  padding: 36px 44px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  animation: invite-pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes invite-pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.invite-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--hover-ease);
}
.invite-close svg { width: 20px; height: 20px; display: block; }
.invite-close:hover { background: var(--surface); }

/* Pure white, never tinted, never shadowed: this is read by a phone camera from
   the far side of a room, and contrast is the only thing that matters. The
   padding IS the QR's quiet zone — scanners need it. */
.invite-qr-panel {
  flex: 0 0 auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  line-height: 0;
}
.invite-qr-panel img { width: min(280px, calc(32 * var(--vw))); height: auto; display: block; }
/* Placeholder while the mint is in flight, exactly the size of the image that
   replaces it, so the card never jumps. */
.invite-qr-panel .invite-qr-skeleton {
  width: min(280px, calc(32 * var(--vw)));
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: rgba(18, 26, 71, 0.08);
}

.invite-info { flex: 1 1 auto; min-width: 0; }
.invite-kicker {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.invite-group {
  font-family: var(--font-display);
  font-size: clamp(24px, calc(2.6 * var(--vw)), 34px);
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-body { font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0 0 26px; }

.invite-timer-row { display: flex; align-items: baseline; gap: 12px; }
.invite-timer-row svg { width: 20px; height: 20px; align-self: center; color: var(--muted); }
.invite-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 34px;
  color: var(--fg);
}
/* Expiring invitation: warning, still refreshable. */
.invite-time.warning { color: var(--warning); }
.invite-timer-label { font-size: 15px; color: var(--muted); }

.invite-bar {
  margin-top: 12px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.invite-bar > div {
  height: 100%;
  border-radius: 2px;
  background: var(--purple);
  transition: width 1s linear;
}
.invite-bar > div.warning { background: var(--warning); }

.invite-foot { margin-top: 18px; font-size: 14px; color: var(--muted); }
.invite-foot svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }
.invite-foot .sep { margin: 0 8px; opacity: 0.5; }

/* Expired / error: the same card, different contents. */
.invite-expired { text-align: center; padding: 20px 0; width: 100%; }
.invite-expired .invite-group { white-space: normal; }
.invite-expired .invite-body { margin: 0; }

/* Narrow stages (a portrait screen, a small window): the card stacks. */
@media (max-width: 720px) {
  .invite-card {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 24px;
    padding: 28px 24px;
  }
  .invite-info { flex-basis: 100%; }
  .invite-timer-row { justify-content: center; }
  .invite-qr-panel img,
  .invite-qr-panel .invite-qr-skeleton { width: min(240px, calc(60 * var(--vw))); }
}

/* Primary navigation — shown left of the avatars while a linked (event_button)
   event is open; pops back to the previous event. */
.room-back {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: var(--hover-ease);
}
.room-back svg { width: 26px; height: 26px; display: block; }
.room-back:hover { background: var(--accent); filter: brightness(1.08); color: var(--on-primary); }
.room-back:active { transform: scale(0.94); }

/* stage: main area (left) + widgets strip (right) */
.stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}
.main-area {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  /* Dark veil over the brand gradient; media overlays keep their contrast. */
  background-color: rgba(6, 6, 20, 0.30);
}
.main-area > * { position: relative; z-index: 1; }

/* event music mute toggle (shown only when the event has music) */
.music-mute {
  position: absolute;
  left: 32px;
  bottom: 32px; /* overscan margin */
  z-index: 5;
  width: 52px;
  height: 52px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(10, 8, 30, 0.5);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: #fff;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--hover-ease);
}
.music-mute svg { width: 24px; height: 24px; display: block; }
.music-mute:hover { background: rgba(255, 255, 255, 0.18); }
.music-mute:active { transform: scale(0.94); }
.music-mute.muted { background: var(--neutral-action); }

/* brand watermark, bottom-right of the stage (opposite the mute button) */
.brand-mark {
  position: absolute;
  right: 32px;
  bottom: 32px; /* overscan margin */
  z-index: 5;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  user-select: none;
}

/* ?debug=1 viewport readout (mountDebugHud in app.js): fixed bottom-left,
   above every screen, sized to be legible from a couch. */
.debug-hud {
  position: fixed;
  left: 32px;
  bottom: 32px; /* overscan margin */
  z-index: 100;
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--stroke);
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.35;
  color: var(--fg);
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}

/* Build version, dimmer and smaller, riding next to the brand mark. */
.brand-version {
  font-size: 0.55em;
  font-weight: 600;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.01em;
  vertical-align: baseline;
}

/* idle event-info view (event name + timer block + event-data block) */
.ev-info {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(10px, calc(1.8 * var(--ev-unit, 10px)), 20px);
  padding: clamp(16px, calc(2.5 * var(--ev-unit, 10px)), 32px);
  overflow: auto;
  text-align: center;
  color: #fff;
}
.ev-name {
  margin: 0;
  margin-top: auto;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, calc(3.2 * var(--ev-unit, 10px)), 40px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  max-width: 90%;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
.ev-name-mark {
  opacity: 0.85;
  display: inline-block;
  margin-right: 0.3em;
  vertical-align: -0.12em;
}
.ev-name-mark svg { width: 0.95em; height: 0.95em; display: inline-block; }
.ev-timer { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; gap: clamp(6px, var(--ev-unit, 10px), 12px); }
.ev-timer-label {
  font-size: clamp(12px, calc(1.4 * var(--ev-unit, 10px)), 16px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.ev-timer { max-width: 100%; }
.ev-timer-value {
  font-family: var(--font-mono);
  max-width: 100%;
  font-size: clamp(32px, calc(8 * var(--ev-unit, 10px)), 96px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}
.ev-progress {
  width: min(100%, 460px);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.ev-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.ev-progress-sub {
  font-family: var(--font-mono);
  font-size: clamp(12px, calc(1.3 * var(--ev-unit, 10px)), 16px);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ev-data {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(560px, 100%);
  min-height: 80px;
  flex: 0 1 auto;
  margin-bottom: auto;
  overflow: auto;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 14px 44px rgba(0, 0, 0, 0.25);
  padding: 6px 20px;
  transition: var(--hover-ease);
}
.ev-data:hover { background: rgba(255, 255, 255, 0.12); }
.ev-row {
  display: flex;
  flex-shrink: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(5px, calc(0.8 * var(--ev-unit, 10px)), 10px) 0;
  text-align: left;
}
.ev-row + .ev-row { border-top: 1px solid var(--stroke-soft); }
.ev-k {
  flex: 0 0 auto;
  font-size: clamp(11px, calc(1.2 * var(--ev-unit, 10px)), 14px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.ev-v {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: clamp(14px, calc(1.6 * var(--ev-unit, 10px)), 18px);
  font-weight: 600;
}

/* in-place YouTube player (mirrors the Flutter youtube widget) */
.yt-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px;
}
.yt-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: calc(100% - 56px);
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--stroke-soft);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.yt-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* Instagram embeds are portrait cards (~400px wide) on a white surface. */
.ig-frame {
  width: clamp(320px, calc(30 * var(--vw)), 420px);
  max-width: 100%;
  height: 100%;
  max-height: calc(100% - 56px);
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.ig-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* Image widget: the photo defines its own aspect; the frame bounds it to
   the stage (same 56px title reserve as the video frame). The height must
   be DEFINITE — with only a max-height the img's max-height:100% computes
   to none per spec, and a portrait photo (up to 1280px tall) overflows the
   stage on a 1080p screen. */
.imgw-frame {
  max-width: 100%;
  height: calc(100% - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.imgw-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--stroke-soft);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  display: block;
}
.imgw-note {
  color: var(--muted);
  font-size: 18px;
  padding: 28px 36px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius);
}
.yt-fallback {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Quote widget: storybook slide ----------
 * Everything inside .quote-box is em-scaled off one base font-size, which
 * renderQuote() binary-searches so the slide always fills the stage without
 * ever escaping it. The drop-cap is a plain float: the first letter spans two
 * body lines, the opening lines wrap to its right, the third resumes at its
 * left margin — exactly the storybook opening. */
.quote-slide {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
/* Giant ghost opening-quote behind a passage slide. */
.quote-slide.has-quote::before {
  content: "\201C";
  position: absolute;
  top: -0.06em;
  left: 0.02em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: calc(34 * var(--vmin));
  line-height: 1;
  color: rgba(255, 255, 255, 0.055);
  pointer-events: none;
}
.quote-box {
  position: relative;
  max-width: 34em; /* measured in the fitted size — keeps book-length lines */
  padding: 0.4em;
}
/* Kicker heading above the passage. */
.quote-title {
  font-family: var(--font-display);
  font-size: 0.52em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--purple-soft);
  margin: 0 0 1.1em 0.12em;
}
/* Title-only slide: the heading IS the content — big, centered, display type. */
.quote-title-only {
  font-size: 1.15em;
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.22;
  color: var(--fg);
  text-align: center;
  margin: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.quote-text {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", "Times New Roman", serif;
  font-size: 1em;
  line-height: 1.45;
  color: var(--fg);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}
/* Drop-cap: box height = font-size × line-height ≈ 3.05 × 0.95 ≈ 2.9em — two
 * 1.45em body lines, so exactly two lines wrap beside it. */
.quote-cap {
  float: left;
  font-family: Georgia, "Palatino Linotype", "Times New Roman", serif;
  font-size: 3.05em;
  line-height: 0.95;
  font-weight: 700;
  padding-right: 0.09em;
  color: var(--purple-soft);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}
.yt-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yt-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(10, 8, 30, 0.5);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: var(--hover-ease);
}
.yt-close:hover { background: rgba(255, 255, 255, 0.18); }

/* WhatsApp placard (mirrors the whatsapp_button widget) — a big brand-green
   badge in the main area; the card click already opened the group in a new tab,
   and tapping the badge re-opens it. */
.wa-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 48px 80px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 32px;
  background: linear-gradient(160deg, #2be273, #1fb958);
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 22px 70px rgba(0, 0, 0, 0.5);
  transition: var(--hover-ease);
}
.wa-badge:hover { filter: brightness(1.08); transform: translateY(-2px); }
.wa-logo { display: block; }
.wa-logo svg { width: 104px; height: 104px; display: block; }
.wa-word { font-size: 46px; font-weight: 800; letter-spacing: 0.5px; line-height: 1; }
.wa-sub {
  font-size: 20px;
  font-weight: 600;
  opacity: 0.92;
  max-width: 32ch;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* embedded website (link_button) — fills the stage, with a bottom action bar */
.web-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--stroke-soft);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.web-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.web-fallback { color: #111; font-size: 20px; font-weight: 700; text-decoration: none; }
.web-bar {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.web-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.web-open {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--hover-ease);
}
.web-open:hover { background: var(--surface-hover); }
.web-open:disabled { opacity: 0.5; cursor: default; }
.web-open svg { width: 18px; height: 18px; }

/* map widget: title above the embed, description below the address bar */
.map-title {
  flex: 0 0 auto;
  width: 100%;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-desc {
  flex: 0 0 auto;
  width: 100%;
  font-size: 16px;
  line-height: 1.4;
  opacity: 0.85;
}

/* postit (sticky notes) mosaic */
.postit-wrap {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 28px 28px 28px 28px;
}
.postit-header { margin-bottom: 14px; }
.postit-h-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.postit-h-desc { font-size: 15px; color: var(--muted); margin-top: 4px; }
/* sort/filter toolbar at the top of the notes */
.postit-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 16px; }
.postit-tool {
  height: 40px;
  min-width: 48px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--fg);
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--hover-ease);
}
.postit-tool:hover { background: var(--surface-hover); }
.postit-tool.on { border-color: var(--accent); color: var(--accent); }
.postit-tool svg { width: 20px; height: 20px; }
.postit-filter-n { font-size: 15px; font-weight: 700; font-family: var(--font-mono); }
.postit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-content: flex-start;
}
.postit-empty { color: var(--muted); font-size: 16px; padding: 12px; }
.postit-note {
  width: 170px;
  height: 170px;
  border-radius: var(--radius-sm);
  padding: 14px;
  color: #1f1f1f;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.postit-grid .postit-note { transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease; }
.postit-grid .postit-note:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); }
/* A note never wears a ring of another colour. Tiles and the maximized clone
   are focusable (keyboard/remote) and TV engines paint their own focus
   outline (orange on Android TV WebViews) unless told otherwise; keyboard
   focus on a tile reuses the hover lift instead. */
.postit-note { outline: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
.postit-note:focus, .postit-note:focus-visible { outline: none; }
.postit-grid .postit-note:focus-visible { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); }
.postit-text {
  flex: 1 1 auto;
  min-height: 0;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  overflow: hidden; /* mosaic tiles clip; the maximized note fits its font */
  white-space: pre-wrap;
  word-break: break-word;
}
/* Keep a fixed text box above the footer while fitting the complete note. */
.postit-clone .postit-text { flex: 1 1 0; }
.postit-clone .postit-foot { flex: 0 0 auto; }
.postit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.postit-stars { display: flex; gap: 2px; font-size: 14px; line-height: 1; }
.postit-star { color: rgba(0, 0, 0, 0.22); }
.postit-star.on { color: #1f1f1f; }
.postit-avatar { width: 26px; height: 26px; font-size: 11px; }

/* zoom-to-centre animation */
.postit-backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0);
  transition: background 0.32s ease;
  cursor: pointer;
}
.postit-backdrop.show { background: rgba(8, 6, 26, 0.6); }
.postit-clone {
  position: absolute;
  z-index: 6;
  margin: 0;
  transform-origin: top left;
  transform: translate(0, 0) scale(1);
  transition: transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.widgets-strip {
  /* Rebuilds restore scroll explicitly; native anchoring must not undo it. */
  overflow-anchor: none;
  position: relative;
  flex: 0 0 auto;
  align-self: stretch;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.04);
  border-left: 1px solid var(--stroke-soft);
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Overflow signal (app.js updateStripOverflow): when cards hide below the
   strip's fold, a bottom fade + "+N" pill says so. Sticky with height 0, so
   it pins to the fold and takes no layout space; the fade draws upward from
   it. Visual cue only — a TV has no guaranteed pointer, so no buttons. */
.strip-overflow {
  position: sticky;
  bottom: -12px; /* reach past the strip's bottom padding to hug the edge */
  height: 0;
  z-index: 3;
  flex: 0 0 auto;
  pointer-events: none;
}
.strip-overflow-fade {
  height: 84px;
  margin-top: -84px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  background: linear-gradient(180deg, rgba(10, 8, 30, 0), rgba(10, 8, 30, 0.82));
}
.strip-overflow-pill {
  font-size: 14px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(10, 8, 30, 0.72);
  color: var(--fg);
}
/* the darkening scrim is layered into the strip's background-image (app.js
   applyStageBackground) so it stays fixed and doesn't scroll with the cards */
.widget-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  transition: var(--hover-ease);
}
/* Fused neighbors (same rules as the app's timer detail — see mergesWithPrev
   in app.js): the lower card pulls up over the strip's 12px flex gap and both
   square the corners they share, so the pair reads as one block. The hover
   lift is suppressed on fused cards so the seam never splits open. */
.widget-card.merge-top {
  margin-top: -12px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
}
.widget-card.merge-bottom {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.widget-card.merge-top.clickable:hover,
.widget-card.merge-bottom.clickable:hover { transform: none; }
.widget-card.clickable { cursor: pointer; }
.widget-card.clickable:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}
.widget-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0, 0, 0, 0.18); }
/* tribe_button whose target the pairing owner can't access (or whose access
   probe hasn't confirmed yet): visibly inert. */
.widget-card.locked { opacity: 0.45; cursor: default; }
.widget-head { display: flex; align-items: center; gap: 10px; }
.widget-icon {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg);
}
.widget-icon svg { width: 22px; height: 22px; }
.widget-title { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Widget de ejemplo entregado desde una plantilla: un chip discreto, en la
   familia de atención suave. Vencido baja a tinta apagada — la pantalla no
   vende nada, solo informa. */
.widget-demo-chip {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #FBBF24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
}
.widget-demo-chip.ended {
  color: var(--muted);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.05);
}
/* small popup button on a link_button card */
.widget-popup {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  cursor: pointer;
  transition: var(--hover-ease);
}
.widget-popup:hover { background: var(--surface-hover); }
.widget-popup svg { width: 16px; height: 16px; }
.widget-desc { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.35; }

/* phone_button — the card is an <a href="tel:…">, so undo the anchor defaults
   and keep it reading exactly like the sibling cards. */
.widget-card.phone-link { display: block; color: inherit; text-decoration: none; }
/* The dialable number under the name: tabular figures so digits line up, and
   large enough to read (or type into a phone) from across the room. */
.phone-number {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* poll (read-only results, shown in the main area) */
.poll-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, calc(3.2 * var(--vh)), 40px);
  padding: calc(6 * var(--vh)) clamp(24px, 7%, 120px);
  overflow-y: auto;
}
.poll-header { display: flex; align-items: center; gap: 16px; }
.poll-ico { flex: 0 0 auto; color: var(--accent); display: inline-flex; }
.poll-ico svg { width: clamp(28px, calc(3 * var(--vw)), 42px); height: clamp(28px, calc(3 * var(--vw)), 42px); }
.poll-title {
  font-family: var(--font-display);
  font-size: clamp(24px, calc(3.4 * var(--vw)), 46px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.poll-options { display: flex; flex-direction: column; gap: clamp(16px, calc(2.4 * var(--vh)), 28px); }
.poll-row { display: flex; flex-direction: column; gap: 8px; }
.poll-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.poll-opt-text {
  font-size: clamp(16px, calc(1.9 * var(--vw)), 26px);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poll-row.leading .poll-opt-text { font-weight: 800; }
.poll-opt-pct {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(16px, calc(1.9 * var(--vw)), 26px);
  font-weight: 700;
}
.poll-track {
  position: relative;
  height: clamp(12px, calc(1.6 * var(--vh)), 18px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.poll-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  min-width: 3px;
  transition: width 0.5s ease;
}
.poll-opt-votes { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.poll-total { font-size: 15px; font-weight: 600; color: var(--muted); }
/* No tallies to show (E2EE cast whose presenter hasn't voted): the options
   stay, the numbers go, and a single line says why. */
.poll-blind .poll-track,
.poll-blind .poll-opt-pct,
.poll-blind .poll-opt-votes,
.poll-blind .poll-total { display: none; }
.poll-unavailable {
  font-size: clamp(14px, calc(1.5 * var(--vw)), 19px);
  color: var(--muted);
  font-style: italic;
}

/* progress (collaborative sliders, read-only, shown in the main area) */
.prog-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, calc(2.8 * var(--vh)), 34px);
  padding: calc(6 * var(--vh)) clamp(24px, 7%, 120px);
  overflow-y: auto;
}
.prog-header { display: flex; align-items: center; gap: 16px; }
.prog-ico { flex: 0 0 auto; color: var(--accent); display: inline-flex; }
.prog-ico svg { width: clamp(28px, calc(3 * var(--vw)), 42px); height: clamp(28px, calc(3 * var(--vw)), 42px); }
.prog-title {
  font-family: var(--font-display);
  font-size: clamp(24px, calc(3.4 * var(--vw)), 46px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.prog-desc { font-size: clamp(14px, calc(1.5 * var(--vw)), 20px); color: var(--muted); margin-top: -8px; }
.prog-history-btn {
  align-self: flex-start;
  border: 1px solid var(--stroke);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--fg);
  font-family: inherit;
  font-size: clamp(14px, calc(1.4 * var(--vw)), 18px);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--hover-ease);
}
.prog-history-btn:hover { background: var(--surface-hover); }

/* progress change history (back-navigable list inside the main area) */
.prog-hist { justify-content: flex-start; }
.prog-hist-head { display: flex; align-items: center; gap: 16px; }
.prog-back {
  flex: 0 0 auto;
  border: 1px solid var(--stroke);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--fg);
  font-family: inherit;
  font-size: clamp(14px, calc(1.4 * var(--vw)), 18px);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--hover-ease);
}
.prog-back:hover { background: var(--surface-hover); }
.prog-hist-list { display: flex; flex-direction: column; gap: 8px; }
.prog-hist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--stroke-soft);
  transition: var(--hover-ease);
}
.prog-hist-row:hover { background: var(--surface); }
.prog-hist-body { min-width: 0; }
.prog-hist-line { font-size: clamp(15px, calc(1.5 * var(--vw)), 20px); line-height: 1.35; }
.prog-hist-who { font-weight: 700; }
.prog-hist-item { font-style: italic; }
.prog-hist-val { font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.prog-hist-time { font-size: 13px; color: var(--muted); margin-top: 3px; font-family: var(--font-mono); }
.prog-empty { color: var(--muted); font-size: clamp(15px, calc(1.5 * var(--vw)), 20px); padding: 24px 4px; }

/* bullet_list (ordered points, read-only, shown in the main area) */
/* Equal-width columns laid out left-to-right, filling the space left of the
   widgets strip. JS (layoutFittedColumns) sets the list font-size so every point
   fits the available box; all item metrics below are em-based so padding, gaps
   and the number scale together with that one font size. The list grows to fill
   the remaining vertical space and clips (JS keeps content within it). */
.bullet-list {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.2em;
}
.bullet-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.bullet-row {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  padding: 0.5em 0.7em;
  border-radius: 0.55em;
  background: var(--surface-soft);
  border: 1px solid var(--stroke-soft);
  transition: var(--hover-ease);
}
.bullet-row:hover { background: var(--surface); }
.bullet-num {
  flex: 0 0 auto;
  min-width: 1.4em;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1em;
  font-weight: 700;
  color: var(--accent);
}
.bullet-text {
  font-size: 1em;
  font-weight: 500;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}
.bullet-empty { padding: 12px 4px; }

/* checklist (shared checkable items, read-only, shown in the main area) */
.checklist-count {
  font-size: clamp(14px, calc(1.5 * var(--vw)), 20px);
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--success);
  margin-top: -6px;
}
/* Equal-width columns laid out left-to-right, filling the space left of the
   widgets strip. JS (layoutChecklistColumns) sets the list font-size so every
   item fits the available box; all item metrics below are em-based so padding,
   gaps and the checkbox scale together with that one font size. The list grows
   to fill the remaining vertical space and clips (JS keeps content within it). */
.checklist-list {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.2em;
}
.checklist-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.checklist-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.7em;
  border-radius: 0.55em;
  background: var(--surface-soft);
  border: 1px solid var(--stroke-soft);
  transition: var(--hover-ease);
}
.checklist-row:hover { background: var(--surface); }
.checklist-box {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--muted);
}
.checklist-box svg { width: 1.15em; height: 1.15em; }
.checklist-row.checked .checklist-box,
.scr-checklist-box.checked { color: var(--success); }
/* Loop checks keep their emphasis independently of the completed task text. */
.scr-checklist-box { opacity: 0.62; }
.scr-checklist-box.checked { opacity: 1; }
.checklist-text {
  font-size: 1em;
  font-weight: 500;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}
.checklist-row.checked .checklist-text {
  text-decoration: line-through;
  color: var(--muted);
}
.checklist-empty { padding: 12px 4px; }
/* Overflow row for the floor-size fallback of layoutFittedColumns (checklist
   and bullet_list): when not even the minimum font fits every row, the tail
   is summarized as "+N more" instead of silently clipped. */
.fit-more-row {
  padding: 0.4em 0.7em;
  font-weight: 700;
  color: var(--muted);
}

/* gantt (tribe timeline) — a duration-packed staircase with a frozen title
   column and a body scroller that owns both scrollbars; the week-label header
   and the title column are transform-driven from the body's scroll offsets
   (frozen-column pattern), mirroring the Flutter widget's synced controllers.
   Row/bar/header sizes are FIXED px so the chart reads exactly like the phone. */
.gantt-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, calc(2 * var(--vh)), 22px);
  padding: calc(4 * var(--vh)) clamp(20px, 4%, 60px);
  overflow: hidden;
}
.gantt-header { flex: 0 0 auto; }
.gantt-header .prog-title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-count {
  flex: 0 0 auto;
  font-size: clamp(13px, calc(1.3 * var(--vw)), 18px);
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.10);
  padding: 2px 12px;
  border-radius: 999px;
}
.gantt-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.gantt-headrow { flex: 0 0 auto; display: flex; height: 42px; }
.gantt-corner {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-right: 8px;
  padding-bottom: 2px;
}
.gantt-headscroll { flex: 1 1 auto; min-width: 0; overflow: hidden; position: relative; }
.gantt-headinner {
  position: relative;
  height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  will-change: transform;
}
.gantt-tick { position: absolute; bottom: 0; width: 1px; height: 8px; background: rgba(255, 255, 255, 0.18); }
/* stacked labels: day numbers on the top row, month names on the row below */
.gantt-tick-day {
  position: absolute;
  top: 2px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}
.gantt-tick-month {
  position: absolute;
  top: 20px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.gantt-grid { flex: 1 1 auto; min-height: 0; display: flex; }
.gantt-titles {
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  border-right: 1px solid var(--stroke-soft);
}
.gantt-titles-inner { position: relative; will-change: transform; }
.gantt-titlecell {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 8px;
}
.gantt-rail { flex: 0 0 auto; width: 3px; height: 30px; border-radius: 2px; }
.gantt-titletext { min-width: 0; }
.gantt-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.1px;
  color: rgba(255, 255, 255, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gantt-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.5); margin-top: 2px; font-family: var(--font-mono); }
.gantt-scroll { flex: 1 1 auto; min-width: 0; overflow: auto; position: relative; }
.gantt-canvas { position: relative; }
.gantt-divider { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.07); }
.gantt-bar {
  position: absolute;
  border-radius: 11px;
  box-shadow: 0 1.2px 3px rgba(0, 0, 0, 0.25);
  transition: filter 0.15s ease;
}
.gantt-bar:hover { filter: brightness(1.12); }
.gantt-milestone {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 14px solid transparent;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1.2px 2px rgba(0, 0, 0, 0.25));
}
.gantt-hint { flex: 0 0 auto; font-size: 12px; color: rgba(255, 255, 255, 0.45); }
.gantt-empty { color: var(--muted); font-size: clamp(15px, calc(1.5 * var(--vw)), 20px); padding: 24px 4px; }

/* hover detail card: title in a dark 50% block over the (33% opacity) design
   image on white; rounded corners; floats under the cursor (pointer-events off) */
.gantt-tip {
  position: absolute;
  z-index: 6;
  width: 320px;
  max-width: 80%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.gantt-tip-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.33;
  z-index: 0;
}
.gantt-tip-head {
  position: relative;
  z-index: 1;
  background: rgba(10, 8, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  padding: 14px 16px;
}
.gantt-tip-body {
  position: relative;
  z-index: 1;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gantt-tip-row { display: flex; gap: 12px; align-items: baseline; }
.gantt-tip-k {
  flex: 0 0 auto;
  width: 84px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0, 0, 0, 0.55);
}
.gantt-tip-v {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  overflow-wrap: anywhere;
}

/* chart (shared numeric values: horizontal/vertical bars, pie, area — read-only) */
.chart-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, calc(2.2 * var(--vh)), 26px);
  /* Tight insets (oct-10): the plots below fill the body, so the padding
     is the only space the chart does not use. */
  padding: calc(3 * var(--vh)) clamp(16px, 3%, 48px);
  /* --brand-band: the height the brand mark takes at the foot of the panel
     when positionBrandMark parks it over #main-area (0 otherwise), so the
     axis labels / legend never sit under "socialtimers.com vX". */
  padding-bottom: calc(3 * var(--vh) + var(--brand-band, 0px));
  overflow-y: auto;
}
.chart-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; }

/* horizontal bars */
/* Every chart fills .chart-body (flex 1 1 auto + min-height 0 down the
   chain, so each level's flexed size is DEFINITE and the 62% bars and 100%
   axes inside resolve): the title row above is the only fixed part. */
.chart-hbar { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: clamp(10px, calc(1.8 * var(--vh)), 18px); }
/* The rows' positioned host, so one grid layer can sit behind ALL the bars.
   The plot is as tall as the vertical-bars plot (.chart-vbar) and the rows
   share it equally as lanes (flex 1 1 0), the horizontal twin of
   .chart-vbar-col: flipping a chart's orientation keeps its footprint. Past
   ~13 rows the 24 px lane floor wins and the plot grows instead. (oct-10) */
.chart-hbar-plot {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Takes the whole body height (flexed size = definite, so the tracks'
     62% resolves); --rows, written by chartBuildHBar, keeps a 24 px lane
     floor past which the plot grows and the page scrolls. */
  flex: 1 1 auto;
  min-height: max(160px, calc(var(--rows, 1) * 24px));
}
.chart-hbar-row { display: flex; align-items: center; gap: 14px; flex: 1 1 0; min-height: 24px; }

/* Shared plot gridlines: a faint line per axis tick spanning the whole plot
   area, zero emphasized — the traditional chart read the old per-track marks
   never gave. The hbar layer's insets mirror .chart-axis' margins (label
   column left, value column right) so lines and labels agree; the vbar
   layer's vertical insets mirror the fixed value/label row heights below. */
.chart-grid { position: absolute; pointer-events: none; }
.chart-hbar-plot > .chart-grid {
  top: 0;
  bottom: 0;
  left: clamp(104px, calc(14 * var(--vw)) + 14px, 184px);
  right: 78px;
}
.chart-vbar-plot > .chart-grid { left: 0; right: 0; top: 26px; bottom: 24px; }
.chart-grid-cols > .chart-grid-line { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.1); }
.chart-grid-rows > .chart-grid-line { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255, 255, 255, 0.1); }
.chart-grid-line.chart-grid-zero { background: rgba(255, 255, 255, 0.45); }
.chart-row-label {
  flex: 0 0 clamp(90px, calc(14 * var(--vw)), 170px);
  font-size: clamp(14px, calc(1.4 * var(--vw)), 18px);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-row-value {
  flex: 0 0 auto;
  min-width: 64px;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(14px, calc(1.4 * var(--vw)), 18px);
  font-weight: 700;
}
/* Range charts (min ≠ 0) print BOTH endpoints ("−20% – −5%"): smaller type in
   a wider value column, with the grid/axis right insets widened by the same
   amount (column + the row's 14px gap) so ticks keep pointing at the track. */
.chart-hbar.chart-range .chart-row-value { min-width: 112px; font-size: clamp(12px, calc(1.1 * var(--vw)), 15px); }
.chart-hbar.chart-range .chart-hbar-plot > .chart-grid { right: 126px; }
.chart-hbar.chart-range .chart-axis { margin-right: 126px; }
.chart-vbar.chart-range .chart-col-value { font-size: clamp(10px, calc(1 * var(--vw)), 13px); }

/* The track is now a TRANSPARENT lane over the shared plot grid — the grid
   is the visual context; a filled pill would read as a slider, not a chart. */
.chart-track {
  position: relative;
  flex: 1 1 auto;
  /* 62% of the lane, capped — the same proportion as .chart-track-v's width. */
  height: 62%;
  min-height: 14px;
  max-height: 140px;
  overflow: hidden;
}
/* Only the CROSS-axis insets live here; the along-axis geometry is set inline
   per bar (left/width for horizontal, top/height for vertical). The vertical
   variant must therefore pin left/right below — an absolutely positioned box
   with left/right/width all `auto` shrink-to-fits, and the fill is an empty
   div, so it would resolve to width:0 and the bar would simply not render. */
.chart-fill { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; opacity: 0.85; }
.chart-track-v .chart-fill { top: auto; bottom: auto; left: 3px; right: 3px; }
/* Mirrors the row's own geometry: the label column on the left and the value
   column (plus its gap) on the right. Missing the right inset lets the ticks
   spread past the end of the track, so every label but the first points at
   the wrong place — a skew that grows with the widest formatted value. */
.chart-axis {
  position: relative;
  height: 18px;
  margin-left: clamp(104px, calc(14 * var(--vw)) + 14px, 184px);
  margin-right: 78px;
}
.chart-tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* vertical bars — a Y-axis scale column beside a shared plot. The value row
   above each bar and the label row below it have FIXED heights on purpose:
   the axis column's padding and the grid layer's vertical insets are those
   exact numbers (26px top = 20+6 margin, 24px bottom = 18+6), which is what
   keeps every tick label and gridline crossing the tracks at the value they
   name instead of floating a row's height away from it. */
.chart-vbar { display: flex; align-items: stretch; justify-content: center; gap: clamp(10px, calc(2 * var(--vw)), 22px); flex: 1 1 auto; min-height: 160px; }
.chart-vbar-axis { position: relative; flex: 0 0 44px; box-sizing: border-box; padding: 26px 0 24px; }
.chart-yaxis-inner { position: relative; height: 100%; }
.chart-ytick {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The plot takes the whole row and the columns share it equally (flex 1 1 0,
   like the area chart's evenly spread points), so a 3-item chart on a wide
   screen is three wide lanes, not three thin sticks huddled in the middle.
   The bar fills 62% of its lane up to a cap that keeps a 2-item chart from
   turning into slabs. (oct-10) */
.chart-vbar-plot { position: relative; display: flex; flex: 1 1 auto; min-width: 0; gap: clamp(10px, calc(2 * var(--vw)), 22px); height: 100%; }
.chart-vbar-col { display: flex; flex-direction: column; align-items: center; height: 100%; flex: 1 1 0; min-width: 0; }
.chart-col-value {
  height: 20px;
  line-height: 20px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(12px, calc(1.2 * var(--vw)), 15px);
  font-weight: 700;
  margin-bottom: 6px;
}
.chart-track-v {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  width: 62%;
  min-width: 12px;
  max-width: 140px;
  overflow: hidden;
}
.chart-col-label {
  margin-top: 6px;
  height: 18px;
  line-height: 18px;
  font-size: clamp(11px, calc(1.1 * var(--vw)), 14px);
  text-align: center;
  color: var(--muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* pie — SVG wedges (see chartBuildPie): the exploded highlight slice needs
   real per-slice geometry, which a conic-gradient disc cannot offset. The
   viewBox already reserves margin for the explode offset, but overflow stays
   visible so the drop-shadow is never clipped square. */
.chart-pie-wrap { display: flex; align-items: center; justify-content: center; gap: clamp(24px, calc(4 * var(--vw)), 56px); flex: 1 1 auto; min-height: 160px; }
/* The disc is as tall as the body allows (its square comes from the
   viewBox via aspect-ratio), capped at half the width so the legend keeps
   its column. */
.chart-pie {
  flex: 0 1 auto;
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: 50%;
  aspect-ratio: 1 / 1;
  overflow: visible;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}
/* The seam between slices: a hairline in the page's dark navy so adjacent
   colors read as separate wedges instead of one striped disc. */
.chart-pie-slice { stroke: rgba(14, 12, 40, 0.55); stroke-width: 1.5; }
.chart-pie-slice-highlight { stroke: rgba(255, 255, 255, 0.85); stroke-width: 2; }
.chart-pie-slice-remainder { fill: rgba(255, 255, 255, 0.12); }
.chart-pie-label {
  fill: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2px;
}
.chart-legend { display: flex; flex-direction: column; gap: 8px; min-width: clamp(160px, calc(22 * var(--vw)), 260px); }
.chart-legend-row { display: flex; align-items: center; gap: 10px; }
.chart-legend-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; }
.chart-legend-star { flex: 0 0 auto; color: var(--highlight); font-size: 13px; }
.chart-legend-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(14px, calc(1.4 * var(--vw)), 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-legend-highlight .chart-legend-label { font-weight: 700; }
.chart-legend-value {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(13px, calc(1.3 * var(--vw)), 16px);
  font-weight: 700;
  color: var(--muted);
}

/* area ("sawtooth") */
/* Y-axis scale column beside the plot; its height MUST match the svg's so
   the percent-positioned tick labels land on the gridlines they name. */
/* area: a plot row (axis + svg) that takes the body height, then the value
   and label rows under it, inset by the axis column so each cell stays
   centred on its dot. The svg stretches to the row (preserveAspectRatio
   none), the axis column stretches with it. */
.chart-area-wrap { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 6px; }
.chart-area-plot { display: flex; flex: 1 1 auto; min-height: 120px; gap: 10px; }
.chart-area-axis { position: relative; flex: 0 0 44px; align-self: stretch; }
.chart-area-svg { flex: 1 1 auto; min-width: 0; height: 100%; }
.chart-area-values, .chart-area-labels { margin-left: 54px; }
.chart-area-grid { stroke: rgba(255, 255, 255, 0.10); stroke-width: 1.5; }
.chart-area-zero { stroke: rgba(255, 255, 255, 0.45); stroke-width: 2; }
.chart-area-fill { fill: rgba(255, 255, 255, 0.16); stroke: none; }
.chart-area-line { fill: none; stroke: var(--purple); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area-dot { fill: none; stroke: var(--purple); stroke-width: 10; stroke-linecap: round; }
.chart-area-values, .chart-area-labels { display: flex; }
.chart-area-values span, .chart-area-labels span { flex: 1 1 0; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-area-values span {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(12px, calc(1.2 * var(--vw)), 15px);
  font-weight: 700;
}
.chart-area-labels span { font-size: clamp(11px, calc(1.1 * var(--vw)), 14px); color: var(--muted); }

/* rsvp (attendance) — going/maybe/can't-go rows with their roster + no-reply */
.rsvp-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, calc(2.2 * var(--vh)), 28px);
  padding: calc(6 * var(--vh)) clamp(24px, 7%, 120px);
  overflow-y: auto;
}
.rsvp-header { display: flex; align-items: center; gap: 16px; }
.rsvp-ico { flex: 0 0 auto; color: var(--accent); display: inline-flex; }
.rsvp-ico svg { width: clamp(28px, calc(3 * var(--vw)), 42px); height: clamp(28px, calc(3 * var(--vw)), 42px); }
.rsvp-title {
  font-family: var(--font-display);
  font-size: clamp(24px, calc(3.4 * var(--vw)), 46px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.rsvp-desc { font-size: clamp(14px, calc(1.5 * var(--vw)), 20px); color: var(--muted); margin-top: -6px; }
.rsvp-list { display: flex; flex-direction: column; gap: clamp(10px, calc(1.6 * var(--vh)), 18px); }
.rsvp-row {
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--rsvp-accent, rgba(255, 255, 255, 0.2));
  border-radius: var(--radius);
  padding: clamp(12px, calc(1.8 * var(--vh)), 18px) clamp(16px, calc(2 * var(--vw)), 22px);
  background: var(--surface-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: var(--hover-ease);
}
.rsvp-row:hover { background: var(--surface); }
.rsvp-row-head { display: flex; align-items: center; gap: 14px; }
.rsvp-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 999px; }
.rsvp-dot-muted { background: rgba(255, 255, 255, 0.28); }
.rsvp-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(18px, calc(2 * var(--vw)), 28px);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rsvp-count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(20px, calc(2.2 * var(--vw)), 32px);
  font-weight: 700;
}
.rsvp-count-muted { color: var(--muted); }
.rsvp-noreply { background: transparent; border-style: dashed; border-left-color: rgba(255, 255, 255, 0.18); }
.rsvp-voters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rsvp-voter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke-soft);
  transition: var(--hover-ease);
}
.rsvp-voter:hover { background: var(--surface-hover); }
.rsvp-voter-name { font-size: clamp(13px, calc(1.2 * var(--vw)), 17px); font-weight: 600; }
.rsvp-hist-reply {
  display: inline-block;
  font-weight: 700;
  padding: 1px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.92em;
}
/* public_rsvp: the same rows with counts only — each count followed by its
   share of the responses, a total line with the "Updating…" hint, and the
   note that replaces the numbers while no sample is available. */
.rsvp-pct {
  flex: 0 0 auto;
  min-width: 4.2em;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(13px, calc(1.4 * var(--vw)), 20px);
  font-weight: 600;
  color: var(--muted);
}
.rsvp-foot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; }
.rsvp-total {
  font-size: clamp(14px, calc(1.5 * var(--vw)), 20px);
  font-weight: 600;
  color: var(--muted);
}
.rsvp-updating {
  font-size: clamp(12px, calc(1.2 * var(--vw)), 16px);
  font-style: italic;
  color: var(--muted);
}
.rsvp-unavailable {
  font-size: clamp(14px, calc(1.5 * var(--vw)), 19px);
  color: var(--muted);
  font-style: italic;
}

/* program footer */
.program {
  flex: 0 0 auto;
  width: 100%;
  height: 190px;
  background: rgba(8, 6, 26, 0.55);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--stroke-soft);
}

/* ---------- scrum_poker (read-only dashboard view) ---------- */
/* centers the scrum block in the free area, both axes */
.sp-shell {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.sp-root {
  width: 100%;
  max-width: 760px;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* contents left-aligned inside the centered block */
  gap: 18px;
  color: var(--fg);
}
.sp-root > * { width: 100%; }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sp-titlewrap { display: flex; align-items: center; gap: 16px; min-width: 0; }
.sp-ico { flex: 0 0 auto; color: var(--accent); display: inline-flex; }
.sp-ico svg { width: clamp(28px, calc(3 * var(--vw)), 42px); height: clamp(28px, calc(3 * var(--vw)), 42px); }
.sp-title {
  font-family: var(--font-display);
  font-size: clamp(28px, calc(3.4 * var(--vw)), 46px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.sp-chip {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  color: #fff;
  white-space: nowrap;
}
.sp-chip.urgent { background: var(--on-danger); border-color: var(--danger); color: var(--danger); }
/* Chip de ciclo de vida (Closed/Ended) en el header de poll y rsvp: mismo
   capsule que .sp-chip, en fuente de display y más chico, alineado a la
   derecha del título. */
.sp-chip.lc-chip {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: clamp(16px, calc(1.7 * var(--vw)), 24px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 16px;
  color: var(--muted);
}
.sp-hint { font-size: 15px; color: var(--muted); margin-top: -8px; }

.sp-deck { display: flex; flex-wrap: wrap; gap: 12px; }
.sp-cardel {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sp-poker {
  width: 64px;
  height: 88px;
  border-radius: 10px;
  background: #fff;
  color: #16161a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(0, 0, 0, 0.10); /* colour set inline per card */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sp-poker:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.sp-poker-val { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.sp-shirt { width: 104px; height: 112px; }
.sp-shirt svg { width: 100%; height: 100%; display: block; }
.sp-shirt-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(10%);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.sp-shirt-val.long { font-size: 16px; }
.sp-mini.sp-poker { width: 46px; height: 62px; }
.sp-mini.sp-poker .sp-poker-val { font-size: 18px; }
.sp-mini.sp-shirt { width: 66px; height: 70px; }
.sp-mini.sp-shirt .sp-shirt-val { font-size: 15px; }
.sp-mini.sp-shirt .sp-shirt-val.long { font-size: 11px; }

.sp-voted { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-facedown { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.30); }

.sp-results { display: flex; flex-direction: column; gap: 12px; }
.sp-group {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  transition: var(--hover-ease);
}
.sp-group:hover { background: var(--surface); }
.sp-badge {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  color: #131120;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.sp-avs { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.sp-count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}

/* raffle — reuses .sp-shell/.sp-root/.sp-head/.sp-chip/.sp-hint from scrum.
   A "stage" presentation: frosted-glass tiles pop into a centered cloud, an
   enrollment progress bar drains under the hint, the suspense jump sweeps a
   glowing blue pulse across the tiles, and the settled winner blooms gold with
   a confetti burst. All motion is CSS; JS only toggles classes. */
.rf-cloud {
  position: relative; /* confetti burst is positioned inside it */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: clamp(12px, calc(1.6 * var(--vw)), 20px);
  padding: clamp(14px, calc(2 * var(--vh)), 26px) 0;
  min-height: 120px;
}
.rf-tile {
  animation: rf-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  transition: transform 0.16s ease, opacity 0.2s ease, filter 0.2s ease,
    border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease,
    color 0.16s ease;
  will-change: transform, opacity;
}
@keyframes rf-pop {
  from { opacity: 0; transform: scale(0.55) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.rf-item {
  padding: clamp(10px, calc(1.4 * var(--vh)), 14px) clamp(18px, calc(2.2 * var(--vw)), 28px);
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 4px 14px rgba(0, 0, 0, 0.18);
  font-size: clamp(17px, calc(2 * var(--vw)), 26px);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.rf-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 14px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke-soft);
  background: var(--surface-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  max-width: 128px;
}
.rf-member img, .rf-member .avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}
.rf-name {
  font-size: clamp(12px, calc(1.2 * var(--vw)), 15px);
  font-weight: 600;
  color: var(--muted);
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* dimmed field while the spotlight sweeps / after the winner settles */
.rf-tile.dim { opacity: 0.32; filter: saturate(0.6); }

/* the suspense spotlight: an electric-blue pulse on the current tile */
.rf-tile.jump {
  transform: scale(1.14);
  border-color: rgba(102, 187, 255, 0.9);
  background: linear-gradient(160deg, rgba(66, 165, 245, 0.30), rgba(126, 63, 242, 0.26));
  box-shadow: 0 0 0 3px rgba(102, 187, 255, 0.28),
    0 0 34px rgba(66, 165, 245, 0.55);
  animation: rf-jump 0.3s ease;
}
@keyframes rf-jump {
  0% { transform: scale(1.02); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1.14); }
}
.rf-item.jump { color: #cfe8ff; }
.rf-member.jump .rf-name { color: #cfe8ff; }
.rf-member.jump img, .rf-member.jump .avatar {
  box-shadow: 0 0 0 3px rgba(102, 187, 255, 0.85);
}

/* the winner blooms gold: springy pop, warm gradient, breathing halo */
.rf-tile.winner {
  border-color: rgba(255, 213, 79, 0.95);
  background: linear-gradient(160deg, rgba(249, 168, 37, 0.34), rgba(255, 111, 0, 0.22));
  box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.35), 0 0 44px rgba(249, 168, 37, 0.65);
  animation: rf-win-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
    rf-win-halo 2.2s ease-in-out 0.7s infinite;
  transform: scale(1.22);
  z-index: 1;
}
@keyframes rf-win-pop {
  0% { transform: scale(0.9); }
  45% { transform: scale(1.38); }
  70% { transform: scale(1.16); }
  100% { transform: scale(1.22); }
}
@keyframes rf-win-halo {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.35), 0 0 34px rgba(249, 168, 37, 0.50); }
  50% { box-shadow: 0 0 0 5px rgba(255, 213, 79, 0.50), 0 0 58px rgba(249, 168, 37, 0.80); }
}
.rf-item.winner { color: #ffe082; }
.rf-member.winner .rf-name { color: #ffe082; font-weight: 700; }
.rf-member.winner img, .rf-member.winner .avatar {
  box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.95);
}
/* a little crown floats above the winning tile */
.rf-tile.winner::after {
  content: "👑";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  animation: rf-crown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s backwards;
}
.rf-tile { position: relative; }
@keyframes rf-crown {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.4); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* enrollment window: a capsule track that drains left→right in real time */
.rf-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--stroke-soft);
  overflow: hidden;
}
.rf-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: none;
  transition: width 1s linear;
}
.rf-progress-fill.urgent { background: var(--danger); }

/* "Drawing…" hint gets marching dots */
.rf-hint-drawing::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: rf-dots 1.2s steps(4) infinite;
}
@keyframes rf-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* confetti burst over the winner (spawned once by JS, self-cleaning) */
.rf-confetti {
  position: absolute;
  width: 10px;
  height: 14px;
  top: 0;
  left: 0;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  animation: rf-confetti-fall 1.6s cubic-bezier(0.25, 0.8, 0.5, 1) forwards;
  z-index: 2;
}
@keyframes rf-confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% {
    opacity: 0;
    transform: translate(var(--cx, 0px), var(--cy, 160px)) rotate(var(--cr, 540deg)) scale(0.7);
  }
}

.rf-empty {
  padding: 48px 20px;
  font-size: clamp(16px, calc(1.8 * var(--vw)), 22px);
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  width: 100%;
}

/* secret santa — reuses .sp-shell/.sp-root/.sp-head/.sp-chip/.sp-hint and the
   raffle's .rf-cloud/.rf-member entrant tiles + .rf-confetti particles. The
   dashboard never shows assignments — only the countdown, the roster and the
   celebration. */
.ss-stats { display: flex; gap: 16px; }
.ss-stat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.ss-stat-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, calc(3.6 * var(--vw)), 48px);
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
}
.ss-stat-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ss-banner {
  position: relative; /* hosts the confetti particles */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 24px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(135deg, rgba(126, 63, 242, 0.30), rgba(66, 165, 245, 0.18));
  border: 1px solid rgba(126, 63, 242, 0.45);
  box-shadow: 0 0 42px rgba(126, 63, 242, 0.35);
  overflow: hidden;
}
.ss-banner-gift {
  font-size: clamp(44px, calc(5 * var(--vw)), 68px);
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
  animation: ss-gift-pulse 2.4s ease-in-out infinite;
}
@keyframes ss-gift-pulse {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.12) rotate(2deg); }
}
.ss-banner-title {
  font-family: var(--font-display);
  font-size: clamp(26px, calc(3.2 * var(--vw)), 42px);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ss-banner-sub {
  font-size: clamp(14px, calc(1.6 * var(--vw)), 19px);
  color: var(--muted);
  max-width: 560px;
}

/* quiz — reuses .sp-shell/.sp-root/.sp-head/.sp-chip/.sp-hint from scrum */
.qz-note {
  padding: 48px 20px;
  text-align: center;
  font-size: clamp(20px, calc(2.4 * var(--vw)), 30px);
  font-weight: 600;
  color: var(--muted);
}
.qz-question, .qz-results { display: flex; flex-direction: column; gap: 12px; }
.qz-qtext {
  font-size: clamp(22px, calc(2.6 * var(--vw)), 34px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}
.qz-answer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
}
.qz-letter {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--stroke);
}
.qz-letter.correct { background: var(--on-success); border-color: var(--success); color: var(--success); }
.qz-atext { flex: 1 1 auto; min-width: 0; font-size: clamp(16px, calc(1.8 * var(--vw)), 24px); font-weight: 600; }

/* per-question results: option row + vote bar (+ voters in individual mode) */
.qz-res-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
}
.qz-res-answer.correct { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.qz-res-top { display: flex; align-items: center; gap: 14px; }
.qz-res-top .qz-atext { flex: 1 1 auto; }
.qz-bar-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.10); overflow: hidden; }
.qz-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.4s ease; }
.qz-bar-fill.correct { background: var(--success); }

/* summary histogram: correct-answers-per-player distribution */
.qz-hist { display: flex; align-items: flex-end; gap: 10px; padding: 8px 2px 0; }
.qz-hist-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.qz-hist-count { font-family: var(--font-mono); font-size: 15px; font-weight: 700; min-height: 18px; }
.qz-hist-bar { width: 70%; max-width: 54px; border-radius: 8px 8px 3px 3px; background: var(--accent); }
.qz-hist-x { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.qz-hist-caption { text-align: center; font-size: 14px; color: var(--muted); }

/* ranking rows reuse .sp-group; the rank ordinal gets gold for the podium */
.qz-rank {
  flex: 0 0 auto;
  width: 34px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
}
.qz-rank.top { color: var(--highlight); }
.qz-name { flex: 1 1 auto; min-width: 0; font-size: clamp(16px, calc(1.8 * var(--vw)), 22px); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* mood_pulse — reuses .sp-shell/.sp-root/.sp-head/.sp-chip/.sp-title from scrum */
.mp-palette { display: flex; flex-direction: column; gap: 14px; }
.mp-palette.mp-dim { opacity: 0.5; }
.mp-optrow { display: flex; flex-wrap: wrap; gap: 14px; }
.mp-energyrow { gap: 20px; }
.mp-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mp-glyph { display: inline-flex; }
.mp-glyph svg { width: 56px; height: 56px; display: block; }
.mp-energyrow .mp-glyph svg { width: 60px; height: 60px; }
.mp-optlabel {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mp-anon { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-anonchip {
  display: inline-flex;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.30);
}
.mp-anonchip svg { width: 40px; height: 40px; display: block; border-radius: 999px; }

.mp-results { display: flex; flex-direction: column; gap: 12px; }
.mp-floor {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--stroke-soft);
  color: var(--fg);
  font-size: 16px;
}
.mp-scores { display: flex; gap: 12px; }
.mp-tile {
  flex: 1 1 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1.6px solid rgba(255, 255, 255, 0.2);
  transition: var(--hover-ease);
}
.mp-tile:hover { background: var(--surface); }
.mp-tile-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.mp-tile-val {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.mp-tile-max { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; font-family: var(--font-mono); }

.mp-seclabel {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
  opacity: 0.9;
}
.mp-splitwrap { display: flex; flex-direction: column; gap: 6px; }
.mp-splitbar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.mp-legitem { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.mp-legdot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }

.mp-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mp-risk {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #131120;
  padding: 5px 12px;
  border-radius: 999px;
}
.mp-signal { font-size: 14px; font-weight: 600; color: var(--fg); }

.mp-reco {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--stroke-soft);
}
.mp-reco-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 5px;
}
.mp-reco-body { font-size: 15px; color: var(--fg); line-height: 1.35; }
.mp-summary { font-size: 13px; font-style: italic; color: var(--muted); }

/* dice — read-only mirror of the app's dice. Real six-face CSS cubes on a
   tilted table plane (perspective + rotateX): each die is a .dc-cube with six
   pip'd faces standing on a .dc-shadow contact blob that shrinks and fades as
   the die hops. JS (rAF) drives all motion via inline transforms — die
   position/lift/scale on .dc-die, tumble rotation on .dc-cube; the CSS here
   owns the material plus the one-shot flourishes (entrance pop, landing ring,
   reveal glow, total badge). */
.dc-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  perspective: 700px;
}
.dc-tilt {
  position: relative;
  width: 320px;
  height: 200px;
  transform-style: preserve-3d;
  transform: rotateX(22deg);
}
.dc-die {
  position: absolute;
  left: 50%; top: 50%;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  transform-style: preserve-3d;
  will-change: transform;
}
.dc-pop {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: dc-enter 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.dc-cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.dc-f {
  position: absolute;
  inset: -0.5px; /* hairline overlap tucks the seams between faces */
  border-radius: 8px;
  /* an inset ring instead of a border: it hugs the radius, so shared cube
     edges read as one soft crease rather than two parallel lines */
  box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.08);
  backface-visibility: hidden;
}
.dc-top    { background: linear-gradient(135deg, #ffffff, #e6e9ed); transform: translateZ(42px); }
.dc-bottom { background: #b0b4bb;                                   transform: rotateX(180deg) translateZ(42px); }
.dc-north  { background: linear-gradient(#d6dae0, #c7ccd3);         transform: rotateX(90deg) translateZ(42px); }
.dc-south  { background: linear-gradient(#e2e5ea, #d0d4da);         transform: rotateX(-90deg) translateZ(42px); }
.dc-east   { background: linear-gradient(#cdd2d9, #bfc4cb);         transform: rotateY(90deg) translateZ(42px); }
.dc-west   { background: linear-gradient(#cdd2d9, #bfc4cb);         transform: rotateY(-90deg) translateZ(42px); }
.dc-pip {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e05252, #b71c1c 75%);
  transform: translate(-50%, -50%);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.3);
}
.dc-shadow {
  position: absolute;
  left: 50%; top: 50%;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 72%);
  will-change: transform, opacity;
}
/* landing shock ring, spawned by JS at the tumble→settle hand-off */
.dc-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: dc-ring 0.5s ease-out forwards;
  pointer-events: none;
}
/* brief brightness bloom on every face the instant the roll reveals */
.dc-die.glow .dc-f { animation: dc-glow 0.9s ease-out; }
/* the sum, big and tabular under the dice; pops in when watched live */
.dc-total {
  position: absolute;
  left: 50%; bottom: 6px;
  transform: translateX(-50%);
  min-width: 56px;
  padding: 4px 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.dc-total.pop { animation: dc-total-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes dc-enter {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes dc-ring {
  from { transform: translateZ(-42px) scale(0.3); opacity: 0.55; }
  to   { transform: translateZ(-42px) scale(1.6); opacity: 0; }
}
@keyframes dc-glow {
  0%   { filter: brightness(1); }
  25%  { filter: brightness(1.55); }
  100% { filter: brightness(1); }
}
@keyframes dc-total-pop {
  from { transform: translateX(-50%) scale(0.4); opacity: 0; }
  to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* dice layout: title on top, the (viewport-scaled) dice center-stage, and a
   centered status line — result text + "Turn" chip — grouped right under
   them, where the eyes land after the reveal */
/* the block stays natural-height so the shell centers title + dice + status
   as one tight group; the stage's scaled min-height comes inline from JS */
.dc-root .dc-stage { flex: 0 0 auto; }
.dc-total { font-size: clamp(32px, calc(3 * var(--vw)), 44px); }
.dc-hintrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 72px;
}
.dc-hintrow .sp-hint {
  margin-top: 0;
  font-size: clamp(20px, calc(2.4 * var(--vw)), 34px);
  text-align: center;
}
/* the payoff line: bright while a roll is on the table (result / Rolling…),
   muted for the idle "waiting for a roll" prompt */
.dc-hintrow .sp-hint.dc-on {
  color: var(--fg);
  opacity: 0.92;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dc-turn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 4px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  animation: dc-turn-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.dc-turn-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
@keyframes dc-turn-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- Tribe cast: the group's event list ---------- */
.tribe-list {
  height: 100%;
  overflow-y: auto;
  padding: 26px clamp(24px, calc(4 * var(--vw)), 64px) 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}
.tl-count {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
/* Subtle banner-visibility selector: quiet capsule chips, per-screen only. */
.tl-modes {
  display: flex;
  gap: 6px;
}
.tl-modes button {
  appearance: none;
  border: 1px solid var(--stroke-soft);
  background: var(--surface-soft);
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--hover-ease);
  opacity: 0.75;
}
.tl-modes button:hover { background: var(--surface-hover); color: var(--fg); opacity: 1; }
.tl-modes button.active {
  background: var(--surface);
  border-color: var(--stroke);
  color: var(--fg);
  opacity: 1;
}
.tl-empty {
  margin-top: calc(12 * var(--vh));
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}
.tl-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px 18px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke-soft);
  background: var(--surface-soft);
  overflow: hidden;
  min-height: 84px;
}
/* the event banner behind the row content, revealed per the selector */
.tl-banner {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: none;
}
/* Finished events retire live (updateTribeRow sets [hidden]); the explicit
   rule is needed because .tl-row's display:flex outranks the UA [hidden]. */
.tl-row[hidden] { display: none; }
.tl-row.tl-banner-on { border-color: var(--stroke); }
.tl-row.tl-banner-on .tl-banner { display: block; }
/* darkening scrim so titles/figures stay readable over any banner image */
.tl-row.tl-banner-on .tl-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 8, 30, 0.72), rgba(10, 8, 30, 0.45));
}
/* highlight: the accent edge bar, mirroring the app's highlighted rows */
.tl-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 5px 0 0 5px;
  background: transparent;
}
.tl-row.tl-highlight { border-color: var(--highlight); }
.tl-row.tl-highlight .tl-accent { background: var(--highlight); }
.tl-main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tl-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: clamp(19px, calc(2.3 * var(--vw)), 27px);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-mark { flex: 0 0 auto; width: 22px; height: 22px; opacity: 0.9; }
.tl-mark svg { width: 100%; height: 100%; }
.tl-hint { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
.tl-hint svg { width: 100%; height: 100%; }
.tl-hint-muted { color: var(--danger); }
.tl-sub {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-timer {
  position: relative;
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 150px;
}
.tl-timer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.tl-timer-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(22px, calc(2.6 * var(--vw)), 32px);
  font-weight: 700;
}
/* thin progress line along the row foot while the event runs its duration */
.tl-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}
.tl-progress-bar {
  height: 100%;
  width: 0;
  background: var(--purple);
  border-radius: 0 3px 3px 0;
  transition: width 0.6s linear;
}
/* rows are tappable: open the event/to-do detail view */
.tl-row.clickable { cursor: pointer; transition: var(--hover-ease); }
.tl-row.clickable:hover {
  background: var(--surface-hover);
  border-color: var(--stroke);
  transform: translateY(-1px);
}
.tl-row.clickable:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* ---- weather widget --------------------------------------------------------
 * Config-only card: a glance chip (icon + temperature) on the strip, and a clean
 * open view — big temperature, min/max, the "moment" caption, and (for historical
 * readings) the waiting-for-forecast banner + reference-only disclaimer. */
.weather-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-right: 38px; /* clear of the bottom-right open-in-Windy button */
}
.weather-chip-ico { width: 22px; height: 22px; color: var(--muted); display: inline-flex; }
.weather-chip-ico svg { width: 100%; height: 100%; }
.weather-chip-temp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
}
.weather-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
}
.weather-view { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.weather-main { display: flex; align-items: center; gap: 18px; }
.weather-ico { width: 76px; height: 76px; color: #fff; display: inline-flex; }
.weather-ico svg { width: 100%; height: 100%; }
.weather-temp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
}
.weather-minmax {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  color: var(--muted);
}
/* The "moment" caption — mirrors the phone widget's clock line. */
.weather-moment {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}
.weather-hist-banner {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}
.weather-disclaimer { font-size: 13px; color: var(--muted); text-align: center; }
.weather-loading,
.weather-placeholder {
  font-size: 15px;
  color: var(--muted);
  text-align: center;
  max-width: 30ch;
  line-height: 1.4;
}
/* Open-in-Windy affordance, pinned to the bottom-right corner of the strip
 * card (not the open view). Same square glass button as .widget-popup. */
.weather-card-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  cursor: pointer;
  transition: var(--hover-ease);
}
.weather-card-open:hover { background: var(--surface-hover); }
.weather-card-open svg { width: 16px; height: 16px; }

/* ---- moon_phase widget ------------------------------------------------------
 * Config-only, computed locally (moon.js): a glance chip (mini disc + phase
 * name) on the strip card, and an open view that is the phone card at TV
 * scale — hero (disc + name + lit fraction/age + next milestone), the moment
 * caption with the horizon verdict, a hairline and the Sun/Moon rise-set grid.
 * Title/body/placeholder reuse the weather classes (same stage layout). */
.moon-chip { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-width: 0; }
.moon-chip-disc { width: 22px; height: 22px; display: inline-flex; flex: 0 0 auto; }
.moon-chip-disc svg { width: 100%; height: 100%; }
.moon-chip-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.moon-view { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(640px, 100%); }
.moon-using { font-size: 14px; color: var(--muted); text-align: center; }
.moon-hero { display: flex; align-items: center; gap: 24px; max-width: 100%; }
.moon-disc { width: 112px; height: 112px; display: inline-flex; flex: 0 0 auto; }
.moon-disc svg { width: 100%; height: 100%; }
.moon-hero-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.moon-phase-name {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.moon-meta { font-size: 18px; color: var(--muted); }
.moon-milestone { font-size: 16px; color: var(--muted); }
.moon-milestone.tonight { color: var(--fg); font-weight: 700; }
/* The "moment" caption — same line as the weather's, plus the horizon verdict. */
.moon-moment { font-family: var(--font-display); font-size: 15px; color: var(--muted); text-align: center; }
.moon-rule { width: 100%; height: 1px; background: var(--stroke); }
.moon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; width: 100%; }
.moon-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.moon-cell.polar { grid-column: 1 / -1; }
.moon-cell-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.moon-cell.polar .moon-cell-label { text-transform: none; letter-spacing: 0; font-size: 16px; }
.moon-cell-label svg { width: 14px; height: 14px; flex: 0 0 auto; }
.moon-cell-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.moon-cell-value.missing { color: var(--muted); }

/* ---- who am i ---- */
.wai-topic {
  margin: clamp(10px, calc(1.6 * var(--vh)), 18px) auto 0;
  padding: clamp(10px, calc(1.6 * var(--vh)), 16px) clamp(18px, calc(2.4 * var(--vw)), 30px);
  max-width: min(92%, 720px);
  border-radius: 16px;
  background: var(--primary-container);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.30);
  text-align: center;
}
.wai-topic-label {
  font-size: clamp(10px, calc(1 * var(--vw)), 12px);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--on-primary-container);
}
.wai-topic-text {
  margin-top: 2px;
  font-size: clamp(20px, calc(2.6 * var(--vw)), 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--on-primary-container);
}
.wai-check {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 50%;
  background: var(--success);
  color: var(--on-success);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.wai-cloud .rf-tile { position: relative; }
.wai-turn {
  margin: clamp(8px, calc(1.4 * var(--vh)), 14px) auto 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: clamp(38px, calc(6 * var(--vw)), 76px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink, #fff);
}
.wai-turn.urgent { color: var(--danger); }
.wai-rank {
  margin: clamp(12px, calc(2 * var(--vh)), 20px) auto 0;
  width: min(92%, 640px);
}
.wai-rank-head {
  font-size: clamp(10px, calc(1 * var(--vw)), 12px);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 6px;
}
.wai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke-soft);
  background: var(--surface-soft);
  margin-bottom: 6px;
}
.wai-row.out { opacity: 0.6; }
.wai-row .avatar { border-radius: 50%; flex: none; }
.wai-pos { width: 24px; text-align: center; font-weight: 800; color: var(--muted); flex: none; }
.wai-who { flex: 1; min-width: 0; }
.wai-nm {
  font-weight: 700;
  font-size: clamp(14px, calc(1.4 * var(--vw)), 18px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wai-ch {
  font-size: clamp(11px, calc(1.1 * var(--vw)), 14px);
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wai-time {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(12px, calc(1.2 * var(--vw)), 15px);
}
.wai-time.ok { background: var(--on-success); color: var(--success); }
.wai-time.out { background: var(--on-danger); color: var(--danger); }

/* ---- Brainstorm (floating semantic clusters) ---- */
.bs-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, calc(2.2 * var(--vw)), 26px);
  gap: 10px;
}
.bs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-right: 56px; /* clear the close button */
}
.bs-titlewrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bs-ico { width: clamp(24px, calc(2.6 * var(--vw)), 34px); height: clamp(24px, calc(2.6 * var(--vw)), 34px); color: var(--purple); flex: none; }
.bs-ico svg { width: 100%; height: 100%; }
.bs-title {
  font-family: var(--font-display);
  font-size: clamp(20px, calc(2.8 * var(--vw)), 34px);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-chip {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(15px, calc(2 * var(--vw)), 24px);
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  flex: none;
}
.bs-arena {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--stroke-soft);
  touch-action: none;
}
/* The card shrink-wraps its idea instead of clipping it: the physics reads
   each body's real measured box (bsPaintBody), so a taller/wider card still
   collides and bounces correctly. */
.bs-card {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 150px;
  max-width: 280px;
  min-height: 56px;
  box-sizing: border-box;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}
.bs-card.drag {
  cursor: grabbing;
  z-index: 30;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.bs-card-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8; /* safety valve only — ideas this long are pathological */
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.bs-badge {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.bs-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(18px, calc(2.6 * var(--vw)), 30px);
  opacity: 0.65;
  pointer-events: none;
  text-align: center;
  padding: 0 8%;
}

/* a traveling brainstorm card flies OVER the crowd on its way to its cluster */
.bs-card.fly {
  z-index: 24;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* hover tooltip: the semantic dimension scores behind a card's placement */
.bs-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 40;
  min-width: 300px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(10, 12, 24, 0.92);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bs-tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bs-tip-name {
  flex: 0 0 52%;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-tip-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bs-tip-fill {
  height: 100%;
  border-radius: 3px;
}
.bs-tip-val {
  flex: none;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  opacity: 0.8;
  width: 30px;
  text-align: right;
}
.bs-tip-none {
  font-size: 12px;
  opacity: 0.6;
  white-space: nowrap;
}

/* pomodoro — a projected session reads as ONE object: the phase ring with the
   countdown at its centre, the phase beneath it, and a dot per pomodoro. No
   controls: a Rooms screen watches, it never acts. Reuses .sp-shell/.sp-root/
   .sp-head from scrum poker so the frame matches every other opened widget. */
.pm-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
}
.pm-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, calc(2.2 * var(--vh)), 26px);
}
.pm-ring {
  position: relative;
  display: grid;
  place-items: center;
  /* The ring is the show on a shared screen: scale it with the viewport the
     way the dice stage does, so it reads from across the room. */
  width: clamp(200px, calc(34 * var(--vh)), 340px);
  height: clamp(200px, calc(34 * var(--vh)), 340px);
}
.pm-ring svg { width: 100%; height: 100%; display: block; }
.pm-track { stroke: var(--stroke); }
.pm-arc {
  stroke: #ff4f00;
  /* The arc only ever advances by one second's worth, so a short transition
     smooths the step without lagging a phase change (which jumps to 0). */
  transition: stroke-dashoffset 0.4s linear, stroke 0.3s ease, opacity 0.3s ease;
}
.pm-arc.pm-dim { opacity: 0.4; }
.pm-arc.pm-paused { stroke: var(--highlight); opacity: 1; }
.pm-readout {
  position: absolute;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, calc(6.2 * var(--vh)), 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  transition: opacity 0.3s ease;
}
.pm-readout.pm-dim { opacity: 0.55; }
.pm-readout.pm-paused { color: var(--highlight); opacity: 1; }
.pm-phase {
  font-family: var(--font-display);
  font-size: clamp(18px, calc(2.6 * var(--vh)), 30px);
  font-weight: 600;
  color: var(--fg);
  text-align: center;
}
.pm-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.pm-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1.5px solid var(--stroke);
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.pm-dot.pm-on {
  background: #ff4f00;
  border-color: #ff4f00;
}

/* ---------- E2EE privacy interstitial ---------- */
.e2ee-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 12, 34, 0.55);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.e2ee-card {
  max-width: 420px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.e2ee-lock {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-primary-container);
  background: var(--primary-container);
  border: 1px solid var(--accent);
}
.e2ee-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px;
}
.e2ee-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 24px;
}
.e2ee-btn {
  appearance: none;
  width: 100%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-primary);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 13px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--hover-ease);
}
.e2ee-btn:hover { background: var(--primary-container); color: var(--on-primary-container); }
.e2ee-btn:active { transform: scale(0.98); }
.e2ee-seal {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 18px 0 0;
}

/* ===================================================================
 * Screens loop player (screens-player.js) — the former socialtimers-tv
 * site's render surface, absorbed on the merge. Everything is scr-*
 * (the dashboard owns .stage/.weather-body/.brand-mark). The stage is
 * sized by JS to the largest 16:9 rect in the viewport so the slides'
 * normalized layout coordinates map 1:1 onto pixels.
 * =================================================================== */
/* position:relative is load-bearing: it is the containing block for the
   absolutely positioned #scr-stage that layoutStage() places with left/top.
   The absolute stage is also what fixed the old bug (a margin-top on an
   in-flow stage collapsed through the player, moved the player itself down
   and made the document taller than the screen). overflow:hidden is only a
   backstop that clips the stage if it ever lands past the edge. */
.scr-player { position: relative; overflow: hidden; background: #000; }

/* Sized and placed (left/top) in px by layoutStage(). */
.scr-stage {
  position: absolute;
  left: 0;
  top: 0;
  background: #000;
  overflow: hidden;
}

.scr-slide {
  z-index: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  /* The buffer that is not on screen must cost nothing: once its fade-out
     ends it becomes visibility:hidden (no paint, no composited layer kept
     for a transparent full-screen image). The delayed visibility transition
     keeps it painted for the whole 0.8 s cross-fade; .visible lifts the
     delay so the incoming buffer appears at once and fades in. */
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}
.scr-slide.visible { opacity: 1; visibility: visible; transition-delay: 0s; }
.scr-slide-img { width: 100%; height: 100%; object-fit: cover; }

/* One filter per background buffer: above its image, below all content.
   It shares the buffer's transition and cannot cover the text/QR layer. */
.scr-background-overlay {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
}

/* Composer overlays: one absolutely-positioned box per layout item (title,
   date, description…), geometry/colors/font applied inline by the player. */
.scr-overlays {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.scr-overlay-item {
  position: absolute;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* Each box is a fixed-size island: layout/paint containment keeps the
     per-second countdown tick, a marquee frame or a late photo from
     invalidating anything beyond its own box. The fit search reads the
     inner span's scroll metrics, which containment does not change. */
  contain: layout paint;
  line-height: 1.1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.54);
  /* Wrap like the composer: at spaces only — an unbreakable word overflows
     during the fit search (detected via scrollWidth) instead of splitting. */
  white-space: pre-wrap;
}
.scr-overlay-item > span { width: 100%; }
/* moon_phase overlay (renderMoonOverlay): a 340px block — disc + text column —
   positioned absolutely inside the item box and scaled by transform (origin
   top-left) into the box, like the UF presentation. Sizes are the editor's
   base units; only the transform changes per stage. */
.scr-moon { position: absolute; width: 340px; display: flex; align-items: center; -webkit-transform-origin: 0 0; transform-origin: 0 0; white-space: normal; line-height: 1.2; }
.scr-moon-disc { width: 72px; height: 72px; margin-right: 14px; flex: 0 0 auto; }
.scr-moon-disc svg { display: block; width: 72px; height: 72px; }
.scr-moon-text { min-width: 0; flex: 1 1 auto; }
.scr-moon-title { font-size: 13px; font-weight: 600; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-moon-name { font-size: 22px; font-weight: 700; line-height: 1.15; }
.scr-moon-meta { font-size: 14px; font-weight: 600; opacity: 0.8; margin-top: 2px; }

/* Live QR overlay: positioned/sized by the player from the slide's layout.
   White card behind the code, like the composer preview. */
.scr-qr {
  position: absolute;
  background: #fff;
  border-radius: 6%;
  padding: 1.2%;
  /* La tarjeta ES la caja del layout (el padding va por dentro), como en el
     editor; sin esto crecía 2·padding más allá del rect del slide. */
  box-sizing: border-box;
  z-index: 3;
}

/* Event/group info: bottom-left placard (fallback for layout-less slides). */
.scr-info {
  position: absolute;
  left: 2.5%;
  bottom: 3.5%;
  max-width: 55%;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 14px;
  padding: calc(1.4 * var(--vmin)) calc(2.2 * var(--vmin));
  z-index: 2;
}
.scr-info-name {
  font-size: clamp(18px, calc(3.4 * var(--vmin)), 40px);
  font-weight: 700;
  line-height: 1.15;
}
.scr-info-sub {
  margin-top: calc(0.4 * var(--vmin));
  font-size: clamp(13px, calc(2.2 * var(--vmin)), 26px);
  color: var(--muted);
}

/* Weather element: the composer's layout item (id "weather") re-rendered at
   its own geometry/style — icon + event-hour temperature, like the editor.
   Geometry, colors and font come inline from the player; this only pins the
   box model shared with .scr-overlay-item. */
.scr-weather {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  contain: layout paint;
}
.scr-weather-body {
  white-space: nowrap;
  display: inline-block;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.54);
}
/* The icon is inline SVG in currentColor, sized in em so the fit search's
   font-size drives it; the slight negative offset seats it on the text
   baseline (the editor centers icon + text on one row). */
.scr-weather-body svg {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  margin-right: 0.18em;
}

/* Countdown element: the composer's layout item (id "countdown") re-rendered
   at its own geometry/style and ticked LIVE every second from the slide's
   event_date. Same box model as the text overlays — pre-wrap keeps the
   two-line formats ("3 days\n5 hours"). */
.scr-countdown {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  /* Ticks every second under 24 h: containment scopes that repaint. */
  contain: layout paint;
  line-height: 1.1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.54);
  white-space: pre-wrap;
}
.scr-countdown-body { width: 100%; }

.scr-close {
  display: none;
  position: absolute;
  top: 32px;
  right: 32px; /* overscan margin */
  z-index: 4;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--danger);
  color: var(--on-danger);
  font-size: 28px;
  cursor: pointer;
  opacity: 1;
}
.scr-close:hover { opacity: 1; background: var(--danger); color: var(--on-danger); }

/* Full HD fallback; layoutStage scales type, margins and shadow with the
   16:9 stage to match the reserved corner in the Flutter editor. */
.scr-brand-mark {
  position: absolute;
  bottom: 32px;
  right: 32px; /* overscan margin */
  z-index: 2;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Task picker: task and assignee are separate, read-only columns. The
   assignee column hugs the right edge, as wide as its longest label (JS sets
   that shared width, see sizeTaskAssigneeColumn) and never over 40% of the
   row, so the task text keeps the rest. Names clip with an ellipsis; the
   "Unassigned" label instead shrinks its font to fit the cell whole
   (fitTaskAssigneeLabels). */
.task-picker-row .checklist-text { flex: 1 1 0; }
.task-picker-assignee {
  display: flex;
  align-items: center;
  gap: 0.45em;
  flex: 0 0 auto;
  max-width: 40%;
  min-width: 0;
  font-size: 0.75em;
  color: var(--muted);
}
.task-picker-assignee .avatar {
  flex: 0 0 auto;
  width: 2em !important;
  height: 2em !important;
  font-size: 0.65em !important;
  border-radius: 50%;
}
.task-picker-assignee > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-picker-assignee.unassigned { font-style: italic; white-space: nowrap; }

/* A disabled cast destination still explains itself on click or keyboard. */
.widget-card.cast-scope-locked { opacity: 0.55; cursor: help; }
.cast-scope-tooltip {
  position: fixed; z-index: 10000; max-width: 380px; padding: 12px 16px;
  background: var(--panel); color: var(--fg); border: 1px solid var(--stroke);
  border-radius: 8px; font: 16px/1.4 sans-serif; pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* UF: one primary amount; optional details stay behind a remote-friendly button. */
.uf-view { color: inherit; }
.uf-date, .uf-note { opacity: .72; font-size: .8em; line-height: 1.45; margin: 6px 0; }
.uf-title { font-size: 1.05em; font-weight: 600; margin-bottom: 12px; overflow-wrap: break-word; }
.uf-total { font-weight: 700; font-size: 1.65em; line-height: 1.2; margin: 8px 0; }
.uf-secondary-total { font-weight: 600; font-size: 1.1em; }
.uf-reference { font-size: .75em; font-weight: 600; margin-top: 8px; }
.uf-next { border-top: 1px solid currentColor; margin-top: 16px; padding-top: 12px; }
.uf-action { color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 8px; padding: 10px 16px; font: inherit; font-size: .8em; margin: 12px 8px 0 0; cursor: pointer; }
.uf-action:focus { outline: 3px solid currentColor; outline-offset: 3px; }
.uf-panel {
  box-sizing: border-box; width: 100%; height: 100%; overflow: auto;
  padding: 32px; font-size: 28px; text-align: center;
  display: flex; flex-direction: column;
}
.uf-panel > * { flex-shrink: 0; }
/* Auto margins center short views and leave overflowing details scrollable. */
.uf-panel > :first-child { margin-top: auto; }
.uf-panel > :last-child { margin-bottom: auto; }
.uf-panel > .uf-action { align-self: center; margin-left: 0; margin-right: 0; }
.widget-card .uf-total { font-size: 1.15em; }
/* Passive Screens layout mirrors UFView(presentationOnly) in the editor. */
.scr-overlay-item .uf-presentation { position: absolute; width: 340px; transform-origin: left top; font-size: 14px; line-height: 1.2; }
.uf-presentation .uf-title { display: flex; align-items: flex-start; font-size: 14px; line-height: 1.2; min-height: 18px; margin: 0 0 12px; }
.uf-presentation .uf-title-text { flex: 1; min-width: 0; }
.uf-presentation .uf-icon { display: block; width: 18px; height: 18px; margin-right: 8px; flex-shrink: 0; opacity: .68; }
.uf-presentation .uf-icon svg { display: block; width: 100%; height: 100%; }
.uf-presentation .uf-date, .uf-presentation .uf-note { font-size: 12px; line-height: 1.4; opacity: .68; margin: 0; }
.uf-presentation .uf-date { margin-bottom: 8px; }
.uf-presentation .uf-total { font-size: 28px; line-height: 1.15; margin: 0 0 6px; overflow-wrap: break-word; }
.uf-presentation .uf-reference { font-size: 11px; line-height: 1.2; margin: 0 0 6px; }

/* Ambient effects are bounded, inert and below every content overlay. */
.scr-ambient {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Cross-origin input cannot bubble to the lock. Known embeds keep native
   browsing/player UI; any unclassified frame stays protected. */
.remote-exclusive iframe:not([data-remote-local="1"]) { pointer-events: none; }

/* Quantity Picker shares RSVP surfaces, typography and participant chips. */
.quantity-wrap { min-height: 0; justify-content: flex-start; }
/* Auto margins center short content and collapse to zero for scrollable lists. */
.quantity-wrap .rsvp-header { margin-top: auto; }
.quantity-list { margin-bottom: auto; }
.quantity-row { border-left-color: var(--accent); flex: 0 0 auto; }
.quantity-head { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.quantity-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.quantity-head .rsvp-label { white-space: normal; overflow-wrap: anywhere; }
.quantity-tally { display: flex; align-items: baseline; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.quantity-caption, .quantity-empty, .quantity-chevron { color: var(--muted); font-size: 15px; }
.quantity-chevron { margin-left: 4px; }
.quantity-head[aria-expanded="false"] .quantity-chevron { transform: rotate(-90deg); }
.quantity-voter { max-width: 100%; min-width: 0; }
.quantity-voter .rsvp-voter-name { min-width: 0; overflow-wrap: anywhere; }
.quantity-amount { color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.quantity-wrap .rsvp-header, .quantity-wrap .rsvp-desc, .quantity-list { flex: 0 0 auto; }
.quantity-wrap .rsvp-title, .quantity-wrap .rsvp-desc { min-width: 0; overflow-wrap: anywhere; }

/* Fixed white paper and ink are whiteboard content, matching AppPalette. */
#main-area .whiteboard-panel { position: absolute; top: 56px; right: 20px; bottom: 20px; left: 20px; overflow: hidden; }
.whiteboard-title { height: 32px; line-height: 32px; font-size: 24px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whiteboard-display { position: absolute; top: 42px; left: 0; right: 0; bottom: 0; overflow: hidden; }
.whiteboard-canvas { position: absolute; display: block; border-radius: 8px; }
.whiteboard-laser { position: absolute; z-index: 1; width: 20px; height: 20px; margin: -12px 0 0 -12px; border: 2px solid #fff; border-radius: 50%; background: #e00000; box-sizing: content-box; pointer-events: none; transition: left 120ms linear, top 120ms linear; }
.whiteboard-error { position: absolute; top: 50%; left: 0; width: 100%; text-align: center; }

/* Live editing reserves the complete stage width. Tall boards stay proportional
   and can scroll vertically rather than being shrunk to the stage height. */
.stage.whiteboard-editing > #widgets,
.stage.whiteboard-editing > .widgets-col { display: none !important; }
.stage.whiteboard-editing .whiteboard-display { overflow-x: hidden; overflow-y: auto; }
.stage.whiteboard-editing > .brand-mark { right: 20px !important; }
