/* Hybrid Race Log — design system (tasteskill 2.5: tokens, type, motion, hover layer).
   Dark-first, one accent (lime), neutral interface; colour only encodes workout kind. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0c0f; --surface: #14161b; --surface-2: #1b1e25; --surface-3: #262a33; --line: #2a2e38; --line-2: #3a3f4b;
  --text: #f4f5f7; --text-2: #b9bdc8; --muted: #8b909c;
  --accent: #c8ff3d; --accent-ink: #0b0c0f; --accent-soft: rgba(200, 255, 61, .1);
  --run: #4da3ff; --strength: #ff7a45; --hybrid: #2ed3a0; --test: #d6dae3; --deload: #f5c542; --race: #ff5c8a; --rest: #6b7280; --swim: #38d6e8; --travel: #e8b46a;
  --m-protein: #c8ff3d; --m-carbs: #4da3ff; --m-fat: #f5c542;
  --good: #2ed3a0; --warn: #f5c542; --danger: #ff6b6b;
  --r-lg: 20px; --r-md: 12px; --r-sm: 8px; --r-btn: 12px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --font-display: "Manrope", system-ui, sans-serif;
  --font-text: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display-weight: 500; --display-tracking: -0.035em;
  --btn-h: 44px;
  /* motion tokens */
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --m-in: 150ms; --m-out: 120ms; --m-press: 90ms; --m-panel: 200ms; --m-slide: 240ms;
  --shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f1f2f5; --surface-3: #e5e7ec; --line: #e1e3e9; --line-2: #c9ccd5;
  --text: #0e1014; --text-2: #3f4452; --muted: #6a7080;
  --accent: #4f7a00; --accent-ink: #ffffff; --accent-soft: rgba(79, 122, 0, .09);
  --run: #1f6fd1; --strength: #d04e17; --hybrid: #0f8f69; --test: #3a3f4b; --deload: #a37708; --race: #c92c63; --rest: #8a909c; --swim: #0a8797; --travel: #a8661a;
  --m-protein: #4f7a00; --m-carbs: #1f6fd1; --m-fat: #a37708;
  --good: #0f8f69; --warn: #a37708; --danger: #c9302c;
  --shadow: 0 12px 32px rgba(20, 24, 40, .1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.1; margin: 0; }
h1 { font-size: 32px; } h2 { font-size: 20px; letter-spacing: -0.02em; } h3 { font-size: 17px; letter-spacing: -0.01em; }
b, strong { font-weight: 500; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 13px; line-height: 1.5; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); }
.num, .calc, .kpi .v, .stat .v, .cmp-row .now, .lb-row .sc, .ring .lbl, .rpe-val b, .splits input { font-variant-numeric: tabular-nums; }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 16px; height: 16px; } .ico.lg { width: 28px; height: 28px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

main { padding: 32px 24px 120px; max-width: 1040px; margin: 0 auto; }
body.in main { margin-left: 260px; max-width: 980px; }
@media (max-width: 900px) { body.in main { margin-left: 0; padding: 20px 16px 120px; } }

/* ---------- sidebar / tabbar ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 240px; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 28px; z-index: 10; }
.logo { display: flex; align-items: center; gap: 10px; font: var(--display-weight) 17px/1 var(--font-display); letter-spacing: -0.02em; padding: 0 8px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 13px var(--font-display); letter-spacing: -0.03em; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; font-size: 15px; transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.nav a:hover { background: var(--surface); color: var(--text); transition-duration: var(--m-in); }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav a.on::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav a.on .ico { color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: border-color var(--m-out) var(--ease); }
.who:hover { border-color: var(--line-2); transition-duration: var(--m-in); }
.who b { display: block; font-size: 15px; line-height: 1.3; }
.who small { display: block; color: var(--muted); font-size: 13px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: none; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); min-height: 52px; min-width: 60px; padding: 4px 8px; border-radius: var(--r-md); transition: color var(--m-out) var(--ease); }
.tabbar a.on { color: var(--text); }
.tabbar a.on .ico { color: var(--accent); }
.tabbar a.on::after { content: ""; position: absolute; top: 0; width: 20px; height: 2px; border-radius: 2px; background: var(--accent); }
@media (max-width: 900px) { .side { display: none !important; } .tabbar:not([hidden]) { display: flex; } }
/* six tabs (pre-Hyrox on): equal columns that still fit a 320px phone */
.tabbar.six { display: none; padding-left: 2px; padding-right: 2px; }
@media (max-width: 900px) { .tabbar.six:not([hidden]) { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tabbar.six a { min-width: 0; padding: 4px 2px; font-size: 11px; letter-spacing: -0.01em; }
.tabbar.six a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp { flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }

/* buttons: one primary (filled accent), one secondary (outline). Hover steps 1px up, press sinks. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); font: 500 16px/1 var(--font-text); letter-spacing: -0.005em; border: 1px solid var(--line-2); background: transparent; color: var(--text); padding: 0 20px; border-radius: var(--r-btn); cursor: pointer; text-align: center;
  transition: transform var(--m-out) var(--ease), background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), filter var(--m-out) var(--ease); }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { width: 44px; padding: 0; }
.btn .ico { transition: transform var(--m-out) var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); background: var(--surface-2); border-color: var(--text-2); transition-duration: var(--m-in); }
  .btn.pri:hover { background: color-mix(in srgb, var(--accent) 86%, var(--text)); border-color: transparent; }
  :root[data-theme="light"] .btn.pri:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
  .btn:hover .ico:last-child:not(:first-child) { transform: translateX(3px); }
}
.btn:active { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }

.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px 0 8px; border-radius: 99px; font-size: 13px; font-weight: 500; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.badge .ico { width: 14px; height: 14px; }
.k-run { --c: var(--run); } .k-strength { --c: var(--strength); } .k-hybrid { --c: var(--hybrid); } .k-test { --c: var(--test); }
.k-deload { --c: var(--deload); } .k-race { --c: var(--race); } .k-rest { --c: var(--rest); }
.k-swim { --c: var(--swim); } .k-travel { --c: var(--travel); } .k-pre { --c: var(--accent); }
.kicon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); flex: none; }

.av { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; color: #0b0c0f; font: 600 15px var(--font-display); flex: none; }
.av.lg { width: 56px; height: 56px; border-radius: 17px; font-size: 22px; }
.av.xl { width: 72px; height: 72px; border-radius: 22px; font-size: 28px; }

label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
input, select, textarea { font: 16px var(--font-text); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 48px; padding: 12px 14px; width: 100%;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease), background-color 140ms var(--ease); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.field { margin-bottom: 16px; }
.fields { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* ---------- login ---------- */
.login { min-height: 100svh; display: grid; place-items: center; padding: 40px 16px; background:
  radial-gradient(700px 380px at 12% -8%, var(--accent-soft), transparent 62%),
  radial-gradient(600px 360px at 108% 6%, rgba(77, 163, 255, .08), transparent 60%); }
.login-in { width: 100%; max-width: 520px; }
.login h1 { font-size: clamp(36px, 6vw, 48px); line-height: 1.04; letter-spacing: -0.045em; margin: 24px 0 12px; }
.login h1 em { font-style: normal; color: var(--accent); }
.login .lead { color: var(--text-2); font-size: 17px; line-height: 1.55; margin: 0 0 28px; max-width: 46ch; }
.people { display: grid; gap: 10px; }
.chips-in { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-opt { position: relative; margin: 0; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; min-height: 0; }
.chip-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease); }
.chip-opt span:hover { border-color: var(--line-2); }
.chip-opt input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- today ---------- */
.hello { margin-bottom: 24px; }
.hello h1 { font-size: 36px; letter-spacing: -0.04em; margin-top: 4px; }
.hero { position: relative; overflow: hidden; display: block; border-radius: 24px; padding: 28px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  background: radial-gradient(520px 280px at 100% 0%, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%), var(--surface);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease); }
@media (hover: hover) and (pointer: fine) { a.hero:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); } }
.hero h2 { font-size: 34px; letter-spacing: -0.04em; line-height: 1.06; margin: 16px 0 10px; max-width: 16ch; }
.hero .meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-2); font-size: 14px; margin-bottom: 22px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .bigicon { position: absolute; right: -16px; bottom: -20px; width: 180px; height: 180px; color: var(--c); opacity: .1; stroke-width: 1.2; pointer-events: none; }
.hero .preview { display: grid; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; position: relative; max-width: 60ch; }
.hero .preview li { display: flex; gap: 12px; align-items: baseline; color: var(--text-2); font-size: 15px; }
.hero .preview .n { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); display: inline-grid; place-items: center; font: 500 12px var(--font-mono); flex: none; }
/* once-per-visit entrance (motion.md: rise out of a mask, then fade up 12px) */
.hero.is-entering h2 { animation: rise 700ms var(--ease-enter) both; }
.hero.is-entering .row, .hero.is-entering .meta, .hero.is-entering .preview, .hero.is-entering .btn { animation: fadeup 520ms var(--ease-enter) both; }
.hero.is-entering .meta { animation-delay: 300ms; } .hero.is-entering .preview { animation-delay: 360ms; } .hero.is-entering .btn { animation-delay: 420ms; }
.hero.is-entering .bigicon { animation: settle 1.1s var(--ease-enter) both; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; clip-path: inset(0 0 100% 0); } to { transform: none; opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes fadeup { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes settle { from { transform: scale(1.05); } to { transform: none; } }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; padding: 10px 2px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; color: var(--muted); min-width: 0; transition: transform 180ms var(--ease), border-color 120ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .wday:hover { transform: translateY(-2px); border-color: var(--line-2); } }
.wday .dot { width: 32px; height: 32px; margin-top: 2px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.wday.done .dot { background: var(--c); color: var(--bg); }
.wday.next { border-color: var(--accent); color: var(--text); }
.wday b { color: var(--text); font: 500 15px var(--font-mono); }

.rings { display: flex; gap: 20px; align-items: center; }
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bgc { stroke: var(--surface-3); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease-enter); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 500 20px var(--font-mono); letter-spacing: -0.03em; line-height: 1; }
.ring .lbl small { display: block; font: 500 12px var(--font-text); letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex: 1; }
.kpi .v { display: flex; align-items: center; gap: 6px; font: 500 26px var(--font-mono); letter-spacing: -0.04em; line-height: 1.1; }
.kpi .v .ico { color: var(--strength); }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

.insights { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.insights::-webkit-scrollbar { display: none; }
.insight { scroll-snap-align: start; flex: 0 0 min(340px, 86%); display: flex; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--text-2); }
.insight b { color: var(--text); }
.insight a { color: var(--accent); font-weight: 500; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--m-out) var(--ease); }
.insight a:hover { background-size: 100% 1px; transition-duration: var(--m-in); }
.insight .ii { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.insight.warn .ii { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.insight.good .ii { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 32px 0 14px; }
.sec-title h2 { font-size: 19px; }

/* ---------- session ---------- */
.s-head { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.s-title { margin-bottom: 8px; }
.s-title h1 { font-size: 36px; letter-spacing: -0.04em; line-height: 1.06; margin: 14px 0 8px; }
.prog-line { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 16px 0 24px; }
.prog-line b { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; transition: transform var(--m-slide) var(--ease); }
.steps { display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color 160ms var(--ease); }
.step.ok { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.step-body { transition: opacity 160ms var(--ease); }
.step.ok .step-body { opacity: .6; }
.tick { width: 44px; height: 44px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: transparent; color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform var(--m-press) var(--ease); }
.tick .ico { opacity: 0; transform: scale(.7); transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .tick:hover { border-color: var(--accent); } }
.tick:active { transform: scale(.94); }
.step.ok .tick { background: var(--accent); border-color: var(--accent); }
.step.ok .tick .ico { opacity: 1; transform: none; }
.step h3 { font-size: 18px; margin: 6px 0 10px; line-height: 1.3; }
.step .num { font-size: 13px; font-weight: 500; color: var(--muted); }
.step ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.step li { position: relative; padding-left: 16px; color: var(--text-2); font-size: 16px; line-height: 1.55; }
.step li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.calc { color: var(--accent); font: 500 .94em var(--font-mono); white-space: nowrap; cursor: help; }
.score { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.score label { display: flex; align-items: center; gap: 6px; }
.score input { max-width: 280px; font-family: var(--font-mono); }
.splits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 440px; }
.splits input { text-align: center; padding: 10px 4px; }
.done-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text); margin: 12px 0 0; }
.done-banner .ico { color: var(--accent); }
.done-banner .t2 { font-size: 14px; }
.finish-bar { position: sticky; bottom: 16px; z-index: 5; margin-top: 20px; display: flex; gap: 10px; padding: 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.finish-bar .btn { min-height: 48px; }
@media (max-width: 900px) { .finish-bar { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--m-panel) var(--ease); }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 12px 24px calc(24px + env(safe-area-inset-bottom)); animation: up 260ms var(--ease-enter); }
.sheet h2 { font-size: 24px; letter-spacing: -0.03em; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 24px; } }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 0 auto 18px; }
@keyframes up { from { transform: translateY(32px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.rpe-val { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.rpe-val b { font: 500 44px var(--font-mono); letter-spacing: -0.05em; color: var(--rc, var(--accent)); line-height: 1; transition: color var(--m-in) var(--ease); }
.rpe-val span { color: var(--text-2); font-weight: 500; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 44px; min-height: 44px; padding: 0; margin: 4px 0 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; }
input[type=range]:focus { background: transparent; box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: linear-gradient(90deg, #2ed3a0, #c8ff3d 40%, #f5c542 65%, #ff7a45 85%, #ff5c8a); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 99px; background: linear-gradient(90deg, #2ed3a0, #c8ff3d 40%, #f5c542 65%, #ff7a45 85%, #ff5c8a); }
input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; margin-top: -11px; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 4px solid var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); cursor: grab; transition: transform var(--m-press) var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.08); cursor: grabbing; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--bg); cursor: grab; }
.scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 0 2px 20px; }

/* ---------- plan ---------- */
.timeline { display: flex; gap: 3px; margin: 8px 0 10px; }
.timeline .tl { flex: 1; height: 40px; min-width: 0; border-radius: 6px; background: color-mix(in srgb, var(--c) 20%, var(--surface-2)); position: relative; overflow: hidden; transition: background-color var(--m-out) var(--ease); }
.timeline .fill { position: absolute; inset: 0; background: var(--c); transform-origin: bottom; }
@media (hover: hover) and (pointer: fine) { .timeline .tl { cursor: pointer; } .timeline .tl:hover { background: color-mix(in srgb, var(--c) 36%, var(--surface-2)); } }
.timeline .tl.sel { outline: 2px solid var(--text); outline-offset: 2px; }
.ph-base { --c: #4da3ff; } .ph-mixed { --c: #2ed3a0; } .ph-deload { --c: #f5c542; } .ph-test { --c: #d6dae3; } .ph-strength { --c: #ff7a45; } .ph-race { --c: #ff5c8a; } .ph-run { --c: #c8ff3d; }
:root[data-theme="light"] .ph-run { --c: #4f7a00; } :root[data-theme="light"] .ph-test { --c: #3a3f4b; }
.legend { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 20px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.wk-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; margin-bottom: 12px; }
.wk-chips::-webkit-scrollbar { display: none; }
.wk-chip { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 60px; min-height: 56px; padding: 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 500 15px var(--font-mono); cursor: pointer; transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.wk-chip small { font: 500 11px var(--font-mono); color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .wk-chip:hover { border-color: var(--line-2); color: var(--text); } }
.wk-chip.sel { background: var(--text); color: var(--bg); border-color: transparent; }
.wk-chip.sel small { color: var(--bg); opacity: .7; }
.wk-chip.cur::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.dlist { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.drow { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: transform 180ms var(--ease), border-color 120ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .drow:hover { transform: translateY(-2px); border-color: var(--line-2); } }
.drow.next { border-color: var(--accent); }
.drow .info { flex: 1; min-width: 0; }
.drow .info b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .info span { font-size: 14px; color: var(--muted); }
.status { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; }
.drow.done .status { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill-next { font-size: 12px; font-weight: 500; color: var(--accent-ink); background: var(--accent); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }

/* ---------- progress ---------- */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.stat { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.stat .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.stat .v { font: 500 30px var(--font-mono); letter-spacing: -0.05em; line-height: 1; }
.stat .v .muted { font-size: 16px; letter-spacing: 0; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font: 12px var(--font-mono); }
.chart .mark { fill: var(--accent); }
.chart .plan { fill: var(--surface-3); }
.chart .line { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .vlabel { fill: var(--text); font: 500 13px var(--font-mono); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); flex-wrap: wrap; }
.seg button { font: 500 14px var(--font-text); min-height: 44px; border: 0; background: transparent; color: var(--text-2); padding: 0 12px; border-radius: var(--r-sm); cursor: pointer; transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 32px 12px; color: var(--muted); font-size: 15px; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.cmp { display: grid; }
.cmp-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; min-height: 64px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row b { font-weight: 500; }
.cmp-row .now { font: 500 16px var(--font-mono); }
.delta { font: 500 12px var(--font-mono); padding: 4px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); min-width: 68px; text-align: center; }
.delta.up { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }

/* ---------- friends ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; margin-bottom: 20px; }
.pod { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.pod > div:not(.blk) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pod .blk { width: 100%; border-radius: 16px 16px 6px 6px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font: 500 26px var(--font-mono); color: var(--muted); }
.pod.p1 .blk { height: 120px; background: linear-gradient(180deg, var(--accent-soft), var(--surface)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); }
.pod.p2 .blk { height: 90px; } .pod.p3 .blk { height: 70px; }
.pod b { font-weight: 500; } .pod small { color: var(--muted); font-size: 13px; }
.lb { display: grid; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 28px auto 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.lb-row.me { border-color: var(--accent); }
.lb-row .rank { font: 500 15px var(--font-mono); color: var(--muted); text-align: center; }
.lb-row .nm { min-width: 0; }
.lb-row .nm b { display: block; font-weight: 500; }
.lb-row .nm span { display: block; font-size: 13px; color: var(--muted); }
.lb-row .nm span .ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.lb-row.has-kick { grid-template-columns: 28px auto 1fr auto 44px; }
.lb-row .nm .ico { color: var(--strength); }
.lb-row .sc { text-align: right; font: 500 18px var(--font-mono); letter-spacing: -0.03em; }
.lb-row .sc small { display: block; font: 500 12px var(--font-text); letter-spacing: 0; color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.crew-code { font: 500 34px var(--font-mono); letter-spacing: .14em; margin: 6px 0 16px; }

/* ---------- me ---------- */
.profile-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-hero h1 { font-size: 32px; }
.weights { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.weights div { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.weights b { display: block; font: 500 18px var(--font-mono); letter-spacing: -0.03em; }
.weights span { font-size: 13px; color: var(--muted); }
.theme-tg { display: inline-flex; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); gap: 4px; }
.theme-tg button { border: 0; background: transparent; color: var(--text-2); font: 500 14px var(--font-text); min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.theme-tg button.on { background: var(--surface-3); color: var(--text); }
.swatch-opt span { width: 44px; height: 44px; padding: 0; border-radius: 12px; }

/* ---------- pre-Hyrox month ---------- */
.dt-accent { --c: var(--accent); } .dt-deload { --c: var(--deload); } .dt-run { --c: var(--run); } .dt-hybrid { --c: var(--hybrid); } .dt-race { --c: var(--race); }
.lnk { color: var(--accent); font-weight: 500; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size var(--m-out) var(--ease); }
.lnk:hover { background-size: 100% 1px; transition-duration: var(--m-in); }
.pre-head { margin-bottom: 18px; }
.pre-head p { max-width: 62ch; }
.pre-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 20px; max-width: 420px; }
.pre-tabs a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 15px; transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.pre-tabs a:hover { color: var(--text); }
.pre-tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line-2), 0 4px 14px rgba(0, 0, 0, .18); }
.pre-tabs a.on .ico { color: var(--accent); }
.hero .meta .ok { color: var(--accent); }
.hero.is-done { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.kpi-of { font-size: 15px; letter-spacing: 0; }
.pre-teaser { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); transition: transform 180ms var(--ease), border-color 120ms var(--ease); }
.pre-teaser .info { flex: 1; min-width: 0; } .pre-teaser b { display: block; font-weight: 500; } .pre-teaser span { font-size: 14px; color: var(--text-2); }
.pre-teaser > .ico { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .pre-teaser:hover { transform: translateY(-2px); } }

/* week chooser */
.pre-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 28px 0 18px; }
.pw { display: grid; gap: 4px; text-align: left; padding: 12px; min-height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; cursor: pointer; position: relative; transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease), transform 180ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .pw:hover { border-color: var(--line-2); transform: translateY(-2px); } }
.pw-n { font: 500 17px var(--font-mono); color: var(--text); letter-spacing: -0.03em; }
.pw-d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw small { font: 500 11px var(--font-mono); color: var(--muted); }
.pw-bar svg { display: block; width: 100%; height: 4px; border-radius: 4px; overflow: hidden; }
.pw-bar .bgr { fill: var(--surface-3); } .pw-bar .fgr { fill: var(--accent); }
.pw.sel { background: var(--text); border-color: transparent; }
.pw.sel .pw-n { color: var(--bg); } .pw.sel .pw-d, .pw.sel small { color: var(--bg); opacity: .7; }
.pw.sel .pw-bar .bgr { fill: color-mix(in srgb, var(--bg) 25%, transparent); }
:root[data-theme="light"] .pw.sel .pw-bar .fgr { fill: #c8ff3d; }
.pw.cur::after { content: ""; position: absolute; top: 12px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wk-head { margin-bottom: 14px; }
.wk-head p { max-width: 64ch; }
.pre-strip { margin-bottom: 14px; }
.pre-strip .wday { position: relative; }
.dt-pip { position: absolute; bottom: 6px; width: 14px; height: 3px; border-radius: 3px; background: var(--c); }
.pre-strip .wday { padding-bottom: 14px; }
.dt-txt { font-style: normal; color: var(--c); font-weight: 500; }
.hyrox-link .pill-soft { font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface-2); padding: 3px 10px; border-radius: 99px; }
.hyrox-link > .ico { color: var(--muted); }
.today-pre { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
@media (max-width: 1100px) { .today-pre { grid-template-columns: minmax(0, 1fr); } }

/* diet chip on a session */
.diet-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 0 14px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); font-size: 14px; font-weight: 500; }
.diet-chip > .ico:first-child { color: var(--c); } .diet-chip b { font: 500 13px var(--font-mono); color: var(--c); }
.diet-chip > .ico:last-child { color: var(--muted); }

/* diet card (Today) */
.diet-card { display: flex; flex-direction: column; gap: 14px; border-color: color-mix(in srgb, var(--c) 26%, var(--line)); background: radial-gradient(360px 200px at 100% 0%, color-mix(in srgb, var(--c) 12%, transparent), transparent 70%), var(--surface); transition: transform 180ms var(--ease), border-color 180ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .diet-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 46%, var(--line)); } }
.diet-card .kicon { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.dc-top { display: flex; align-items: center; gap: 14px; }
.dc-t { flex: 1; min-width: 0; } .dc-t h3 { font-size: 20px; margin-top: 2px; }
.kcal { text-align: right; line-height: 1; }
.kcal b { display: block; font: 500 30px var(--font-mono); letter-spacing: -0.05em; color: var(--c, var(--text)); }
.kcal span { font-size: 12px; color: var(--muted); }
.kcal.xl b { font-size: 52px; } .kcal.xl span { font-size: 14px; }
.mbar { height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.mbar svg { display: block; width: 100%; height: 100%; }
.mbar .m-p { fill: var(--m-protein); } .mbar .m-c { fill: var(--m-carbs); } .mbar .m-f { fill: var(--m-fat); }
.mlegend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mc { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.mc i { width: 8px; height: 8px; border-radius: 3px; grid-row: span 1; }
.mc.m-p i { background: var(--m-protein); } .mc.m-c i { background: var(--m-carbs); } .mc.m-f i { background: var(--m-fat); }
.mc span { font-size: 12px; color: var(--muted); }
.mc b { grid-column: 1 / -1; font: 500 18px var(--font-mono); letter-spacing: -0.03em; }
.dc-meals { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-meals span { font-size: 13px; color: var(--text-2); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); }
.dc-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; font-size: 15px; }

/* diet page */
.diet-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .diet-top { grid-template-columns: minmax(0, 1fr); } }
.diet-hero { position: relative; display: grid; gap: 16px; border-radius: 24px; padding: 24px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line)); background: radial-gradient(520px 280px at 100% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), var(--surface); }
.diet-hero .badge.dt-b { --c: inherit; color: var(--c); }
.dh-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dh-main h2 { font-size: 34px; letter-spacing: -0.04em; line-height: 1.05; }
.dh-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: 15px; line-height: 1.5; }
.dh-note .ico { color: var(--c); margin-top: 3px; }
.meals { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.meal { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.meal h3 { font-size: 15px; letter-spacing: -0.01em; margin-bottom: 8px; color: var(--text); }
.meal ul, .safety ul, .track { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.meal li { position: relative; padding-left: 14px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.meal li::before { content: ""; position: absolute; left: 1px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--c); opacity: .7; }
.safety { border-radius: var(--r-lg); padding: 20px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.sf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--danger); }
.sf-head h2 { color: var(--text); font-size: 19px; }
.safety li { position: relative; padding-left: 22px; color: var(--text); font-size: 15px; line-height: 1.5; }
.safety li::before { content: "!"; position: absolute; left: 0; top: .2em; width: 15px; height: 15px; border-radius: 5px; background: var(--danger); color: var(--surface); font: 700 11px/15px var(--font-mono); text-align: center; }
.diet-intro { margin: 16px 4px 0; max-width: 70ch; }
.month-card { display: grid; gap: 16px; }
.mgrid { display: grid; gap: 6px; }
.mrow { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.mhead span { text-align: center; font-size: 12px; color: var(--muted); font-weight: 500; }
.mhead em { font-style: normal; }
@media (max-width: 520px) { .mhead em { display: none; } }
.mw { display: grid; place-items: center; font: 500 12px var(--font-mono); color: var(--muted); }
.mcell { display: grid; gap: 2px; justify-items: center; align-content: center; min-height: 54px; padding: 6px 2px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); border: 1px solid transparent; min-width: 0; transition: transform 180ms var(--ease), border-color var(--m-out) var(--ease); }
.mcell b { font: 500 15px var(--font-mono); color: var(--text); }
.mcell span { font-size: 10.5px; font-weight: 600; color: var(--c); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .01em; }
@media (hover: hover) and (pointer: fine) { .mcell:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, transparent); } }
.mcell.today { border-color: var(--accent); }
.mcell.sel { background: var(--c); } .mcell.sel b, .mcell.sel span { color: var(--bg); }
:root[data-theme="light"] .mcell.sel b, :root[data-theme="light"] .mcell.sel span { color: #fff; }
.tlegend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-2); }
.tlegend span { display: inline-flex; align-items: center; gap: 8px; }
.tlegend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tlegend b { color: var(--text); }
.tlegend em { font: 500 12px var(--font-mono); font-style: normal; color: var(--muted); }
.diet-grid { margin-top: 16px; }
.ch { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ch > .ico { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ch h2 { font-size: 19px; }
.rules { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 10px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.rules li::before { content: counter(r); width: 24px; height: 24px; border-radius: 8px; background: var(--surface-3); color: var(--text); display: grid; place-items: center; font: 500 12px var(--font-mono); }
.dose-list { display: grid; }
.dose { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dose:first-child { padding-top: 0; } .dose:last-child { border-bottom: 0; padding-bottom: 0; }
.dose b { font-weight: 600; }
.dose .dz { font: 500 13.5px/1.45 var(--font-mono); color: var(--accent); letter-spacing: -0.01em; }
.dose .dh { font-size: 14px; color: var(--muted); line-height: 1.5; }
.shop { display: grid; gap: 2px; }
.shop-it { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; padding: 4px 0; font-size: 15px; font-weight: 400; color: var(--text); cursor: pointer; }
.shop-it input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; pointer-events: none; }
.shop-it .box { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.shop-it input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.shop-it input:checked ~ .tx { color: var(--muted); text-decoration: line-through; }
.shop-it input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.track li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.track .ico { color: var(--accent); margin-top: 3px; }

/* switch (Profile toggle) */
.tg-row { display: flex; align-items: center; gap: 16px; }
.tg-text { flex: 1; min-width: 0; } .tg-text p { margin: 6px 0 0; max-width: 56ch; }
.switch { position: relative; margin: 0; flex: none; width: 56px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; min-height: 0; cursor: pointer; }
.switch span { width: 52px; height: 30px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); transition: transform 200ms var(--ease), background-color 160ms var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(22px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* misc */
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; padding: 7px 10px; border-radius: var(--r-sm); max-width: 260px; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 500; box-shadow: var(--shadow); animation: toast 260ms var(--ease-enter); }
@keyframes toast { from { transform: translate(-50%, 12px); opacity: 0; } }

/* reduced motion: colours still change, nothing moves */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: color, background-color, border-color, opacity !important; }
  .btn:hover, .btn:active, a.hero:hover, .wday:hover, .drow:hover, .tick:active, .pw:hover, .mcell:hover, .diet-card:hover, .pre-teaser:hover { transform: none !important; }
  .switch span::after { transition: none !important; }
}

/* phones */
@media (max-width: 520px) {
  h1 { font-size: 28px; }
  .hello h1, .s-title h1 { font-size: 30px; }
  .hero { padding: 22px 20px; border-radius: 20px; } .hero h2 { font-size: 28px; }
  .hero .btn { width: 100%; }
  .kpis { gap: 8px; } .kpi .v { font-size: 22px; }
  .ring { width: 80px; height: 80px; } .rings { gap: 14px; }
  .week-strip { gap: 6px; } .wday { min-height: 84px; padding: 8px 0; } .wday .dot { width: 28px; height: 28px; border-radius: 9px; }
  .step { grid-template-columns: 44px 1fr; gap: 12px; padding: 16px; }
  .card { padding: 18px; }
  .page-head h1 { font-size: 30px; }
  .lb-row { grid-template-columns: 22px auto 1fr auto; gap: 10px; padding: 12px; }
  .lb-row.has-kick { grid-template-columns: 22px auto 1fr auto 44px; }
  .pre-weeks { gap: 6px; } .pw { padding: 10px 8px; } .pw-d { display: none; }
  .diet-hero { padding: 20px 18px; border-radius: 20px; } .dh-main h2 { font-size: 28px; } .kcal.xl b { font-size: 44px; }
  .mrow { grid-template-columns: 22px repeat(7, minmax(0, 1fr)); gap: 4px; } .mcell { min-height: 50px; border-radius: 10px; padding: 6px 0; } .mcell span { font-size: 9px; letter-spacing: -0.01em; text-overflow: clip; }
  .mc { padding: 8px 10px; } .mc b { font-size: 16px; }
  .meals { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -18px; padding: 0 18px 4px; scroll-padding: 0 18px; scrollbar-width: none; }
  .meals::-webkit-scrollbar { display: none; }
  .meal { flex: 0 0 82%; scroll-snap-align: start; }
  .kcal b { font-size: 26px; }
}
body:not(.in) main { max-width: none; padding: 0; }
.meals-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: -6px; }
.meals-h h3 { font-size: 16px; }
.meals-h .small { display: none; }
@media (max-width: 520px) { .meals-h .small { display: inline; } }
/* very small phones (320–359px) */
@media (max-width: 359px) {
  .tabbar.six a { font-size: 10px; letter-spacing: -0.02em; }
  .mrow { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .mrow > .mw, .mhead > span:first-child { display: none; }
}
.sec-title h2, .sec-title .btn { white-space: nowrap; }
/* diet: repeating cycle after the fixed weeks */
.cy-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 18px 0 8px; }
.cy-row { margin-bottom: 4px; }
.cy-row .mcell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pre-tabs.three { grid-template-columns: repeat(3, 1fr); max-width: 520px; }
@media (max-width: 400px) { .pre-tabs.three a { font-size: 13px; gap: 5px; } }
