/* ==========================================================================
   Design tokens. Change --accent to rebrand the whole site.
   ========================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --border: #e1e4ea;
  --border-strong: #cdd2db;
  --text: #0e1525;
  --text-2: #3b4457;
  --muted: #657087;
  --accent: #3b3fc4;
  --accent-hover: #3236a8;
  --accent-soft: #eceefd;
  --accent-text: #2e31a0;
  --on-accent: #ffffff;
  --ring: rgba(59, 63, 196, 0.35);

  --cat-classroom: #5b63d6;
  --cat-pe: #1f9d72;
  --cat-office: #c98a1b;

  --red: #e5484d;
  --amber: #f2a516;
  --green: #2fa66a;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(14, 21, 37, 0.05);
  --shadow: 0 1px 2px rgba(14, 21, 37, 0.04), 0 4px 16px -4px rgba(14, 21, 37, 0.08);
  --shadow-lg: 0 2px 4px rgba(14, 21, 37, 0.04), 0 16px 40px -12px rgba(14, 21, 37, 0.16);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0a0d14;
  --surface: #11161f;
  --surface-2: #171d28;
  --surface-3: #202837;
  --border: #232b3a;
  --border-strong: #313b4e;
  --text: #ecf0f6;
  --text-2: #c2c9d6;
  --muted: #8b95a8;
  --accent: #8f95ff;
  --accent-hover: #a4a9ff;
  --accent-soft: #1d2142;
  --accent-text: #b4b8ff;
  --on-accent: #0a0d14;
  --ring: rgba(143, 149, 255, 0.4);
  --cat-classroom: #8f95ff;
  --cat-pe: #3fc796;
  --cat-office: #e3a83a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 20px 48px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-feature-settings: 'cv11', 'ss01';
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.35rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-underline-offset: 3px; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum', 'cv11', 'ss01', 'zero' 0; }

/* ==========================================================================
   Header and footer
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: 0.92rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: background 0.15s, color 0.15s; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current='page'] { color: var(--accent-text); background: var(--accent-soft); }
@media (max-width: 820px) { .site-nav { display: none; } .theme-toggle { margin-left: auto; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
[data-theme='light'] .when-dark, [data-theme='dark'] .when-light { display: none; }

.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 32px 0 40px; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); }
.footer-brand svg { width: 22px; height: 22px; }
.footer-note, .footer-copy { margin: 0; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; gap: 10px; } }

/* ==========================================================================
   Buttons and form controls
   ========================================================================== */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 10px;
  font: inherit; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.005em;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-border);
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-border: transparent; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 0.85rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
kbd {
  font: 600 0.72rem/1 var(--font); padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); color: var(--muted);
}
.btn-primary kbd { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); color: inherit; }
[data-theme='dark'] .btn-primary kbd { background: rgba(0, 0, 0, 0.12); border-color: rgba(0, 0, 0, 0.25); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field-label { font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.hint { font-size: 0.8rem; color: var(--muted); margin: 0; }
input[type='text'], input[type='number'], input[type='search'], textarea, select {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 9px 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 180px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23657087' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }

.check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--text-2); cursor: pointer; margin-bottom: 10px; }
.check input { appearance: none; width: 36px; height: 22px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; margin: 0; }
.check input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.check input:checked { background: var(--accent); }
.check input:checked::after { transform: translateX(14px); }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; gap: 2px; width: 100%; }
.segmented button { flex: 1; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 7px; padding: 7px 10px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.segmented button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { width: 40px; border: 0; background: transparent; color: var(--text-2); font-size: 1.15rem; cursor: pointer; }
.stepper button:hover { background: var(--surface-2); }
.stepper input { width: 56px; border: 0; border-radius: 0; text-align: center; font-weight: 650; padding: 8px 0; -moz-appearance: textfield; box-shadow: none !important; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { padding: 72px 0 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 6px 12px; border-radius: 99px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); max-width: 14ch; margin-bottom: 18px; }
.hero h1 .accent { color: var(--accent); }
.hero .lede { font-size: 1.15rem; color: var(--text-2); max-width: 52ch; margin-bottom: 32px; }
.search { position: relative; max-width: 520px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search input { height: 54px; padding-left: 48px; padding-right: 48px; font-size: 1.02rem; border-radius: 14px; box-shadow: var(--shadow); border-color: var(--border); }
.search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; color: var(--muted); font-size: 0.9rem; padding: 0; list-style: none; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.tool-group { margin-top: 40px; }
.group-title { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 14px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot-classroom { background: var(--cat-classroom); }
.dot-pe { background: var(--cat-pe); }
.dot-office { background: var(--cat-office); }
.bento { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 14px;
  padding: 20px; min-height: 180px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
a.tile:hover .tile-icon { background: var(--accent); color: var(--on-accent); }
.tile-feature { grid-column: span 2; }
@media (max-width: 620px) { .tile-feature { grid-column: auto; } }
.tile-feature .tile-name { font-size: 1.3rem; }
.tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); transition: background 0.2s, color 0.2s; }
.tile-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.tile-icon.sm svg { width: 18px; height: 18px; }
.tile-body { display: grid; gap: 4px; align-content: start; }
.tile-name { font-weight: 650; font-size: 1.08rem; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.tile-blurb { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.tile-cat { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 550; color: var(--muted); }
.tile-soon { background: transparent; box-shadow: none; border-style: dashed; }
.tile-soon .tile-icon { background: var(--surface-2); color: var(--muted); }
.tile-soon .tile-name { color: var(--text-2); }
.badge { font-size: 0.68rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 99px; }
.no-results { color: var(--muted); padding: 24px 0; display: none; }

/* ==========================================================================
   Tool pages
   ========================================================================== */
.tool-head { padding: 36px 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.tool-head h1 { margin-bottom: 6px; }
.tool-head .lede { color: var(--text-2); margin: 0; max-width: 60ch; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .tool-layout { grid-template-columns: 1fr; } }

.stage {
  position: relative; display: flex; flex-direction: column;
  min-height: min(68vh, 640px); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.stage-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.stage-bar .status { font-size: 0.85rem; color: var(--muted); margin-right: auto; padding-left: 6px; }
.stage-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; gap: 24px; min-height: 0; }
.stage-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 0 20px 24px; }
.brand-mark { display: none; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 1rem; margin-bottom: 14px; }
.panel hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.shortcuts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.shortcuts span { display: inline-flex; align-items: center; gap: 6px; }

.below { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 48px; }
@media (max-width: 960px) { .below { grid-template-columns: 1fr; } }
.prose { max-width: 68ch; color: var(--text-2); }
.prose h2 { color: var(--text); margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose li { margin-bottom: 6px; }
.related h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.related-link { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 550; }
.related-link:hover { background: var(--surface); }
.faq { margin-top: 32px; max-width: 68ch; }
.faq details { border-top: 1px solid var(--border); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '\2212'; }
.faq p { margin: 10px 0 0; color: var(--text-2); }

/* ==========================================================================
   Present mode: the stage fills the screen and everything else hides.
   ========================================================================== */
body.presenting { overflow: hidden; }
body.presenting .site-header, body.presenting .site-footer, body.presenting .tool-head,
body.presenting .panel, body.presenting .below, body.presenting .hide-in-present { display: none !important; }
body.presenting .tool-layout { display: block; }
body.presenting .wrap { max-width: none; padding: 0; }
body.presenting .stage { position: fixed; inset: 0; z-index: 50; border-radius: 0; border: 0; min-height: 0; box-shadow: none; background: var(--bg); }
body.presenting .stage-bar { position: absolute; top: 0; right: 0; left: 0; border: 0; background: transparent; z-index: 2; opacity: 1; transition: opacity 0.4s; }
body.presenting.idle .stage-bar, body.presenting.idle .stage-controls { opacity: 0; }
body.presenting.idle { cursor: none; }
body.presenting .stage-controls { transition: opacity 0.4s; padding-bottom: 4vh; }
body.presenting .stage-controls .btn { height: 60px; padding: 0 28px; font-size: 1.15rem; border-radius: 14px; }
body.presenting .brand-mark { display: inline-flex; align-items: center; gap: 8px; position: absolute; left: 24px; bottom: 20px; font-size: 0.95rem; font-weight: 650; color: var(--muted); opacity: 0.8; z-index: 2; }
body.presenting .brand-mark svg { width: 22px; height: 22px; }
.exit-present { display: none; }
body.presenting .exit-present { display: inline-flex; }
body.presenting .enter-present { display: none; }

/* ==========================================================================
   Name picker
   ========================================================================== */
.picked-name {
  font-size: clamp(2.6rem, 8vw, 6.5rem); font-weight: 750; letter-spacing: -0.04em; line-height: 1.05;
  max-width: 100%; overflow-wrap: anywhere; color: var(--text);
}
.picked-name.placeholder { color: var(--muted); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.02em; }
.picked-name.rolling { color: var(--text-2); }
.picked-name.landed { animation: land 0.5s var(--ease); color: var(--accent); }
.picked-multi { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.picked-multi span { font-size: clamp(1.5rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; padding: 10px 22px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); animation: land 0.5s var(--ease) backwards; }
@keyframes land { 0% { transform: scale(0.92); opacity: 0.4; } 60% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }
.meter { width: min(320px, 70%); height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.4s var(--ease); }
.history { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 720px; }
.chip { font-size: 0.82rem; font-weight: 550; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
body.presenting .picked-name { font-size: clamp(4rem, 13vw, 14rem); }
body.presenting .picked-name.placeholder { font-size: clamp(2rem, 4vw, 3.5rem); }
body.presenting .picked-multi span { font-size: clamp(2rem, 5.5vw, 5rem); }
body.presenting .chip { font-size: 1rem; padding: 6px 14px; }

/* ==========================================================================
   Team maker
   ========================================================================== */
.teams { --cols: 4; width: 100%; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 14px; align-self: stretch; text-align: left; }
.team { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; animation: land 0.45s var(--ease) backwards; }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--team) 10%, var(--surface)); }
.team-name { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.015em; }
.team-name::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--team); }
.team-count { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.team ol { list-style: none; margin: 0; padding: 10px 14px 14px; display: grid; gap: 4px; }
.team li { font-weight: 550; font-size: 1rem; }
.empty-state { color: var(--muted); max-width: 40ch; }
.empty-state strong { display: block; color: var(--text); font-size: 1.2rem; margin-bottom: 6px; }
body.presenting .stage-body { padding: 72px 4vw 24px; }
body.presenting .teams { gap: 2vh 1.5vw; }
@media (max-width: 900px) { .teams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .teams { grid-template-columns: 1fr; } }
body.presenting .team-head { padding: 1.4vh 1.2vw; }
body.presenting .team-name { font-size: clamp(1.2rem, 2.2vw, 2.4rem); }
body.presenting .team li { font-size: clamp(1rem, 1.9vw, 2rem); }
body.presenting .team-count { font-size: clamp(0.8rem, 1.2vw, 1.2rem); }

/* ==========================================================================
   Stopwatch
   ========================================================================== */
.clock {
  font-size: clamp(3.4rem, 12vw, 9.5rem); font-weight: 650; letter-spacing: -0.045em; line-height: 1;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum', 'cv11', 'ss01';
  display: flex; align-items: baseline; justify-content: center;
}
.clock .cs { font-size: 0.5em; color: var(--muted); margin-left: 0.04em; letter-spacing: -0.03em; }
.clock.running { color: var(--text); }
.clock.paused { color: var(--text-2); }
.lap-now { font-size: 1.05rem; color: var(--muted); font-weight: 550; min-height: 1.6em; }
.lap-now b { color: var(--text-2); font-weight: 650; }
.laps { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.laps th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 0 10px 8px; }
.laps td { padding: 9px 10px; border-top: 1px solid var(--border); }
.laps td:not(:first-child), .laps th:not(:first-child) { text-align: right; }
.laps tr.fastest td:nth-child(2) { color: var(--green); font-weight: 650; }
.laps tr.slowest td:nth-child(2) { color: var(--red); font-weight: 650; }
.laps-wrap { max-height: 420px; overflow: auto; }
.laps-empty { color: var(--muted); font-size: 0.9rem; margin: 0; }
.stage-laps { display: none; }
body.presenting .clock { font-size: clamp(5rem, 22vw, 24rem); }
body.presenting .lap-now { font-size: clamp(1.2rem, 2.6vw, 2.4rem); }
body.presenting .stage-laps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 90vw; }
body.presenting .stage-laps .chip { font-size: clamp(0.9rem, 1.5vw, 1.4rem); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Traffic light
   ========================================================================== */
.signal { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 5vw, 72px); width: 100%; }
.housing {
  --lamp: clamp(72px, 11vh, 120px);
  display: grid; gap: calc(var(--lamp) * 0.18); padding: calc(var(--lamp) * 0.2);
  background: #1a1f2b; border-radius: calc(var(--lamp) * 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 40px -16px rgba(10, 13, 20, 0.45);
}
[data-theme='dark'] .housing { background: #05070b; box-shadow: inset 0 0 0 1px #232b3a, 0 20px 40px -16px rgba(0, 0, 0, 0.7); }
.lamp {
  width: var(--lamp); height: var(--lamp); border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: color-mix(in srgb, var(--c) 16%, #0b0e14);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.lamp[data-light='red'] { --c: var(--red); }
.lamp[data-light='amber'] { --c: var(--amber); }
.lamp[data-light='green'] { --c: var(--green); }
.lamp[aria-pressed='true'] {
  background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 46%, color-mix(in srgb, var(--c) 80%, #000) 100%);
  box-shadow: 0 0 calc(var(--lamp) * 0.5) color-mix(in srgb, var(--c) 60%, transparent), inset 0 -4px 10px rgba(0, 0, 0, 0.2);
}
.lamp:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 50%; }
.signal-text { text-align: left; max-width: 520px; }
.signal-label { font-size: clamp(2rem, 5vw, 4.2rem); font-weight: 750; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 10px; color: color-mix(in srgb, var(--sig, var(--text)) 78%, #000); transition: color 0.3s; }
[data-theme='dark'] .signal-label { color: var(--sig, var(--text)); }
.signal-desc { font-size: clamp(1rem, 1.8vw, 1.5rem); color: var(--text-2); margin: 0; }
@media (max-width: 640px) { .signal { flex-direction: column; } .signal-text { text-align: center; } }
.light-edit { display: grid; grid-template-columns: 14px 1fr; gap: 6px 10px; align-items: center; margin-bottom: 14px; }
.light-edit .dot { width: 12px; height: 12px; }
.light-edit input:last-child { grid-column: 2; font-size: 0.85rem; }
body.presenting .housing { --lamp: clamp(90px, 25vh, 260px); }
body.presenting .signal-label { font-size: clamp(3rem, 8vw, 9rem); }
body.presenting .signal-desc { font-size: clamp(1.2rem, 2.6vw, 2.6rem); }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 0.9rem; font-weight: 550; box-shadow: var(--shadow-lg); transition: opacity 0.2s, transform 0.2s var(--ease); z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 404 */
.notfound { padding: 96px 0; text-align: center; }
.notfound .big { font-size: clamp(5rem, 14vw, 9rem); font-weight: 800; letter-spacing: -0.06em; color: var(--accent); line-height: 1; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .site-header, .site-footer, .panel, .stage-bar, .stage-controls, .below { display: none !important; }
  .stage { border: 0; box-shadow: none; }
}
.icon-btn.armed { background: var(--red); color: #fff; border-color: var(--red); }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .stage-body { padding: 20px 16px; }
  .search kbd { display: none; }
  .hero { padding: 48px 0 24px; }
}
