/* MyRunningPace 2: one dark, bold, calm system. Heebo for words, Barlow Condensed for numbers. */
:root {
  --bg: #0b0d12; --surface: #12151b; --card: #1a1e26; --card-2: #222733; --line: #2b313d;
  --text: #f4f6f8; --text-2: #c3c9d3; --muted: #8b94a3; --accent: #d4ff3a; --on-accent: #0b0d12;
  --good: #5cd18b; --warn: #f5b83d; --alert: #ff6b5b; --info: #6aa9ff;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --tab-h: 64px;
  --font: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --num: 'Barlow Condensed', 'Heebo', system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f4f7; --surface: #ffffff; --card: #ffffff; --card-2: #eef0f4; --line: #dfe3ea;
  --text: #12151b; --text-2: #3b4250; --muted: #6b7382; --accent: #3f6212; --on-accent: #ffffff;
  --good: #15803d; --warn: #b45309; --alert: #dc2626; --info: #2563eb;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5;
  font-weight: 500; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--num); font-weight: 700; letter-spacing: 0.2px; font-variant-numeric: tabular-nums; }
[dir="ltr"] { unicode-bidi: isolate; }

/* ---------- shell ---------- */
.shell { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); }
.screen { padding-top: calc(16px + env(safe-area-inset-top)); }
.screen[hidden] { display: none; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top h1 { margin: 0; font-size: 1.75rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.3px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 0.875rem; font-weight: 700; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.sec-title h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.sec-title small { color: var(--muted); font-size: 0.875rem; }

.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
}
.icon-btn svg { width: 22px; height: 22px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 0; text-decoration: none;
  color: var(--muted); font-size: 0.75rem; font-weight: 700; border-radius: 12px;
}
.tabbar a .ico { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] .ico { color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  font-weight: 800; text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.block { width: 100%; }
/* Google's sign-in button: white with the colored G, as Google asks */
.btn.google-btn { background: #fff; color: #1f1f1f; border-color: #747775; gap: 10px; }
.btn.google-btn .ico { width: 20px; height: 20px; stroke: none; }
/* how it felt: four small chips after a done workout */
.feel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 12px; }
.feel span { color: var(--text-2); font-weight: 700; font-size: 0.88rem; margin-inline-end: 4px; }
.feel button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.feel button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.adapt { margin: 12px 0 4px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.adapt p { margin: 0 0 12px; color: var(--text); line-height: 1.55; }
.adapt p b { display: block; margin-bottom: 4px; }
.adapt-btns { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* waiting: the top bar, a spinner in busy buttons, and a skeleton of the screen while the plan loads */
.loadbar { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 1000; overflow: hidden; background: color-mix(in srgb, var(--accent) 20%, transparent); }
.loadbar::before { content: ""; position: absolute; inset-block: 0; width: 40%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { from { inset-inline-start: -40%; } to { inset-inline-start: 100%; } }
button[aria-busy="true"] { position: relative; cursor: progress; }
button[aria-busy="true"]::after { content: ""; display: inline-block; width: 1em; height: 1em; margin-inline-start: 8px; vertical-align: -0.15em; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel-wrap { display: grid; gap: 12px; }
.skel-label { margin: 0 0 4px; color: var(--text-2); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 40%, var(--card) 80%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
.skel-hero { height: 180px; border-radius: 20px; }
.skel-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.skel-day { height: 56px; }
.skel-line { height: 18px; width: 80%; }
.skel-line.short { width: 50%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.dot-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: pulse 1.2s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) {
  .loadbar::before { animation: none; width: 100%; inset-inline-start: 0; opacity: 0.7; }
  .skel, .dot-pulse { animation: none; }
  button[aria-busy="true"]::after { animation-duration: 2s; }
}
.ts-box { margin: 4px 0 10px; }
.steps-plain { margin: 0 0 14px; padding-inline-start: 20px; color: var(--text-2); line-height: 1.6; }
.mfa-qr { display: block; margin: 6px auto 8px; background: #fff; padding: 10px; border-radius: 12px; width: 180px; height: 180px; }
.mfa-key { text-align: center; font-family: ui-monospace, monospace; font-size: .85rem; color: var(--text-2); word-break: break-all; margin: 0 0 14px; user-select: all; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--alert); }
.btn[disabled] { opacity: 0.55; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--text-2); text-decoration: underline; font-weight: 700; }

/* ---------- today ---------- */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.strip button {
  display: grid; justify-items: center; gap: 2px; min-height: 64px; padding: 6px 0; border-radius: 14px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
}
.strip b { font-size: 0.75rem; }
.strip .d { font-family: var(--num); font-size: 1.15rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.strip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, transparent); }
.strip .dot.ok { background: none; width: auto; height: auto; color: var(--good); font-size: 0.75rem; line-height: 8px; font-weight: 800; }
.strip button.today .d { color: var(--accent); }
.strip button[aria-pressed="true"] { background: var(--card); border-color: var(--line); }

.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c);
}
.hero::after {
  content: ''; position: absolute; inset: -40% -30% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 18%, transparent), transparent); pointer-events: none;
}
.hero > * { position: relative; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.hero h2 { margin: 10px 0 4px; font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.4px; }
.hero .sub { margin: 0; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.stat { display: grid; gap: 0; }
.stat b { font-family: var(--num); font-size: 1.75rem; line-height: 1.05; font-weight: 700; }
.stat small { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.done-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-weight: 800; }

.shape { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin: 4px 0 18px; }
.shape i { display: block; border-radius: 4px 4px 2px 2px; background: var(--c); opacity: 0.35; min-width: 3px; }
.shape i.w { opacity: 1; }

.ring-card { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.ring { width: 92px; height: 92px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--card-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 600ms cubic-bezier(.2, .8, .2, 1); }
.ring-card h3 { margin: 0 0 2px; font-size: 1.1rem; font-weight: 800; }
.ring-card p { margin: 0; color: var(--text-2); }

.rows { display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: start;
  padding: 14px 16px; min-height: 64px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line);
}
.row .when { display: grid; justify-items: center; min-width: 42px; line-height: 1.1; }
.row .when b { font-size: 0.8rem; color: var(--muted); }
.row .when span { font-family: var(--num); font-size: 1.35rem; font-weight: 700; }
.row .what { display: grid; gap: 2px; border-inline-start: 3px solid var(--c); padding-inline-start: 12px; min-width: 0; }
.row .what b { font-size: 1rem; font-weight: 800; }
.row .what small { color: var(--muted); font-size: 0.85rem; }
.row .end { color: var(--muted); font-size: 1.1rem; }
.row .end.ok { color: var(--good); font-weight: 800; }
.row.skipped .what b { text-decoration: line-through; color: var(--muted); }
.row.past:not(.ok) { opacity: 0.7; }

/* ---------- plan ---------- */
.race {
  border-radius: 24px; padding: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--card)) 0%, var(--card) 55%);
  border: 1px solid var(--line);
}
.race .big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 2px; }
.race .big b { font-family: var(--num); font-size: 3.5rem; line-height: 1; font-weight: 700; }
.race .big span { font-size: 1.1rem; font-weight: 800; color: var(--text-2); }
.race p { margin: 0; color: var(--text-2); }
.phases { position: relative; display: flex; gap: 4px; margin: 18px 0 6px; }
.phases span { display: grid; gap: 6px; min-width: 0; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.phases i { display: block; height: 8px; border-radius: 4px; background: var(--c); }
.phases .now { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); transform: translateX(50%); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.facts div { background: color-mix(in srgb, var(--bg) 40%, transparent); border-radius: 12px; padding: 10px 12px; }
.facts b { display: block; font-family: var(--num); font-size: 1.4rem; line-height: 1.1; }
.facts small { color: var(--muted); font-weight: 700; font-size: 0.75rem; }

.weeks { display: grid; gap: 12px; margin-top: 18px; }
.wk { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.wk > button {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 16px 18px; min-height: 64px;
  background: none; border: 0; text-align: start;
}
.wk h3 { margin: 0; font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk h3 .chip { font-size: 0.75rem; }
.wk .meta { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.wk .chev { transition: transform 200ms ease-out; color: var(--muted); }
.wk > button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.wk .body { padding: 0 12px 14px; display: grid; gap: 8px; }
.wk .body .row { background: var(--card-2); border-color: transparent; }
.wk.current { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.wk-bar { height: 4px; margin: 0 18px 14px; border-radius: 2px; background: var(--card-2); overflow: hidden; }
.wk-bar i { display: block; height: 100%; background: var(--good); }

/* ---------- sheet ---------- */
dialog.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0;
  background: var(--surface); color: var(--text); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}
dialog.sheet::backdrop { background: rgba(4, 6, 10, 0.6); }
.sheet-in { padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; max-height: 92dvh; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet h2 { margin: 8px 0 2px; font-size: 1.6rem; line-height: 1.15; font-weight: 800; }
.sheet .date { color: var(--muted); font-weight: 700; margin: 0; }
.steps { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--card); }
.steps li::before { content: ''; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.steps b { display: block; font-weight: 800; }
.steps span { color: var(--text-2); font-size: 0.9rem; }
.why { margin: 0 0 18px; padding: 14px; border-radius: 12px; background: var(--card); color: var(--text-2); }
.why b { color: var(--text); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn { width: 100%; }
.menu { display: grid; gap: 8px; margin-top: 10px; }
.menu button, .menu a { justify-content: flex-start; width: 100%; }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 24px; } }

/* ---------- progress ---------- */
/* Personal records: one board, a row per distance, like a club's results sheet. Classic medal colours
   (gold, silver, bronze, steel), flat and matte; the time is the big thing. */
.recs { padding: 4px 16px; }
.rec { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rec:last-child { border-bottom: 0; }
.rec-txt { display: grid; gap: 2px; min-width: 0; }
.rec-txt b { font-size: 1rem; font-weight: 800; }
.rec-txt small, .rec-val small { color: var(--muted); font-size: 0.78rem; }
.rec-val { display: grid; justify-items: end; gap: 0; text-align: end; }
.rec-val b { font-size: 1.7rem; line-height: 1; letter-spacing: 0.01em; }
.rec .new { color: var(--accent); font-weight: 800; font-size: 0.72rem; }
/* the medal: a solid matte disc with an engraved inner ring and a small flat ribbon above it */
.disc { position: relative; border-radius: 50%; display: grid; place-items: center; background: var(--c);
  box-shadow: inset 0 0 0 3px var(--c), inset 0 0 0 4px rgba(255, 255, 255, 0.28); }
.disc span { font-family: var(--num); font-weight: 700; color: #fff; position: relative; z-index: 1; }
.disc::before { content: ""; position: absolute; z-index: -1; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000) 50%, color-mix(in srgb, var(--c) 85%, #000) 50%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.rec .disc { width: 40px; height: 40px; margin-top: 8px; }
.rec .disc span { font-size: 0.82rem; }
.rec .disc::before { top: -9px; width: 20px; height: 16px; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 18px 10px; }
.medal { display: grid; justify-items: center; text-align: center; gap: 4px; }
.medal .disc { width: 62px; height: 62px; margin-top: 12px; }
.medal .disc span { font-size: 1.2rem; }
.medal .disc::before { top: -12px; width: 28px; height: 20px; }
.medal.locked .disc { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.medal.locked .disc::before { background: var(--line); }
.medal.locked .disc span { color: var(--muted); }
/* the next medal: a thin ring that fills as you get closer */
.medal.next .disc { background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); box-shadow: none; }
.medal.next .disc::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg, var(--card)); }
.medal.next .disc span { z-index: 2; color: var(--text); }
.medal .to-go { color: var(--text-2); font-weight: 700; }
/* the progress screen's two parts */
.ptabs { margin: 0 0 18px; }
/* advanced data tiles: the value, its unit, the trend (green when it moved the good way, red when not) and the usual range */
.advs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.adv { padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.adv > small:first-child { color: var(--text-2); font-weight: 700; }
.adv b { font-size: 1.7rem; line-height: 1.1; }
.adv small { color: var(--muted); font-size: 0.75rem; }
.adv .trend { font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.adv[data-t="up"] .trend { color: var(--good); }
.adv[data-t="down"] .trend { color: var(--alert); }
.adv p { margin: 6px 0 0; font-size: 0.75rem; color: var(--text-2); line-height: 1.4; }
.adv-empty .sub { margin: 0; }
.medal b { font-size: 0.9rem; font-weight: 800; line-height: 1.2; }
.medal small { color: var(--muted); font-size: 0.75rem; }
.medal .new { color: var(--good); font-weight: 800; font-size: 0.75rem; }
.medal .prog { width: 64px; height: 4px; border-radius: 2px; background: var(--card-2); overflow: hidden; }
.medal .prog i { display: block; height: 100%; background: var(--good); }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.totals .card { padding: 14px; text-align: center; }
.totals b { display: block; font-family: var(--num); font-size: 1.75rem; line-height: 1.1; }
.totals small { color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bars div { flex: 1; display: grid; align-items: end; justify-items: center; gap: 6px; height: 100%; }
.bars i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: var(--card-2); min-height: 3px; transform-origin: bottom; }
.bars div.cur i { background: var(--accent); }
.bars small { color: var(--muted); font-size: 0.75rem; font-weight: 700; }

/* ---------- more ---------- */
.group-title { margin: 26px 4px 8px; color: var(--muted); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.4px; }
.list { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px 16px; background: none; border: 0;
  border-bottom: 1px solid var(--line); text-align: start; text-decoration: none; color: var(--text);
}
.list > :last-child { border-bottom: 0; }
.item .ico { color: var(--text-2); }
.item span { flex: 1; display: grid; }
.item span b { font-weight: 700; }
.item span small { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.item .go { color: var(--muted); }
.item.danger { color: var(--alert); }
.item.danger .ico { color: var(--alert); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card-2); }
.seg button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: none; color: var(--text-2); font-weight: 800; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.strava-btn { background: none; border: 0; padding: 0; min-height: 48px; }
.strava-btn img { display: block; height: 48px; width: auto; }
.powered { display: block; margin-top: 6px; height: 15px; width: auto; }
.empty { text-align: center; padding: 36px 18px; }
.empty h2 { margin: 12px 0 6px; font-size: 1.5rem; font-weight: 800; }
.empty p { margin: 0 0 18px; color: var(--text-2); }
.foot { margin: 28px 0 8px; text-align: center; color: var(--muted); font-size: 0.8rem; }

/* ---------- onboarding ---------- */
.onb { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; grid-template-rows: minmax(0, 1fr); }
.onb[hidden] { display: none; }
.onb-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; max-width: 640px; width: 100%; margin: 0 auto; }
.onb-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.onb-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 300ms ease-out; }
.onb-body { overflow-y: auto; padding: 16px 16px 24px; max-width: 640px; width: 100%; margin: 0 auto; }
.onb-body h1 { margin: 8px 0 8px; font-size: 2rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.4px; }
.onb-body .lead { margin: 0 0 22px; color: var(--text-2); font-size: 1.05rem; }
.onb-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; display: grid; gap: 6px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 14px 16px;
  text-align: start; border-radius: var(--r-md); background: var(--card); border: 2px solid var(--line);
}
.opt .badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-family: var(--num); font-weight: 700; font-size: 1.15rem; background: var(--card-2); color: var(--text); }
.opt b { display: block; font-size: 1.05rem; font-weight: 800; }
.opt small { color: var(--muted); font-size: 0.9rem; }
.opt[aria-checked="true"], .opt[aria-pressed="true"] { border-color: var(--accent); }
.opt[aria-checked="true"] .badge, .opt[aria-pressed="true"] .badge { background: var(--accent); color: var(--on-accent); }
.feat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; padding: 6px 0; }
.feat .badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-family: var(--num); font-weight: 700; }
.feat b { display: block; font-weight: 800; }
.feat small { color: var(--muted); }
.days7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days7 button { min-height: 56px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); font-weight: 800; font-size: 1.05rem; }
.days7 button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.field input[type="date"], .field input[type="number"] {
  min-height: 52px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 1.05rem;
}
.tbox { display: flex; gap: 6px; align-items: flex-start; justify-content: flex-end; }
.tbox label { display: grid; justify-items: center; gap: 4px; }
.tbox input { width: 70px; min-height: 56px; text-align: center; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-family: var(--num); font-size: 1.5rem; font-weight: 700; }
.tbox small { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.tbox b { line-height: 56px; font-size: 1.5rem; color: var(--muted); }
.err { color: var(--alert); font-weight: 700; min-height: 1.5em; margin: 0; }
.summary .race { margin-bottom: 14px; }
.hint-box { padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--good) 12%, var(--card)); color: var(--text); margin-bottom: 18px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; inset: auto 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); z-index: 60; max-width: 560px; margin: 0 auto;
  padding: 14px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 700; opacity: 0; transform: translateY(8px);
  pointer-events: none; transition: opacity 200ms ease-out, transform 200ms ease-out;
}
#toast.show { opacity: 1; transform: none; }
#toast.error { background: var(--alert); color: #fff; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .screen.enter > *, .screen.enter .main > *, .screen.enter .side > * { animation: rise 200ms ease-out both; animation-delay: calc(var(--i, 0) * 30ms); }
  .onb-body > * { animation: rise 220ms ease-out both; animation-delay: calc(var(--i, 0) * 30ms); }
  dialog.sheet[open] { animation: up 250ms cubic-bezier(.2, .8, .2, 1); }
  dialog.sheet[open]::backdrop { animation: fade 250ms ease-out; }
  .btn, .opt, .row, .strip button, .days7 button, .tabbar a { transition: transform 100ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out; }
  .btn:active, .opt:active, .row:active, .days7 button:active { transform: scale(0.97); }
  .screen.enter .bars i { animation: grow 300ms ease-out both; animation-delay: calc(var(--i, 0) * 20ms); }
  .screen.enter .medal:not(.locked) .disc { animation: fade 400ms ease-out both; animation-delay: calc(min(var(--i, 0), 10) * 25ms); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ring .fg, .onb-bar i { transition: none; } }

/* ---------- 2.1: layout, notes, onboarding parts ---------- */
.tabbar .brand { display: none; }
.cols { display: grid; gap: 14px; }
.cols .main, .cols .side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.cols .side > .sec-title:first-child { margin-top: 6px; }
.desk-only { display: none; }
.note { padding: 12px 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); color: var(--text-2); font-size: 0.92rem; }
.note b { color: var(--text); }
.note.good { background: color-mix(in srgb, var(--good) 12%, var(--card)); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.note .link { padding: 6px 0; min-height: 36px; margin-inline-start: 6px; }
.wk-acts { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0 4px; }
.wk-acts .link, .week-list .link { display: inline-flex; align-items: center; gap: 6px; }
.wk-acts .ico, .week-list .link .ico { width: 18px; height: 18px; }
.ladders { display: grid; gap: 4px; }
.item.wrap { flex-wrap: wrap; }
.or { text-align: center; color: var(--muted); font-weight: 800; margin: 6px 0 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 800; }
.field input[type="email"] { min-height: 52px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 1.05rem; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; color: var(--text-2); }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.onb-panel { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-height: 0; }
.onb-body h1:focus { outline: none; }
.moved { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.7); }
.moved .card { max-width: 440px; }
.moved h2 { margin: 0 0 8px; }
.moved p { color: var(--text-2); }

/* ---------- desktop: a top bar, wide content in two columns ---------- */
@media (min-width: 900px) {
  .tabbar {
    position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 6px;
    padding: 12px max(32px, calc((100% - 1120px) / 2 + 32px)); border-top: 0; border-bottom: 1px solid var(--line);
  }
  .tabbar .brand { display: inline-flex; margin-inline-end: auto; font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--text); min-height: 44px; align-items: center; }
  .tabbar .brand span { color: var(--accent); }
  .tabbar a[data-tab] { grid-auto-flow: column; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; font-size: 0.95rem; border-radius: 999px; }
  .tabbar a[data-tab] .ico { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { background: var(--card); }
  .shell { max-width: 1120px; padding: 0 32px 64px; }
  .screen { padding-top: 104px; }
  .top h1 { font-size: 2.25rem; }
  .cols { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
  #s-plan .cols { grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.6fr); }
  #s-plan .cols .side { order: 0; } #s-plan .cols .main { order: 1; }
  .cols.two { grid-template-columns: 1fr 1fr; }
  .cols.two > div > .group-title:first-child { margin-top: 0; }
  .sticky { position: sticky; top: 96px; }
  .desk-only { display: block; }
  .mob-only { display: none; }
  .hero { padding: 28px; }
  .hero h2 { font-size: 2.5rem; }
  .shape { height: 72px; }
  .strip button { min-height: 72px; }
  .medals { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .ladders { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .bars { height: 200px; }
  .onb { place-items: center; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 10%, var(--bg)), var(--bg) 60%); }
  .onb-panel { width: min(600px, 100%); height: min(860px, calc(100dvh - 48px)); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; }
  .onb-top, .onb-body, .onb-foot { max-width: none; }
  dialog.sheet { max-width: 620px; }
  #toast { inset: auto 24px 24px; }
}

/* ---------- Pro cards: the weekly review, insights, the runs list ---------- */
.pro-tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; color: var(--on-accent); background: var(--accent); }
.sec-title .pro-tag { margin-inline-start: 8px; }
.sec-title:has(.pro-tag) { justify-content: flex-start; }
.pro-lock p { margin: 0 0 12px; color: var(--text-2); }
.review-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.review-nums div { background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.review-nums b { display: block; font-family: var(--num); font-size: 1.6rem; line-height: 1.1; }
.review-nums small { color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.review-line { margin: 12px 0 4px; font-weight: 700; }
.review-next { margin: 0; color: var(--text-2); }
.review-next .link { padding: 4px 0; min-height: 36px; }
.insights { display: grid; gap: 10px; }
.insight { padding: 14px 16px; border-inline-start: 4px solid var(--good); }
.insight.warn { border-inline-start-color: var(--warn); }
.insight b { display: block; font-size: 1.02rem; font-weight: 800; }
.insight p { margin: 4px 0 0; color: var(--text-2); }
.insight details summary { cursor: pointer; color: var(--muted); font-weight: 700; min-height: 40px; display: flex; align-items: center; margin-top: 4px; }
.runs .when span { font-size: 1rem; }

/* ---------- Pro: the locked part of a card, and the plan screen ---------- */
.pro-more {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 10px; padding: 10px 14px; text-align: start;
  border-radius: var(--r-md); border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--card)); color: var(--text);
}
.pro-more .ico { width: 20px; height: 20px; color: var(--accent); flex: none; }
.pro-more span { flex: 1; font-weight: 700; }
.pro-more b { font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.insights .pro-more { margin-top: 0; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.price { position: relative; display: grid; justify-items: center; gap: 2px; padding: 18px 10px 14px; border-radius: var(--r-md); background: var(--card); border: 2px solid var(--line); }
.price b { font-family: var(--num); font-size: 2rem; line-height: 1; }
.price span { color: var(--text-2); font-size: 0.85rem; font-weight: 700; }
.price em { position: absolute; top: -11px; font-style: normal; font-size: 0.75rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.price[aria-checked="true"] { border-color: var(--accent); }
.compare { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 0.92rem; }
.compare th, .compare td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.compare th[scope="row"] { text-align: start; font-weight: 700; }
.compare thead th { color: var(--muted); font-size: 0.8rem; }
.compare thead th:last-child { color: var(--accent); }
.compare td { color: var(--text-2); }
.compare td .ico { width: 18px; height: 18px; color: var(--good); }
/* what free does not get: a bright red X that glows, so the difference is obvious at a glance */
.compare .no-cell { display: inline-grid; justify-items: center; gap: 2px; }
.compare .no-cell small { color: #ff4d5e; font-size: 0.72rem; font-weight: 700; }
.compare td .ico.x-no { width: 20px; height: 20px; color: #ff2d47; stroke-width: 3.2; filter: drop-shadow(0 0 5px rgba(255, 45, 71, 0.85)) drop-shadow(0 0 12px rgba(255, 45, 71, 0.45)); }
.compare .yes-cell { color: var(--accent); font-weight: 800; }
:root[data-theme="light"] .compare td .ico.x-no { color: #e11d2e; filter: drop-shadow(0 0 4px rgba(225, 29, 46, 0.55)); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .compare td .ico.x-no { color: #e11d2e; filter: drop-shadow(0 0 4px rgba(225, 29, 46, 0.55)); } }

/* a locked week or workout: the day, the phase, a lock, nothing else */
.row.locked .what b { color: var(--text-2); }
.row.locked .end .ico { color: var(--accent); width: 20px; height: 20px; }
.wk.locked { border-style: dashed; }
.wk.locked .chev { transform: none; color: var(--accent); }
.hero .chip .ico { width: 14px; height: 14px; }

/* access code, under the Pro offer */
.code-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 6px; }
.code-box summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-2); font-weight: 700; }
.code-box input { min-height: 52px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 1.05rem; letter-spacing: 1px; }
/* the health note under the new plan, and the consent line under sign-in: small, readable, never alarming */
.health-note { margin-top: 16px; font-size: 0.88rem; line-height: 1.55; color: var(--text-2); }
.consent { margin-top: 12px; font-size: 0.85rem; color: var(--text-2); }
.consent a, .health-note a { color: inherit; text-decoration: underline; }
