/* CIP participant UI — design system.
   Editorial precision: a cool paper canvas, white surfaces on hairlines, one ultramarine accent,
   Fraunces for headlines and the big numbers, Geist for the interface, Geist Mono for data.
   Fonts are served locally; licences in wwwroot/fonts/OFL-*.txt. */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-latin.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-italic-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/geist-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/geist-mono-latin.woff2) format('woff2'); }
/* The Classic palettes' faces (D-47); licences in wwwroot/fonts/OFL-*.txt. */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/manrope-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/instrument-serif-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/instrument-serif-italic-latin.woff2) format('woff2'); }

:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display-weight: 400;
  --display-em-weight: 300;
  --display-tracking: -0.02em;

  --canvas: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-3: #EEF0F3;
  --ink: #0F1219;
  --ink-2: #363B47;
  --muted: #6B7280;
  --faint: #9AA1AD;
  --hairline: rgba(15, 18, 25, 0.08);
  --hairline-2: rgba(15, 18, 25, 0.14);

  --accent: #2E4BFF;
  --accent-ink: #1B32D6;
  --accent-soft: #E9ECFF;
  --accent-glow: rgba(46, 75, 255, 0.32);
  --on-accent: #FFFFFF;

  --night: #0F1219;
  --night-2: #171B25;
  --night-text: #F5F6F8;
  --night-muted: #A5ACB8;
  --night-faint: #6E7684;
  --night-hair: rgba(255, 255, 255, 0.10);
  --night-hair-2: rgba(255, 255, 255, 0.14);
  --night-good: #8FE3B4;
  --night-good-soft: rgba(143, 227, 180, 0.16);

  --good: #0B7A4E; --good-soft: #DDF5E6;
  --bad: #D93025; --bad-soft: #FDE7E5;
  --amber: #F2B705; --amber-soft: #FFF4CC; --amber-ink: #7A5A00;
  --violet: #7C5CFF; --violet-soft: #EEEAFF; --violet-ink: #4A2ECC;
  --green: #17A362; --green-soft: #DDF5E6; --green-ink: #0B5A3A;
  --grey: #9AA1AD; --grey-soft: #EEF0F3; --grey-ink: #5B6470;

  /* Translucent bars, the knob of a control, and the few decorative colours a theme must also set. */
  --glass-bar: rgba(243, 244, 246, 0.78);
  --glass: rgba(255, 255, 255, 0.82);
  --knob: #FFFFFF;
  --spot: rgba(46, 75, 255, 0.07);
  --orb-2: #E7E2FF;
  --orb-3: #FFF1CC;

  --r-lg: 24px; --r-md: 16px; --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15, 18, 25, 0.04), 0 0 0 1px var(--hairline);
  --shadow-2: 0 12px 32px -12px rgba(15, 18, 25, 0.18), 0 0 0 1px var(--hairline);
  --shadow-3: 0 24px 64px -16px rgba(15, 18, 25, 0.28), 0 0 0 1px var(--hairline);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font: 400 15px/1.5 var(--font-ui);
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Type */
.display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.02; font-optical-sizing: auto; }
.display em { font-style: italic; font-weight: var(--display-em-weight); }
h1.display { font-size: clamp(38px, 4.2vw, 58px); text-wrap: balance; }
h2.display { font-size: clamp(26px, 2.4vw, 34px); }
.eyebrow { font: 500 11px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.eyebrow.accent { color: var(--accent); }
/* The line that opens a page (period, dates, standing) reads at 16pt; the small form stays for labels inside cards. */
.page-head .eyebrow, .hero .eyebrow { font-size: 16pt; letter-spacing: 0.08em; line-height: 1.25; }
.lede { font-size: 16px; color: var(--muted); max-width: 60ch; }
.num { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-variant-numeric: lining-nums tabular-nums; font-optical-sizing: auto; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Rolling digits: each digit is a column of 0–9 that slides into place. */
.roll { display: inline-flex; height: 1.15em; line-height: 1.15; overflow: hidden; vertical-align: bottom; white-space: nowrap; }
.roll > span { display: block; height: 1.15em; }
.roll .dg { display: flex; flex-direction: column; align-items: center; transform: translateY(calc(var(--d, 0) * -1.15em)); transition: transform 0.9s var(--ease-out), width 0.9s var(--ease-out); transition-delay: var(--dl, 0s); }
.roll .dg span { display: block; height: 1.15em; flex: none; }

/* Entrance: children with --i rise in sequence. */
.reveal > * { animation: rise 0.7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body.leaving .shell { animation: leave 0.2s ease-in both; }
@keyframes leave { to { opacity: 0; transform: translateY(-6px); } }

/* Cross-document page transitions where the browser supports them. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 200ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 420ms var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
.topbar { view-transition-name: topbar; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 40px; }
main.container { flex: 1; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px;
  background: var(--glass-bar);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.topbar .container { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 24px; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.venue { font-size: 13px; font-weight: 500; color: var(--muted); padding-left: 20px; border-left: 1px solid var(--hairline-2); white-space: nowrap; }
.topbar .grow { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--night); color: var(--night-text); display: grid; place-items: center; font: 600 12px var(--font-ui); letter-spacing: 0.02em; }

/* Timeline of weeks */
.timeline { display: flex; align-items: center; gap: 14px; }
.timeline .segs { display: flex; gap: 4px; }
.tl-seg { position: relative; display: block; width: 18px; height: 22px; padding: 8px 0; }
.tl-seg > span { display: block; height: 6px; border-radius: 3px; background: var(--hairline-2); transition: background 0.3s, transform 0.3s var(--spring); }
.tl-seg.done > span { background: var(--ink); }
.tl-seg.now > span { background: var(--accent); animation: pulse-seg 1.8s ease-in-out infinite; }
.tl-seg.past-review > span { background: var(--accent); }
a.tl-seg:hover > span { transform: scaleY(1.6); }
@keyframes pulse-seg { 50% { opacity: 0.45; } }
.tl-label { font: 500 13px var(--font-ui); color: var(--ink); white-space: nowrap; }
.tl-label em { font-style: normal; color: var(--faint); }

/* Tooltips from data-tip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translate(-50%, 4px) scale(0.96); transform-origin: bottom center;
  background: var(--night); color: var(--night-text); font: 500 12px/1 var(--font-ui);
  padding: 7px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.28s var(--spring); z-index: 60;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 40px; padding: 44px 0 28px; }
.page-head .grow { flex: 1; }
.page-head .title { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.page-head .aside { display: flex; gap: 12px; }

/* ---------- Cards ---------- */
.card { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.spot::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.card.spot:hover::after { opacity: 1; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 22px 24px 0; }
.card-head .grow { flex: 1; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--faint); }
.card-body { padding: 20px 24px 24px; }

.tile { padding: 18px 22px; min-width: 176px; display: flex; flex-direction: column; gap: 8px; }
.tile .k { font-size: 12px; font-weight: 500; color: var(--muted); }
.tile .v { font-size: 30px; }
.tile .d { display: flex; align-items: center; gap: 8px; }

.delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.delta.up { background: var(--good-soft); color: var(--good); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--grey-soft); color: var(--grey-ink); }
.delta svg { width: 12px; height: 12px; }
.note { font-size: 12px; color: var(--faint); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 600 11px/1.4 var(--font-ui); letter-spacing: 0.02em; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Tones: the fixed palette engines colour views with (D-34). Each sets --tone, --tone-soft and --tone-ink. */
.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); --tone-ink: var(--amber-ink); --on-tone: #1F1A05; }
.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); --tone-ink: var(--green-ink); --on-tone: #FFFFFF; }
.tone-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); --tone-ink: var(--violet-ink); --on-tone: #FFFFFF; }
.tone-grey { --tone: var(--grey); --tone-soft: var(--grey-soft); --tone-ink: var(--grey-ink); --on-tone: #FFFFFF; }
.badge.tone-amber, .badge.tone-green, .badge.tone-violet, .badge.tone-grey { background: var(--tone-soft); color: var(--tone-ink); }
.badge.off { background: var(--grey-soft); color: var(--grey-ink); }
.badge.off::before { display: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform 0.25s var(--spring), box-shadow 0.25s, background 0.2s, color 0.2s; overflow: hidden;
  transform: translate(var(--tx, 0), var(--ty, 0));
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 0.3s var(--ease-out); }
.btn.lg { height: 52px; padding: 0 26px; font-size: 15px; border-radius: 14px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -8px var(--accent-glow), 0 0 0 1px rgba(27, 50, 214, 0.2) inset; }
.btn-primary:hover { background: var(--accent-ink); color: var(--on-accent); box-shadow: 0 14px 28px -10px var(--accent-glow); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%); transform: translateX(-130%); transition: transform 0.9s var(--ease-out); }
.btn-primary:hover::after { transform: translateX(130%); }
.btn-primary.busy { pointer-events: none; }
.btn-primary.busy::after { animation: sheen 1.1s linear infinite; }
@keyframes sheen { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.btn-secondary:hover { color: var(--ink); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-3); }
.btn-night { background: var(--night); color: var(--night-text); }
.btn-night:hover { background: var(--night-2); color: var(--night-text); }
.btn-night:hover svg { transform: translateX(3px); }
.btn-light { background: var(--night-text); color: var(--night); }
.btn-light:hover { background: var(--night-text); color: var(--night); filter: brightness(1.04); }
.btn-outline-light { color: var(--night-text); box-shadow: 0 0 0 1px var(--night-hair) inset; }
.btn-outline-light:hover { color: var(--night-text); background: var(--night-hair); }

/* ---------- Controls ---------- */
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--hairline-2); transition: background 0.3s var(--ease-out); flex: none; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px rgba(15, 18, 25, 0.3); transition: transform 0.4s var(--spring), width 0.15s; }
.switch:active .knob { width: 24px; }
.switch[aria-pressed="true"] { background: var(--accent); }
.switch[aria-pressed="true"] .knob { transform: translateX(18px); }
.switch[aria-pressed="true"]:active .knob { transform: translateX(14px); }

.fixed { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; font: 500 14px var(--font-mono); color: var(--muted); }
.stepper { display: inline-flex; align-items: center; height: 36px; border-radius: 10px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline) inset; }
.stepper button { width: 32px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; transition: color 0.2s, background 0.2s, transform 0.2s var(--spring); }
.stepper button:hover { color: var(--ink); background: var(--surface-3); }
.stepper button:active { transform: scale(0.9); }
.stepper button svg { width: 14px; height: 14px; }
.stepper .val { min-width: 66px; text-align: center; font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.stepper.wobble { animation: wobble 0.35s ease; }
@keyframes wobble { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.seg { position: relative; display: inline-flex; height: 36px; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline) inset; }
.seg button { position: relative; z-index: 1; min-width: 32px; padding: 0 10px; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; transition: color 0.2s; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .thumb { position: absolute; top: 3px; left: 3px; width: 32px; height: 30px; border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 18, 25, 0.12), 0 0 0 1px var(--hairline); transition: left 0.4s var(--spring), width 0.4s var(--spring); }
.seg.disabled, .stepper.disabled { opacity: 0.5; }

/* Budget dial */
.dial { position: relative; display: grid; place-items: center; padding: 6px 0 0; }
.dial svg { width: 200px; height: 200px; overflow: visible; touch-action: none; cursor: grab; }
.dial svg:active { cursor: grabbing; }
.dial .track { fill: none; stroke: var(--surface-3); stroke-width: 12; stroke-linecap: round; }
.dial .prog { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.35s var(--ease-out), stroke 0.35s; }
.dial.warn .prog { stroke: var(--amber); }
.dial .knob-g { transition: transform 0.35s var(--ease-out); transform-origin: 100px 100px; }
.dial .knob { fill: var(--knob); stroke: var(--hairline-2); stroke-width: 1; filter: drop-shadow(0 2px 4px rgba(15, 18, 25, 0.25)); transition: r 0.2s; }
.dial svg:active .knob { r: 12; }
.dial .readout { position: absolute; top: 52%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.dial .readout .v { font-size: 34px; }
.dial .readout .l { font-size: 12px; color: var(--muted); }
.dial .ends { display: flex; justify-content: space-between; width: 200px; margin-top: -18px; font: 500 11px var(--font-mono); color: var(--faint); }
.dial:focus-within svg { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 50%; }
.dial-note { min-height: 18px; text-align: center; font-size: 12px; color: var(--muted); max-width: 260px; }

/* ---------- Decisions ---------- */
.decide { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; padding-bottom: 150px; }
.menu-table { padding: 8px 0 8px; }
.trow, .thead { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 4), max-content); gap: 20px; align-items: center; padding: 0 24px; }
.thead { height: 40px; font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--hairline); }
.thead > span:not(:first-child), .trow > .c { justify-self: center; }
/* The header and the rows of a table share one grid, so each column label sits over its controls. The rows stay
   their own elements for hover and dimming; subgrid lines them up with the header, and the gap is set once. */
.tbl { display: grid; gap: 0 20px; }
.tbl > .rows { display: contents; }
.tbl > .thead, .tbl .rows > .trow { grid-template-columns: subgrid; grid-column: 1 / -1; }
.menu-table .tbl { grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 4), max-content); }
.trow { min-height: 68px; border-bottom: 1px solid var(--hairline); transition: background 0.25s, opacity 0.35s; }
.rows > .trow:last-child { border-bottom: 0; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface-2); }
.trow.off .dish-name, .trow.off .dish-meta { color: var(--faint); }
.ctl.dim { opacity: 0.35; pointer-events: none; }
.ctl { position: relative; }
.dish { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dish .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; transition: background 0.3s; }
.dish .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dish-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dish-name .no { font: 500 10px var(--font-mono); color: var(--faint); margin-right: 8px; vertical-align: 1px; }
.dish-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dish-meta .sep { color: var(--hairline-2); }

.rail, .main-col { display: flex; flex-direction: column; gap: 16px; }
.channel { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--hairline); }
.channel:first-child { border-top: 0; padding-top: 0; }
.channel .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.channel .ico svg { width: 18px; height: 18px; }
.channel .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.channel .name { font-weight: 600; font-size: 14px; }
.channel .desc { font-size: 12px; color: var(--muted); }
.channel .always { font: 500 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--good); }

/* Night card: event offer, hero */
.night { position: relative; overflow: hidden; background: var(--night); color: var(--night-text); border-radius: var(--r-lg); isolation: isolate; }
.night::before { content: ''; position: absolute; inset: 0; background-image: var(--grain); opacity: 0.35; pointer-events: none; z-index: 1; mix-blend-mode: overlay; }
.night .orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.55; pointer-events: none; transition: transform 1s var(--ease-out), opacity 0.6s; }
.night .orb.a { width: 260px; height: 260px; right: -80px; top: -100px; background: var(--accent); }
.night .orb.b { width: 220px; height: 220px; left: -90px; bottom: -120px; background: var(--violet); opacity: 0.4; }
.night > .inner { position: relative; z-index: 2; }
.event { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.event .eyebrow { color: var(--night-muted); }
.event h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.12; letter-spacing: -0.015em; }
.event p { font-size: 14px; color: var(--night-muted); line-height: 1.55; }
.event .terms { display: flex; gap: 18px; padding-top: 4px; }
.event .terms div { display: flex; flex-direction: column; gap: 2px; }
.event .terms .k { font: 500 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--night-faint); }
.event .terms .v { font-size: 15px; font-weight: 500; }
.event .actions { display: flex; gap: 10px; padding-top: 6px; }
.event .actions .btn { flex: 1; }
.event .verdict { display: none; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--night-hair); font-size: 13px; font-weight: 500; }
.event .verdict svg { width: 20px; height: 20px; }
.event .verdict .check { fill: none; stroke: var(--night-good); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.event.accepted .verdict .check, .event.declined .verdict .check { animation: draw 0.6s 0.1s var(--ease-out) forwards; }
.event.declined .verdict .check { stroke: var(--night-muted); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.event.accepted .actions, .event.declined .actions { display: none; }
.event.accepted .verdict, .event.declined .verdict { display: flex; animation: rise 0.5s var(--ease-out) both; }
.event.accepted .orb.a { transform: scale(1.8); opacity: 0.7; }
.event.declined .orb { opacity: 0.15; }
.event .undo { margin-left: auto; color: var(--night-muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.event .undo:hover { color: var(--night-text); }
.event.shake { animation: wobble 0.35s ease; }

/* Dock */
.dock {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  width: min(1280px, calc(100% - 80px)); height: 72px; padding: 0 12px 0 22px; border-radius: 22px;
  background: var(--glass); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 12px;
  animation: dock-in 0.8s 0.25s var(--ease-out) both;
}
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 28px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dock .chips { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-3); font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background 0.25s, color 0.25s; }
.chip b { font-weight: 600; color: var(--ink); }
.chip.pop { animation: pop 0.35s var(--spring); }
@keyframes pop { 50% { transform: scale(1.06); } }
.chip.warn { background: var(--amber-soft); color: var(--amber-ink); cursor: pointer; }
.chip.warn::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: pulse-seg 1.4s infinite; }
.chip.ok { background: var(--good-soft); color: var(--good); }
.dock .sep { width: 1px; height: 28px; background: var(--hairline-2); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 112px; transform: translate(-50%, 14px); opacity: 0; z-index: 50; padding: 11px 16px; border-radius: 12px; background: var(--night); color: var(--night-text); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-3); transition: opacity 0.22s, transform 0.4s var(--spring); pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Floating tooltip card (matrix) */
.tipcard { position: fixed; z-index: 70; pointer-events: none; opacity: 0; transform: translate(-50%, 6px) scale(0.96); transition: opacity 0.15s, transform 0.25s var(--spring); background: var(--night); color: var(--night-text); padding: 10px 12px; border-radius: 10px; font-size: 12px; box-shadow: var(--shadow-3); min-width: 150px; }
.tipcard.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.tipcard .t { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tipcard .r { display: flex; justify-content: space-between; gap: 16px; color: var(--night-muted); }
.tipcard .r b { color: var(--night-text); font-weight: 500; font-family: var(--font-mono); }

/* ---------- Results ---------- */
.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ledger .tile { min-width: 0; padding: 22px 24px; }
.ledger .tile .v { font-size: 40px; }
.ledger .tile.night { box-shadow: none; }
.ledger .tile.night .k { color: var(--night-muted); }
.ledger .tile.night .delta.up { background: var(--night-good-soft); color: var(--night-good); }
.ledger .tile.night .note { color: var(--night-faint); }
.analysis { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; padding-top: 16px; }

.tabs { position: relative; display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline) inset; }
.tabs button { position: relative; z-index: 1; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--muted); transition: color 0.2s; }
.tabs button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.tabs .thumb { position: absolute; top: 3px; height: 30px; border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 18, 25, 0.12), 0 0 0 1px var(--hairline); transition: left 0.4s var(--spring), width 0.4s var(--spring); }

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--hairline); }
.chart .grid line.zero { stroke: var(--hairline-2); }
.chart .axis text { font: 500 11px var(--font-mono); fill: var(--faint); }
.chart .axis text.on { fill: var(--ink); }
.chart .area { fill: url(#areaGrad); opacity: 0; transition: opacity 0.8s 0.4s, d 0.7s var(--ease-out); }
.chart.ready .area { opacity: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: d 0.7s var(--ease-out); }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; r: 4.5; transition: r 0.2s, cy 0.6s var(--ease-out), opacity 0.3s; }
.chart .pt.on { r: 7; }
.chart .xhair { stroke: var(--hairline-2); stroke-dasharray: 3 4; transition: opacity 0.2s; }
.chart .tipbox rect { fill: var(--night); }
.chart .tipbox text { font: 600 12px var(--font-ui); fill: var(--night-text); }
.chart .tipbox { transition: transform 0.3s var(--ease-out), opacity 0.2s; }
.chart .hit { fill: transparent; cursor: crosshair; }

.matrix-wrap { display: flex; flex-direction: column; gap: 12px; }
.matrix { position: relative; aspect-ratio: 1.18; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; }
.quad { border-radius: 14px; padding: 10px 12px; font: 500 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; transition: background 0.3s; display: flex; flex-direction: column; justify-content: space-between; }
.quad .count { font: 400 22px var(--font-display); letter-spacing: -0.02em; text-transform: none; }
.quad.tone-amber, .quad.tone-green, .quad.tone-violet, .quad.tone-grey { background: var(--tone-soft); color: var(--tone-ink); }
.quad.hot { filter: brightness(0.97); }
.mdot { position: absolute; width: 20px; height: 20px; margin: -10px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(15, 18, 25, 0.25); cursor: default; transition: left 1s var(--spring), top 1s var(--spring), transform 0.2s var(--spring); z-index: 2; }
.mdot:hover { transform: scale(1.35); z-index: 3; }
.mdot.lead { width: 24px; height: 24px; margin: -12px; }
.mdot .no { font: 600 9px/1 var(--font-mono); letter-spacing: -0.02em; color: var(--on-tone, #fff); pointer-events: none; }
.mdot.lead .no { font-size: 10px; }
.mdot .lbl { position: absolute; top: 50%; left: calc(100% + 8px); transform: translateY(-50%); font: 600 11px var(--font-ui); color: var(--ink); white-space: nowrap; pointer-events: none; }
/* app.js places each label on the first side with room; one that fits nowhere shows on hover. */
.mdot[data-lbl="left"] .lbl { left: auto; right: calc(100% + 8px); }
.mdot[data-lbl="below"] .lbl { top: calc(100% + 5px); left: 50%; transform: translateX(-50%); }
.mdot[data-lbl="above"] .lbl { top: auto; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); }
.mdot[data-lbl="none"] .lbl { opacity: 0; }
.mdot[data-lbl="none"]:hover .lbl, .mdot[data-lbl="none"]:focus-visible .lbl { opacity: 1; z-index: 5; background: var(--surface); padding: 2px 6px; border-radius: 6px; box-shadow: var(--shadow-1); }
.mdot.was { border-style: dashed; border-color: var(--faint); background: transparent !important; box-shadow: none; z-index: 1; width: 12px; height: 12px; margin: -6px; }
.mdot.was .lbl { color: var(--faint); font-weight: 500; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.trail line { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -16; } }
.axis-l { display: flex; justify-content: space-between; font: 500 10px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

.dishes { padding-bottom: 8px; }
.dishes .tbl { grid-template-columns: minmax(0, 1.4fr) repeat(var(--cols, 6), max-content); }
.dishes .trow { min-height: 60px; }
.dishes .trow > .c { justify-self: end; font: 500 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.dishes .thead > span:not(:first-child) { justify-self: end; }
.dishes .trow > .c.badge-cell, .dishes .thead > span.badge-col { justify-self: start; }

/* Decisions in effect for a played period (P-06) */
.decisions { padding-bottom: 8px; scroll-margin-top: 88px; }
.decisions .dtable + .dtable { border-top: 1px solid var(--hairline); }
/* Each row is its own grid, so value columns get a fixed width to line up down the table. */
.decisions .thead, .decisions .trow { grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 4), 96px); }
.decisions .trow { min-height: 52px; }
.decisions .trow > .c { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 500 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.decisions .changed { color: var(--accent); font-weight: 600; }
.decisions .was { font: 400 10.5px var(--font-mono); color: var(--faint); }
.dpanels { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--hairline); }
.dpanel { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); min-width: 180px; }
.dpanel .k { font: 500 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.dpanel .v { font-weight: 600; }
.spark { width: 100px; height: 28px; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--accent); }
.move { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-ui); color: var(--muted); }
.move.up { color: var(--good); } .move.down { color: var(--bad); }
.move svg { width: 12px; height: 12px; }

.actions { display: flex; align-items: center; gap: 12px; padding: 20px 0 48px; }
.actions .grow { flex: 1; }

/* ---------- Scorecard ---------- */
.hero { margin-top: 28px; padding: 56px 56px 48px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: end; }
.hero .orb.a { width: 520px; height: 520px; right: -140px; top: -220px; opacity: 0.5; }
.hero .orb.b { width: 420px; height: 420px; left: 30%; bottom: -300px; background: var(--violet); opacity: 0.35; }
.hero .eyebrow { color: var(--night-muted); }
.hero h1 { font-size: clamp(36px, 3.8vw, 52px); color: var(--night-text); margin-top: 14px; max-width: 14ch; }
.hero .lede { color: var(--night-muted); margin-top: 14px; }
.hero .score { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hero .score .v { font-size: clamp(88px, 10vw, 150px); line-height: 0.95; letter-spacing: -0.045em; }
.hero .score .u { font: 500 12px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--night-muted); }
.hero .parts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid var(--night-hair); }
.hero .part { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 14px; background: var(--night-hair); transition: background 0.25s; }
.hero .part:hover { background: var(--night-hair-2); }
.hero .part .k { font-size: 12px; color: var(--night-muted); }
.hero .part .v { font-size: 28px; }
.hero .fine { grid-column: 1 / -1; font-size: 12px; color: var(--night-faint); }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.final { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; padding-top: 16px; }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 180px; padding-top: 8px; }
.bar { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; height: calc(var(--h) * 100%); border-radius: 8px 8px 4px 4px; background: var(--accent-soft); transform-origin: bottom; animation: grow 0.9s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms); transition: background 0.25s; }
.bar.best i { background: var(--accent); }
.bar:hover i { background: var(--accent); }
.bar b { font: 500 10px var(--font-mono); color: var(--faint); }
@keyframes grow { from { transform: scaleY(0); } }
.bar[data-tip]::after { bottom: calc(100% + 2px); }

.lb { display: flex; flex-direction: column; gap: 8px; }
.lb-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); transition: transform 0.3s var(--ease-out), background 0.25s; overflow: hidden; }
.lb-row:hover { transform: translateX(4px); background: var(--surface-3); }
.lb-row .pos { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--hairline); display: grid; place-items: center; font: 400 17px var(--font-display); }
.lb-row .who { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--font-ui); color: #fff; }
.lb-row .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lb-row .name { font-weight: 600; font-size: 14px; }
.lb-row .desc { font-size: 12px; color: var(--muted); }
.lb-row .pts { font-size: 26px; }
.lb-row.past .name { color: inherit; text-decoration: none; }
.lb-row.past .name:hover { text-decoration: underline; }
.lb-row.past .note a { color: inherit; }
.lb-row .playing { font: 500 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.lb-row.me { background: var(--surface); }
.lb-row.me::before { content: ''; position: absolute; inset: -2px; border-radius: 16px; padding: 2px; background: conic-gradient(from var(--a), var(--accent), var(--violet), var(--amber), var(--accent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin-a 6s linear infinite; pointer-events: none; }
.lb-row.me .pos { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.lb-row.link, .trow.link { color: inherit; text-decoration: none; }
.trow.link:hover { background: var(--surface-2); }
.progress { display: block; width: min(220px, 100%); height: 5px; margin-top: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 3px; background: var(--accent); }

/* Facilitator view (PT-17): every game, and one game period by period. */
.games .thead, .games .trow { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 120px 150px 80px 64px; }
.games .trow > .c, .history .trow > .c { justify-self: end; font: 500 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.games .trow > .c:nth-child(2) { justify-self: start; font: 500 13px var(--font-ui); }
.games .thead > span:not(:first-child), .history .thead > span:not(:first-child) { justify-self: end; }
.games .thead > span:nth-child(2) { justify-self: start; }
.history .thead, .history .trow { grid-template-columns: minmax(0, 1fr) repeat(var(--kpis, 4), 110px) minmax(0, 1.2fr) 64px; }
.history .trow > .c.notes { justify-self: start; font: 400 12px var(--font-ui); color: var(--muted); }
.history .thead > span:nth-last-child(2) { justify-self: start; }
.pick.facilitator { background: var(--surface-2); }
@keyframes spin-a { to { --a: 360deg; } }

/* ---------- Sign in ---------- */
.auth { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 40px; overflow: hidden; }
.orbs { position: absolute; inset: 0; pointer-events: none; }
.orbs .o { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; animation: float 16s ease-in-out infinite alternate; }
.orbs .o1 { width: 560px; height: 560px; left: -140px; top: -160px; background: var(--accent-soft); }
.orbs .o2 { width: 480px; height: 480px; right: -120px; top: 10%; background: var(--orb-2); animation-duration: 20s; }
.orbs .o3 { width: 420px; height: 420px; left: 30%; bottom: -220px; background: var(--orb-3); animation-duration: 24s; }
@keyframes float { to { transform: translate(40px, 30px) scale(1.08); } }
.auth-wrap { position: relative; width: min(440px, 100%); display: flex; flex-direction: column; gap: 28px; }
.wordmark { display: flex; align-items: baseline; gap: 14px; }
.wordmark .m { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 44px; letter-spacing: -0.03em; line-height: 1; }
.wordmark .m span { display: inline-block; animation: rise 0.7s var(--ease-out) both; }
.wordmark .m span:nth-child(2) { animation-delay: 60ms; } .wordmark .m span:nth-child(3) { animation-delay: 120ms; }
.wordmark .t { font: 500 11px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.auth-card { padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-card h1 { font-size: 34px; }
.auth-card .lede { font-size: 14px; }
.auth-card .access { display: flex; flex-direction: column; gap: 16px; }
.auth-card .errors { margin: 0; }
.field { position: relative; }
.field input { width: 100%; height: 56px; padding: 22px 16px 6px; border-radius: 12px; border: 0; background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline) inset; font-size: 15px; transition: box-shadow 0.2s, background 0.2s; }
.field input:focus { outline: 0; background: var(--surface); box-shadow: 0 0 0 2px var(--accent) inset; }
.field label { position: absolute; left: 16px; top: 18px; font-size: 14px; color: var(--muted); pointer-events: none; transition: transform 0.25s var(--ease-out), color 0.2s; transform-origin: left top; }
.field input:focus + label, .field input:not(:placeholder-shown) + label { transform: translateY(-11px) scale(0.78); }
.field input:focus + label { color: var(--accent); }
.status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.status .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(11, 122, 78, 0.4); animation: pulse-ring 2s infinite; flex: none; }
@keyframes pulse-ring { 70% { box-shadow: 0 0 0 8px rgba(11, 122, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(11, 122, 78, 0); } }
.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; font-size: 12px; color: var(--faint); }
.auth-foot .meta { display: flex; flex-direction: column; gap: 4px; }
.auth-foot a { color: var(--muted); }

/* ---------- Error ---------- */
.error-page { padding: 80px 0; display: flex; flex-direction: column; gap: 20px; max-width: 560px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .decide, .analysis, .final, .hero { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .venue { display: none; }
}
@media (max-width: 820px) {
  .container { padding: 0 20px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .trow, .thead { gap: 10px; padding: 0 16px; }
  .tbl { column-gap: 10px; }
  /* Decision tables stack on a phone: each item becomes a block with its controls in a wrapped row, every control
     labelled from the column it came from, so nothing scrolls sideways. */
  .menu-table .tbl { display: block; }
  .menu-table .thead { display: none; }
  .menu-table .rows > .trow { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 14px 10px; padding: 14px 16px 16px; min-height: 0; align-items: end; }
  .menu-table .rows > .trow > .dish { grid-column: 1 / -1; }
  .menu-table .rows > .trow > .c { justify-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
  .menu-table .rows > .trow > .c:has(.seg) { grid-column: 1 / -1; }
  .menu-table .rows > .trow > .c::before { content: attr(data-label); font: 500 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
  .dishes .tbl { grid-template-columns: minmax(0, 1fr) 100px 70px 70px; }
  .dishes .thead > span:nth-child(n+5), .dishes .trow > .c:nth-child(n+5) { display: none; }
  .decisions .dtable, .games, .history { overflow-x: auto; }
  .games .thead, .games .trow, .history .thead, .history .trow { min-width: 700px; }
  .decisions .thead, .decisions .trow { grid-template-columns: minmax(120px, 1fr) repeat(var(--cols, 4), 76px); min-width: calc(152px + var(--cols, 4) * 86px); }
  .timeline .segs { display: none; }
  .dock { width: calc(100% - 32px); height: auto; padding: 12px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .roll .dg { transition: none; }
}

/* ---------- Decision form extras ---------- */
.errors { margin: 0 0 20px; padding: 16px 20px; border-radius: 14px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.errors ul { margin: 8px 0 0; padding-left: 18px; }
.notice { margin: 0 0 20px; padding: 16px 20px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.field-error { display: block; margin-top: 6px; font-size: 11px; color: var(--bad); text-align: center; max-width: 160px; }
.fields { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fields .ctl { display: flex; flex-direction: column; align-items: center; }
.channel .txt .name { font-size: 14px; }
.event .note { font-size: 12px; margin: 0; }

/* ---------- Picker ---------- */
.picker { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline) inset; font-weight: 600; font-size: 15px; text-align: left; transition: background 0.2s, transform 0.25s var(--spring), box-shadow 0.2s; }
.pick:hover { background: var(--accent-soft); transform: translateX(2px); }
.pick:active { transform: scale(0.98); }
.pick .who { width: 32px; height: 32px; border-radius: 50%; background: var(--night); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.pick svg { margin-left: auto; width: 18px; height: 18px; color: var(--faint); transition: transform 0.25s var(--ease-out), color 0.2s; }
.pick:hover svg { transform: translateX(3px); color: var(--accent); }
.switch-user { display: flex; justify-content: center; }
/* Choosing a simulation (D-38): the picker's rows, each with a line saying what it is. */
.auth-wrap.wide { width: min(540px, 100%); }
.pick.sim { height: auto; padding: 14px; }
.pick.sim .txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pick.sim .desc { font-weight: 400; font-size: 13px; line-height: 1.45; color: var(--muted); }
.pick.sim svg { flex: none; }
/* A leaderboard per simulation: the name above each board when there is more than one. */
.lb-group { margin: 8px 0 0; font: 500 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lb-group:first-child { margin-top: 0; }
.bar.neg i { background: var(--bad-soft); }
.avatar { text-decoration: none; }

/* ---------- Theme switch (D-47) ---------- */
/* Four swatches, one per palette below; app.js applies a pick and remembers it per browser. */
.theme-switch { display: flex; gap: 5px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); }
.theme-switch button { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--swatch-bg); box-shadow: 0 0 0 1px var(--hairline-2) inset; transition: transform 0.25s var(--spring), border-color 0.2s; }
.theme-switch button::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--swatch-accent); }
.theme-switch button:hover { transform: scale(1.12); }
.theme-switch button[aria-pressed="true"] { border-color: var(--ink); box-shadow: none; }
.theme-switch button:focus-visible { outline-offset: 1px; }
.theme-switch .sep { width: 1px; height: 18px; margin: 2px 2px; background: var(--hairline-2); }

/* ---------- Palettes (D-47) ----------
   The default above is Ultramarine. The three below are the Classic design's palettes, carried over as token
   overrides so every participant and facilitator page can be reviewed in each. _Layout sets data-theme on <html>. */
:root[data-theme="harbour"] {
  /* Harbour: warm ivory, copper accent, Instrument Serif display, Manrope interface. */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-em-weight: 400;
  --canvas: #F4EFE8; --surface: #FFFFFF; --surface-2: #F8F4EE; --surface-3: #EFE8DF;
  --ink: #1C1A17; --ink-2: #3D3832; --muted: #6B655C; --faint: #8C8579;
  --hairline: rgba(28, 26, 23, 0.07); --hairline-2: rgba(28, 26, 23, 0.14);
  --accent: #A8501F; --accent-ink: #8A3F16; --accent-soft: #FBEFE4; --accent-glow: rgba(168, 80, 31, 0.35); --on-accent: #FFFFFF;
  --night: #1C1A17; --night-2: #2A2622; --night-text: #F4EFE8; --night-muted: #C9BFB2; --night-faint: #9C948A;
  --night-hair: rgba(244, 239, 232, 0.12); --night-hair-2: rgba(244, 239, 232, 0.18);
  --night-good: #8FD3A6; --night-good-soft: rgba(143, 211, 166, 0.18);
  --good: #2F7A4D; --good-soft: #E1F1E6; --bad: #B23A3A; --bad-soft: #F7E3E3;
  --amber: #D9A441; --amber-soft: #F8EDD6; --amber-ink: #7A5410;
  --violet: #7A8FB5; --violet-soft: #EEF1F6; --violet-ink: #44557A;
  --green: #5E8C6A; --green-soft: #EEF3EF; --green-ink: #35563F;
  --grey: #C9BFB2; --grey-soft: #EFE8DF; --grey-ink: #6B655C;
  --glass-bar: rgba(244, 239, 232, 0.82); --glass: rgba(255, 255, 255, 0.86); --knob: #FFFFFF;
  --spot: rgba(168, 80, 31, 0.07); --orb-2: #F3E3D3; --orb-3: #F6E9C9;
  --shadow-1: 0 1px 2px rgba(28, 26, 23, 0.05), 0 0 0 1px var(--hairline);
  --shadow-2: 0 12px 32px -12px rgba(28, 26, 23, 0.18), 0 0 0 1px var(--hairline);
  --shadow-3: 0 24px 64px -16px rgba(28, 26, 23, 0.28), 0 0 0 1px var(--hairline);
}

:root[data-theme="graphite"] {
  /* Graphite: dark, electric blue, tight Manrope display. Inverted panels (offers, hero, toasts) turn light. */
  color-scheme: dark;
  --font-display: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 800; --display-em-weight: 600; --display-tracking: -0.035em;
  --canvas: #111315; --surface: #1B1E22; --surface-2: #22262B; --surface-3: #2C3239;
  --ink: #F2F3F5; --ink-2: #D8DBE0; --muted: #9AA0A8; --faint: #737A84;
  --hairline: rgba(255, 255, 255, 0.07); --hairline-2: rgba(255, 255, 255, 0.14);
  --accent: #4C8DFF; --accent-ink: #6FA3FF; --accent-soft: rgba(76, 141, 255, 0.16); --accent-glow: rgba(76, 141, 255, 0.35); --on-accent: #0B1220;
  --night: #F2F3F5; --night-2: #E4E7EB; --night-text: #111315; --night-muted: #4A5058; --night-faint: #737A84;
  --night-hair: rgba(17, 19, 21, 0.08); --night-hair-2: rgba(17, 19, 21, 0.12);
  --night-good: #1F7A4D; --night-good-soft: rgba(31, 122, 77, 0.14);
  --good: #4CC38A; --good-soft: rgba(76, 195, 138, 0.16); --bad: #F26D6D; --bad-soft: rgba(242, 109, 109, 0.16);
  --amber: #F5B94A; --amber-soft: rgba(245, 185, 74, 0.16); --amber-ink: #F5C86B;
  --violet: #8FA6D9; --violet-soft: rgba(143, 166, 217, 0.16); --violet-ink: #B3C3E8;
  --green: #6FB58A; --green-soft: rgba(111, 181, 138, 0.16); --green-ink: #9ED3B3;
  --grey: #5C636C; --grey-soft: rgba(255, 255, 255, 0.06); --grey-ink: #9AA0A8;
  --glass-bar: rgba(17, 19, 21, 0.82); --glass: rgba(27, 30, 34, 0.88); --knob: #F2F3F5;
  --spot: rgba(76, 141, 255, 0.08); --orb-2: #1E2436; --orb-3: #26231A;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--hairline);
  --shadow-2: 0 12px 32px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--hairline);
  --shadow-3: 0 24px 64px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--hairline);
}

:root[data-theme="fresh"] {
  /* Fresh: clean white, forest green, the system face throughout. */
  --font-display: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 700; --display-em-weight: 500; --display-tracking: -0.03em;
  --canvas: #F6F8F6; --surface: #FFFFFF; --surface-2: #F1F5F2; --surface-3: #E6ECE8;
  --ink: #0F1F17; --ink-2: #23392E; --muted: #5C6B63; --faint: #8A968F;
  --hairline: rgba(15, 31, 23, 0.07); --hairline-2: rgba(15, 31, 23, 0.14);
  --accent: #1F7A5C; --accent-ink: #165C45; --accent-soft: #E3F2EB; --accent-glow: rgba(31, 122, 92, 0.3); --on-accent: #FFFFFF;
  --night: #0F1F17; --night-2: #1A2D24; --night-text: #F6F8F6; --night-muted: #B8C6BE; --night-faint: #7F8F86;
  --night-hair: rgba(246, 248, 246, 0.1); --night-hair-2: rgba(246, 248, 246, 0.16);
  --night-good: #9BD6BE; --night-good-soft: rgba(155, 214, 190, 0.18);
  --good: #2E8B57; --good-soft: #DFF2E6; --bad: #C0392B; --bad-soft: #F8E3E0;
  --amber: #E0A72D; --amber-soft: #FAEFD6; --amber-ink: #7A5410;
  --violet: #5B7FBF; --violet-soft: #EAEFF7; --violet-ink: #3A5587;
  --green: #4E9E6D; --green-soft: #EAF3EE; --green-ink: #2E6A47;
  --grey: #B8C2BC; --grey-soft: #E6ECE8; --grey-ink: #5C6B63;
  --glass-bar: rgba(246, 248, 246, 0.82); --glass: rgba(255, 255, 255, 0.86); --knob: #FFFFFF;
  --spot: rgba(31, 122, 92, 0.07); --orb-2: #DCEBE3; --orb-3: #F6EDCF;
  --shadow-1: 0 1px 2px rgba(15, 31, 23, 0.05), 0 0 0 1px var(--hairline);
  --shadow-2: 0 12px 32px -12px rgba(15, 31, 23, 0.16), 0 0 0 1px var(--hairline);
  --shadow-3: 0 24px 64px -16px rgba(15, 31, 23, 0.26), 0 0 0 1px var(--hairline);
}

/* ---------- Explainer mode (D-48) ---------- */
/* Ctrl+E marks every element that carries the engine's explanation (data-xt/data-xb) and shows it on hover,
   focus or tap in a card. app.js owns the toggle, the card and the badge; the text comes from the server. */
.explain [data-xt] { outline: 1px dashed var(--accent); outline-offset: 3px; border-radius: 4px; cursor: help; }
.explain .trow[data-xt], .explain tr[data-xt] { outline-offset: -2px; }
.explain .c-table thead th[data-xt], .explain .thead > span[data-xt] { outline-offset: 1px; }
.xcard { position: fixed; z-index: 80; width: min(400px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 12px; background: var(--night); color: var(--night-text); font: 400 12.5px/1.5 var(--font-ui); box-shadow: var(--shadow-3); opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.2s var(--ease-out); pointer-events: none; }
.xcard.show { opacity: 1; transform: none; }
.xcard .t { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--night-text); }
.xcard p { margin: 0; color: var(--night-muted); }
.xcard p + p { margin-top: 6px; }
.xcard p.w { color: var(--night-text); font: 500 12px/1.5 var(--font-mono); }
.xbadge { position: fixed; right: 20px; top: 76px; z-index: 45; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 12px var(--font-ui); box-shadow: var(--shadow-2); cursor: pointer; }
.xbadge span { font: 500 11px var(--font-mono); opacity: 0.8; }
.xbadge[hidden] { display: none; }
.auth-foot .hint { color: var(--muted); }
.auth-foot .hint kbd { font: 500 10px var(--font-mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); }
