@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg-2: #10131a;
  --surface: #151922;
  --surface-2: #1c212c;
  --surface-3: #283040;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --text: #eef1f6;
  --muted: #9aa3b2;
  --faint: #6d7585;
  --accent: #4d84ff;
  --accent-2: #7aa4ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(77, 132, 255, 0.16);
  --accent-text: #8fb2ff;
  --danger: #ff5a5f;
  --gold: #ffc94a;
  --fig: #e9edf4;
  --fig-far: #6f7889;
  --fig-base: #e9edf4;
  --fig-far-base: #6f7889;
  --fig-line: rgba(10, 12, 16, 0.35);
  --prop: #5a6273;
  --door: #252b37;
  --metal: #b9c1cf;
  --stage: radial-gradient(120% 90% at 50% 100%, #1b2130 0%, #141823 55%, #11141c 100%);
  --hero: linear-gradient(160deg, #142449 0%, #141923 62%);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --radius-sm: 14px;
  --nav-h: 72px;
  --rail: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wide: 'Archivo', system-ui, sans-serif;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f1f3f7;
  --bg-2: #e9ecf2;
  --surface: #ffffff;
  --surface-2: #e8ecf2;
  --surface-3: #d9dfe8;
  --line: rgba(15, 23, 42, 0.09);
  --line-2: rgba(15, 23, 42, 0.18);
  --text: #0f1420;
  --muted: #586174;
  --faint: #8a93a4;
  --accent: #2160f3;
  --accent-2: #4d84ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(33, 96, 243, 0.1);
  --accent-text: #1a4fd1;
  --fig: #1a2030;
  --fig-far: #a3abb8;
  --fig-base: #1a2030;
  --fig-far-base: #a3abb8;
  --fig-line: rgba(255, 255, 255, 0.4);
  --prop: #8a93a3;
  --door: #dde2ea;
  --metal: #6b7484;
  --stage: radial-gradient(120% 90% at 50% 100%, #ffffff 0%, #f3f5f9 60%, #eceff4 100%);
  --hero: linear-gradient(160deg, #d9e5ff 0%, #ffffff 62%);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--wide);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.display {
  font-stretch: 125%;
  font-weight: 850;
  letter-spacing: -0.01em;
  line-height: 0.98;
  text-transform: uppercase;
}
.condensed { font-stretch: 70%; font-weight: 800; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 16px + var(--safe-b)); }
@media (min-width: 960px) {
  .app { padding-bottom: 32px; }
  .wlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blocks.plan { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .sticky-foot { max-width: 520px; margin-left: auto; }
}
.view { max-width: 760px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px 24px; animation: view-in 0.28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
@media (min-width: 960px) { .view { max-width: 1120px; padding: 24px 32px 40px; } .view.narrow { max-width: 820px; } }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 10px; }
.grow { flex: 1; min-width: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.topbar h1 { font-size: 28px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-stretch: 125%; font-weight: 900; font-size: 20px; letter-spacing: -0.01em; text-transform: uppercase; }
.wordmark svg { width: 30px; height: 30px; }
.back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 650; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--surface); color: var(--text); flex: none; }
.icon-btn svg, .back svg { width: 20px; height: 20px; }

/* ---------- Nav ---------- */
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line-2);
}
.tabbar .tab-brand { display: none; }
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 4px 0 6px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 750; letter-spacing: 0.01em; }
.tabbar a svg { width: 24px; height: 24px; padding: 4px 18px; box-sizing: content-box; border-radius: 999px; transition: background 0.2s var(--ease), color 0.2s; }
.tabbar a:hover { color: var(--text); }
.tabbar a[aria-current='page'] { color: var(--text); }
.tabbar a[aria-current='page'] svg { background: var(--accent); color: var(--accent-ink); }

/* Desktop: the tab bar becomes a sidebar. */
@media (min-width: 960px) {
  :root { --rail: 236px; --nav-h: 0px; }
  .app { padding-left: var(--rail); }
  .tabbar {
    inset: 0 auto 0 0; width: var(--rail);
    grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 4px;
    padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--bg-2);
  }
  .tabbar .tab-brand { display: flex; margin: 0 8px 22px; padding: 0; font-size: 18px; color: var(--text); background: none; }
  .tabbar .tab-brand svg { width: 30px; height: 30px; }
  .tabbar a { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; padding: 10px 12px; font-size: 15px; border-radius: 14px; }
  .tabbar a svg { padding: 0; width: 22px; height: 22px; background: none !important; }
  .tabbar a:hover { background: var(--surface-2); }
  .tabbar a[aria-current='page'] { background: var(--accent-soft); color: var(--accent-text); }
  .tabbar a[aria-current='page'] svg { color: var(--accent); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  font-weight: 750; letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease), background 0.2s;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.huge { height: 68px; font-size: 20px; font-stretch: 115%; font-weight: 850; text-transform: uppercase; letter-spacing: 0.02em; border-radius: 22px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap;
}
.chip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.tag.accent { background: var(--accent-soft); color: var(--text); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.tap { transition: transform 0.15s var(--ease); cursor: pointer; }
.card.tap:active { transform: scale(0.985); }
.stage { background: var(--stage); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.figslot { display: block; aspect-ratio: 1; width: 100%; }
.figslot svg { width: 100%; height: 100%; display: block; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 0; background: var(--hero); }
.hero-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 10px 10px 0; }
.hero-figs .figslot { aspect-ratio: 1; }
.hero-body { padding: 4px 18px 18px; }
.hero h2 { font-size: clamp(30px, 9vw, 44px); margin: 6px 0 8px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

/* Today */
.dash { display: grid; gap: 14px; }
.greet h1 { font-size: clamp(26px, 7vw, 38px); margin-top: 4px; }
.greet { margin-bottom: 14px; }
.hero-blurb { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; max-width: 46ch; }
.hero-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.hero-actions .btn.ghost { height: 68px; border-radius: 22px; padding: 0 22px; }
@media (max-width: 559px) { .hero-actions { grid-template-columns: 1fr; } .hero-actions .btn.ghost { display: none; } }
.dash-side { display: grid; gap: 14px; align-content: start; }
.weekcard { display: grid; gap: 14px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 12px; }
.mini-stats div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.mini-stats b { display: block; font-size: 26px; line-height: 1; font-stretch: 70%; font-weight: 850; font-variant-numeric: tabular-nums; }
.mini-stats small { font-size: 15px; color: var(--muted); }
.mini-stats span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
@media (min-width: 960px) {
  .today-top .wordmark { visibility: hidden; }
  .dash { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
  .greet { margin-top: -50px; }
}

/* Week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { display: grid; justify-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--faint); }
.day i { width: 100%; height: 34px; max-width: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); display: grid; place-items: center; }
.day.done i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day.today { color: var(--text); }
.day.today i { outline: 2px solid var(--accent); outline-offset: 2px; }
.day i svg { width: 16px; height: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.stat b { display: block; font-size: 28px; line-height: 1; font-stretch: 70%; font-weight: 850; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }

/* Workout cards */
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
@media (min-width: 560px) { .hscroll { grid-auto-columns: 42%; } }
@media (min-width: 720px) {
  .hscroll { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .chips:not(.nowrap) { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0; }
}
.wcard { padding: 0; overflow: hidden; display: grid; }
.wcard .stage { border-radius: 0; aspect-ratio: auto; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; padding: 6px 4px 0; }
.wcard .body { padding: 12px 14px 14px; }
.wcard h3 { font-size: 17px; font-stretch: 112%; font-weight: 850; text-transform: uppercase; letter-spacing: -0.005em; }
.wcard p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.wlist { display: grid; gap: 10px; }
.wrow { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 10px; }
.wrow .stage { width: 72px; height: 72px; }
.wrow h3 { font-size: 16px; font-weight: 800; font-stretch: 108%; }
.wrow p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* Generator */
.gen { display: grid; gap: 14px; }
.dash-side .gen .seg button { font-size: 13px; }
.gen .label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Moves library ---------- */
.search { position: relative; }
.search input { width: 100%; height: 48px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px 0 44px; font-size: 16px; }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--faint); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.mcard { padding: 8px; position: relative; }
.mcard .stage { aspect-ratio: 1; }
.mcard h3 { font-size: 14px; font-weight: 750; line-height: 1.2; margin: 9px 4px 2px; }
.mcard p { margin: 0 4px 4px; font-size: 11.5px; color: var(--muted); }
.mcard .pick {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1.5px solid var(--line-2); color: var(--text);
}
.mcard .pick svg { width: 18px; height: 18px; }
.mcard.picked { border-color: var(--accent); }
.mcard.picked .pick { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pattern-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.count { font-size: 12px; color: var(--muted); font-weight: 650; }

/* Move detail */
.hscroll.similar { grid-auto-columns: 38%; }
@media (min-width: 720px) { .hscroll.similar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .detail-media { position: sticky; top: 20px; }
  .detail-stage { max-height: none; width: 100%; }
  .detail-title { margin-top: 0; }
}
.detail-stage { aspect-ratio: 1; max-height: 52vh; margin: 0 auto; border-radius: var(--radius); }
.detail-title { font-size: clamp(30px, 8.5vw, 46px); margin: 18px 0 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.band-picker { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: 0 -2px; }
.band-picker::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .band-picker { flex-wrap: wrap; overflow: visible; } }
.swatch { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s var(--ease); }
.swatch[aria-pressed='true'] { transform: scale(1.06); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.swatch b { position: absolute; inset: auto -4px -4px auto; min-width: 18px; height: 18px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.cue-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cue-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-weight: 600; }
.cue-list li span { width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.rig { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface); }
.rig ol { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: rig; display: grid; gap: 9px; }
.rig li { counter-increment: rig; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-weight: 600; }
.rig li::before { content: counter(rig); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 850; font-size: 13px; display: grid; place-items: center; }
.rig .harder { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 650; }
.history-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.history-table td { padding: 8px 0; border-top: 1px solid var(--line); }
.history-table td:last-child { text-align: right; }
.band-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 3px; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.25); }

/* ---------- Sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.5); animation: fade-in 0.2s; }
.sheet {
  position: fixed; left: var(--rail); right: 0; bottom: 0; z-index: 61; max-height: 92dvh; overflow: auto;
  background: var(--bg-2); border-radius: 26px 26px 0 0; padding: 10px 16px calc(20px + var(--safe-b));
  animation: sheet-in 0.32s var(--ease); max-width: 720px; margin: 0 auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 14px; }
.sheet.tall { height: 92dvh; display: flex; flex-direction: column; }
.sheet.tall .sheet-scroll { flex: 1; overflow: auto; margin: 0 -16px; padding: 0 16px; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 960px) {
  .sheet { inset: 0; margin: auto; width: min(760px, 92vw); height: fit-content; max-height: 86vh; border-radius: 26px; padding: 22px 24px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
  .sheet.tall { height: 86vh; }
  .sheet .grab { display: none; }
  @keyframes sheet-in { from { transform: translateY(16px) scale(0.98); opacity: 0; } }
}
@keyframes fade-in { from { opacity: 0; } }

.who { display: grid; gap: 10px; }
.who button { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface); border: 2px solid transparent; text-align: left; font-weight: 750; font-size: 17px; }
.who button[aria-pressed='true'] { border-color: var(--accent); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #111; flex: none; font-size: 16px; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.who .check { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.who button[aria-pressed='true'] .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.who .check svg { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.field input[type='text'], .field input[type='number'], .field select { height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 16px; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; height: 52px; overflow: hidden; }
.stepper button { height: 100%; font-size: 22px; font-weight: 700; }
.stepper button:active { background: var(--surface-2); }
.stepper output { text-align: center; font-size: 20px; font-stretch: 75%; font-weight: 850; font-variant-numeric: tabular-nums; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); font-weight: 650; }
.toggle input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--surface-3); position: relative; transition: background 0.2s; flex: none; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(20px); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { height: 40px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--text); }

/* ---------- Builder ---------- */
.blocks { display: grid; gap: 10px; }
.gear-need { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 650; }
.block { padding: 0; overflow: hidden; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0 14px; }
.block-head .eyebrow { color: var(--accent-text); }
.bitem { display: grid; grid-template-columns: 30px 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px 8px 6px; }
.bitem + .bitem { border-top: 1px solid var(--line); }
.bitem .stage { width: 56px; height: 56px; border-radius: 12px; }
.bitem h4 { margin: 0; font-size: 15px; font-weight: 750; }
.bitem p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.handle { width: 30px; height: 44px; display: grid; place-items: center; color: var(--faint); touch-action: none; cursor: grab; }
.handle svg { width: 18px; height: 18px; }
.block.dragging { opacity: 0.9; box-shadow: var(--shadow); transform: scale(1.02); z-index: 2; position: relative; }
.link-btn { display: flex; justify-content: center; margin: -4px 0; }
.link-btn button { font-size: 11.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 6px 12px; border-radius: 999px; }
.link-btn button:hover { color: var(--text); }
.sticky-foot { position: sticky; bottom: calc(var(--nav-h) + 8px + var(--safe-b)); padding: 12px 0 0; background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 10px; }

/* ---------- Log ---------- */
.heat { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10px, 1fr); grid-template-rows: repeat(7, auto); gap: 4px; overflow-x: auto; }
.heat i { aspect-ratio: 1; min-width: 10px; max-height: 26px; border-radius: 4px; background: var(--surface-2); }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.heat i.l2 { background: var(--accent); }
.session-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.date-badge { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; text-align: center; line-height: 1; }
.date-badge b { font-size: 20px; font-stretch: 75%; font-weight: 850; display: block; }
.date-badge span { font-size: 10px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pb-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }

/* ---------- Bands guide ---------- */
.band-row { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.band-chip { width: 48px; height: 48px; border-radius: 14px; background: var(--c); display: grid; place-items: center; color: var(--ink); font-weight: 900; font-size: 12px; }
.range { position: relative; height: 10px; border-radius: 5px; background: var(--surface-2); margin-top: 8px; }
.range i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--c); }
.calc-total { font-size: 44px; font-stretch: 75%; font-weight: 900; line-height: 1; }

/* ---------- Player ---------- */
.player {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
  padding-top: var(--safe-t);
  animation: player-in 0.35s var(--ease);
}
[hidden] { display: none !important; }
.pbar, .pmain, .pfoot { width: 100%; max-width: 620px; margin: 0 auto; }
@keyframes player-in { from { transform: translateY(24px); opacity: 0; } }
.pbar { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 14px 6px; }
.segments { display: flex; gap: 3px; height: 6px; }
.segments i { flex: 1; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; }
.segments i.done { background: var(--accent); }
.segments i.now::after { content: ''; position: absolute; inset: 0; width: var(--p, 0%); background: var(--accent); border-radius: 3px; }
.clock { font-stretch: 72%; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 52px; text-align: right; }
.pmain { overflow-y: auto; overflow-x: hidden; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.pstage { position: relative; border-radius: 26px; background: var(--stage); flex: none; aspect-ratio: 1; max-height: 40dvh; width: 100%; margin: 0 auto; max-width: 40dvh; }
@media (min-height: 760px) { .pstage { max-height: 44dvh; max-width: 44dvh; } }
/* Give the controls room when there's more to log. */
@media (max-width: 959px) {
  .pmain:has(.rig) .pstage, .pmain:has(.multi) .pstage { max-height: 32dvh; max-width: 32dvh; }
  .pmain:has(.rig):has(.multi) .pstage { max-height: 26dvh; max-width: 26dvh; }
}
.pstage .figslot { aspect-ratio: auto; height: 100%; }
.pstage .duo { display: grid; grid-template-columns: 1fr 1fr; height: 100%; }
.pstage:has(.duo) { aspect-ratio: 2 / 1; max-width: none !important; max-height: 34dvh !important; }
.pstage .duo .figslot { height: 100%; }
.pstage .badge { position: absolute; top: 12px; left: 12px; }
.pstage .corner { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.pstage .corner button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(8px); }
.pstage .corner svg { width: 20px; height: 20px; }
.who-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 4px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(8px); font-weight: 800; font-size: 14px; }
.who-pill .avatar { width: 26px; height: 26px; font-size: 12px; }
.pname { font-size: clamp(26px, 7.4vw, 40px); }
.psub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-weight: 650; font-size: 14px; }
.set-pips { display: inline-flex; gap: 4px; }
.set-pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.set-pips i.done { background: var(--accent); }
.set-pips i.now { background: var(--text); }
.suggest { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }
.suggest b { font-weight: 850; }
.suggest .tag { flex: none; }
.suggest.up { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.suggest.up .tag { background: color-mix(in srgb, var(--gold) 25%, transparent); color: var(--text); }
.logger { display: grid; gap: 10px; }
.logger-row { display: grid; gap: 10px; }
.rep-dial { display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; gap: 8px; }
.rep-dial button { height: 76px; border-radius: 22px; background: var(--surface); font-size: 34px; font-weight: 600; border: 1px solid var(--line); }
.rep-dial button:active { background: var(--surface-2); transform: scale(0.96); }
.rep-dial output { text-align: center; font-size: 76px; line-height: 0.9; font-stretch: 65%; font-weight: 900; font-variant-numeric: tabular-nums; }
.rep-dial small { display: block; font-size: 12px; font-stretch: 100%; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }
.effort { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.effort button { height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 750; color: var(--muted); }
.effort button[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pfoot { padding: 10px 16px calc(12px + var(--safe-b)); display: grid; gap: 8px; background: linear-gradient(transparent, var(--bg) 22%); }
.pfoot .minor { display: flex; justify-content: space-between; }
.pfoot .minor button { font-size: 13.5px; font-weight: 700; color: var(--muted); padding: 8px 6px; }
.multi .rep-dial { grid-template-columns: 56px 1fr 56px; }
.multi .rep-dial button { height: 56px; font-size: 26px; }
.multi .rep-dial output { font-size: 52px; }
.athlete-log { padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; }

/* Laptop: stage on the left, logging on the right. */
.kbd-hint { display: none; margin: 0; text-align: center; font-size: 12px; color: var(--faint); }
kbd { font: 700 11px/1 var(--wide); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); margin: 0 1px; }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: block; } }
@media (min-width: 960px) and (min-height: 600px) {
  .player { grid-template-rows: auto auto 1fr; overflow-y: auto; }
  .pbar, .pmain, .pfoot { max-width: 1120px; padding-left: 32px; padding-right: 32px; }
  .pmain { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; row-gap: 14px; align-content: start; padding-top: 16px; overflow: visible; }
  .pmain > .pstage { grid-column: 1; grid-row: 1 / span 8; width: 100%; max-width: min(100%, 64vh); max-height: none; margin: 0; justify-self: end; }
  .pmain > :not(.pstage) { grid-column: 2; }
  .pfoot { align-self: start; padding-left: calc(50% + 20px); padding-top: 0; background: none; }
  .pmain.finish, .player.resting .pmain { display: flex; max-width: 660px; }
  .player.resting .pfoot, .player:has(.finish) .pfoot { padding-left: 32px; max-width: 660px; }
}

/* Timer + rest */
.ring { position: relative; width: min(64vw, 300px); aspect-ratio: 1; margin: 6px auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center b { display: block; font-size: clamp(64px, 20vw, 96px); line-height: 0.9; font-stretch: 65%; font-weight: 900; font-variant-numeric: tabular-nums; }
.ring .center span { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rest-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.next-card { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; padding: 10px; }
.next-card .stage { width: 84px; height: 84px; }
.next-card h3 { font-size: 18px; font-weight: 850; font-stretch: 105%; }
.handoff { text-align: center; padding: 8px 0; }
.handoff .avatar { width: 72px; height: 72px; font-size: 30px; margin: 0 auto 10px; }
.player.resting { background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 12%, var(--bg)) 0%, var(--bg) 60%); }
.go-flash { animation: go 0.6s var(--ease); }
@keyframes go { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Finish */
.finish { text-align: center; padding-top: 12px; }
.finish h1 { font-size: clamp(40px, 12vw, 64px); margin: 8px 0; }
.finish .stat-row { text-align: left; }
.pb-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--gold) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); text-align: left; font-weight: 650; }
.pb-banner svg { width: 22px; height: 22px; color: var(--gold); flex: none; }

/* Toast */
.toast { position: fixed; left: calc(50% + var(--rail) / 2); bottom: calc(var(--nav-h) + 24px + var(--safe-b)); z-index: 90; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 750; font-size: 14px; box-shadow: var(--shadow); animation: toast 2.4s var(--ease) forwards; white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.toast button { color: var(--accent-2); font-weight: 850; }
:root[data-theme='light'] .toast button { color: #9dbcff; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 6px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; }

.resume { position: fixed; left: calc(12px + var(--rail)); right: 12px; bottom: calc(var(--nav-h) + 10px + var(--safe-b)); z-index: 25; max-width: 696px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: var(--shadow); }
.resume .btn { background: var(--accent-ink); color: var(--accent); height: 40px; }
@media (min-width: 960px) { .resume { bottom: 20px; } }

/* ---------- Figure ---------- */
.fig .fig-floor { stroke: var(--line-2); stroke-width: 1.5; }
.fig .fig-shadow { fill: #000; opacity: 0.22; }
:root[data-theme='light'] .fig .fig-shadow { opacity: 0.08; }
.fig-body line, .fig-far line, .fig .torso-side { stroke-linecap: round; fill: none; }
.fig-body line, .fig .torso-side, .fig .torso-front { stroke: var(--fig); }
.fig-body .hand, .fig .head { fill: var(--fig); stroke: none; }
.fig-far line { stroke: var(--fig-far); }
.fig-far .hand { fill: var(--fig-far); }
.fig .torso-front { fill: var(--fig); stroke-width: 7; stroke-linejoin: round; }
.fig .torso-side { stroke-width: 17; }
.fig .leg.upper { stroke-width: 12; }
.fig .leg.lower { stroke-width: 9.5; }
.fig .arm.upper { stroke-width: 8.5; }
.fig .arm.lower { stroke-width: 7; }
.fig .foot { stroke-width: 5.5; }
.fig[data-tint] { --fig: color-mix(in srgb, var(--tint) 62%, var(--fig-base)); --fig-far: color-mix(in srgb, var(--tint) 40%, var(--fig-far-base)); }
.fig .fig-detail { fill: var(--fig); stroke: var(--fig-line); stroke-width: 1.1; }
.fig ellipse.fig-detail { stroke: none; }
.fig path.fig-detail { fill: none; stroke: var(--fig); stroke-width: 3.8; stroke-linecap: round; }
.fig .fig-outline { fill: none; stroke: var(--fig-line); stroke-width: 5.4; stroke-linecap: round; }
.fig .fig-hair { fill: var(--fig); stroke: var(--fig); stroke-width: 5; stroke-linecap: round; }
.fig .fig-band { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.fig .fig-plate { fill: var(--prop); }
.fig .fig-door { fill: var(--door); }
.fig .fig-anchor { fill: #c9a227; }
.fig .fig-bar { stroke: var(--metal); stroke-width: 4; stroke-linecap: round; }
.fig .fig-bar-end { fill: var(--metal); stroke: var(--door); stroke-width: 1.5; }
.fig .fig-handle { fill: var(--surface); stroke: var(--metal); stroke-width: 1.4; }
.fig .fig-prop { fill: var(--surface-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
