/* =====================================================================
   Sets & Splits design system
   Tokens → base → layout → components → domain views → motion
   ===================================================================== */

/* Dark-first (docs/DESIGN_2026.md): the dark palette is the default; light is
   kept for anyone who picks it in Account. */
:root {
  color-scheme: light;
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #ecece8;
  --surface-3: #e2e2dc;
  --ink: #111113;
  --ink-2: #55555f;
  --ink-3: #66666f;
  --line: rgb(17 17 19 / 0.08);
  --line-strong: rgb(17 17 19 / 0.14);
  --track: #e4e4de;
  --brand: #111113;
  --brand-ink: #ff6a3d;
  --glass: rgb(255 255 255 / 0.72);
  --glow-strength: 0.16;

  /* Each domain owns one hue, plus a gradient for rings, glows and highlights. */
  --strength: #f2552c;
  --run: #2f74f0;
  --fuel: #15a865;
  --recover: #7c5cf5;
  --warn: #d98a00;
  --danger: #e5394d;
  --strength-soft: color-mix(in srgb, var(--strength) 12%, var(--surface));
  --run-soft: color-mix(in srgb, var(--run) 12%, var(--surface));
  --fuel-soft: color-mix(in srgb, var(--fuel) 12%, var(--surface));
  --recover-soft: color-mix(in srgb, var(--recover) 12%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 14%, var(--surface));
  --danger-soft: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --ok: var(--fuel);
  --accent: var(--strength);
  --g-strength: linear-gradient(135deg, #ff8a3d, #ff3d6e);
  --g-run: linear-gradient(135deg, #4b8dff, #22d3ee);
  --g-fuel: linear-gradient(135deg, #b4f04a, #22c55e);
  --g-recover: linear-gradient(135deg, #a07cff, #f472b6);
  --g-warn: linear-gradient(135deg, #ffd23f, #ff8a3d);

  --primary-bg: #111113;
  --primary-ink: #ffffff;

  --shadow-1: 0 1px 2px rgb(20 20 18 / 0.04);
  --shadow-2: 0 2px 6px rgb(20 20 18 / 0.05), 0 12px 32px rgb(20 20 18 / 0.08);
  --shadow-3: 0 24px 64px rgb(20 20 18 / 0.2);

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 22px;
  --r-xl: 28px;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Inter', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 220ms;

  --sidebar: 272px;
  --tabbar: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #08080a;
    --surface: #131316;
    --surface-2: #1c1c21;
    --surface-3: #26262d;
    --ink: #f5f5f7;
    --ink-2: #a8a8b3;
    --ink-3: #85858f;
    --line: rgb(255 255 255 / 0.08);
    --line-strong: rgb(255 255 255 / 0.14);
    --track: #2a2a31;
    --brand: #f5f5f7;
    --glass: rgb(24 24 29 / 0.66);
    --glow-strength: 0.3;
    --strength: #ff6a3d;
    --run: #4b8dff;
    --fuel: #3ddc84;
    --recover: #a07cff;
    --warn: #ffb224;
    --danger: #ff5468;
    --primary-bg: #f5f5f7;
    --primary-ink: #08080a;
    --shadow-1: none;
    --shadow-2: 0 2px 8px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.4);
    --shadow-3: 0 24px 64px rgb(0 0 0 / 0.6);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #08080a;
  --surface: #131316;
  --surface-2: #1c1c21;
  --surface-3: #26262d;
  --ink: #f5f5f7;
  --ink-2: #a8a8b3;
  --ink-3: #85858f;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);
  --track: #2a2a31;
  --brand: #f5f5f7;
  --glass: rgb(24 24 29 / 0.66);
  --glow-strength: 0.3;
  --strength: #ff6a3d;
  --run: #4b8dff;
  --fuel: #3ddc84;
  --recover: #a07cff;
  --warn: #ffb224;
  --danger: #ff5468;
  --primary-bg: #f5f5f7;
  --primary-ink: #08080a;
  --shadow-1: none;
  --shadow-2: 0 2px 8px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.4);
  --shadow-3: 0 24px 64px rgb(0 0 0 / 0.6);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--strength) calc(var(--glow-strength) * 30%), transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in srgb, var(--run) calc(var(--glow-strength) * 22%), transparent), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: 'ss01', 'cv11';
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; line-height: 1.2; font-weight: 700; }
h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; }
h2 { font-size: 19px; }
h3, h2[data-h3] { font-size: 16px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; border-radius: 6px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Layout ---------- */
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 12px auto 12px 12px; width: calc(var(--sidebar) - 24px);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; border-radius: 26px;
  border: 1px solid var(--line); background: var(--glass); z-index: 20;
  backdrop-filter: saturate(1.6) blur(24px); -webkit-backdrop-filter: saturate(1.6) blur(24px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--brand); }
.brand em { font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); background: var(--surface-2); padding: 2px 7px; border-radius: 99px; }
.brand-mark { color: var(--brand); flex: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px;
  color: var(--ink-2); font-weight: 600; transition: background var(--dur), color var(--dur), transform 160ms var(--ease);
}
.side-link:active { transform: scale(0.97); }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.active { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.side-link.active .icon { color: var(--accent); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; color: var(--ink-2); }
.side-user:hover, .side-user.active { background: var(--surface-2); }
.side-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-user-meta b { color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { margin-left: var(--sidebar); min-height: 100dvh; outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 36px 96px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { line-height: 1.1; }
.page-head .sub { color: var(--ink-2); margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 550; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

.tabbar { display: none; }
.focus .sidebar, .focus .tabbar { display: none; }
.focus .main { margin-left: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.stack-l { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.gap-s { gap: 8px; }
.gap-xs { gap: 4px; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 2px 12px; }
.section-title h2 { font-size: 17px; }
.section-title a, .link { color: var(--ink-2); font-size: 14px; font-weight: 550; }
.section-title a:hover, .link:hover { color: var(--ink); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border-radius: var(--r-l); padding: 20px;
  box-shadow: var(--shadow-1); border: 1px solid var(--line); position: relative; isolation: isolate;
}
/* A soft light follows the cursor over tappable cards (set by app.js). */
a.card::before, .card.tap::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity 300ms;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--ink) 7%, transparent), transparent 60%);
}
a.card:hover::before, .card.tap:hover::before { opacity: 1; }
/* Domain glow in the top-right corner. */
.card[class*='glow-'] { overflow: hidden; }
.card[class*='glow-']::after {
  content: ''; position: absolute; width: 280px; height: 280px; top: -150px; right: -120px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--gc) calc(var(--glow-strength) * 100%), transparent), transparent 70%);
}
.glow-strength { --gc: #ff3d6e; }
.glow-run { --gc: #4b8dff; }
.glow-fuel { --gc: #22c55e; }
.glow-recover { --gc: #a07cff; }
.glow-warn { --gc: #ffb224; }
.card-tight { padding: 14px 16px; }
.card-flush { padding: 0; overflow: hidden; }
.card h3, .card h2[data-h3] { margin-bottom: 2px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-bottom: 14px; }
.card-head h3, .card-head h2[data-h3] { margin: 0; white-space: nowrap; }
/* On a narrow card the switcher drops under the title; it scrolls rather than spill out. */
.card-head .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
a.card, .card.tap { transition: transform var(--dur) var(--ease), box-shadow var(--dur); cursor: pointer; }
a.card:hover, .card.tap:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); }
a.card:active, .card.tap:active { transform: scale(0.985); }

.hero {
  --h1: #ff3d6e; --h2: #ff8a3d;
  background: #0f0f12; color: #fff; border: 1px solid rgb(255 255 255 / 0.08); padding: 28px;
  overflow: hidden; border-radius: var(--r-xl); isolation: isolate; min-height: 220px; display: flex; flex-direction: column;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; animation: drift 11s ease-in-out infinite alternate;
}
.hero::before { width: 460px; height: 460px; top: -240px; right: -180px; background: radial-gradient(circle, color-mix(in srgb, var(--h1) 55%, transparent), transparent 68%); }
.hero::after { width: 360px; height: 360px; bottom: -220px; left: -120px; background: radial-gradient(circle, color-mix(in srgb, var(--h2) 38%, transparent), transparent 68%); animation-delay: -5s; }
.hero.hero-done { --h1: #22c55e; --h2: #b4f04a; }
.hero.hero-rest { --h1: #a07cff; --h2: #4b8dff; }
.hero .muted, .hero .faint { color: rgb(255 255 255 / 0.66); }
.hero .eyebrow { color: var(--h2); }
.hero h2 .icon { display: inline-block; vertical-align: -2px; }
.hero h2 { font-size: 38px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; }
.hero .chip { background: rgb(255 255 255 / 0.1); color: rgb(255 255 255 / 0.88); border: 1px solid rgb(255 255 255 / 0.12); }
.hero .btn-primary { background: var(--g-strength); color: #fff; box-shadow: 0 10px 30px rgb(255 61 110 / 0.35); }
.hero .btn-ghost { color: #fff; border-color: rgb(255 255 255 / 0.22); }
.hero .btn-ghost:hover:not(:disabled) { background: rgb(255 255 255 / 0.08); }
.hero-art { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform 120ms var(--ease), background var(--dur), opacity var(--dur), box-shadow var(--dur);
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.95); }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary-bg); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-2); }
.btn-accent { background: var(--g-strength); color: #fff; }
.btn-run { background: var(--g-run); color: #fff; }
.btn-fuel { background: var(--g-fuel); color: #06120a; }
.btn-recover { background: var(--g-recover); color: #fff; }
.btn-accent:hover:not(:disabled) { box-shadow: 0 10px 28px rgb(255 61 110 / 0.3); }
.btn-run:hover:not(:disabled) { box-shadow: 0 10px 28px rgb(75 141 255 / 0.3); }
.btn-fuel:hover:not(:disabled) { box-shadow: 0 10px 28px rgb(34 197 94 / 0.3); }
.btn-recover:hover:not(:disabled) { box-shadow: 0 10px 28px rgb(160 124 255 / 0.3); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-3); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.btn-text { background: none; border: 0; color: var(--ink-2); padding: 0 8px; height: 36px; }
.btn-text:hover { color: var(--ink); }
.btn-s { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-l { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.busy { color: transparent !important; position: relative; }
.btn.busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--primary-ink) transparent var(--primary-ink) transparent; animation: spin 0.7s linear infinite;
}
.btn-ghost.busy::after, .btn-soft.busy::after { border-color: var(--ink) transparent var(--ink) transparent; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; border: 0;
  background: transparent; color: var(--ink-2); transition: background var(--dur), color var(--dur), transform 120ms;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.s { width: 32px; height: 32px; }

/* ---------- Chips, pills, badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px;
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 550; white-space: nowrap;
}
.chip-strength { background: var(--strength-soft); color: var(--strength); }
.chip-run { background: var(--run-soft); color: var(--run); }
.chip-fuel { background: var(--fuel-soft); color: var(--fuel); }
.chip-recover { background: var(--recover-soft); color: var(--recover); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-ok { background: var(--fuel-soft); color: var(--fuel); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line-strong); background: var(--surface); height: 34px; padding: 0 14px; cursor: pointer; transition: all var(--dur); }
.chip-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.chip-btn[aria-pressed='true'] { background: var(--primary-bg); color: var(--primary-ink); border-color: var(--primary-bg); animation: pop 300ms var(--ease-spring); }
.scroll-x { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -2px; padding-left: 2px; }
.scroll-x::-webkit-scrollbar { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--g-strength); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--ink); font-weight: 650; font-size: 13px; letter-spacing: 0.02em;
}
.avatar.l { width: 56px; height: 56px; font-size: 19px; }
.avatar.c1 { background: var(--g-strength); color: #fff; }
.avatar.c2 { background: var(--g-run); color: #fff; }
.avatar.c3 { background: var(--g-fuel); color: #06120a; }
.avatar.c4 { background: var(--g-recover); color: #fff; }
.avatar.c5 { background: var(--g-warn); color: #2a1600; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 999px; gap: 2px; position: relative; border: 1px solid var(--line); }
.seg button, .seg a {
  border: 0; background: transparent; height: 34px; padding: 0 16px; border-radius: 999px; font-weight: 600;
  color: var(--ink-2); font-size: 14px; transition: color var(--dur), background var(--dur), box-shadow var(--dur);
  display: inline-flex; align-items: center; gap: 6px;
}
.seg [aria-selected='true'], .seg [aria-pressed='true'] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tabs-line { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line button {
  border: 0; background: none; padding: 10px 0 12px; font-weight: 600; color: var(--ink-3); position: relative; white-space: nowrap;
  display: inline-flex; gap: 6px; align-items: center;
}
.tabs-line button[aria-selected='true'] { color: var(--ink); }
.tabs-line button[aria-selected='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--g-strength); border-radius: 2px; animation: grow-x 240ms var(--ease); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  height: 48px; padding: 0 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface-2);
  outline: none; width: 100%; transition: border-color var(--dur), box-shadow var(--dur); font-size: 16px;
}
textarea.input { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--ink-3); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--run) 18%, transparent); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; animation: fade-in 200ms; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: var(--r-m); font-size: 14px; font-weight: 550; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 42px; }
.input-group > .icon { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.input-suffix { position: absolute; right: 14px; color: var(--ink-3); font-size: 14px; pointer-events: none; }
.big-input { font-size: 40px; font-weight: 650; letter-spacing: -0.03em; border: 0; background: transparent; outline: none; width: 100%; text-align: center; padding: 0; font-variant-numeric: tabular-nums; }
.big-input::placeholder { color: var(--ink-3); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-3); display: grid; place-items: center; transition: transform 160ms var(--ease-spring); }
.stepper button:active { transform: scale(0.92); }
.stepper output { min-width: 48px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.scale-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale-pick button {
  height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; color: var(--ink-2);
  transition: all 160ms var(--ease); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.scale-pick button small { font-size: 10px; font-weight: 500; color: var(--ink-3); }
.scale-pick button[aria-pressed='true'] { background: var(--g-recover); color: #fff; border-color: transparent; animation: pop 320ms var(--ease-spring); }
.scale-pick button[aria-pressed='true'] small { color: inherit; opacity: 0.7; }
input[type='range'] { width: 100%; accent-color: var(--ink); }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background var(--dur); flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease-spring); }
.switch:checked { background: var(--g-fuel); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item, button.list-item { transition: background var(--dur); border-radius: 12px; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); }
button.list-item { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.list-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta { color: var(--ink-3); font-size: 13px; }
.list-pad .list-item { padding-left: 16px; padding-right: 16px; border-radius: 0; }
.tile {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--ink-2);
}
.tile-strength { background: var(--g-strength); color: #fff; }
.tile-run { background: var(--g-run); color: #fff; }
.tile-fuel { background: var(--g-fuel); color: #06120a; }
.tile-recover { background: var(--g-recover); color: #fff; }
.tile-warn { background: var(--g-warn); color: #2a1600; }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.stat .k { font-size: 13px; color: var(--ink-3); font-weight: 550; }
.stat .d { font-size: 12px; font-weight: 600; }
.up { color: var(--ok); }
.down { color: var(--danger); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; }
.stat-card { padding: 16px 18px; }
.big-num { font-size: 48px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Meter / ring ---------- */
.meter { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; transition: width 700ms var(--ease); animation: grow-x 900ms var(--ease) both; transform-origin: left; }
.meter.thin { height: 5px; }
.ring { position: relative; flex: none; }
.ring svg { display: block; }
.ring-bar { transition: stroke-dashoffset 900ms var(--ease); animation: ring-in 1100ms var(--ease) both; }
.ring-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.ring-inner b { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.ring-inner small { font-size: 12px; color: var(--ink-3); font-weight: 550; }

/* ---------- Charts ---------- */
.chart { position: relative; height: var(--h); margin: 6px 0 22px; touch-action: pan-y; cursor: crosshair; }
.chart-svg { width: calc(100% - 44px); height: 100%; overflow: visible; display: block; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .baseline { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-svg .line { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; animation: draw 1100ms var(--ease); }
.chart-svg .raw-line { stroke-width: 1.4; opacity: 0.3; }
.chart-svg .area { animation: fade-in 900ms 300ms both; }
.chart-y { position: absolute; right: 0; top: 0; bottom: 0; width: 40px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.chart-x { position: absolute; left: 0; right: 44px; bottom: -20px; display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.chart-base-label { position: absolute; left: 4px; transform: translateY(-120%); font-size: 11px; color: var(--ink-3); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.chart-dots { position: absolute; inset: 0 44px 0 0; pointer-events: none; }
.chart-dots i { position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--c); opacity: 0.45; }
.chart-hover { position: absolute; inset: 0 44px 0 0; pointer-events: none; opacity: 0; transition: opacity 120ms; }
.chart-hover.show { opacity: 1; }
.chart-hover b { position: absolute; left: var(--x); top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.chart-hover i { position: absolute; left: var(--x); top: var(--y); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); box-shadow: var(--shadow-1); }
.chart-empty { display: grid; place-items: center; color: var(--ink-3); font-size: 14px; background: var(--surface-2); border-radius: var(--r-m); }
.bars { --plot: 1; position: relative; display: flex; align-items: flex-end; gap: 6px; height: var(--h); padding-bottom: 20px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; position: relative; outline: none; min-width: 0; }
.bar-track { flex: 1; display: flex; align-items: flex-end; }
.bar { width: 100%; background: color-mix(in srgb, var(--c) 32%, var(--track)); border-radius: 8px 8px 4px 4px; min-height: 3px; transform-origin: bottom; animation: grow-y 700ms var(--ease) both; transition: background var(--dur), height 600ms var(--ease); }
.bar-col.active .bar, .bar-col:hover .bar, .bar-col:focus .bar { background: linear-gradient(to top, var(--c), color-mix(in srgb, var(--c) 60%, #fff)); }
.bar-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.bar-col.active .bar-label { color: var(--ink); font-weight: 600; }
.bars-target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ink-3); z-index: 1; pointer-events: none; margin-bottom: 20px; }
.bars-target span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--ink-3); background: var(--surface); padding: 0 4px; }
.tip {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; background: var(--primary-bg); color: var(--primary-ink);
  font-size: 12.5px; font-weight: 550; padding: 6px 10px; border-radius: 9px; box-shadow: var(--shadow-2); opacity: 0;
  transition: opacity 120ms; white-space: nowrap; max-width: 280px;
}
.tip.show { opacity: 1; }
.spark { display: block; }

/* ---------- Empty, skeleton ---------- */
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 64px; height: 64px; border-radius: 22px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); margin-bottom: 6px; }
.empty h2, .empty h3 { margin-bottom: 2px; }
.empty p { max-width: 360px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.sk-title { width: 220px; height: 34px; }
.sk-line { height: 14px; margin-bottom: 12px; }
.sk-block { height: 120px; margin-top: 16px; border-radius: 14px; }
.sk-card { min-height: 180px; }
.w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }

/* ---------- Sheets ---------- */
.sheet-host { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(6 6 8 / 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 220ms; }
.sheet {
  position: relative; background: var(--surface); border-radius: var(--r-xl); width: 100%; max-height: min(88dvh, 860px); border: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: var(--shadow-3); outline: none;
  opacity: 0; transform: translateY(16px) scale(0.98); transition: opacity 220ms var(--ease), transform 260ms var(--ease);
}
.sheet-sm { max-width: 420px; }
.sheet-md { max-width: 560px; }
.sheet-lg { max-width: 760px; }
.sheet-host.open .sheet-backdrop { opacity: 1; }
.sheet-host.open .sheet { opacity: 1; transform: none; }
.sheet-host.closing .sheet-backdrop { opacity: 0; }
.sheet-host.closing .sheet { opacity: 0; transform: translateY(16px) scale(0.98); }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 8px 24px; }
.sheet-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.sheet-sub { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.sheet-body { padding: 8px 24px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); }
.sheet-foot[hidden] { display: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--glass); color: var(--ink); border: 1px solid var(--line-strong); backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px);
  padding: 11px 16px; border-radius: 14px; box-shadow: var(--shadow-3); font-weight: 550; font-size: 14px;
  animation: toast-in 320ms var(--ease-spring);
}
.toast-ok .icon { color: var(--fuel); }
.toast-error .icon { color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all 220ms; }
.toast-btn { border: 0; background: none; color: var(--brand-ink); font-weight: 700; padding: 0 0 0 6px; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }

/* ---------- Resume pill ---------- */
.resume {
  position: fixed; z-index: 30; right: 28px; bottom: 28px; display: flex; align-items: center; gap: 12px;
  background: var(--glass); color: var(--ink); border: 1px solid var(--line-strong); backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px); padding: 10px 12px 10px 16px; border-radius: 999px; box-shadow: var(--shadow-3);
  animation: toast-in 400ms var(--ease-spring);
}
.resume b { display: block; font-size: 14px; }
.resume small { display: block; font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.resume-cta { display: inline-flex; align-items: center; gap: 2px; background: var(--g-strength); color: #fff; font-weight: 650; font-size: 13px; padding: 7px 10px 7px 14px; border-radius: 99px; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--strength); box-shadow: 0 0 0 0 var(--strength); animation: pulse 1.6s infinite; flex: none; }

/* ---------- Connection status ---------- */
.net {
  position: fixed; z-index: 35; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 7px 14px; border-radius: 999px;
  background: var(--glass); color: var(--ink); border: 1px solid var(--line-strong); backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px); box-shadow: var(--shadow-3); font-size: 13px; font-weight: 700;
  white-space: nowrap; pointer-events: none; animation: fade-down 260ms ease-out;
}
.net span { overflow: hidden; text-overflow: ellipsis; }
.net-off .icon { color: var(--warn); }
.net-sync .icon { animation: spin 1.2s linear infinite; }
.net-ok .icon { color: var(--fuel); }
.shell:not(.focus) .net { left: calc(50% + var(--sidebar) / 2); }
.shell.focus .net { top: calc(80px + env(safe-area-inset-top)); }

/* ---------- Login ---------- */
.bare { min-height: 100dvh; }
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100dvh; }
.auth-art { background: #07070a; color: #f5f5f7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; isolation: isolate; }
/* Aurora: three slow-drifting lights in the domain colours. */
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; animation: drift 12s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 620px; height: 620px; top: -260px; right: -220px; background: radial-gradient(circle, rgb(255 61 110 / 0.55), transparent 68%); }
.aurora i:nth-child(2) { width: 520px; height: 520px; top: 30%; left: -260px; background: radial-gradient(circle, rgb(75 141 255 / 0.42), transparent 68%); animation-delay: -4s; }
.aurora i:nth-child(3) { width: 480px; height: 480px; bottom: -240px; right: -120px; background: radial-gradient(circle, rgb(160 124 255 / 0.4), transparent 68%); animation-delay: -8s; }
.auth-art .brand { color: #f5f5f7; padding: 0; }
.auth-art h1 { font-size: 64px; font-weight: 800; line-height: 0.98; letter-spacing: -0.055em; max-width: 560px; }
.grad-text { background: var(--g-strength); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: rgb(255 255 255 / 0.62); max-width: 460px; margin-top: 18px; font-size: 17px; }
.auth-domains { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.auth-domains span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14px; font-weight: 600; color: rgb(255 255 255 / 0.85); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.demo-grid { display: grid; gap: 8px; }
.demo-btn {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
  text-align: left; transition: transform 220ms var(--ease-spring), border-color var(--dur), box-shadow var(--dur);
}
.demo-btn:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.demo-btn:active { transform: scale(0.97); }
.demo-btn .avatar { width: 42px; height: 42px; font-size: 16px; font-weight: 800; }
.demo-btn b { display: block; font-size: 14px; }
.demo-btn small { color: var(--ink-3); font-size: 12.5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.pulse-line { position: absolute; left: 0; right: 0; bottom: 140px; opacity: 0.9; }
.pulse-line path { stroke: url(#pulse-g); }
.pulse-line path { animation: draw 2.4s var(--ease); }

/* ---------- Today ---------- */
.page-wide { max-width: 1240px; }
.today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.today-head h1 { font-size: 44px; }
.today-avatar { font-size: 22px; font-weight: 800; transition: transform 200ms var(--ease-spring); }
.today-avatar:hover { transform: scale(1.06); }
/* Bento: hero + tiles on a 4-column grid, 2 columns on tablets and phones. */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 14px; }
.b-hero { grid-column: span 2; grid-row: span 2; display: flex; }
.b-hero > .hero { flex: 1; }
.b-wide { grid-column: span 2; }
.b-tile { display: flex; flex-direction: column; gap: 12px; min-height: 0; text-align: left; font: inherit; color: inherit; }
.b-tile .card-head { margin-bottom: 0; }
.b-tile .ring { align-self: flex-start; }
.b-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.b-foot > b { font-size: 17px; letter-spacing: -0.02em; }
.b-big { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.b-short { gap: 10px; }
.b-short .b-big { margin-top: auto; }
.b-short .big-num { font-size: 36px; }
button.card { cursor: pointer; width: 100%; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px; border-radius: var(--r-l);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-weight: 700; font-size: 14px; text-align: left;
  transition: transform 200ms var(--ease-spring), box-shadow var(--dur), border-color var(--dur);
}
.quick .tile { width: 40px; height: 40px; border-radius: 13px; }
.quick a:hover, .quick button:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-strong); }
.quick a:active, .quick button:active { transform: scale(0.95); }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 12px; border-radius: 14px; color: var(--ink-3);
  font-size: 12px; font-weight: 600;
}
.day.today { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.day .n { font-size: 15px; color: var(--ink); font-weight: 700; width: min(34px, 100%); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; }
.day .n.did { color: #fff; animation: pop 420ms var(--ease-spring) backwards; }
.day .n.did-s { background: var(--g-strength); }
.day .n.did-r { background: var(--g-run); }
.day .marks { display: flex; gap: 3px; height: 8px; align-items: center; }
.day .marks i { width: 7px; height: 7px; border-radius: 50%; }
.day .marks i.s { background: var(--strength); }
.day .marks i.r { background: var(--run); }
.day .marks i.p { border: 1.5px solid var(--ink-3); width: 7px; height: 7px; }
.day .marks i.m { border: 1.5px solid var(--danger); }
.insight-card { border-left: 0; }
.insight-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }
.kind-win { color: var(--fuel); }
.kind-watch { color: var(--danger); }
.kind-adjust { color: var(--warn); }
.kind-tip { color: var(--run); }
.engine-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); font-weight: 550; }
.readiness-mini { display: flex; gap: 16px; align-items: center; }
.macro-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.macro-row b { font-weight: 600; }

/* ---------- Workout logger ---------- */
.wk-top {
  position: sticky; top: 0; z-index: 25; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
.wk-top-inner { max-width: 760px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.wk-title { border: 0; background: none; font-size: 17px; font-weight: 650; padding: 4px 6px; margin-left: -6px; border-radius: 8px; width: 100%; outline: none; letter-spacing: -0.01em; }
.wk-title:focus { background: var(--surface-2); }
.wk-clock { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.wk-progress { height: 3px; background: var(--track); }
.wk-progress span { display: block; height: 100%; background: var(--g-strength); transition: width 500ms var(--ease); }
.wk-body { max-width: 760px; margin: 0 auto; padding: 20px 20px 160px; display: flex; flex-direction: column; gap: 14px; }
.ex-card { padding: 0; overflow: hidden; }
.ex-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 6px 18px; }
.ex-head h3, .ex-head h2[data-h3] { font-size: 17px; }
.ex-hint { margin: 4px 18px 8px; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--strength-soft); border: 1px solid color-mix(in srgb, var(--strength) 22%, transparent); padding: 9px 12px; border-radius: 12px; }
.ex-hint .icon { color: var(--strength); margin-top: 1px; }
.sets { width: 100%; border-collapse: collapse; }
.set-row { display: grid; grid-template-columns: 34px minmax(56px, 1fr) minmax(64px, 1fr) minmax(56px, 0.9fr) 52px 48px; gap: 6px; align-items: center; padding: 5px 12px 5px 14px; transition: background 260ms var(--ease); }
.set-head { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); padding-top: 8px; padding-bottom: 2px; }
.set-head span:nth-child(n + 3) { text-align: center; }
.set-no { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 650; font-size: 13px; background: var(--surface-2); color: var(--ink-2); border: 0; }
.set-prev { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-in {
  height: 42px; width: 100%; border-radius: 11px; border: 1px solid transparent; background: var(--surface-2); text-align: center;
  font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; outline: none; transition: all 160ms; padding: 0 4px; -moz-appearance: textfield;
}
.set-in::-webkit-outer-spin-button, .set-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-in:focus { border-color: var(--ink-3); background: var(--surface); }
.set-in.rpe { font-size: 14px; font-weight: 600; }
.set-check {
  width: 44px; height: 42px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center;
  transition: background 200ms var(--ease), color 200ms, transform 160ms var(--ease-spring);
}
.set-check:hover { color: var(--ink); }
.set-check:active { transform: scale(0.88); }
.set-no.t-warmup { background: color-mix(in srgb, var(--warn) 18%, var(--surface-2)); color: var(--warn); }
.set-no.t-drop { background: color-mix(in srgb, var(--recover) 20%, var(--surface-2)); color: var(--recover); }
.set-no.t-failure { background: color-mix(in srgb, var(--strength) 20%, var(--surface-2)); color: var(--strength); }
.set-label.t-warmup { color: var(--warn); font-weight: 650; }
.set-label.t-drop { color: var(--recover); font-weight: 650; }
.set-label.t-failure { color: var(--strength); font-weight: 650; }
.set-row-edit { grid-template-columns: 34px minmax(64px, 1fr) minmax(64px, 1fr) minmax(56px, 0.8fr); }
.edit-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
/* Supersets: a coloured edge joins the exercises done back to back. */
.in-superset { border-left: 3px solid var(--run); }
.superset-tag { display: inline-flex; align-items: center; gap: 6px; margin: 12px 14px 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--run); background: color-mix(in srgb, var(--run) 14%, transparent); }
.list-item .set-no { flex: none; }
.set-row.done { background: color-mix(in srgb, var(--fuel) 9%, transparent); }
.set-row.done .set-check { background: var(--g-fuel); color: #06120a; animation: pop 360ms var(--ease-spring); }
.set-row.done .set-in { background: transparent; }
.set-row.done .set-no { background: var(--fuel); color: #06120a; }
.set-del { width: 28px; height: 28px; border: 0; background: none; color: var(--ink-3); border-radius: 8px; display: grid; place-items: center; opacity: 0.6; }
.set-del:hover { opacity: 1; color: var(--danger); background: var(--danger-soft); }
.ex-foot { display: flex; gap: 8px; padding: 8px 14px 14px; }
.rest-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; width: min(440px, calc(100% - 24px));
  background: var(--glass); color: var(--ink); border: 1px solid var(--line-strong); backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px); border-radius: 28px; box-shadow: var(--shadow-3); padding: 12px 12px 12px 16px;
  display: flex; align-items: center; gap: 12px; animation: toast-in 380ms var(--ease-spring);
}
.rest-bar .t { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; min-width: 76px; }
.rest-bar button { border: 0; background: color-mix(in srgb, var(--ink) 10%, transparent); color: inherit; height: 36px; padding: 0 12px; border-radius: 99px; font-weight: 650; font-size: 13px; }
.rest-bar .skip { background: var(--g-strength); color: #fff; }
.rest-track { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 14%, transparent); overflow: hidden; }
.rest-track span { display: block; height: 100%; background: var(--g-strength); transition: width 1s linear; }
.finish-hero { text-align: center; padding: 32px 20px 8px; }
.finish-hero .medal { width: 96px; height: 96px; border-radius: 50%; background: var(--g-strength); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; animation: medal 700ms var(--ease-spring) both; box-shadow: 0 16px 40px color-mix(in srgb, var(--strength) 40%, transparent); }
.pr-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); animation: slide-up 420ms var(--ease) both; }
.pr-item .icon { color: var(--warn); }

/* ---------- Exercise picker ---------- */
.picker-list { display: flex; flex-direction: column; margin: 8px -8px 0; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%; transition: background 160ms; }
.picker-item:hover { background: var(--surface-2); }
.picker-item[aria-pressed='true'] { background: var(--strength-soft); }
.picker-item[aria-pressed='true'] .tile { background: var(--strength); color: #fff; }
.muscle-tag { font-size: 12px; color: var(--ink-3); text-transform: capitalize; }

/* ---------- Fuel ---------- */
.meal { padding: 0; }
.meal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; }
.meal-items .list-item { padding: 10px 20px; }
.food-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; transition: background 160ms; }
.food-row:hover { background: var(--surface-2); }
.food-row .grow { cursor: pointer; }
/* ---- Notifications bell */
.bell-slot { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 16px; z-index: 40; }
.bell { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgb(0 0 0 / 0.2); }
.bell:hover { background: var(--surface-2); }
.bell-count { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--g-strength); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.inbox-item { align-items: flex-start; text-align: left; }
.inbox-item b { display: block; }
.inbox-item small { display: block; color: var(--ink-2); margin-top: 2px; }
.inbox-item.unread b::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--strength); vertical-align: 2px; }
.shell.focus .bell-slot { display: none; }

/* ---- Sign-up and onboarding */
.btn-link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.welcome { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(60% 50% at 80% 10%, rgb(255 61 110 / 0.16), transparent 70%), radial-gradient(50% 40% at 10% 90%, rgb(75 141 255 / 0.12), transparent 70%), var(--bg); }
.welcome-card { width: min(560px, 100%); display: grid; gap: 18px; padding: clamp(20px, 4vw, 34px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-l, 0 30px 80px rgb(0 0 0 / 0.35)); }
.welcome-card h1 { font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.03em; line-height: 1.1; }
.welcome-card .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.welcome-card .brand svg { width: 26px; height: 26px; }
.welcome-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.welcome-steps i { height: 4px; border-radius: 4px; background: var(--surface-2); transition: background 300ms; }
.welcome-steps i.on { background: var(--g-strength); }
.choice-list { display: grid; gap: 8px; }
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; transition: border-color 200ms, background 200ms, transform 160ms var(--ease-spring); }
.choice:active { transform: scale(0.98); }
.choice b { display: block; font-weight: 750; }
.choice small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.choice[aria-checked="true"] { border-color: var(--strength); background: color-mix(in srgb, var(--strength) 12%, var(--surface-2)); }
.choice-s { flex-direction: column; align-items: flex-start; gap: 2px; }
.target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.target-grid div { padding: 14px 16px; border-radius: 18px; background: var(--surface-2); }
.target-grid b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.target-grid span { color: var(--ink-3); font-size: 13px; }
.welcome-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
@media (max-width: 520px) { .choice-row { grid-template-columns: 1fr; } }

/* ---- Messages */
.page-thread .thread { display: flex; flex-direction: column; gap: 6px; max-height: min(62vh, 640px); overflow-y: auto; padding: 4px 2px 12px; overscroll-behavior: contain; }
.thread-day { align-self: center; margin: 10px 0 4px; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: min(78%, 520px); padding: 9px 13px 7px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); color: var(--ink); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-row.mine .bubble { border-radius: 18px 18px 6px 18px; background: var(--g-strength); color: #fff; }
.bubble-time { display: block; margin-top: 3px; font-size: 11px; opacity: 0.7; text-align: right; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 160px; padding: 12px 14px; line-height: 1.4; }
.composer .btn { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.link-inline { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.food-star { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); display: grid; place-items: center; flex: none; transition: color 160ms, transform 160ms var(--ease-spring); }
.food-star:hover { color: var(--warn); }
.food-star:active { transform: scale(0.85); }
.food-star.on { color: var(--warn); }
.food-star.on svg { fill: currentColor; }
.chip-tiny { font-size: 11px; padding: 1px 7px; vertical-align: 2px; }
.seg-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg-tabs button { flex: 1; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 650; font-size: 14px; }
.seg-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.food-add { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fuel-soft); color: var(--fuel); display: grid; place-items: center; flex: none; transition: transform 160ms var(--ease-spring); }
.food-add:hover { background: var(--fuel); color: #fff; }
.food-add:active { transform: scale(0.85); }
.food-add.added { background: var(--g-fuel); color: #06120a; animation: pop 360ms var(--ease-spring); }
.macro-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.macro-pills > div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.macro-pills b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.macro-pills span { font-size: 12px; color: var(--ink-3); font-weight: 550; }
.date-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.date-nav b { min-width: 120px; text-align: center; font-size: 14px; }

/* ---------- Run ---------- */
.pace-display { text-align: center; padding: 22px; border-radius: var(--r-l); background: radial-gradient(300px 160px at 50% 0%, color-mix(in srgb, var(--run) 30%, transparent), transparent), var(--surface-2); color: var(--run); border: 1px solid var(--line); }
.pace-display b { color: var(--ink); font-size: 56px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; display: block; line-height: 1; }
.dur-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dur-inputs .input { text-align: center; font-size: 20px; font-weight: 650; height: 54px; }
.record { padding: 16px; border-radius: var(--r-l); background: var(--surface-2); }
.run-open { border: 0; background: none; padding: 0; text-align: left; color: inherit; cursor: pointer; min-width: 0; }
.run-open:hover .title { color: var(--run); }
.route-box { position: relative; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(400px 220px at 50% 0%, color-mix(in srgb, var(--run) 18%, transparent), transparent), var(--surface-2); }
.route-svg { display: block; width: 100%; height: auto; }
.route-line { animation: draw 1400ms var(--ease) both; }
.route-start, .route-legend .route-start { fill: #22c55e; stroke: var(--surface); stroke-width: 3; background: #22c55e; }
.route-end, .route-legend .route-end { fill: #ff3d6e; stroke: var(--surface); stroke-width: 3; background: #ff3d6e; }
.route-legend { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); }
.route-legend span { display: inline-flex; align-items: center; gap: 6px; }
.route-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.share-stage { display: grid; place-items: center; border-radius: var(--r-l); background: #050507; border: 1px solid var(--line); padding: 14px; min-height: 200px; }
.share-stage.sticker { background: repeating-conic-gradient(#1a1a20 0% 25%, #111116 0% 50%) 50% / 28px 28px; }
.share-canvas { display: block; width: auto; max-width: 100%; height: min(56vh, 520px); border-radius: 14px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.5); }
.share-stage.sticker .share-canvas { height: min(40vh, 340px); box-shadow: none; }
.share-text { margin: 0; width: 100%; white-space: pre-wrap; font: 600 15px/1.6 var(--font); color: var(--ink); background: var(--surface-2); border-radius: 12px; padding: 16px; user-select: all; }
.splits { display: flex; flex-direction: column; gap: 8px; }
.split-row { display: grid; grid-template-columns: 52px 1fr 52px; gap: 12px; align-items: center; font-size: 13px; }
.split-row b { text-align: right; }
.split-row.best b { color: var(--run); }
.split-track { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.split-track span { display: block; height: 100%; border-radius: 99px; background: color-mix(in srgb, var(--run) 60%, transparent); transform-origin: left; animation: grow-x 700ms var(--ease) both; }
.split-row.best .split-track span { background: var(--g-run); }
.record .v { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- Recovery ---------- */
.contrib { display: grid; grid-template-columns: 110px 1fr 54px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contrib:last-child { border-bottom: 0; }
.contrib small { grid-column: 2 / 4; color: var(--ink-3); font-size: 12.5px; margin-top: -6px; }

/* ---------- Progress ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 0; padding: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo span { position: absolute; left: 8px; bottom: 8px; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.photo[aria-pressed='true'] { outline: 3px solid var(--strength); outline-offset: 2px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 6px; }
.compare-table td { padding: 11px 6px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.compare-table td:first-child { color: var(--ink-2); }
.compare-table td:not(:first-child), .compare-table th:not(:first-child) { text-align: right; }
.goal { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Coach ---------- */
.client-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) 110px 80px 24px; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); transition: background var(--dur); }
.client-row:last-child { border-bottom: 0; }
.client-row:hover { background: var(--surface-2); }
.client-row .who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.client-row .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row .who small { color: var(--ink-3); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
/* Status chips wrap onto a second line rather than cut the label off. */
.flags .chip { max-width: 100%; display: inline-block; height: auto; min-height: 24px; padding: 4px 10px; line-height: 16px; white-space: normal; border-radius: 12px; font-size: 12px; }
.flags .chip svg { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.adh { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .tile { width: 34px; height: 34px; border-radius: 11px; }
.client-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.sched-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sched-day { min-height: 76px; border-radius: 12px; background: var(--surface-2); padding: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.sched-day.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.sched-day .d { color: var(--ink-3); font-weight: 600; }
.sched-pill { border-radius: 8px; padding: 4px 6px; font-weight: 600; font-size: 12px; line-height: 1.25; background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; }
.sched-pill.completed { background: var(--fuel-soft); color: var(--fuel); border-color: transparent; }
.sched-pill.missed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.note { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.note.pinned { background: var(--warn-soft); }
.checkin-q { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkin-q > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.checkin-q b { font-size: 18px; }
.day-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-picker button { height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; font-weight: 650; color: var(--ink-2); }
.day-picker button[aria-pressed='true'] { background: var(--primary-bg); color: var(--primary-ink); border-color: var(--primary-bg); }
.pb-plan { margin: -2px 0 6px; }
.pb-ex { display: grid; grid-template-columns: minmax(0, 1fr) 58px 58px 72px 64px 64px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pb-ex:last-child { border-bottom: 0; }
.pb-ex .input { height: 38px; text-align: center; padding: 0 6px; font-size: 15px; }
.pb-ex-head { font-size: 11px; color: var(--ink-3); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; border: 0; padding-bottom: 0; }
.temp-pass { font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: 0.06em; background: var(--surface-2); padding: 12px 16px; border-radius: 12px; text-align: center; user-select: all; }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: 0.55; }
.table select.input { height: 36px; font-size: 14px; padding: 0 10px; width: auto; min-width: 120px; }

/* ---------- Motion ---------- */
.page-enter > * { animation: page-in 380ms var(--ease) backwards; }
.stagger > * { animation: slide-up 460ms var(--ease) backwards; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(n + 7) { animation-delay: 240ms; }
.enter { animation: slide-up 360ms var(--ease) backwards; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .why-body { animation: fade-down 260ms var(--ease); }
details[open] summary .chev { transform: rotate(180deg); }
.chev { transition: transform var(--dur) var(--ease); }

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-6px); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
/* Dash only while drawing: a static dash pattern breaks up non-scaling strokes. */
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes ring-in { from { stroke-dashoffset: var(--circ); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translate(var(--tx, 0), 14px) scale(0.96); } }
@keyframes medal { from { opacity: 0; transform: scale(0.4) rotate(-14deg); } }
@keyframes drift { from { transform: translate(-6%, 4%) scale(1); } to { transform: translate(6%, -5%) scale(1.15); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--strength) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.rest-bar { --tx: -50%; }

/* ---------- Typeface and touch (the 2026 revamp, shared with the app) ----------
   Archivo, one variable face: wider for headings, condensed for numbers, so
   figures read like a timing board. Gradient buttons carry their own light. */
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@property --orbit { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root { --font: 'Archivo', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; --font-display: var(--font); }
h1, h2, h3, h4 { font-stretch: 108%; }
.hero h2, .page-head h1 { font-stretch: 114%; font-weight: 800; }
.num, .tnum, .stat .v, .big-num, .big-input, .stepper output, .ring-inner b { font-stretch: 80%; }

.btn { transition: transform 420ms var(--ease-spring), background var(--dur), opacity var(--dur), box-shadow var(--dur); }
.btn:active:not(:disabled) { transform: scale(0.96); transition-duration: 110ms; }
.btn-accent, .btn-run, .btn-fuel, .btn-recover, .hero .btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-accent { box-shadow: 0 8px 22px -8px rgb(255 61 110 / 0.6); }
.btn-run { box-shadow: 0 8px 22px -8px rgb(75 141 255 / 0.6); }
.btn-fuel { box-shadow: 0 8px 22px -8px rgb(34 197 94 / 0.55); }
.btn-recover { box-shadow: 0 8px 22px -8px rgb(160 124 255 / 0.6); }
/* A sheen crosses gradient buttons on hover or keyboard focus. */
.btn-accent::after, .btn-run::after, .btn-fuel::after, .btn-recover::after, .hero .btn-primary::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.38) 50%, transparent 65%);
}
:is(.btn-accent, .btn-run, .btn-fuel, .btn-recover, .hero .btn-primary):is(:hover, :focus-visible):not(:disabled)::after { animation: btn-sheen 800ms var(--ease) both; }
/* The hero's main action has a thin light travelling round its edge. */
.hero .btn-primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--orbit), transparent 0 64%, rgb(255 255 255 / 0.8) 78%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: btn-orbit 3.6s linear infinite;
}
/* The hero's pulse field (core/field.js) replaces its two CSS glows. */
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-fields .hero::before, .hero-fields .hero::after { display: none; }
/* Rings glow softly along their stroke, like the app's Skia rings. */
.ring svg { filter: drop-shadow(0 0 6px rgb(255 255 255 / 0.1)); }
:root[data-theme='dark'] .ring svg { filter: drop-shadow(0 0 8px rgb(255 120 90 / 0.18)); }
@keyframes btn-sheen { to { transform: translateX(130%); } }
@keyframes btn-orbit { to { --orbit: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  /* Show final states immediately; a tiny duration would still animate every property. */
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-hero { grid-row: auto; }
  .client-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) 110px 24px; }
  .client-row .wk { display: none; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .shell:not(.focus) .net { left: 50%; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar) + 20px + env(safe-area-inset-bottom)); }
  .focus .main { padding-bottom: 0; }
  .page { padding: 20px 16px 96px; }
  h1 { font-size: 32px; }
  .hero h2 { font-size: 32px; }
  /* Floating glass capsule; the pill slides to the active tab (--i, --n set in app.js). */
  .tabbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; height: var(--tabbar);
    padding: 6px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line-strong); box-shadow: var(--shadow-3);
    backdrop-filter: saturate(1.6) blur(24px); -webkit-backdrop-filter: saturate(1.6) blur(24px);
  }
  .tab-pill {
    position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / var(--n)); border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 11%, transparent); transform: translateX(calc(var(--i) * 100%));
    transition: transform 420ms var(--ease-spring); pointer-events: none;
  }
  .tabbar[style*='--i:-1'] .tab-pill { display: none; }
  .tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 650; color: var(--ink-3); transition: color var(--dur), transform 160ms var(--ease); border-radius: 999px; }
  .tab:active { transform: scale(0.9); }
  .tab .icon { transition: transform 300ms var(--ease-spring); }
  .tab.active { color: var(--ink); font-weight: 800; }
  .tab.active .icon { color: var(--accent); transform: scale(1.08); }
  .resume { right: 12px; left: 12px; bottom: calc(var(--tabbar) + 22px + env(safe-area-inset-bottom)); justify-content: space-between; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quick a, .quick button { padding: 12px 6px; align-items: center; text-align: center; font-size: 12px; gap: 8px; }
  .today-head h1 { font-size: 34px; }
  .bento { gap: 10px; }
  .b-tile { padding: 16px; }
  .b-tile .ring { transform: scale(0.86); transform-origin: left top; margin-bottom: -14px; }
  .b-tile .b-foot p { display: none; }
  .big-num { font-size: 38px; }
  .b-short .big-num { font-size: 30px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px 32px; min-height: auto; }
  .auth-art h1 { font-size: 42px; }
  .auth-art p { font-size: 15px; }
  .auth-art .pulse-line, .auth-domains { display: none; }
  .sheet-host { padding: 0; align-items: flex-end; }
  .sheet { max-width: none !important; border-radius: 26px 26px 0 0; max-height: 92dvh; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .sheet-host.open .sheet { transform: none; }
  .sheet-host.closing .sheet { transform: translateY(100%); }
  .sheet-grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
  .sheet-head { padding: 10px 16px 6px 20px; }
  .sheet-body { padding: 6px 20px 16px; }
  .sheet-foot { padding: 12px 20px 16px; }
  .sheet-foot .btn { flex: 1; }
  .client-row { grid-template-columns: minmax(0, 1fr) 76px 20px; gap: 10px; padding: 14px; }
  .client-row .flags-col { display: none; }
  .client-row .adh-col { order: 0; }
  .set-row { grid-template-columns: 30px minmax(44px, 0.8fr) minmax(58px, 1fr) minmax(52px, 1fr) 44px 44px; gap: 5px; padding: 5px 8px 5px 10px; }
  .wk-body { padding: 16px 12px 160px; }
  .macro-pills { grid-template-columns: repeat(2, 1fr); }
  .toasts { bottom: calc(var(--tabbar) + 26px + env(safe-area-inset-bottom)); }
  .pb-ex { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; }
  .pb-ex > span:first-child { grid-column: 1 / -1; }
  .pb-ex-head > span:first-child { display: none; }
  .sched-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .sched-day { min-height: 64px; padding: 5px; }
  .sched-pill { font-size: 10.5px; padding: 3px 4px; }
  .checkin-q { grid-template-columns: repeat(3, 1fr); }
  .contrib { grid-template-columns: 92px 1fr 44px; }
}
@media (max-width: 420px) {
  .set-row .set-prev { font-size: 11.5px; }
  .big-num { font-size: 38px; }
}
.meal-items .list-item { border-radius: 0; }

/* Streak line on Today */
.streak-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.streak-flame { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--warn), var(--strength)); flex: none; }
.streak-flame.off { background: var(--surface-2); color: var(--ink-3); }
.streak-row > .grow { flex: 1 1 170px; min-width: 0; }
.streak-next { flex: 1 1 200px; display: grid; gap: 6px; }

.interval-table td, .interval-table th { padding: 8px 6px; }
.interval-table tr.work td { font-weight: 600; }
.interval-table tr.best td { color: var(--fuel); }
