/* =========================================================
   AESTHETICS BLUEPRINT — Design System
   Single source of truth for layout, color, typography.
   Edit tokens in :root to retheme.
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Brand */
  --bg:           #f5f5f7;
  --bg-card:      #ffffff;
  --bg-card-2:    #fafafa;
  --bg-dark:      #0a0a0a;
  --bg-dark-2:    #1a1a1a;
  --ink:          #0a0a0a;
  --ink-mute:     #5b5b60;
  --ink-faint:    #9a9aa1;
  --line:         #e6e6ea;
  --line-strong:  #d4d4d8;
  --accent:       #dc2626;       /* energetic red — used sparingly for CTAs / PRs / streaks */
  --accent-soft:  #fef2f2;
  --good:         #16a34a;
  --warn:         #d97706;
  --bad:          #dc2626;

  /* Type */
  --display: 'Bebas Neue', sans-serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --nav-h-desktop: 64px;
  --nav-h-mobile:  68px;
  --page-max: 1180px;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: linear-gradient(180deg, #fbfbfc 0%, #f4f4f7 46%, #f7f7f8 100%);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h-mobile) + env(safe-area-inset-bottom, 0px) + 40px);
  position: relative;
  isolation: isolate;
}
body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: -1;
}
body::before {
  top: -180px;
  right: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,38,38,.12) 0%, rgba(220,38,38,0) 72%);
}
body::after {
  top: 200px;
  left: -180px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15,23,42,.06) 0%, rgba(15,23,42,0) 74%);
}
@media (min-width: 820px) { body { padding-bottom: 0; padding-top: 0; } }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- Typography ---------- */
.h-display { font-family: var(--display); letter-spacing: 0.02em; line-height: 1; }
h1, h2, h3, h4 { margin: 0 0 12px; font-family: var(--display); letter-spacing: 0.02em; line-height: 1; }
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.65rem); }
h4 { font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; }
p  { margin: 0 0 14px; color: var(--ink-mute); line-height: 1.7; }
strong { color: var(--ink); }
em { color: var(--ink); font-style: italic; }
.muted { color: var(--ink-mute); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }
.mono  { font-family: var(--mono); }
.uppercase { text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Layout ---------- */
.shell { max-width: var(--page-max); margin: 0 auto; padding: 0 16px; }
.page  { padding: 24px 16px 56px; max-width: var(--page-max); margin: 0 auto; }
@media (min-width: 768px) { .page { padding: 40px 24px 72px; } }
@media (min-width: 1280px) { .shell, .page { padding-left: 28px; padding-right: 28px; } }

.row    { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.center-y { align-items: center; }
.row.between { justify-content: space-between; }
.col    { display: flex; flex-direction: column; gap: 12px; }
.gap-4  { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grid   { display: grid; gap: 16px; align-items: stretch; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1160px) {
  .grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

.spacer-8  { height: 8px; }
.spacer-16 { height: 16px; }
.spacer-32 { height: 32px; }

/* ---------- Card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(140%) blur(8px);
}
.card.lg { padding: clamp(22px, 3.2vw, 30px); border-radius: var(--radius-lg); }
.grid > .card,
.grid > form.card,
.summary-grid > .summary-card,
.shortcut-grid > .shortcut-card,
.chapter-grid > .chapter-card {
  height: 100%;
}
.grid > .card,
.grid > form.card,
.summary-card {
  display: flex;
  flex-direction: column;
}
.grid > .card > .btn:last-child,
.grid > form.card > .btn:last-child,
.grid > .card > .chips:last-child,
.grid > form.card > .chips:last-child,
.grid > .card > .form-note:last-child,
.grid > form.card > .form-note:last-child,
.grid > .card > .danger-zone:last-child,
.grid > form.card > .danger-zone:last-child,
.grid > .card > .action-stack:last-child,
.grid > form.card > .action-stack:last-child {
  margin-top: auto;
}
.grid > .card > .btn:last-child,
.grid > form.card > .btn:last-child {
  align-self: flex-start;
  width: min(100%, 220px);
}
.card.dark {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #fff; border-color: #2a2a2a;
}
.card.dark p { color: rgba(255,255,255,.78); }
.card.accent {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #fff; border-color: transparent;
}
.card.accent p { color: rgba(255,255,255,.9); }
.card.flush { padding: 0; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.05em;
  border: 2px solid var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost     { background: transparent; color: var(--ink); border-color: transparent; }
.btn.danger    { background: var(--accent); border-color: var(--accent); }
.btn.sm        { padding: 8px 14px; font-size: .9rem; }
.btn.lg        { padding: 16px 28px; font-size: 1.2rem; }
.btn.full      { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--line); }

/* ---------- Inputs ---------- */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.textarea { min-height: 90px; resize: vertical; }
.label {
  display: block; margin-bottom: 6px;
  font-size: .85rem; font-weight: 600; color: var(--ink);
  text-transform: uppercase; letter-spacing: .04em;
}
.field { margin-bottom: 16px; }
.help { font-size: .82rem; color: var(--ink-faint); margin-top: 6px; }
.hstack-input { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* Choice chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line-strong);
  font-weight: 500; transition: all .15s ease;
  font-size: .95rem;
}
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.danger.active { background: var(--accent); border-color: var(--accent); }

/* ---------- Pill / Badge ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .04em;
  line-height: 1;
}
.pill.accent  { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.dark    { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.good    { background: #ecfdf5; color: var(--good); border-color: transparent; }

.hero-copy > .pill:first-child,
.page-hero-copy > .pill:first-child,
.page-hero-aside > .pill:first-child,
.card > .pill:first-child,
.shortcut-card > .pill:first-child,
.onboard-header > .pill:first-child,
.danger-zone > .pill:first-child {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 14px;
}

/* ---------- Stat block ---------- */
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 164px;
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}
.stat .label { margin: 0; font-size: .72rem; letter-spacing: .08em; color: var(--ink-faint); }
.stat .value {
  font-family: var(--mono);
  font-size: clamp(1.85rem, 3.4vw, 2.7rem);
  font-weight: 700;
  color: var(--ink);
  line-height: .94;
}
.stat .value.display { font-family: var(--display); letter-spacing: .02em; }
.stat .delta {
  font-size: .92rem;
  color: var(--ink-faint);
  line-height: 1.55;
  line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.stat .delta.up { color: var(--good); }
.stat .delta.down { color: var(--bad); }
@media (max-width: 639px) { .stat { min-height: auto; } }

/* ---------- Top Nav (desktop) ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  height: var(--nav-h-desktop);
  display: flex; align-items: center;
}
.topnav .shell { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; min-width: 0; }
.brand {
  font-family: var(--display); font-size: 1.4rem; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}
.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.topnav-links { display: none; gap: 4px; min-width: 0; flex: 1; justify-content: center; }
@media (min-width: 820px) { .topnav-links { display: flex; } }
.topnav-link {
  padding: 8px 14px; border-radius: 10px;
  font-size: .9rem; font-weight: 500;
  color: var(--ink-mute);
  transition: background .15s, color .15s;
}
.topnav-link:hover { background: var(--bg); color: var(--ink); }
.topnav-link.active { background: var(--ink); color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; }
.nav-theme,
.nav-settings {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.82);
}
.nav-theme:hover,
.nav-settings:hover { background: var(--bg); }
.nav-theme svg,
.nav-settings svg { width: 18px; height: 18px; }
.nav-status {
  min-width: 0;
  white-space: nowrap;
}
.nav-status-short {
  display: none;
}
@media (min-width: 820px) { .nav-settings { display: none; } }
@media (min-width: 820px) and (max-width: 1040px) {
  .brand { font-size: 1.2rem; }
  .topnav-link { padding: 7px 10px; font-size: .82rem; }
}
@media (max-width: 819px) {
  .brand {
    flex: 1;
  }
  .nav-actions {
    gap: 6px;
  }
  .nav-theme,
  .nav-settings {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    flex: 0 0 auto;
  }
  .nav-status {
    padding-left: 10px;
    padding-right: 10px;
  }
}
@media (max-width: 520px) {
  .brand {
    max-width: 100%;
  }
  .nav-status-full {
    display: none;
  }
  .nav-status-short {
    display: inline;
  }
}
@media (max-width: 380px) {
  .topnav .shell {
    gap: 8px;
  }
  .brand {
    font-size: 1.18rem;
  }
  .nav-status {
    padding-left: 8px;
    padding-right: 8px;
    font-size: .72rem;
  }
}

/* ---------- Bottom Nav (mobile) ---------- */
.bottomnav {
  position: fixed; bottom: 10px; left: 12px; right: 12px; z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 22px;
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  max-width: 760px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 820px) { .bottomnav { display: none; } }
.bottomnav-link {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px;
  font-size: .65rem; font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: .04em; text-transform: uppercase;
  flex: 1; min-width: 0;
}
.bottomnav-link.active { color: var(--ink); }
.bottomnav-link.active svg { color: var(--accent); }
.bottomnav-link svg { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #070707 0%, #18181b 55%, #09090b 100%);
  color: #fff;
  border-radius: 30px;
  padding: clamp(24px, 4vw, 40px);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ''; position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(220,38,38,.18) 0%, transparent 70%);
}
.hero::after {
  content: '';
  position: absolute;
  left: -40px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 72%);
}
.hero > * { position: relative; z-index: 1; }
.hero.hero-grid { display: grid; gap: 24px; }
@media (min-width: 820px) {
  .hero.hero-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .82fr);
    align-items: end;
  }
}
.hero-copy { min-width: 0; }
.hero h1 {
  color: #fff;
  margin-bottom: 10px;
  font-size: clamp(2.45rem, 5.8vw, 4.5rem);
  line-height: .92;
  max-width: 13ch;
}
.hero p  {
  color: rgba(255,255,255,.78);
  margin-bottom: 0;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  max-width: 56rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.hero-actions .btn {
  min-width: 0;
  width: min(100%, 240px);
}
.auth-shell {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  align-items: start;
}
@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1.08fr) 320px;
  }
}
.auth-mode-toggle {
  margin: 18px 0 16px;
}
.auth-mode-toggle .chip {
  flex: 1 1 0;
  justify-content: center;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-error {
  display: inline-flex;
  justify-content: center;
}
.auth-note-list {
  margin: 16px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
  color: var(--ink-mute);
}
@media (max-width: 520px) {
  .auth-shell {
    gap: 14px;
  }
}
.hero-blueprint-note {
  margin-top: 16px;
  color: rgba(255,255,255,.72);
  font-size: .92rem;
  line-height: 1.55;
}
.hero-aside {
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.03) 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  padding: 20px;
}
.hero-aside-title {
  display: block;
  margin-bottom: 14px;
  color: rgba(255,255,255,.7);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hero-metric-grid {
  display: grid;
  gap: 1px;
  padding: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}
.hero-metric {
  background: rgba(10,14,22,.24);
  border: 0;
  border-radius: 0;
  padding: 16px;
  min-height: 0;
  min-width: 0;
}
.hero-metric-label {
  display: block;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.hero-metric-value {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: clamp(1.12rem, 1.75vw, 1.7rem);
  line-height: .98;
  letter-spacing: .02em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.hero-metric-sub {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.7);
  font-size: .84rem;
  line-height: 1.45;
}

.page-hero {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 4vw, 34px);
  background: linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.9) 100%);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: -40% auto auto 58%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,38,38,.08) 0%, rgba(220,38,38,0) 72%);
}
.page-hero--train::before {
  inset: -22% auto auto 68%;
  width: 360px;
  height: 300px;
  background: radial-gradient(circle, rgba(220,38,38,.11) 0%, rgba(220,38,38,0) 74%);
}
.page-hero > * { position: relative; z-index: 1; }
@media (min-width: 820px) {
  .page-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .95fr);
    align-items: end;
  }
  .page-hero--train {
    align-items: stretch;
  }
  .page-hero--train .page-hero-copy {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .page-hero--train .page-hero-aside {
    align-self: start;
  }
}
.train-day-switcher {
  margin-top: auto;
}
.page-hero-copy { min-width: 0; padding-right: clamp(0px, 1vw, 18px); }
.page-hero h1 {
  margin-bottom: 12px;
  max-width: 13.5ch;
  font-size: clamp(2.1rem, 4.9vw, 3.9rem);
  line-height: .92;
}
.page-hero p {
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  max-width: 52rem;
  margin-bottom: 0;
}
.page-hero-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #fbfbfc 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.page-hero-meta {
  display: grid;
  gap: 1px;
  padding: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 20px;
  overflow: hidden;
  background: var(--line);
}
.page-hero-metric {
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  min-width: 0;
  min-height: 0;
}
.page-hero-metric .label {
  margin-bottom: 4px;
  font-size: .7rem;
  color: var(--ink-faint);
}
.page-hero-metric strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.08rem, 2.1vw, 1.65rem);
  line-height: .95;
  letter-spacing: .02em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.page-hero-note {
  font-size: .92rem;
  color: var(--ink-mute);
  line-height: 1.55;
}
.summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: stretch;
}
@media (min-width: 720px) {
  .summary-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.summary-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15,23,42,.04);
}
.summary-card .kicker {
  display: block;
  margin-bottom: 8px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
}
.summary-card h3 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}
.summary-card p {
  margin: 0;
  color: var(--ink-mute);
  line-height: 1.55;
}
.blueprint-priority-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.blueprint-priority-card h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.5vw, 2.3rem);
}
.plan-ribbon,
.plan-inline-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.plan-ribbon {
  margin-top: 18px;
}
.plan-hero-actions {
  margin-top: 20px;
}
.plan-quick-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .plan-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.plan-card h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}
.plan-bullet-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 10px;
}
.plan-bullet-list.compact {
  gap: 8px;
}
.plan-macro-grid {
  display: grid;
  gap: 1px;
  padding: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 20px;
  overflow: hidden;
  background: var(--line);
}
.plan-macro-card {
  padding: 15px 16px;
  border-radius: 0;
  border: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
}
.plan-macro-card .label {
  margin-bottom: 6px;
}
.plan-macro-card strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
  line-height: .96;
}
.plan-macro-card p {
  margin: 6px 0 0;
  color: var(--ink-mute);
  font-size: .88rem;
  line-height: 1.5;
}
.plan-layout {
  display: grid;
  gap: 16px;
}
@media (min-width: 980px) {
  .plan-layout {
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
    align-items: start;
  }
}
.plan-day-grid {
  display: grid;
  gap: 14px;
}
.plan-day-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(251,251,252,.96) 100%);
  display: grid;
  gap: 14px;
  box-shadow: 0 10px 26px rgba(15,23,42,.04);
}
.plan-day-card.current {
  border-color: rgba(220,38,38,.3);
  box-shadow: 0 14px 36px rgba(220,38,38,.08);
}
.plan-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.plan-day-head h3 {
  margin: 10px 0 6px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}
.plan-day-head p {
  margin: 0;
  color: var(--ink-mute);
}
.plan-day-meta {
  display: grid;
  gap: 1px;
  padding: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 18px;
  overflow: hidden;
  background: var(--line);
}
.plan-day-meta div {
  padding: 13px 14px;
  border-radius: 0;
  border: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
}
.plan-day-meta span {
  display: block;
  margin-bottom: 4px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.plan-day-meta strong {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: .96;
}
.plan-note-stack {
  display: grid;
  gap: 1px;
  padding: 1px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--line);
}
.plan-note {
  padding: 14px 16px;
  border-radius: 0;
  border: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  line-height: 1.55;
}
.plan-food-grid {
  display: grid;
  gap: 1px;
  padding: 1px;
  grid-template-columns: 1fr;
  border-radius: 20px;
  overflow: hidden;
  background: var(--line);
}
@media (min-width: 680px) {
  .plan-food-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.plan-food-card {
  padding: 16px;
  border-radius: 0;
  border: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-food-kicker {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.plan-food-card h3 {
  margin: 0;
  font-size: 1.2rem;
}
.plan-food-card p {
  margin: 0;
  color: var(--ink-mute);
  line-height: 1.55;
}
.section-intro {
  margin-bottom: 14px;
  max-width: 56ch;
  color: var(--ink-mute);
}
.form-note {
  margin-bottom: 16px;
  max-width: 52ch;
  color: var(--ink-mute);
  font-size: .94rem;
  line-height: 1.6;
}
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.action-stack .btn {
  width: min(100%, 220px);
}
.danger-zone {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px dashed rgba(220,38,38,.35);
  background: linear-gradient(180deg, rgba(254,242,242,.95) 0%, rgba(255,255,255,.9) 100%);
}
.danger-zone .label {
  color: var(--bad);
}
.danger-zone p {
  margin-bottom: 12px;
}
.shortcut-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: stretch;
}
@media (min-width: 820px) {
  .shortcut-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.shortcut-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 232px;
}
.shortcut-card h3 {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}
.shortcut-card p {
  margin: 0;
}
.shortcut-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.shortcut-list {
  display: grid;
  gap: 12px;
}
.shortcut-item {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-card-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.shortcut-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(220,38,38,.18);
}
.shortcut-topline,
.shortcut-meta {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.shortcut-item strong {
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: .96;
  letter-spacing: .02em;
}
.field.tight { margin-bottom: 0; }
.field.tight .label { margin-bottom: 8px; }

@media (max-width: 639px) {
  .hstack-input {
    grid-template-columns: 1fr;
  }
  .page {
    padding: 18px 14px 44px;
  }
  .card,
  .card.lg {
    padding: 18px;
  }
  .hero-aside {
    background: transparent;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.1);
    border-radius: 0;
    padding: 18px 0 0;
  }
  .page-hero-aside {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 18px 0 0;
  }
  .page-hero {
    gap: 16px;
    padding: 20px 18px;
    border-radius: 24px;
  }
  .page-hero h1 {
    max-width: none;
    font-size: clamp(1.95rem, 12vw, 3rem);
  }
  .page-hero p,
  .page-hero-note {
    font-size: .96rem;
    line-height: 1.6;
  }
  .train-day-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
  }
  .train-day-switcher .chip {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
  }
  .hero-metric-grid,
  .page-hero-meta,
  .plan-macro-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }
  .hero-metric,
  .page-hero-metric,
  .plan-macro-card {
    padding: 12px 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .hero-metric + .hero-metric {
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .page-hero-metric + .page-hero-metric,
  .plan-macro-card + .plan-macro-card {
    border-top: 1px solid var(--line);
  }
  .plan-day-meta,
  .plan-note-stack,
  .plan-food-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }
  .plan-day-meta div,
  .plan-note,
  .plan-food-card {
    padding: 12px 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .plan-day-meta div + div,
  .plan-note + .plan-note,
  .plan-food-card + .plan-food-card {
    border-top: 1px solid var(--line);
  }
  .exercise-card .ex-head,
  .plan-day-head {
    flex-wrap: wrap;
  }
  .exercise-card {
    padding: 14px;
  }
  .exercise-card .ex-name {
    font-size: 1.18rem;
  }
  .exercise-card .ex-meta {
    font-size: .8rem;
  }
  .exercise-card .ex-head > .row,
  .plan-day-head > .row {
    width: 100%;
    justify-content: space-between;
  }
  .exercise-preview-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }
  .exercise-preview-cue {
    width: 100%;
    font-size: .84rem;
  }
  .set-row,
  .set-head {
    grid-template-columns: 28px repeat(3, minmax(0, 1fr)) 32px;
    gap: 4px;
  }
  .set-head {
    font-size: .62rem;
  }
  .set-row input {
    padding: 8px 6px;
    font-size: .92rem;
  }
  .card form .row.wrap,
  form.card .row.wrap,
  .col > .card .row.wrap {
    gap: 10px;
  }
  .card form .row.wrap .btn,
  form.card .row.wrap .btn,
  .col > .card .row.wrap .btn {
    width: 100%;
  }
  .hero-actions .btn,
  .page-hero .btn,
  .action-stack .btn,
  .grid > .card > .btn:last-child,
  .grid > form.card > .btn:last-child {
    width: 100%;
  }
  .hero-metric-grid,
  .page-hero-meta {
    grid-template-columns: 1fr;
  }
  .shortcut-footer .btn {
    width: 100%;
  }
}

@media (max-width: 639px) {
  html[data-theme='dark'] .page-hero-aside {
    background: transparent;
    box-shadow: none;
    border: 0;
    border-top: 1px solid #28303a;
  }

  html[data-theme='dark'] .page-hero-meta,
  html[data-theme='dark'] .plan-macro-grid {
    background: transparent;
  }

  html[data-theme='dark'] .page-hero-metric,
  html[data-theme='dark'] .plan-macro-card {
    background: transparent;
    box-shadow: none;
  }

  html[data-theme='dark'] .page-hero-metric + .page-hero-metric,
  html[data-theme='dark'] .plan-macro-card + .plan-macro-card {
    border-top: 1px solid #28303a;
  }
}

/* ---------- Streak heatmap ---------- */
.heatmap {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 3px;
  overflow-x: auto;
}
.heatmap .cell {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--line);
  min-width: 10px;
}
.heatmap .cell.l1 { background: #fee2e2; }
.heatmap .cell.l2 { background: #fca5a5; }
.heatmap .cell.l3 { background: #ef4444; }
.heatmap .cell.l4 { background: #b91c1c; }
.heatmap .cell.today { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- Workout / Set logger ---------- */
.exercise-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: border-color .15s ease;
  box-shadow: 0 8px 22px rgba(15,23,42,.03);
}
.exercise-card.done { border-color: var(--good); background: #f7fef9; }
.exercise-card .ex-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.exercise-card .ex-name { font-family: var(--display); font-size: 1.4rem; letter-spacing: .02em; }
.exercise-card .ex-meta { font-size: .85rem; color: var(--ink-faint); }
.exercise-preview-list {
  display: grid;
  gap: 10px;
}
.exercise-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 38%);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(250,250,250,.98) 100%);
}
.exercise-preview-main {
  min-width: 0;
}
.exercise-preview-main strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.02rem;
  line-height: 1.2;
}
.exercise-preview-main .faint {
  margin: 0;
  font-size: .96rem;
  line-height: 1.55;
}
.exercise-preview-cue {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.32);
  background: rgba(15,23,42,.04);
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: .02em;
  text-wrap: pretty;
}
.set-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr auto;
  gap: 6px; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row .set-num {
  font-family: var(--mono); font-weight: 700; color: var(--ink-faint); text-align: center;
}
.set-row input { padding: 8px 10px; text-align: center; font-family: var(--mono); }
.set-row .check {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
}
.set-row .check.checked { background: var(--good); border-color: var(--good); color: #fff; }
.set-row .check svg { width: 16px; height: 16px; }
.set-head {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr auto;
  gap: 6px; padding-bottom: 4px;
  font-size: .7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em;
  text-align: center;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%; max-width: 520px;
  background: #fff; border-radius: var(--radius-lg);
  padding: 24px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h2 { margin-bottom: 4px; }
.modal .close-x {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); display: inline-flex; align-items: center; justify-content: center;
}
.modal-body { position: relative; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-width: 380px; width: calc(100% - 32px);
}
@media (min-width: 1024px) { .toast-stack { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast {
  pointer-events: auto;
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
  font-size: .9rem;
}
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }

/* ---------- Library / chapters ---------- */
.chapter-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
@media (min-width: 640px) { .chapter-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1160px) { .chapter-grid { grid-template-columns: 1fr 1fr 1fr; } }
.chapter-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, #ffffff 100%);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px);
  padding: 22px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column; min-height: 156px;
  text-align: left;
}
.chapter-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(220,38,38,.18); }
.chapter-card .num {
  font-family: var(--mono); font-size: .75rem; color: var(--ink-faint); margin-bottom: 6px;
}
.chapter-card .title { font-family: var(--display); font-size: 1.55rem; letter-spacing: .02em; margin-bottom: 8px; line-height: .96; }
.chapter-card .blurb { font-size: .9rem; color: var(--ink-mute); margin: 0; }

/* Chapter article */
.article { max-width: 720px; margin: 0 auto; }
.article h2 { margin-top: 0; }
.article h3 { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.article h3:first-of-type { padding-top: 0; border-top: 0; margin-top: 0; }
.article h4 { margin-top: 24px; font-family: var(--display); font-size: 1.5rem; letter-spacing: .02em; text-transform: none; color: var(--ink); }
.article ul { padding-left: 20px; color: var(--ink-mute); line-height: 1.8; }
.article ul li { margin-bottom: 6px; }
.article .callout {
  background: var(--bg-card-2); border-left: 3px solid var(--ink); padding: 16px 18px;
  border-radius: 0 12px 12px 0; margin: 20px 0;
}
.article .callout.dark {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%); color: #fff;
  border-left-color: var(--accent);
}
.article .callout.dark p, .article .callout.dark li { color: rgba(255,255,255,.85); }
.article .callout.danger { background: var(--accent-soft); border-left-color: var(--accent); }

/* RPE table */
.rpe-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rpe-table th, .rpe-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.rpe-table th { font-family: var(--display); font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.rpe-table tr:last-child td { border-bottom: 0; }

/* ---------- Plate calc visual ---------- */
.plate-bar {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  padding: 16px; background: var(--bg-card-2); border-radius: 12px; min-height: 80px;
  flex-wrap: wrap;
}
.plate {
  font-family: var(--mono); font-weight: 700; font-size: .8rem;
  color: #fff; padding: 6px 8px; border-radius: 4px;
  min-width: 32px; text-align: center;
}
.plate.p45  { background: #1e40af; height: 70px; line-height: 58px; padding: 0 8px; }
.plate.p35  { background: #b91c1c; height: 60px; line-height: 48px; padding: 0 8px; }
.plate.p25  { background: #047857; height: 54px; line-height: 42px; padding: 0 8px; }
.plate.p10  { background: #facc15; color: #000; height: 42px; line-height: 30px; padding: 0 8px; }
.plate.p5   { background: #ffffff; color: #000; border: 1.5px solid var(--ink); height: 36px; line-height: 24px; padding: 0 8px; }
.plate.p2   { background: #71717a; height: 30px; line-height: 18px; padding: 0 6px; font-size: .7rem; }

/* ---------- Rest timer ---------- */
.rest-timer-fab {
  position: fixed; bottom: calc(var(--nav-h-mobile) + 34px); right: 16px;
  z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  font-family: var(--mono); font-weight: 700; font-size: .95rem;
  border: 3px solid rgba(255,255,255,.9);
}
@media (min-width: 820px) {
  .rest-timer-fab {
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
  }
}
.rest-timer-fab.active { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.6); } 50% { box-shadow: 0 0 0 14px rgba(220,38,38,0); } }

/* ---------- Mini bar chart ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 128px; padding-top: 24px; }
.bar-chart .bar {
  flex: 1; min-width: 8px; background: var(--ink); border-radius: 4px 4px 0 0;
  position: relative;
}
.bar-chart .bar.empty { background: var(--line); }
.bar-chart .bar .v {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .65rem; color: var(--ink-faint);
}

/* ---------- Progress sparkline ---------- */
.sparkline { width: 100%; height: 60px; }

/* ---------- Onboarding step ---------- */
.onboard {
  position: fixed; inset: 0; z-index: 90;
  background: linear-gradient(180deg, rgba(247,247,248,.96) 0%, rgba(240,241,244,.92) 100%);
  overflow-y: auto;
  padding: 28px 16px 42px;
}
.onboard-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
@media (min-width: 960px) {
  .onboard-shell {
    grid-template-columns: minmax(0, 1.16fr) 330px;
    align-items: start;
  }
}
.onboard-main,
.onboard-aside {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(251,251,252,.96) 100%);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
}
.onboard-main {
  padding: clamp(24px, 4vw, 32px);
}
.onboard-aside {
  padding: 22px;
}
@media (min-width: 960px) {
  .onboard-aside {
    position: sticky;
    top: 24px;
  }
}
.onboard-aside-block + .onboard-aside-block {
  margin-top: 18px;
}
.onboard-aside-block h3 {
  margin: 10px 0 8px;
  font-size: 1.3rem;
}
.onboard-aside-block p {
  margin: 0;
}
.onboard-progress-wrap {
  margin-bottom: 26px;
}
.onboard-progress {
  height: 4px; background: var(--line); border-radius: 4px; overflow: hidden;
  margin-bottom: 14px;
}
.onboard-progress .fill {
  height: 100%; background: var(--accent); transition: width .25s ease;
}
.onboard-progress-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.onboard .step-num {
  font-family: var(--mono); font-size: .8rem; color: var(--ink-faint);
}
.onboard-progress-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.onboard-progress-label span {
  font-size: .96rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 600;
}
.onboard-header {
  margin-bottom: 22px;
}
.onboard h2 { margin-bottom: 8px; }
.onboard-header p {
  max-width: 58ch;
  margin-bottom: 0;
}
.onboard-impact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.onboard-grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) {
  .onboard-grid.onboard-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.onboard-panel {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--bg-card-2);
  box-shadow: 0 8px 24px rgba(15,23,42,.03);
}
.onboard-panel h3 {
  margin: 8px 0 14px;
  font-size: 1.2rem;
}
.onboard-panel-kicker {
  display: inline-flex;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.onboard-step-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.onboard-step-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-card-2);
}
.onboard-step-item > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .8rem;
}
.onboard-step-item strong {
  display: block;
  font-size: .9rem;
}
.onboard-step-item p {
  margin-top: 3px;
  color: var(--ink-mute);
  font-size: .88rem;
  line-height: 1.4;
}
.onboard-step-item.active {
  border-color: rgba(220,38,38,.28);
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.onboard-step-item.active > span,
.onboard-step-item.done > span {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.onboard-preview-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.onboard-preview-card {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-card-2);
}
.onboard-preview-card .label {
  margin-bottom: 6px;
}
.onboard-preview-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: .96;
}
.onboard-preview-card p {
  margin-top: 6px;
  color: var(--ink-mute);
  font-size: .88rem;
  line-height: 1.45;
}
.onboard-bullets {
  margin: 14px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 10px;
}
.onboard-bullets.compact {
  gap: 8px;
}

/* ---------- Empty state ---------- */
.empty {
  padding: 48px 16px; text-align: center; border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius); color: var(--ink-faint);
}

html[data-theme='dark'] {
  color-scheme: dark;
}

html[data-theme='dark'] body {
  background: linear-gradient(180deg, #07090d 0%, #0d1117 46%, #11161d 100%);
  color: #f5f7fb;
}

html[data-theme='dark'] body::before {
  background: radial-gradient(circle, rgba(239,68,68,.18) 0%, rgba(239,68,68,0) 72%);
}

html[data-theme='dark'] body::after {
  background: radial-gradient(circle, rgba(56,189,248,.14) 0%, rgba(56,189,248,0) 74%);
}

html[data-theme='dark'] p,
html[data-theme='dark'] .muted,
html[data-theme='dark'] .faint,
html[data-theme='dark'] .help,
html[data-theme='dark'] .section-intro,
html[data-theme='dark'] .form-note,
html[data-theme='dark'] .page-hero-note,
html[data-theme='dark'] .hero-metric-sub,
html[data-theme='dark'] .shortcut-meta,
html[data-theme='dark'] .shortcut-topline,
html[data-theme='dark'] .chapter-card .blurb,
html[data-theme='dark'] .article ul,
html[data-theme='dark'] .stat .delta {
  color: #a9b1bc;
}

html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] strong,
html[data-theme='dark'] .stat .value,
html[data-theme='dark'] .summary-card h3,
html[data-theme='dark'] .page-hero-metric strong,
html[data-theme='dark'] .hero-metric-value,
html[data-theme='dark'] .shortcut-item strong,
html[data-theme='dark'] .chapter-card .title,
html[data-theme='dark'] .exercise-card .ex-name {
  color: #f8fafc;
}

html[data-theme='dark'] .label,
html[data-theme='dark'] .stat .label,
html[data-theme='dark'] .summary-card .kicker,
html[data-theme='dark'] .page-hero-metric .label,
html[data-theme='dark'] .hero-metric-label,
html[data-theme='dark'] .chapter-card .num,
html[data-theme='dark'] .topnav-link,
html[data-theme='dark'] .bottomnav-link {
  color: #9099a8;
}

html[data-theme='dark'] .card,
html[data-theme='dark'] .summary-card,
html[data-theme='dark'] .stat,
html[data-theme='dark'] .page-hero,
html[data-theme='dark'] .page-hero-aside,
html[data-theme='dark'] .page-hero-metric,
html[data-theme='dark'] .chapter-card,
html[data-theme='dark'] .exercise-card,
html[data-theme='dark'] .modal,
html[data-theme='dark'] .onboard-shell,
html[data-theme='dark'] .plate-bar,
html[data-theme='dark'] .empty,
html[data-theme='dark'] .shortcut-item,
html[data-theme='dark'] .shortcut-card {
  background: linear-gradient(180deg, rgba(17,22,29,.98) 0%, rgba(13,17,23,.96) 100%);
  border-color: #28303a;
  box-shadow: 0 12px 34px rgba(0,0,0,.26);
}

html[data-theme='dark'] .danger-zone {
  background: linear-gradient(180deg, rgba(69,10,10,.5) 0%, rgba(17,22,29,.92) 100%);
  border-color: rgba(239,68,68,.42);
}

html[data-theme='dark'] .topnav,
html[data-theme='dark'] .bottomnav {
  background: rgba(7,9,13,.88);
  border-color: rgba(71,85,105,.32);
}

html[data-theme='dark'] .topnav-link:hover,
html[data-theme='dark'] .bottomnav-link:hover {
  background: rgba(148,163,184,.08);
  color: #f8fafc;
}

html[data-theme='dark'] .topnav-link.active {
  background: #f8fafc;
  color: #0b0d10;
}

html[data-theme='dark'] .bottomnav-link.active {
  color: #f8fafc;
}

html[data-theme='dark'] .bottomnav-link.active svg {
  color: #ff8f8f;
}

html[data-theme='dark'] .auth-note-list {
  color: #a9b1bc;
}

html[data-theme='dark'] .nav-theme,
html[data-theme='dark'] .nav-settings,
html[data-theme='dark'] .icon-btn {
  background: rgba(15,23,42,.38);
  border-color: #28303a;
  color: #f8fafc;
}

html[data-theme='dark'] .btn {
  background: #f8fafc;
  color: #0b0d10;
  border-color: #f8fafc;
}

html[data-theme='dark'] .btn.secondary {
  background: transparent;
  color: #f8fafc;
  border-color: #364152;
}

html[data-theme='dark'] .btn.danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

html[data-theme='dark'] .input,
html[data-theme='dark'] .select,
html[data-theme='dark'] .textarea,
html[data-theme='dark'] .set-row .check {
  background: #0f141b;
  border-color: #364152;
  color: #f8fafc;
}

html[data-theme='dark'] .input::placeholder,
html[data-theme='dark'] .textarea::placeholder {
  color: #7d8795;
}

html[data-theme='dark'] .chip {
  background: #11161d;
  border-color: #364152;
  color: #e6ebf2;
}

html[data-theme='dark'] .chip.active {
  background: #f8fafc;
  color: #0b0d10;
  border-color: #f8fafc;
}

html[data-theme='dark'] .pill {
  background: rgba(148,163,184,.08);
  border-color: #364152;
  color: #dce2ea;
}

html[data-theme='dark'] .pill.accent {
  background: rgba(220,38,38,.16);
  color: #ff9393;
}

html[data-theme='dark'] .pill.good {
  background: rgba(34,197,94,.16);
  color: #8de3a3;
}

html[data-theme='dark'] .page-hero::before {
  background: radial-gradient(circle, rgba(239,68,68,.12) 0%, rgba(239,68,68,0) 72%);
}

html[data-theme='dark'] .page-hero--train::before {
  background: radial-gradient(circle, rgba(239,68,68,.16) 0%, rgba(239,68,68,0) 74%);
}

html[data-theme='dark'] .hero-aside {
  background: linear-gradient(180deg, rgba(15,23,42,.62) 0%, rgba(15,23,42,.38) 100%);
  border-color: rgba(148,163,184,.14);
}

html[data-theme='dark'] .bar-chart .bar {
  background: #f8fafc;
}

html[data-theme='dark'] .bar-chart .bar.empty {
  background: #2a3340;
}

html[data-theme='dark'] .article .callout {
  background: #141922;
  border-left-color: #f8fafc;
}

html[data-theme='dark'] .article .callout.danger {
  background: rgba(127,29,29,.28);
}

html[data-theme='dark'] .rpe-table th,
html[data-theme='dark'] .rpe-table td,
html[data-theme='dark'] .set-row,
html[data-theme='dark'] .set-head {
  border-color: #28303a;
}

html[data-theme='dark'] .plate.p5 {
  background: #11161d;
  color: #f8fafc;
  border-color: #f8fafc;
}

html[data-theme='dark'] .rest-timer-fab {
  border-color: rgba(7,9,13,.92);
}

html[data-theme='dark'] .onboard {
  background: linear-gradient(180deg, rgba(7,9,13,.96) 0%, rgba(13,17,23,.94) 100%);
}

html[data-theme='dark'] .onboard-main,
html[data-theme='dark'] .onboard-aside,
html[data-theme='dark'] .onboard-panel,
html[data-theme='dark'] .onboard-step-item,
html[data-theme='dark'] .onboard-preview-card,
html[data-theme='dark'] .plan-day-card,
html[data-theme='dark'] .plan-macro-card,
html[data-theme='dark'] .plan-food-card,
html[data-theme='dark'] .plan-note,
html[data-theme='dark'] .plan-day-meta div {
  background: linear-gradient(180deg, rgba(17,22,29,.98) 0%, rgba(13,17,23,.96) 100%);
  border-color: #28303a;
  box-shadow: 0 12px 34px rgba(0,0,0,.24);
}

html[data-theme='dark'] .page-hero-meta,
html[data-theme='dark'] .plan-macro-grid,
html[data-theme='dark'] .plan-day-meta,
html[data-theme='dark'] .plan-note-stack,
html[data-theme='dark'] .plan-food-grid {
  background: #28303a;
}

html[data-theme='dark'] .page-hero-metric,
html[data-theme='dark'] .plan-macro-card,
html[data-theme='dark'] .plan-day-meta div,
html[data-theme='dark'] .plan-note,
html[data-theme='dark'] .plan-food-card {
  border-color: transparent;
  box-shadow: none;
}

html[data-theme='dark'] .exercise-preview-row {
  background: linear-gradient(180deg, rgba(17,22,29,.94) 0%, rgba(13,17,23,.98) 100%);
  border-color: #28303a;
}

html[data-theme='dark'] .exercise-preview-cue {
  background: rgba(148,163,184,.08);
  border-color: rgba(71,85,105,.55);
  color: #e5e7eb;
}

@media (max-width: 639px) {
  html[data-theme='dark'] .plan-day-meta,
  html[data-theme='dark'] .plan-note-stack,
  html[data-theme='dark'] .plan-food-grid {
    background: transparent;
  }

  html[data-theme='dark'] .plan-day-meta div,
  html[data-theme='dark'] .plan-note,
  html[data-theme='dark'] .plan-food-card {
    background: transparent;
  }

  html[data-theme='dark'] .plan-day-meta div + div,
  html[data-theme='dark'] .plan-note + .plan-note,
  html[data-theme='dark'] .plan-food-card + .plan-food-card {
    border-top: 1px solid #28303a;
  }
}

html[data-theme='dark'] .onboard-progress-label span,
html[data-theme='dark'] .plan-day-head h3,
html[data-theme='dark'] .plan-card h2,
html[data-theme='dark'] .plan-food-card h3 {
  color: #f8fafc;
}

html[data-theme='dark'] .onboard-step-item > span {
  background: #0f141b;
  border-color: #364152;
  color: #f8fafc;
}

html[data-theme='dark'] .onboard-step-item.active,
html[data-theme='dark'] .plan-day-card.current {
  border-color: rgba(239,68,68,.38);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

html[data-theme='dark'] .plan-macro-card p,
html[data-theme='dark'] .plan-food-card p,
html[data-theme='dark'] .plan-note,
html[data-theme='dark'] .plan-day-head p,
html[data-theme='dark'] .onboard-step-item p,
html[data-theme='dark'] .onboard-preview-card p {
  color: #a9b1bc;
}

/* ---------- Print ---------- */
@media print {
  .topnav, .bottomnav, .rest-timer-fab, .btn { display: none !important; }
  body { background: #fff; padding: 0; }
}
