/* Fit · Otha — colorful neumorphic UI */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --r-sm: 14px; --r-md: 20px; --r-lg: 28px; --r-full: 999px;

  --bg: #e6eaf3;
  --surface: #e6eaf3;
  --ink: #1f2440;
  --ink-2: #4c5375;
  --ink-3: #6f7696;
  --hi: rgba(255, 255, 255, 0.95);
  --lo: rgba(163, 174, 204, 0.75);
  --raise: 9px 9px 18px var(--lo), -9px -9px 18px var(--hi);
  --raise-sm: 5px 5px 10px var(--lo), -5px -5px 10px var(--hi);
  --press: inset 5px 5px 10px var(--lo), inset -5px -5px 10px var(--hi);
  --press-sm: inset 3px 3px 6px var(--lo), inset -3px -3px 6px var(--hi);

  /* color system */
  --violet: #7b5cff; --violet-2: #b06bff;
  --coral: #ff6b8b; --coral-2: #ff9a62;
  --teal: #12c2b5; --teal-2: #4fd8ff;
  --amber: #ffb547; --amber-2: #ff7a45;
  --lime: #67d36b; --lime-2: #c0e94b;
  --sky: #4b8dff; --sky-2: #6fd0ff;
  --g-violet: linear-gradient(135deg, var(--violet), var(--violet-2));
  --g-coral: linear-gradient(135deg, var(--coral), var(--coral-2));
  --g-teal: linear-gradient(135deg, var(--teal), var(--teal-2));
  --g-amber: linear-gradient(135deg, var(--amber), var(--amber-2));
  --g-lime: linear-gradient(135deg, var(--lime), var(--lime-2));
  --g-sky: linear-gradient(135deg, var(--sky), var(--sky-2));
  --g-hero: linear-gradient(135deg, #7b5cff 0%, #ff6b8b 55%, #ffb547 100%);
  --ok: #1fa96b; --warn: #d98a00; --bad: #e0445f;
  --focus: 0 0 0 3px rgba(123, 92, 255, 0.45);
  --font-body: 'Satoshi', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #262a3b; --surface: #262a3b; --ink: #eef0fb; --ink-2: #c2c6de; --ink-3: #9599b6;
    --hi: rgba(62, 68, 94, 0.9); --lo: rgba(12, 14, 24, 0.75); color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #262a3b; --surface: #262a3b; --ink: #eef0fb; --ink-2: #c2c6de; --ink-3: #9599b6;
  --hi: rgba(62, 68, 94, 0.9); --lo: rgba(12, 14, 24, 0.75); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--violet); }
:focus-visible { outline: none; box-shadow: var(--focus) !important; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: var(--text-xl); font-weight: 800; }
h2 { font-size: var(--text-lg); font-weight: 800; }
h3 { font-size: var(--text-base); font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.sm { font-size: var(--text-sm); }
.xs { font-size: var(--text-xs); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
.main { padding: var(--space-5) var(--space-4) calc(110px + env(safe-area-inset-bottom)); max-width: 1180px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.brand { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); text-decoration: none; color: var(--ink); }
.logo { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--raise-sm); }
.avatar { width: 42px; height: 42px; border-radius: 50%; box-shadow: var(--raise-sm); border: 3px solid var(--surface); object-fit: cover; background: var(--g-violet); color: #fff; display: grid; place-items: center; font-weight: 700; }
.nav { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 6px; padding: 8px; border-radius: var(--r-full); background: var(--surface); box-shadow: var(--raise); }
.nav a { display: grid; place-items: center; gap: 2px; min-width: 62px; padding: 8px 10px; border-radius: var(--r-full); color: var(--ink-3); text-decoration: none; font-size: 12px; font-weight: 700; transition: box-shadow .2s, color .2s; }
.nav a svg { width: 22px; height: 22px; }
.nav a[aria-current='page'] { color: var(--violet); box-shadow: var(--press-sm); }
@media (min-width: 960px) {
  .shell { grid-template-columns: 240px 1fr; }
  .nav { position: sticky; top: 0; left: auto; transform: none; bottom: auto; height: 100dvh; border-radius: 0; flex-direction: column; padding: 96px 18px 18px; gap: 10px; box-shadow: 6px 0 18px var(--lo); }
  .nav a { grid-auto-flow: column; justify-content: start; gap: 12px; font-size: var(--text-sm); padding: 12px 18px; border-radius: var(--r-md); }
  .main { padding: var(--space-8) var(--space-8) var(--space-10); }
}

.grid { display: grid; gap: var(--space-5); }
.g2 { grid-template-columns: 1fr; }
.g3, .g4, .g2.keep { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } }
.span2 { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: var(--space-3); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: var(--space-8) 0 var(--space-4); }

/* ---------- neumorphic primitives ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--raise); padding: var(--space-5); position: relative; overflow: hidden; }
.card.flat { box-shadow: var(--press); }
.card.tight { padding: var(--space-4); }
.well { border-radius: var(--r-md); box-shadow: var(--press); padding: var(--space-4); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full); font-size: var(--text-xs); font-weight: 700; box-shadow: var(--raise-sm); background: var(--surface); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.btn { appearance: none; border: 0; cursor: pointer; padding: 12px 20px; border-radius: var(--r-full); background: var(--surface); box-shadow: var(--raise-sm); font-weight: 700; font-size: var(--text-sm); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: box-shadow .15s, transform .15s; text-decoration: none; min-height: 44px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { box-shadow: var(--press-sm); transform: none; }
.btn.primary { background: var(--g-violet); color: #fff; box-shadow: 6px 6px 14px rgba(123, 92, 255, 0.35), -6px -6px 14px var(--hi); }
.btn.hot { background: var(--g-hero); color: #fff; box-shadow: 6px 8px 18px rgba(255, 107, 139, 0.35), -6px -6px 14px var(--hi); }
.btn.teal { background: var(--g-teal); color: #fff; box-shadow: 6px 6px 14px rgba(18, 194, 181, 0.35), -6px -6px 14px var(--hi); }
.btn.danger { color: var(--bad); }
.btn.lg { padding: 16px 26px; font-size: var(--text-base); }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 44px; height: 44px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.input, select.input, textarea.input { width: 100%; border: 0; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--press-sm); padding: 12px 14px; min-height: 46px; }
.input::placeholder { color: var(--ink-3); }
label.field { display: grid; gap: 6px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); }
.seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: var(--r-full); box-shadow: var(--press-sm); }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: var(--r-full); font-weight: 700; font-size: var(--text-xs); color: var(--ink-3); cursor: pointer; min-height: 36px; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--violet); box-shadow: var(--raise-sm); }

/* ---------- color accents ---------- */
.ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 4px 4px 10px var(--lo), -4px -4px 10px var(--hi); }
.ic svg { width: 22px; height: 22px; }
.c-violet .ic, .bg-violet { background: var(--g-violet); }
.c-coral .ic, .bg-coral { background: var(--g-coral); }
.c-teal .ic, .bg-teal { background: var(--g-teal); }
.c-amber .ic, .bg-amber { background: var(--g-amber); }
.c-lime .ic, .bg-lime { background: var(--g-lime); }
.c-sky .ic, .bg-sky { background: var(--g-sky); }
.c-violet { --acc: var(--violet); } .c-coral { --acc: var(--coral); } .c-teal { --acc: var(--teal); }
.c-amber { --acc: var(--amber-2); } .c-lime { --acc: var(--lime); } .c-sky { --acc: var(--sky); }

/* metric tile */
.tile { display: grid; gap: var(--space-3); }
.tile .val { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); line-height: 1; }
.tile .val small { font-size: var(--text-sm); font-weight: 700; color: var(--ink-3); margin-left: 4px; font-family: var(--font-body); }
.tile .lbl { font-size: var(--text-xs); font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.bar { height: 10px; border-radius: var(--r-full); box-shadow: var(--press-sm); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--acc, var(--violet)), color-mix(in srgb, var(--acc, var(--violet)) 55%, #fff)); transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* hero */
.hero { background: var(--g-hero); color: #fff; box-shadow: 10px 12px 26px rgba(123, 92, 255, 0.28), -8px -8px 18px var(--hi); }
.hero .muted { color: rgba(255,255,255,.85); }
.hero .btn { background: rgba(255,255,255,.95); color: #3a2a8a; box-shadow: 0 6px 14px rgba(30, 10, 80, .25); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { content: ''; position: absolute; right: 60px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }

/* readiness ring */
.ring { position: relative; width: 132px; height: 132px; border-radius: 50%; box-shadow: var(--raise); display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); transform: rotate(-90deg); }
.ring .core { width: 84px; height: 84px; border-radius: 50%; box-shadow: var(--press); display: grid; place-items: center; text-align: center; }
.ring .core b { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.band-go { color: var(--ok); } .band-steady { color: var(--warn); } .band-recover { color: var(--bad); }

/* lists */
.list { display: grid; gap: var(--space-3); }
.item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--r-md); box-shadow: var(--raise-sm); background: var(--surface); }
.item .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px; color: #fff; background: var(--g-violet); letter-spacing: .04em; }
.tag.b { background: var(--g-coral); }

/* session player */
.ex { padding: 0; }
.ex-head { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-4) var(--space-5); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.ex-num { width: 38px; height: 38px; border-radius: 12px; box-shadow: var(--press-sm); display: grid; place-items: center; font-weight: 800; color: var(--violet); flex: none; }
.ex.done .ex-num { background: var(--g-lime); color: #fff; box-shadow: var(--raise-sm); }
.ex-body { padding: 0 var(--space-5) var(--space-5); display: grid; gap: var(--space-4); }
.coach { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--r-md); box-shadow: var(--press-sm); font-size: var(--text-sm); color: var(--ink-2); }
.coach b { color: var(--violet); }
.sets { display: grid; gap: var(--space-2); }
.set { display: grid; grid-template-columns: 74px 1fr 1fr 52px; gap: var(--space-2); align-items: center; }
.set .lab { font-size: var(--text-xs); font-weight: 800; color: var(--ink-3); }
.set .input { text-align: center; padding: 10px 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.set .check { width: 48px; height: 46px; border-radius: 14px; border: 0; cursor: pointer; background: var(--surface); box-shadow: var(--raise-sm); display: grid; place-items: center; color: var(--ink-3); }
.set.done .check { background: var(--g-lime); color: #fff; box-shadow: 3px 3px 8px rgba(103,211,107,.4); }
.set.warm .lab { color: var(--amber-2); }
.set-head { display: grid; grid-template-columns: 74px 1fr 1fr 52px; gap: var(--space-2); font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.set-head span:first-child { text-align: left; }

/* rest timer */
.rest { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); width: min(520px, calc(100% - 24px)); border-radius: var(--r-lg); padding: var(--space-4) var(--space-5); background: var(--surface); box-shadow: var(--raise); display: flex; align-items: center; gap: var(--space-4); }
.rest .clock { font-family: var(--font-display); font-size: 34px; font-weight: 800; min-width: 96px; background: var(--g-teal); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (min-width: 960px) { .rest { bottom: 24px; left: calc(50% + 120px); } }

/* sheets */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(30, 34, 60, .35); backdrop-filter: blur(4px); display: grid; align-items: end; justify-items: center; }
.sheet { width: min(640px, 100%); max-height: 88dvh; overflow: auto; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(20, 20, 50, .25); }
@media (min-width: 720px) { .sheet-bg { align-items: center; } .sheet { border-radius: var(--r-lg); } }
.sheet .grab { width: 48px; height: 5px; border-radius: 4px; background: var(--lo); margin: -8px auto var(--space-4); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); }
.scale button { border: 0; border-radius: var(--r-sm); padding: 12px 0; background: var(--surface); box-shadow: var(--raise-sm); font-weight: 800; cursor: pointer; min-height: 48px; }
.scale button[aria-pressed='true'] { box-shadow: var(--press-sm); color: var(--violet); }

/* misc */
#toast { position: fixed; z-index: 60; left: 50%; top: 18px; transform: translate(-50%, -180%); opacity: 0; visibility: hidden; transition: transform .3s, opacity .3s, visibility .3s; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r-full); font-weight: 700; font-size: var(--text-sm); box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.chart-wrap { position: relative; height: 220px; }
.skeleton { border-radius: var(--r-md); box-shadow: var(--press-sm); min-height: 120px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.empty { text-align: center; padding: var(--space-8) var(--space-5); display: grid; gap: var(--space-3); justify-items: center; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-xs); word-break: break-all; padding: 10px 12px; border-radius: var(--r-sm); box-shadow: var(--press-sm); }
.steps { counter-reset: s; display: grid; gap: var(--space-3); padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); font-size: var(--text-sm); color: var(--ink-2); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: var(--g-violet); color: #fff; font-weight: 800; font-size: 13px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { border: 0; border-radius: 12px; padding: 10px 0; background: var(--surface); box-shadow: var(--raise-sm); font-weight: 800; font-size: var(--text-xs); color: var(--ink-3); cursor: pointer; min-height: 44px; }
.days button[aria-pressed='true'] { background: var(--g-violet); color: #fff; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week div { display: grid; gap: 6px; justify-items: center; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.week i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 12px; box-shadow: var(--press-sm); display: grid; place-items: center; font-style: normal; }
.week i.plan { box-shadow: var(--raise-sm); }
.week i.done { background: var(--g-lime); color: #fff; box-shadow: 3px 3px 8px rgba(103,211,107,.35); }
.week i.today { outline: 2px solid var(--violet); outline-offset: 2px; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-5); }
.login .card { width: min(440px, 100%); padding: var(--space-8); display: grid; gap: var(--space-5); text-align: center; justify-items: center; }
.blob { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .45; z-index: -1; }
details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.t td, table.t th { padding: 8px 6px; text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--lo) 40%, transparent); }
table.t th { font-size: var(--text-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- meaningful color system ----------
   Domain = what the data is about (icon, chart, accent). Status = how it's going (green / amber / red + label). */
:root {
  --train: #7c5cff; --train-2: #a98bff;   /* Training & actions */
  --move: #ff7a1a;  --move-2: #ffad5c;    /* Activity: steps, calories */
  --sleep: #3b82f6; --sleep-2: #82b8ff;   /* Sleep */
  --heart: #d43fe0; --heart-2: #f19cff;   /* Heart: resting HR, HRV */
  --body: #0fae9f;  --body-2: #5fdccd;    /* Body composition (Hume) */
  --good: #1f9d5c; --watch: #c98800; --alert: #dc3b4f;
}
:root[data-theme='dark'] { --good: #3fcf86; --watch: #f2b631; --alert: #ff6f7f; --train: #9a82ff; --sleep: #5d9bff; --body: #2cc8b8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --good: #3fcf86; --watch: #f2b631; --alert: #ff6f7f; --train: #9a82ff; --sleep: #5d9bff; --body: #2cc8b8; } }
.d-train { --acc: var(--train); --acc2: var(--train-2); }
.d-move  { --acc: var(--move);  --acc2: var(--move-2); }
.d-sleep { --acc: var(--sleep); --acc2: var(--sleep-2); }
.d-heart { --acc: var(--heart); --acc2: var(--heart-2); }
.d-body  { --acc: var(--body);  --acc2: var(--body-2); }
.d-train .ic, .d-move .ic, .d-sleep .ic, .d-heart .ic, .d-body .ic, .ic.d { background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.lbl-d { color: var(--acc); }
.dot.d-train, .dot.d-move, .dot.d-sleep, .dot.d-heart, .dot.d-body { background: var(--acc); }
.s-good { --st: var(--good); } .s-watch { --st: var(--watch); } .s-alert { --st: var(--alert); } .s-none { --st: var(--ink-3); }
.st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-full); font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--st); background: color-mix(in srgb, var(--st) 13%, transparent); white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.bar[class*='s-'] > i { background: linear-gradient(90deg, var(--st), color-mix(in srgb, var(--st) 60%, #fff)); }
.tile.has-st { position: relative; }
.tile.has-st::after { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: var(--st); opacity: .9; }
.delta { font-size: var(--text-xs); font-weight: 800; color: var(--st, var(--ink-3)); }
.key { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; font-size: var(--text-xs); font-weight: 700; color: var(--ink-2); }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
details.guide > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--space-3); font-weight: 700; font-size: var(--text-sm); }
details.guide > summary::-webkit-details-marker { display: none; }
details.guide[open] > summary { margin-bottom: var(--space-4); }
.why { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: 6px; }
.why li { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--ink-2); }
.why li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--st); flex: none; }
.hero.d-train { background: linear-gradient(135deg, #6a4dff 0%, #8f5cff 55%, #b277ff 100%); }
.btn.good { background: linear-gradient(135deg, var(--good), color-mix(in srgb, var(--good) 65%, #b8f5c8)); color: #fff; box-shadow: 6px 6px 14px color-mix(in srgb, var(--good) 35%, transparent), -6px -6px 14px var(--hi); }
.set.done .check, .week i.done { background: linear-gradient(135deg, var(--good), color-mix(in srgb, var(--good) 60%, #c8f7d4)); }
.set.warm .lab { color: var(--train-2); }
.week i.plan { color: var(--train); font-weight: 800; }
.mini { display: grid; gap: var(--space-2); }
.mini .chart-wrap { height: 90px; }
/* leaderboards */
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.lb li { display: flex; align-items: center; gap: var(--space-3); padding: 10px 12px; border-radius: var(--r-md); }
.lb li.me { box-shadow: var(--press-sm); }
.lb .rk { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--ink-2); box-shadow: var(--raise-sm); }
.lb .rk.gold { background: linear-gradient(135deg, #ffd34d, #f0a500); color: #5a3d00; }
.lb .rk.silver { background: linear-gradient(135deg, #eef1f7, #aab3c5); color: #36405a; }
.lb .rk.bronze { background: linear-gradient(135deg, #f2b48a, #c4733f); color: #4a2410; }
.lb .avatar { border-width: 2px; flex: none; }
table.t tr.me td { background: color-mix(in srgb, var(--train) 8%, transparent); }
.nav a { min-width: 54px; padding: 8px 6px; }
@media (min-width: 960px) { .nav a { padding: 12px 18px; } }
@media (max-width: 719px) { .grid.m1 { grid-template-columns: 1fr; } }
.btn { white-space: nowrap; }
/* guided connect */
.csteps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }
.cstep { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-4); align-items: start; }
.cnum { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: 4px 4px 10px var(--lo), -4px -4px 10px var(--hi); }
.cstep .btn.lg { justify-self: start; }
@media (min-width: 960px) { .cgrid { grid-template-columns: 1.6fr 1fr; } }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; word-break: break-all; }

/* ---------- exercise demos, warm-up / cool-down ---------- */
.demo{display:block;width:100%;padding:0;border:0;border-radius:18px;overflow:hidden;background:#fff;box-shadow:var(--press);position:relative;cursor:pointer}
.demo img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:contain;background:#fff}
.demo span{position:absolute;right:8px;bottom:8px;background:rgba(20,20,40,.7);color:#fff;padding:3px 8px;border-radius:999px}
button.demo{max-width:420px}
.ex-thumb{width:44px;height:30px;object-fit:cover;border-radius:8px;flex:none;background:#fff;box-shadow:var(--raise-sm)}
.dsteps{margin:0;padding-left:20px;display:grid;gap:8px;font-size:var(--text-sm);color:var(--ink-2)}
.rlist{display:grid;gap:var(--space-3)}
.ritem{display:flex;align-items:center;gap:var(--space-3);padding:8px;border-radius:14px;background:var(--surface);box-shadow:var(--raise-sm)}
.ritem.done{opacity:.6}
.ritem.done .check{background:var(--good);color:#fff}
.rthumb{flex:none;width:72px;height:48px;padding:0;border:0;border-radius:10px;overflow:hidden;background:#fff;cursor:pointer}
.rthumb img{width:100%;height:100%;object-fit:cover;display:block}
.rtext{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;background:none;border:0;padding:0;color:inherit;cursor:pointer;font:inherit}
.routine .ex-head h3{font-size:var(--text-base)}
.exlink{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;text-align:left}
.exlink:hover{color:var(--violet)}
.play-tag{display:inline-flex;align-items:center;gap:3px;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--train);background:color-mix(in srgb,var(--train) 12%,transparent);padding:1px 6px;border-radius:999px;vertical-align:middle}
.ritem .check{flex:none;width:44px;height:44px;border:0;border-radius:14px;background:var(--surface);box-shadow:var(--raise-sm);display:grid;place-items:center;color:var(--ink-3);cursor:pointer}
.ritem .check:active{box-shadow:var(--press-sm)}
.ritem.done .check{background:var(--good);color:#fff;box-shadow:none}
.ritem .btn.icon{flex:none}
.rfor{color:var(--acc, var(--train));font-weight:600}

/* ---------- sleep stages ---------- */
:root { --st-deep: #3d4fd6; --st-rem: #9b5cf6; --st-light: #7cc0ff; --st-awake: #f5a524; }
.stagebar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; box-shadow: var(--press-sm); background: var(--surface); }
.stagebar i { display: block; height: 100%; }
.stagekey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.stagekey > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 520px) { .stagekey { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lbl { font-size: var(--text-xs); font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.val { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; }
.val small { font-size: .5em; margin-left: 3px; color: var(--ink-3); }
.st-good { color: var(--good); } .st-watch { color: var(--watch); } .st-alert { color: var(--alert); }
.grid > * { min-width: 0; }
.key { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
.main { min-width: 0; } .lb li, .lb li > * { min-width: 0; }
.yt { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-lg, 16px); overflow: hidden; background: #000; box-shadow: var(--neu-in, inset 0 2px 6px rgba(0,0,0,.2)); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.demo-row { display: flex; gap: var(--space-3); align-items: center; }
.demo-row .demo.sm { width: 112px; flex: 0 0 112px; }
.demo-row .demo.sm img { width: 100%; height: auto; display: block; }
.demo.vid { position: relative; }
.demo.vid img { aspect-ratio: 16/9; object-fit: cover; }
.demo .playbig { position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #e5484d; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.demo .playbig svg { width: 26px; height: 26px; }
.ex-thumb { object-fit: cover; }
.ex-body .demo:not(.vid) img { max-width: 220px; margin: 0 auto; display: block; }

.sync-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 700; padding: 4px 10px; border-radius: 999px; box-shadow: var(--raise-sm); text-decoration: none; white-space: nowrap; }
.sync-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync-chip.st-good { color: var(--good); } .sync-chip.st-watch { color: var(--watch, #d48806); } .sync-chip.st-alert { color: var(--alert, #e5484d); }

.tappable { cursor: pointer; } .tile.tappable:active { transform: scale(.98); }
/* press-and-hold to leave a workout */
.btn.hold { position: relative; overflow: hidden; color: var(--bad); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.btn.hold .fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: color-mix(in srgb, var(--bad) 22%, transparent); }
.btn.hold.on .fill { transform: scaleX(1); transition: transform 1.2s linear; }
.btn.hold .lbl { position: relative; color: var(--bad); }
.part-tag { color: var(--ink-2); font-weight: 700; }
.combo-ex { gap: 10px; padding: 6px 4px; }
.combo-ex input { width: 20px; height: 20px; accent-color: var(--train, #7b5cff); }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.ex.removed { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); opacity: .85; }
.eq-head { display: flex; align-items: baseline; gap: 8px; padding: var(--space-3) var(--space-2) 0; text-transform: uppercase; letter-spacing: .06em; font-size: var(--text-xs); color: var(--ink-2); }
