/* Layout + components. Uses ONLY tokens from theme.css (no literal colours here). */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: var(--weight-light);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-wrap: break-word;   /* long emails / handles wrap instead of widening the page at large text sizes */
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: var(--weight-semibold); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible, .tabbar :focus-visible { outline-color: var(--header-focus); }
::placeholder { color: var(--faint); opacity: 1; }
.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; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--highlight); color: var(--on-highlight); padding: 8px 12px; }
.skip:focus { left: 8px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-weight: var(--weight-regular); letter-spacing: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); color: var(--header-text);
  border-bottom: var(--border) solid var(--tabbar-line);
  padding-top: env(safe-area-inset-top);
}
.site-header__inner {
  min-height: var(--header-h); max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gutter); display: flex; align-items: center; gap: 0 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--header-text); text-decoration: none; min-width: 0; }
.brand__logo { height: 18px; width: auto; flex: none; }
.brand__event { font-size: 0.8125rem; color: var(--header-muted); border-left: var(--border) solid var(--line-strong); padding-left: 12px; font-weight: var(--weight-regular); }
.desk-nav { display: none; gap: 4px; margin-left: 24px; }
.desk-nav a {
  color: var(--header-muted); text-decoration: none; padding: 8px 12px; font-weight: var(--weight-regular); font-size: 0.9375rem;
  border-bottom: var(--border-strong) solid transparent; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.desk-nav a:hover { color: var(--header-text); }
.desk-nav a[aria-current="page"] { color: var(--header-text); border-bottom-color: var(--highlight); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; border: 0;
  color: var(--header-text); cursor: pointer; text-decoration: none; position: relative;
}
.icon-btn:hover { color: var(--highlight); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; background: var(--highlight); }
.sign-in-link { color: var(--header-text); text-decoration: none; font-weight: var(--weight-medium); padding: 10px 6px; font-size: 0.9375rem; }
.sign-in-link:hover { color: var(--highlight); }
.net-status { font-size: 0.75rem; color: var(--on-highlight); background: var(--highlight); padding: 2px 8px; display: none; font-weight: var(--weight-medium); }
html.offline .net-status { display: inline-block; }

/* ---------- tab bar (phone) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--tabbar-bg); border-top: var(--border) solid var(--tabbar-line);
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
}
.tabbar a {
  min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--header-muted); text-decoration: none; font-size: 0.6875rem; font-weight: var(--weight-medium); letter-spacing: 0.02em;
  position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--header-text); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 25%; right: 25%; height: 3px; background: var(--highlight); }

/* ---------- page ---------- */
main { max-width: var(--container); margin: 0 auto; padding: 20px var(--gutter) calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
h1, .h1 { overflow-wrap: break-word; font-weight: var(--weight-light); letter-spacing: var(--tracking-display); font-size: min(2.375rem, 11vw); line-height: 1.12; margin: 0; }
h2, .h2 { font-weight: var(--weight-light); letter-spacing: var(--tracking-tight); font-size: 1.625rem; line-height: 1.2; margin: 0 0 12px; }
h3, .h3 { font-weight: var(--weight-medium); font-size: 1.0625rem; line-height: 1.3; margin: 0 0 6px; letter-spacing: 0; }
.eyebrow { font-size: 0.8125rem; font-weight: var(--weight-medium); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 46ch; margin: 12px 0 0; }
.section { margin-top: 32px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--accent); --btn-fg: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 24px; border: var(--border-strong) solid var(--btn-bg);
  background: var(--btn-bg); color: var(--btn-fg); border-radius: var(--radius);
  font-weight: var(--weight-medium); font-size: 1.0625rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background var(--dur-slow) ease, color var(--dur-slow) ease, border-color var(--dur-slow) ease;
  overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent-hover); text-decoration: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn .arrow { display: inline-block; transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(6px); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 8px 14px; font-size: 0.9375rem; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text); border-color: var(--text); }
.btn--ghost:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--yellow { --btn-bg: var(--highlight); --btn-fg: var(--on-highlight); }
.btn--yellow:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--quiet { --btn-bg: transparent; --btn-fg: var(--link); border-color: transparent; padding-left: 4px; padding-right: 4px; }
.btn--quiet:hover { background: transparent; color: var(--text); border-color: transparent; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--bg); border-color: var(--danger); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.card--alt { background: var(--bg-alt); }
.card--accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.card--accent .muted { color: var(--on-accent); opacity: 0.85; }
.card--link { text-decoration: none; color: inherit; display: block; transition: border-color var(--dur) var(--ease); }
.card--link:hover { border-color: var(--text); }
.card__kicker { font-size: 0.75rem; font-weight: var(--weight-medium); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.stat { font-size: 2.5rem; line-height: 1; font-weight: var(--weight-light); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; }
.stat--sm { font-size: 1.75rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr)); border: var(--border) solid var(--line); }
.stats > div { padding: 16px; border-left: var(--border) solid var(--line); min-width: 0; }
.stats > div:first-child { border-left: 0; }
.stats .label { font-size: 0.75rem; color: var(--muted); font-weight: var(--weight-medium); letter-spacing: 0.06em; text-transform: uppercase; }
.stats .value { font-size: 1.75rem; font-weight: var(--weight-light); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; }

/* ---------- tags / badges ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: var(--border) solid var(--link); color: var(--link); border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: var(--weight-medium); line-height: 1.4; max-width: 100%; }
.tag--muted { border-color: var(--line-strong); color: var(--muted); }
.tag--sample { border-style: dashed; border-color: var(--sample-line); color: var(--text); }
.tag--live { background: var(--highlight); color: var(--on-highlight); border-color: var(--highlight); }
.tag--live::before { content: ""; width: 6px; height: 6px; background: currentColor; animation: blink 1.4s steps(2, start) infinite; }
.tag--danger { border-color: var(--danger); color: var(--danger); }
@keyframes blink { to { visibility: hidden; } }

/* ---------- notices ---------- */
.notice { border: var(--border) solid var(--notice-line); background: var(--notice-bg); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; }
.notice strong { font-weight: var(--weight-semibold); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.flash { padding: 12px 14px; border-left: 4px solid var(--highlight); background: var(--surface-2); margin-bottom: 16px; }
.flash--error { border-left-color: var(--danger); }
.error-text { color: var(--danger); font-size: 0.875rem; font-weight: var(--weight-regular); }
.field-error { margin: 6px 0 12px; font-size: 0.875rem; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 0.875rem; font-weight: var(--weight-medium); }
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 52px; padding: 12px 14px; background: var(--surface); color: var(--text);
  border: var(--border) solid var(--control-border); border-radius: var(--radius); font-weight: var(--weight-regular); font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.input:hover { border-color: var(--text); }
.input:focus { border-color: var(--text); outline: 3px solid var(--focus); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
input[type="file"].input { padding: 8px; font-size: 0.9375rem; cursor: pointer; }
input[type="file"].input::file-selector-button {
  min-height: 40px; margin-right: 12px; padding: 8px 14px; border: var(--border-strong) solid var(--text); border-radius: var(--radius);
  background: transparent; color: var(--text); font: inherit; font-weight: var(--weight-medium); cursor: pointer;
}
input[type="file"].input:hover::file-selector-button { background: var(--text); color: var(--bg); }
.input--code { font-family: var(--font-mono); font-size: 1.75rem; letter-spacing: 0.4em; text-align: center; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; padding: 14px; border: var(--border) solid var(--line); cursor: pointer; }
.check:hover { border-color: var(--line-strong); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.check .t { font-size: 0.9375rem; font-weight: var(--weight-regular); }
.check .s { font-size: 0.8125rem; color: var(--muted); display: block; margin-top: 2px; }
.check .req { font-size: 0.6875rem; font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 0.875rem; font-weight: var(--weight-medium); margin-bottom: 8px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); padding: 1px 0 0 1px; }   /* wraps to rows when text is enlarged; labels overlap their neighbours' borders by 1px */
.seg label { display: grid; place-items: center; min-height: 48px; cursor: pointer; font-weight: var(--weight-regular); border: var(--border) solid var(--control-border); margin: -1px 0 0 -1px; padding: 6px; text-align: center; overflow-wrap: anywhere; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { background: var(--text); color: var(--bg); font-weight: var(--weight-medium); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
details.more summary { cursor: pointer; font-weight: var(--weight-medium); padding: 10px 0; color: var(--link); }
.form { display: grid; gap: 18px; max-width: 560px; }

/* ---------- tabs / chips ---------- */
.tabs { display: flex; gap: 0; border-bottom: var(--border) solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  padding: 12px 16px; min-height: 48px; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer;
  border-bottom: 3px solid transparent; font-weight: var(--weight-medium); white-space: nowrap; font-size: 0.9375rem;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--highlight); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 8px 14px; border: var(--border) solid var(--control-border); background: transparent; color: var(--text);
  border-radius: var(--radius-pill); cursor: pointer; font-size: 0.875rem; font-weight: var(--weight-regular); white-space: nowrap;
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: var(--weight-medium); }
.chip--day { border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 8px 12px; min-width: 64px; }
.chip--day small { font-size: 0.6875rem; opacity: 0.8; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- leaderboard ---------- */
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 0.75rem; font-weight: var(--weight-medium); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; padding: 10px 8px; border-bottom: var(--border) solid var(--line-strong); }
.board td { padding: 14px 8px; border-bottom: var(--border) solid var(--line); vertical-align: middle; }
.board .rank { width: 3.5rem; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); }
.board .score { text-align: right; font-size: 1.125rem; font-weight: var(--weight-regular); white-space: nowrap; }
.board th.score, .board th.games { font-size: 0.75rem; }
.board--podium th.score { font-family: inherit; letter-spacing: 0.06em; }   /* headers share one style; only the numbers are mono */
.board .who { min-width: 0; }
.board .who .n { font-weight: var(--weight-regular); display: block; overflow-wrap: anywhere; }
.board .who .a { font-size: 0.8125rem; color: var(--muted); display: block; overflow-wrap: anywhere; }
.board .games { text-align: right; color: var(--muted); font-size: 0.875rem; width: 1%; white-space: nowrap; }
.board tr.top1 .rank, .board tr.top2 .rank, .board tr.top3 .rank { color: var(--text); font-weight: var(--weight-semibold); }
.board tr.me td { background: var(--highlight); color: var(--on-highlight); }
.board tr.me .a, .board tr.me .rank, .board tr.me .games { color: var(--on-highlight); }
.board tr.me .tag--sample, .board tr.me .tag--muted { color: var(--on-highlight); border-color: var(--on-highlight); }
.board tr.flash td { animation: rowflash 1.2s var(--ease); }
@keyframes rowflash { from { background: var(--surface-2); } to { background: transparent; } }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); border: var(--border) dashed var(--line-strong); }

/* ---------- ticker ---------- */
.ticker { overflow: hidden; border-top: var(--border) solid var(--line); border-bottom: var(--border) solid var(--line); background: var(--bg-alt); white-space: nowrap; position: relative; }
.ticker__track { display: inline-flex; gap: 32px; padding: 10px 0; animation: ticker 40s linear infinite; font-family: var(--font-mono); font-size: 0.8125rem; }
.ticker__track span b { font-weight: var(--weight-semibold); color: var(--up); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- hero + motif ---------- */
.hero { position: relative; padding: 28px 0 8px; overflow: hidden; }
.hero h1 { font-size: 2.75rem; max-width: 12ch; }
.hero .lede { margin-bottom: 24px; }
.motif { position: absolute; right: -40px; top: 0; width: 320px; height: auto; pointer-events: none; opacity: 0.9; z-index: 0; }
.motif .l { stroke: var(--motif-line); stroke-width: 1; fill: none; }
.motif .n { fill: var(--motif-node); stroke: var(--motif-line); stroke-width: 1; }
.motif .h { fill: var(--highlight); stroke: var(--highlight); }
.motif .b { fill: var(--accent); stroke: var(--accent); }
.hero > *:not(.motif) { position: relative; z-index: 1; }

/* ---------- schedule ---------- */
.sched-toolbar { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 8px 0 10px; display: grid; gap: 10px; border-bottom: var(--border) solid var(--line); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 42px; }
.next-day { font-size: 0.875rem; font-weight: var(--weight-semibold); margin: 16px 0 4px; color: var(--text); }
.day-head { font-size: 0.8125rem; font-weight: var(--weight-semibold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; display: flex; justify-content: space-between; }
.session { display: grid; grid-template-columns: 64px 1fr 48px; gap: 12px; padding: 14px 0; border-bottom: var(--border) solid var(--line); align-items: start; }
.session__time { font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.35; font-weight: var(--weight-regular); }
.session__time small { display: block; color: var(--muted); font-size: 0.75rem; }
.session__title { font-weight: var(--weight-regular); font-size: 1rem; line-height: 1.35; margin: 0 0 4px; overflow-wrap: anywhere; }
.session__meta { font-size: 0.8125rem; color: var(--muted); display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.session.conflict { box-shadow: inset 4px 0 0 var(--danger); padding-left: 12px; }
.session.is-now .session__time { color: var(--up); }
.type-dot { width: 8px; height: 8px; display: inline-block; background: var(--line-strong); }
.type-dot[data-type="keynote"], .type-dot[data-type="oral"] { background: var(--highlight); }
.type-dot[data-type="workshop"], .type-dot[data-type="tutorial"] { background: var(--accent); }
.type-dot[data-type="meeting"] { background: var(--text); }
.star {
  width: 48px; height: 48px; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; color: var(--muted);
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.star svg { width: 24px; height: 24px; }
.star:hover { color: var(--text); }
.star[aria-pressed="true"] { color: var(--highlight); }
.star[aria-pressed="true"] svg path { fill: currentColor; }
.star.pending { opacity: 0.6; }
:root[data-theme="light"] .star[aria-pressed="true"] { color: var(--accent); }

/* ---------- meet / slots ---------- */
.researcher { display: grid; gap: 12px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot {
  min-height: 52px; border: var(--border) solid var(--control-border); background: var(--surface); color: var(--text); cursor: pointer;
  font-family: var(--font-mono); font-size: 0.9375rem; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2;
  border-radius: var(--radius); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.slot small { font-family: var(--font-sans); font-size: 0.6875rem; color: var(--muted); }
.slot:hover:not([disabled]) { border-color: var(--text); }
.slot[disabled] { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
.slot.mine { background: var(--highlight); color: var(--on-highlight); border-color: var(--highlight); }
.slot.mine small { color: var(--on-highlight); }
.slot-day { font-size: 0.8125rem; color: var(--muted); font-weight: var(--weight-medium); margin: 12px 0 6px; }

/* ---------- sheet (modal) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 60; display: none; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--bg); border-top: var(--border-strong) solid var(--line-strong);
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform var(--dur) var(--ease);
  max-height: 90dvh; overflow: auto;
}
.sheet.open { transform: translateY(0); }
.sheet-backdrop.open { display: block; }
.sheet__inner { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 80; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; font-weight: var(--weight-regular); font-size: 0.9375rem; box-shadow: var(--shadow-overlay); animation: toastin var(--dur) var(--ease); }
.toast--error { background: var(--danger); color: var(--bg); }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- QR ---------- */
.qr { background: var(--qr-bg); color: var(--qr-fg); padding: 12px; display: inline-block; line-height: 0; }
.qr .qr-svg { width: 220px; height: 220px; }
@media (max-width: 560px) { .profile-qr > .qr { margin: 0 auto; } }   /* on a phone the code sits centred above its text, as on Connect */
.ticket__done { display: grid; gap: 8px; align-content: start; }
.ticket__done-big { margin: 0; font-size: 1.5rem; font-weight: var(--weight-semibold); }
.ticket__done details .ticket__live { margin-top: 10px; }
.ticket__live { display: grid; justify-items: start; gap: 6px; }
.ticket-timer { width: 244px; max-width: 100%; height: 8px; accent-color: var(--meter-fill); }
.ticket__live .ticket-timer__text { margin: 0; font-size: 0.875rem; }
.code-display { font-family: var(--font-sans); font-size: 1.625rem; letter-spacing: 0.18em; font-weight: var(--weight-medium); }

/* ---------- scanner ---------- */
.scanner { position: relative; background: var(--gr-black, var(--bg)); aspect-ratio: 1 / 1; max-width: 420px; width: 100%; overflow: hidden; display: none; }
.scanner.on { display: block; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 15%; border: var(--border-strong) solid var(--highlight); pointer-events: none; }
.scanner .frame::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--highlight); top: 0; animation: scan 2s var(--ease) infinite alternate; }
@keyframes scan { to { top: calc(100% - 2px); } }

/* ---------- people lists ---------- */
.people { display: grid; gap: 0; border-top: var(--border) solid var(--line); }
.person { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: var(--border) solid var(--line); }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); font-weight: var(--weight-medium); font-size: 0.9375rem; }
.person .n { font-weight: var(--weight-regular); overflow-wrap: anywhere; }
.person .a { font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.person .links { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.8125rem; margin-top: 2px; }

/* ---------- game ---------- */
.game-shell { display: grid; gap: 12px; }
.game-chart { position: relative; border: var(--border) solid var(--line); background: var(--bg-alt); height: 260px; }
.game-chart canvas { width: 100%; height: 100%; display: block; }
.game-chart .overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: var(--overlay); padding: 16px; }
.game-chart .overlay[hidden] { display: none; }
.game-price { position: absolute; top: 10px; left: 12px; font-family: var(--font-mono); font-size: 1.375rem; font-weight: var(--weight-regular); }
.game-timer { position: absolute; top: 12px; right: 12px; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.game-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-btn { min-height: 72px; font-size: 1.25rem; font-weight: var(--weight-medium); border: var(--border-strong) solid; cursor: pointer; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); touch-action: manipulation; }
.trade-btn small { font-size: 0.75rem; font-weight: var(--weight-regular); opacity: 0.85; margin-top: 4px; }
.trade-btn--buy { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trade-btn--sell { background: transparent; border-color: var(--text); color: var(--text); }
.trade-btn:active:not([disabled]) { transform: scale(0.98); }
.trade-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.pos-meter { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.pos-meter i { height: 8px; background: var(--line); }
.pos-meter i.on-long { background: var(--up); }
.pos-meter i.on-short { background: var(--down); }
.pos-meter i.mid { background: var(--line-strong); }

/* ---------- home ---------- */
.dash { display: grid; gap: 12px; }
.rank-big { display: flex; align-items: baseline; gap: 10px; }
.rank-big .stat { font-size: 4rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.9375rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.foot { margin-top: 48px; padding-top: 16px; border-top: var(--border) solid var(--line); font-size: 0.8125rem; color: var(--muted); display: flex; gap: 8px 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* ---------- admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: var(--border) solid var(--line); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: var(--weight-medium); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.table-wrap { overflow-x: auto; border: var(--border) solid var(--line); position: relative; }  /* contains .sr-only labels: absolutely positioned ones escaped the scroll box and widened the page (390 px) */
.inline-form { display: inline; }

/* ---------- TV ---------- */
body.tv { overflow: hidden; }
body.tv main { max-width: none; padding: 3vh 3vw 2vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2.5vh; }
.tv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 3vw; }
.tv-head .brand__logo { height: 3vh; }
.tv-title { font-size: 6vh; font-weight: var(--weight-light); letter-spacing: var(--tracking-display); line-height: 1; margin: 0; }
.tv-sub { font-size: 2vh; color: var(--muted); margin: 1vh 0 0; }
.tv-grid { display: grid; grid-template-columns: 1fr 1fr 0.72fr; gap: 2.5vw; min-height: 0; }
.tv-board { min-height: 0; overflow: hidden; }
.tv-board h2 { font-size: 2.2vh; font-weight: var(--weight-medium); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.2vh; }
.tv-board .board td { padding: 1.05vh 0.8vw; }
.tv-board .board .rank { font-size: 2.3vh; width: 3.6vw; }
.tv-board .board .who .n { font-size: 2.6vh; display: inline; }
.tv-board .board .who .a { font-size: 1.8vh; display: inline; margin-left: 0.8vw; }
.tv-board .board .score { font-size: 2.8vh; }
.tv-board .board tr.top1 td { background: var(--highlight); color: var(--on-highlight); }
.tv-board .board tr.top1 .a, .tv-board .board tr.top1 .rank, .tv-board .board tr.top1 .score { color: var(--on-highlight); }
.tv-board .board tr.top1 .tag--sample, .tv-board .board tr.top1 .tag--muted { color: var(--on-highlight); border-color: var(--on-highlight); }   /* tags on the yellow first-place row */
.tv-board .empty { font-size: 2.2vh; }
.tv-join { border: var(--border) solid var(--line-strong); padding: 2.5vh 1.5vw; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.8vh; position: relative; overflow: hidden; min-height: 0; }
.tv-join .motif { position: absolute; top: -2vh; right: -2vw; width: 70%; opacity: 0.8; }
.tv-join .qr { padding: 1.2vh; position: relative; }
.tv-join .qr .qr-svg { width: 26vh; height: 26vh; }
.tv-join .big { font-size: 3.8vh; font-weight: var(--weight-light); letter-spacing: var(--tracking-display); line-height: 1.05; margin: 0; position: relative; }
.tv-join .url { font-size: 1.6vh; color: var(--muted); margin: 0; overflow-wrap: anywhere; position: relative; }
/* Portrait wall (1080x1920): the three-column grid squeezed handles into one letter per line (booth rehearsal 18/11).
   Boards side by side at width-based sizes, the join code in a band underneath. */
@media (orientation: portrait) {
  .tv-grid { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 2.5vw; }
  .tv-join { grid-column: 1 / -1; flex-direction: row; gap: 4vw; padding: 2vh 3vw; }
  .tv-join .qr .qr-svg { width: 17vh; height: 17vh; }
  .tv-board .board td { padding: 0.9vh 0.8vw; }
  .tv-board .board .rank { font-size: 2.4vw; width: 5.5vw; }
  .tv-board .board .who .n { font-size: 2.6vw; overflow-wrap: anywhere; }
  .tv-board .board .who .a { display: block; margin-left: 0; font-size: 1.8vw; }
  .tv-board .board .score { font-size: 2.8vw; }
}
.tv-foot { display: flex; justify-content: space-between; font-size: 1.7vh; color: var(--muted); gap: 2vw; }

/* ---------- responsive ---------- */
@media (max-width: 639px) {
  .hero .motif { opacity: 0.45; width: 300px; right: -90px; top: -10px; }
}
@media (min-width: 640px) {
  h1, .h1 { font-size: 3.25rem; }
  .hero h1 { font-size: 4rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .motif { width: 420px; right: 0; }
  .game-chart { height: 340px; }
}
@media (min-width: 960px) {
  :root { --gutter: 32px; }
  .desk-nav { display: flex; }
  .tabbar { display: none; }
  main { padding-bottom: 64px; padding-top: 32px; }
  .toasts { bottom: 24px; }
  h1, .h1 { font-size: 4rem; }
  .hero { padding: 56px 0 24px; }
  .hero h1 { font-size: 5.25rem; }
  .motif { width: 560px; right: 0; top: 10px; }
  .dash { grid-template-columns: repeat(3, 1fr); }
  .dash .span-2 { grid-column: span 2; }
  .dash .span-3 { grid-column: span 3; }
  .sheet { left: 50%; right: auto; bottom: 50%; width: 560px; transform: translate(-50%, 60%); opacity: 0; pointer-events: none; border: var(--border) solid var(--line-strong); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
  .sheet.open { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; }
  .game-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
  .sched-layout { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .ticker__track { animation: none; }
}
.tv-live { font-size: 2vh; padding: 0.6vh 1.2vw; }
.standing { font-size: 1.0625rem; margin: 0 0 12px; }
.ticket-race + .standing { margin-top: 16px; }
.standing strong { font-weight: var(--weight-semibold); }
.mode-switch { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 0.875rem; }
.mode-switch .chip[disabled] { opacity: 0.45; cursor: not-allowed; }
.person details.note { grid-column: 2 / -1; font-size: 0.875rem; }
.person details.note summary { cursor: pointer; color: var(--link); padding: 4px 0; }
.slot[data-taken] { opacity: 0.55; border-style: dashed; }
.slot[data-taken] small { text-decoration: none; }
.slot[data-standby] { opacity: 1; border-color: var(--highlight); }
.slot[data-held-me] { border-color: var(--highlight); border-width: var(--border-strong); }
.papers { margin: 0; padding-left: 18px; font-size: 0.875rem; }
.papers a { overflow-wrap: anywhere; }
.tagpick { display: flex; flex-wrap: wrap; gap: 8px; }
.tagpick__item { position: relative; cursor: pointer; }
.tagpick__item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tagpick__item span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: var(--border) solid var(--line-strong); border-radius: var(--radius-pill); font-size: 0.875rem; font-weight: var(--weight-regular); }
.tagpick__item input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: var(--weight-medium); }
.tagpick__item input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.match { font-size: 0.75rem; color: var(--muted); }
.toast--reminder { display: block; text-decoration: none; background: var(--highlight); color: var(--on-highlight); }
.toast--reminder strong { font-weight: var(--weight-semibold); }
.dayrows { border-top: var(--border) solid var(--line); }
.dayrow { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: var(--border) solid var(--line); min-height: 72px; }
.dayrow__time { font-size: 1rem; line-height: 1.3; }
.dayrow__time small { display: block; color: var(--muted); font-size: 0.75rem; }
.dayrow__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.dayrow.is-in { box-shadow: inset 4px 0 0 var(--highlight); padding-left: 10px; }
.dayrow.is-late { box-shadow: inset 4px 0 0 var(--danger); padding-left: 10px; }
.dayrow.is-over { opacity: 0.55; }
.booth-status { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; background: var(--highlight); color: var(--on-highlight); font-weight: var(--weight-medium); font-size: 0.9375rem; }
.booth-status__dot { width: 8px; height: 8px; background: currentColor; flex: none; animation: blink 1.4s steps(2, start) infinite; }
.today { padding: 16px 20px; }
.today__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-top: 4px; }
.today__grid .label { font-size: 0.75rem; color: var(--muted); font-weight: var(--weight-medium); letter-spacing: 0.06em; text-transform: uppercase; }
.today__grid .value { font-size: 1.625rem; font-weight: var(--weight-light); letter-spacing: var(--tracking-tight); margin-top: 2px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.today__grid .value small { font-size: 0.875rem; color: var(--muted); letter-spacing: 0; }
.today__grid .value--text { font-size: 1rem; font-weight: var(--weight-regular); display: block; overflow-wrap: anywhere; }
.today__grid .value--text small { display: block; }
.today__cta { font-size: 0.875rem; font-weight: var(--weight-medium); }
@media (min-width: 960px) { .today__grid { grid-template-columns: 0.7fr 0.7fr 1.3fr 1.3fr; } }

/* ---------- immersive round (body.game-running): one viewport, thumb-zone controls ---------- */
body.game-running { overflow: hidden; }
body.game-running .site-header, body.game-running .tabbar, body.game-running .foot,
body.game-running .page-head, body.game-running .notice, body.game-running .mode-switch,
body.game-running aside, body.game-running .booth-status, body.game-running .skip { display: none !important; }
body.game-running main { padding: 0; max-width: none; }
body.game-running .game-layout { display: block; }
body.game-running .game-shell {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) calc(12px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
}
body.game-running .game-chart { flex: 1 1 auto; min-height: 140px; height: auto; }
body.game-running .stats > div { padding: 8px 12px; }
body.game-running .stats .value { font-size: 1.375rem; }
body.game-running .trade-btn { min-height: 84px; }
.hero--compact { padding: 12px 0 0; }
.hero--compact .motif { width: 220px; opacity: 0.5; }
.today__grid .sub { font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }
.today__grid .value .tag { margin: 6px 6px 0 0; }
@media (min-width: 960px) { .hero--compact { padding: 24px 0 0; } .hero--compact .motif { width: 360px; opacity: 0.9; } }

/* ---------- first-run intro ---------- */
body.onboarding { overflow: hidden; }
.onboard { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) calc(16px + env(safe-area-inset-bottom)); }
.onboard__top { display: flex; justify-content: space-between; align-items: center; }
.onboard__track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; max-width: 720px; width: 100%; margin: 0 auto; }
.onboard__track::-webkit-scrollbar { display: none; }
.onboard__card { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; padding: 0 4px; }
.onboard__n { color: var(--up); font-size: 0.9375rem; margin: 0 0 12px; }
.onboard__bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 720px; width: 100%; margin: 0 auto; }
.onboard__dots { display: flex; gap: 6px; }
.onboard__dots i { width: 24px; height: 3px; background: var(--line-strong); }
.onboard__dots i.on { background: var(--highlight); }
.offline-banner { border-left: 4px solid var(--highlight); background: var(--surface-2); padding: 10px 14px; margin: 0 0 16px; font-size: 0.875rem; }
.empty p { margin: 0 0 8px; }
.empty p:last-child { margin-bottom: 0; }
body.game-running main > *:not(.game-layout):not(.ext-frame) { display: none !important; }
body.game-running main { min-height: 0; }
.meet-days { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 8px 0; margin-top: 16px; border-bottom: var(--border) solid var(--line); }
details.slotday { border-top: var(--border) solid var(--line); }
details.slotday summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; cursor: pointer; font-weight: var(--weight-medium); font-size: 0.9375rem; list-style: none; }
details.slotday summary::-webkit-details-marker { display: none; }
details.slotday summary::after { content: "+"; font-family: var(--font-mono); margin-left: 12px; color: var(--muted); }
details.slotday[open] summary::after { content: "−"; }
details.slotday .slots { padding-bottom: 12px; }
.slot-wrap { display: contents; }
.checklist { list-style: none; padding: 0; margin: 0; border-top: var(--border) solid var(--line); }
.checklist li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 14px 0; border-bottom: var(--border) solid var(--line); }
.check-dot { width: 12px; height: 12px; margin-top: 6px; background: var(--line-strong); }
.check-ok .check-dot { background: var(--success); }
.check-warn .check-dot { background: transparent; border: var(--border-strong) solid var(--highlight); }
.check-bad .check-dot { background: var(--danger); }
.checklist .fix { font-size: 0.875rem; margin-top: 4px; }

/* ---------- UX critique round ---------- */
.code { font-family: var(--font-sans); font-weight: var(--weight-medium); letter-spacing: 0.12em; text-transform: uppercase; }
.handle { font-weight: var(--weight-regular); letter-spacing: 0; overflow-wrap: anywhere; }
h1 .handle { font-size: 0.6em; letter-spacing: -0.01em; }
.session__time small { font-family: var(--font-sans); }
.check .req { color: var(--link); font-size: 0.75rem; font-weight: var(--weight-semibold); letter-spacing: 0.04em; text-transform: none; display: block; margin: 4px 0 0; }
.caption-note { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); margin: 0 0 12px; }
.kbd-hint { display: none; }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: inline; } }
.chips { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); padding-right: 40px; }
.game-chart .overlay.overlay--result { background: var(--bg); }
.cheer { color: var(--up); font-weight: var(--weight-semibold); }
.name-ask { border-color: var(--link); }
/* Generative greyscale grain behind hero sections — an SVG turbulence mask (not photography), tinted by token. */
.hero::before { content: ""; position: absolute; inset: 0 0 0 28%; z-index: 0; pointer-events: none;
  background-image: var(--texture-image); background-size: cover; background-position: right top; opacity: var(--texture-opacity);
  -webkit-mask-image: radial-gradient(closest-side at 55% 50%, #000 35%, transparent 100%);
  mask-image: radial-gradient(closest-side at 55% 50%, #000 35%, transparent 100%); }
.moment { position: fixed; inset: 0; z-index: 95; background: var(--bg); overflow: auto; display: flex; align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom)); animation: toastin var(--dur) var(--ease); }
.moment__inner { max-width: 640px; margin: 0 auto; width: 100%; }
.moment h2 .handle { font-size: 0.62em; display: inline-block; }
.moment__x { color: var(--highlight); font-weight: var(--weight-light); }
.who-row { display: flex; gap: 14px; align-items: center; min-width: 0; }
.who-row > div { min-width: 0; overflow-wrap: anywhere; }
.board .who { overflow-wrap: anywhere; }
.grid > *, .grid-2 > *, .dash > * { min-width: 0; }              /* grid items may shrink below their content at large text sizes */
[data-board] { overflow-x: auto; }                               /* last resort at very large text: the table scrolls, the page does not (a11y.js makes it keyboard-reachable) */
.avatar-photo { width: 64px; height: 64px; flex: none; object-fit: cover; background: var(--surface-2); display: inline-grid; place-items: center; overflow: hidden; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { color: var(--text); font-weight: var(--weight-medium); font-size: 1.375rem; letter-spacing: 0.02em; }
.sheet-who { display: flex; gap: 12px; align-items: center; }
.sheet-who .avatar-photo { width: 48px; height: 48px; font-size: 1.0625rem; }
.tag.role-talent { border-color: var(--text); color: var(--text); }
.tag.role-engineer { border-color: var(--line-strong); color: var(--muted); }
.ext-frame { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.ext-frame__bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px var(--gutter); border-bottom: var(--border) solid var(--line); font-size: 0.875rem; }
.ext-frame__bar span { flex: 1; color: var(--muted); }
.ext-frame iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---- Party: ticket race strip, ticket card, door check-in (colours via tokens only) ---- */
.tag--ticket { background: var(--highlight); color: var(--on-highlight); border-color: var(--highlight); }
.ticket-race { border: var(--border) solid var(--line-strong); background: var(--surface-2); padding: 14px 16px; display: grid; gap: 8px; }
.ticket-race__line { margin: 0; font-weight: var(--weight-medium); }
.ticket-race__me { margin: 0; font-size: 0.9375rem; }
.ticket-meter { height: 8px; background: var(--line); overflow: hidden; }
.ticket-meter i { display: block; height: 100%; background: var(--meter-fill); transition: width var(--dur-slow) var(--ease); }
.board tr.wins td.rank { box-shadow: inset 4px 0 0 var(--highlight); }
.ticket__body { display: grid; gap: 20px; grid-template-columns: auto 1fr; align-items: start; }
.ticket__name { font-size: 1.5rem; font-weight: var(--weight-medium); margin: 0 0 8px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .ticket__body { grid-template-columns: 1fr; justify-items: center; text-align: center; } .ticket .kv { text-align: left; } }
.party-status { margin: 0; padding: 12px 14px; border-left: 4px solid var(--line-strong); background: var(--surface-2); }
.party-status--selected { border-left-color: var(--success); }
.party-status--applied, .party-status--waitlist { border-left-color: var(--highlight); }
/* Door results read at arm's length in a dark doorway: a filled block and a tick or a cross, never colour alone. */
.door-result { border: var(--border) solid var(--line-strong); padding: 20px 20px 20px 76px; min-height: 132px; position: relative; }
.door-result::before { position: absolute; left: 18px; top: 16px; font-size: 2.75rem; line-height: 1; font-weight: var(--weight-medium); }
.door-result__msg { font-size: 1.375rem; font-weight: var(--weight-medium); margin: 0 0 6px; }
.door-result__who { font-size: 1.75rem; margin: 0; overflow-wrap: anywhere; }
.door-result--idle { padding-left: 20px; }
.door-result--valid { border-color: var(--success); box-shadow: inset 8px 0 0 var(--success); padding-left: 28px; }
.door-result--checked_in { background: var(--success); border-color: var(--success); color: var(--on-success); }
.door-result--checked_in::before { content: "✓"; content: "✓" / ""; }
.door-result--already, .door-result--revoked, .door-result--unknown, .door-result--expired, .door-result--old { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.door-result--already::before, .door-result--revoked::before, .door-result--unknown::before, .door-result--expired::before, .door-result--old::before { content: "✕"; content: "✕" / ""; }
.door-result--checked_in .muted, .door-result--already .muted, .door-result--revoked .muted, .door-result--unknown .muted, .door-result--expired .muted, .door-result--old .muted { color: inherit; }
/* offline admit: visibly not the same as a confirmed check-in (dashed, no solid fill) */
.door-result--offline { border: 4px dashed var(--success); padding-left: 76px; }
.door-result--offline::before { content: "✓"; content: "✓" / ""; color: var(--success); }
.door-offline { border: var(--border) solid var(--line-strong); padding: 10px 14px; margin: 12px 0; font-size: 0.9375rem; }
.door-offline--on { border-style: dashed; }
.door-key { display: grid; gap: 4px; font-size: 0.875rem; color: var(--muted); margin: 16px 0 0; padding: 0; list-style: none; }
.tv-ticket { font-size: 2.2vh; margin: 1.5vh 0 0; display: flex; gap: 1vw; align-items: center; }
.tv-ticket .tag { font-size: 1.6vh; }
.tv-ticket-explain { font-size: 1.7vh; line-height: 1.35; margin: 0.8vh 0 0; color: var(--muted); max-width: 120ch; }
.tv-ticket-explain[hidden] { display: none; }
/* One slim line above the game: the game has its own header and repeats the ticket line on its results screen. */
.ext-ticket { padding: 4px var(--gutter) 0; font-size: 0.8125rem; border-bottom: var(--border) solid var(--line); display: grid; gap: 4px; }
.ext-ticket p { margin: 0; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }   /* two lines: one line cut the ticket sentence mid-word ("…win a pa…") */
.ext-ticket .ticket-meter { height: 3px; margin: 0 calc(-1 * var(--gutter)); }
.ext-frame--ready .ext-frame__bar { padding-top: 0; padding-bottom: 0; font-size: 0.8125rem; }
.ext-frame--ready .ext-frame__bar .btn { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
.card--accent .card__kicker { color: var(--on-accent); opacity: 0.85; }
a.card--accent.card--link, a.card--accent.card--link h3 { color: var(--on-accent); }
a.card--accent.card--link:hover { border-color: var(--on-accent); }
details.party-edit > summary { cursor: pointer; font-weight: var(--weight-medium); color: var(--link); min-height: 44px; display: flex; align-items: center; }
details.party-edit[open] > summary { margin-bottom: 8px; }
.badge-scan-btn { white-space: nowrap; flex: none; }

/* ---------- phone tab bar clearance (iOS wrapper E2E 18/11/2026) ----------
   The footer sits AFTER <main>, so main's tab-bar padding left it under the fixed tab bar: the footer carries the
   clearance on phones instead. Reminder banners keep a clear gap above the tab bar and can be dismissed. */
@media (max-width: 959px) {
  main:has(+ .foot) { padding-bottom: 8px; }
  .foot { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
  .foot a { padding: 6px 0; }
  .toasts { bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
}
.foot { padding-left: var(--gutter); padding-right: var(--gutter); max-width: var(--container); margin-left: auto; margin-right: auto; box-sizing: border-box; }
.toast--reminder { display: flex; align-items: flex-start; gap: 8px; padding-right: 8px; }
.toast--reminder a { color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.toast__close { flex: none; min-width: 44px; min-height: 44px; margin: -10px -4px -10px 0; border: 0; background: transparent; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
html.is-native .toasts { bottom: calc(var(--tabbar-h) + 24px + max(env(safe-area-inset-bottom), 0px)); }

/* Next up card on Home (18/11/2026) */
.nextup { border-left: 4px solid var(--accent); padding: 16px 20px; }
.nextup--clash { border-left-color: var(--danger); }
.nextup__title { margin: 0 0 6px; }
.nextup__when { margin: 0 0 8px; }
.nextup__clash { margin: 8px 0 0; font-size: 0.875rem; }
.nextup__actions { margin-top: 12px; }
.nextup__then { margin: 12px 0 0; font-size: 0.875rem; }
.clash-with { display: block; font-size: 0.8125rem; color: var(--danger); margin-top: 4px; }

/* Move sheet: list of free times for the same person */
.move-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; max-height: 40vh; overflow-y: auto; }
.move-list .slot small { display: block; }

/* Staff day sheet, all staff (printable) */
.staffsheet__person { break-inside: avoid; page-break-inside: avoid; margin: 0 0 20px; }
.staffsheet__person h2 { margin: 0; font-size: 1.125rem; }
.staffsheet__scroll { overflow-x: auto; position: relative; }   /* a phone shows every column (Here was cut off) */
.staffsheet table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.staffsheet th, .staffsheet td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.staffsheet th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.staffsheet td.t { white-space: nowrap; font-variant-numeric: tabular-nums; width: 7.5em; }
.staffsheet td.chk { width: 3.5em; }
.staffsheet .box { display: inline-block; width: 1em; height: 1em; border: 1.5px solid currentColor; vertical-align: middle; }
.staffsheet .tag { font-size: 0.75rem; }
@media print {
  .site-header, .tabbar, .no-print, .desk-nav { display: none !important; }
  body, .staffsheet { background: #fff !important; color: #000 !important; }
  .staffsheet th, .staffsheet td { border-bottom-color: #999 !important; color: #000 !important; }
  .staffsheet .tag { border: 1px solid #999; background: none !important; color: #000 !important; }
  .staffsheet__person { margin-bottom: 14px; }
  a[href]::after { content: none !important; }
  /* Admin > Booth QR prints as a wall poster: one big code, nothing else */
  .qr-poster-page footer, .qr-poster-page .skip { display: none !important; }
  .qr-poster { max-width: none !important; border: 0 !important; box-shadow: none !important; padding-top: 2cm !important; }
  .qr-poster h2 { font-size: 3rem; margin-bottom: 1cm; }
  .qr-poster .qr-svg { width: 15cm; height: 15cm; }
}

/* Meet: soonest-free strip, wrapping role chips, filter count (18/11/2026) */
.soonest { padding: 14px 16px; }
.soonest__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.soonest__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.soonest__who { display: flex; flex-direction: column; min-width: 0; }
.soonest__who strong { overflow-wrap: anywhere; }
.chips.chips--wrap { flex-wrap: wrap; overflow-x: visible; -webkit-mask-image: none; mask-image: none; padding-right: 0; }
.meet-count { margin: 0 0 8px; font-size: 0.875rem; }

/* ---------- messages badge (header) + unread counts; the rest of the chat styles are in chat.css ---------- */
.chat-badge { position: absolute; top: 5px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center;
  background: var(--highlight); color: var(--on-highlight); font-size: 0.6875rem; font-weight: var(--weight-semibold); line-height: 1; }
.chat-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; background: var(--highlight);
  color: var(--on-highlight); font-size: 0.75rem; font-weight: var(--weight-semibold); line-height: 1; }
.chat-badge[hidden], .chat-count[hidden] { display: none; }
/* G-Research staff accounts: the "Staff" entry in the header (booth inbox), clearly not an attendee control */
.staff-link { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; margin-right: 2px;
  color: var(--header-text); border: 1px solid var(--header-text); text-decoration: none; font-weight: var(--weight-semibold);
  font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; }
.staff-link:hover { color: var(--highlight); border-color: var(--highlight); }
.staff-link .chat-badge { top: -6px; right: -8px; }
.tag--gr { border-color: var(--text); color: var(--text); }
.session__desc { margin: 6px 0 0; font-size: 0.875rem; color: var(--muted); max-width: 62ch; }
.session__msg { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.875rem; }

/* G-Research booth info (/booth, /rules: _challenge.html) */
.gr-hours { border-collapse: collapse; margin: 0 0 12px; }
.gr-hours th, .gr-hours td { text-align: left; padding: 6px 16px 6px 0; border-bottom: var(--border) solid var(--line); font-weight: var(--weight-regular); }
.gr-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.gr-steps li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 8px; align-items: baseline; }
.gr-steps__n { color: var(--muted); }
.gr-facts { margin: 0; }
.gr-facts dt { font-weight: var(--weight-medium); margin-top: 12px; }
.gr-facts dd { margin: 4px 0 0; color: var(--muted); }
/* Staff team briefing (/admin/briefing): rendered Markdown, read-only */
.brief { max-width: 78ch; }
.brief h2, .brief h3 { margin-top: 28px; }
.brief h4, .brief h5 { margin-top: 18px; }
.brief li + li { margin-top: 4px; }
.brief ul ul, .brief ul ol, .brief ol ul { margin-top: 4px; }
.brief .table-wrap { margin: 12px 0; }
.brief .brief-table td { min-width: 6rem; }

/* Meet the team (/team) */
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list .person, .team-contact .person { grid-template-columns: 44px 1fr; align-items: start; }
.team-about { margin: 4px 0 0; font-size: 0.875rem; }
.team-day { margin-top: 8px; }
.team-day summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.team-rota { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0 0; }
.team-rota dt { font-size: 0.875rem; }
.team-rota dd { margin: 0; font-size: 0.875rem; overflow-wrap: anywhere; }

/* "G-Research at NeurIPS" block on Home / landing */
.gr-strip__grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .gr-strip__grid { grid-template-columns: 1fr 1fr; } }
.gr-strip__card h3 { margin: 4px 0 6px; }
.gr-strip__card p { margin: 0 0 8px; }
.gr-strip__card .btn-row { margin-top: 8px; }
.gr-strip__when { font-weight: var(--weight-medium); }
.card--accent .btn { --btn-bg: var(--on-accent); --btn-fg: var(--accent); border-color: var(--on-accent); }
.card--accent .btn--ghost { --btn-bg: transparent; --btn-fg: var(--on-accent); border-color: var(--on-accent); }
