/* "Console" theme: a clean analytics-console look. Navy sidebar with a bright blue active item, a light blue-grey canvas,
   white rounded cards on soft shadows, Plus Jakarta Sans, big bold figures, royal blue as the primary. Light by default;
   the dark mode keeps the same structure on deep navy. */
:root {
  color-scheme: dark;
  /* load-focus bands: low aerobic / high aerobic / anaerobic, three clearly different hues */
  --focus-low: var(--s1); --focus-high: var(--s2); --focus-ana: var(--s4);
  --bg: #0b1020; --rail: #0a0f1f; --surface: #131a2e; --surface-2: #1a2238;
  --ink: #e8ecf7; --ink-2: #b7c0d8; --muted: #8c96b2;
  --grid: #1e2740; --axis: #2d3754; --border: #242e48; --wash: rgba(110, 139, 255, 0.08);
  --accent: #6e8bff; --accent-ink: #0b1020; --accent-tint: rgba(110, 139, 255, 0.16); --accent-text: #93a8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.4);
  /* categorical (validated both modes: CVD ΔE light 9.9 / dark 10.8, all checks pass) */
  --s1: #5b7bff; --s2: #c98415; --s3: #14a897; --s4: #9b74f7; --s5: #e0508f; --s6: #5e9a22; --s7: #2b9bdb; --s8: #e5525f;
  --bar-muted: #2d3754;
  --seq-1: #22336e; --seq-2: #2f4aa8; --seq-3: #5b7bff; --seq-4: #a9b9ff;
  --heat-0: #1a2238; --heat-1: #22336e; --heat-2: #2f4aa8; --heat-3: #4566e8; --heat-4: #7c95ff;
  /* HR zones keep the grey / blue / green / amber / red convention */
  --zone-1: #8a96ad; --zone-2: #4f8ff7; --zone-3: #1fbf87; --zone-4: #f2a422; --zone-5: #f05a5a;
  --str-1: #2e2a63; --str-2: #4a3f9c; --str-3: #7a6bd8;
  --pmc-ctl: #6e8bff; --pmc-ctl-area: rgba(110, 139, 255, 0.16); --pmc-atl: #e0508f; --pmc-tsb: #e89a1f; --pmc-tss: #2bc4b0; --pmc-if: #a98bfa;
  --pmc-tsb-text: #e89a1f; --pmc-if-text: #b9a1fb;
  --good: #22b35e; --good-text: #4cd38a;
  --warn: #e5a100; --warn-text: #f2c14e;
  --serious: #e8590c; --serious-text: #ff8a4c;
  --crit: #e5404f; --crit-text: #ff7b86;
  --banner-bg: #131a2e; --banner-ink: #e8ecf7; --banner-muted: #8c96b2; --banner-line: #242e48;
  --banner-h: 64px;
  --rail-w: 244px;
  --radius: 12px;
  --f-display: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;  /* figures use tabular-nums */
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb; --rail: #0e1630; --surface: #ffffff; --surface-2: #f1f4fa;
  --ink: #0f172a; --ink-2: #334155; --muted: #5b6478;
  --grid: #edf1f7; --axis: #d5dce8; --border: #e3e8f1; --wash: rgba(59, 91, 253, 0.05);
  --accent: #3b5bfd; --accent-ink: #ffffff; --accent-tint: #eef2ff; --accent-text: #2f4ae0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 2px 6px rgba(16, 24, 40, 0.07), 0 16px 34px rgba(59, 91, 253, 0.13);
  --s1: #3b5bfd; --s2: #c97800; --s3: #0e9f8f; --s4: #8b5cf6; --s5: #db2777; --s6: #5b9e1a; --s7: #0284c7; --s8: #dc3545;
  --bar-muted: #d5dce8;
  --seq-1: #c3ceff; --seq-2: #8ea2ff; --seq-3: #3b5bfd; --seq-4: #2a45d8;
  --heat-0: #eef2ff; --heat-1: #c3ceff; --heat-2: #8ea2ff; --heat-3: #5b7bff; --heat-4: #2a45d8;
  --zone-1: #94a3b8; --zone-2: #3b82f6; --zone-3: #10b981; --zone-4: #f59e0b; --zone-5: #ef4444;
  --str-1: #e6e1fb; --str-2: #c4b8f4; --str-3: #8b7ae0;
  --pmc-ctl: #3b5bfd; --pmc-ctl-area: rgba(59, 91, 253, 0.12); --pmc-atl: #db2777; --pmc-tsb: #c97800; --pmc-tss: #0b7f72; --pmc-if: #8b5cf6;
  --pmc-tsb-text: #8a5300; --pmc-if-text: #6d3fe0;
  --good: #12a150; --good-text: #0b7a3b;
  --warn: #e5a100; --warn-text: #8a5a00;
  --serious: #e8590c; --serious-text: #b5440a;
  --crit: #dc3545; --crit-text: #b42330;
  --banner-bg: #ffffff; --banner-ink: #0f172a; --banner-muted: #5b6478; --banner-line: #e3e8f1;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: 0.01em; text-wrap: balance; line-height: 1.1; }
h1 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; text-transform: uppercase; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.mono, .num, td.num, .kv dd { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
/* metric titles: 10px uppercase, wide tracking, semibold, gray-400 */
.micro { font: 600 10px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* telemetry banner */
.telemetry { position: sticky; top: 0; z-index: 30; height: var(--banner-h); display: flex; align-items: stretch;
  background: var(--banner-bg); color: var(--banner-ink); border-bottom: 1px solid var(--banner-line); overflow-x: auto; scrollbar-width: none; }
.telemetry::-webkit-scrollbar { display: none; }
.telemetry .brand { color: var(--banner-ink); width: var(--rail-w); flex: none; border-right: 1px solid var(--banner-line); padding: 0 22px; overflow: hidden; white-space: nowrap; }
.t-data { display: flex; align-items: stretch; flex: 1; min-width: 0; }
.t-seg { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 20px; border-right: 1px solid var(--banner-line); flex: none; }
.t-seg .micro { color: var(--banner-muted); }
button.t-seg { font: inherit; color: inherit; background: none; border: 0; border-right: 1px solid var(--banner-line); text-align: left; cursor: pointer; align-items: flex-start; position: relative; }
button.t-seg:hover { background: rgb(255 255 255 / 0.04); }
button.t-seg[aria-expanded="true"] { background: rgb(255 255 255 / 0.07); }
button.t-seg[aria-expanded="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
button.t-seg:focus-visible { outline-offset: -3px; }
.tpop { position: fixed; top: calc(var(--banner-h) + 6px); z-index: 60; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - var(--banner-h) - 20px); overflow-y: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.28);
  padding: 16px 18px 14px; display: grid; gap: 10px; animation: tpop-in 120ms ease-out; }
@keyframes tpop-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .tpop { animation: none; } }
.tpop h4 { margin: 0; padding-right: 24px; font: 600 19px/1.15 var(--f-display); }
.tpop p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.tpop .pp-big { font: 600 30px/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tpop .pp-big small { font: 400 13px var(--f-body); color: var(--muted); }
.tpop .pp-now { color: var(--ink); } .tpop .pp-now b { font-weight: 600; }
.tpop .pp-why { font-size: 12.5px; color: var(--muted); }
.tpop .pp-facts { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tpop .pp-facts li { font-size: 12.5px; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink-2); }
.tpop .pp-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; justify-self: start; }
.tpop .pp-link:hover { text-decoration: underline; }
.tpop .pp-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.tpop .pp-x:hover { background: var(--wash); color: var(--ink); }
.pp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.pp-chart text { font-family: var(--f-body); font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.pp-chart .pp-grid { stroke: var(--grid); stroke-width: 1; }
.pp-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.pp-scale span { font-size: 11px; text-align: center; padding: 14px 2px 0; color: var(--muted); position: relative; line-height: 1.2; }
.pp-scale span::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; border-radius: 2px; background: var(--c); opacity: .35; }
.pp-scale span.on { color: var(--ink); font-weight: 600; } .pp-scale span.on::before { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c); }
.t-val { font: 600 19px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.t-val small { font: 500 11px var(--f-mono); color: var(--banner-muted); margin-left: 4px; letter-spacing: 0; }
.t-sub { font: 500 10.5px var(--f-mono); color: var(--banner-muted); white-space: nowrap; }
.t-race .t-val { font-size: 21px; }
.t-status { justify-content: center; }
.t-pill { display: inline-flex; align-items: center; gap: 7px; font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 5px 10px; border: 1px solid var(--banner-line); border-radius: 999px; color: var(--banner-ink); white-space: nowrap; }
.t-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--banner-muted); }
.t-pill.good i { background: var(--good); } .t-pill.warn i { background: var(--warn); } .t-pill.crit i { background: var(--crit); }
.t-sync { margin-left: auto; border-right: 0; border-left: 1px solid var(--banner-line); align-items: flex-end; }
.t-err { padding: 0 20px; display: flex; align-items: center; color: #f87171; font-size: 13px; }

/* shell */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: calc(100vh - var(--banner-h)); }
.side { background: var(--rail); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: var(--banner-h); height: calc(100vh - var(--banner-h)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 19px;
  text-transform: uppercase; letter-spacing: 0.06em; }
.brand-mark { width: 20px; height: 20px; background: var(--accent); clip-path: polygon(0 100%, 30% 40%, 50% 70%, 75% 15%, 100% 100%); }
.side nav { display: grid; gap: 1px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); text-decoration: none; color: var(--ink-2);
  font-weight: 500; border: 1px solid transparent; }
.side nav a .n { font: 600 11px var(--f-mono); width: 20px; height: 20px; border-radius: 4px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); color: var(--muted); flex: none; }
.side nav a:hover { background: var(--wash); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--surface); color: var(--ink); border-color: var(--border); }
.side nav a[aria-current="page"] .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: 13px; padding-top: 14px; border-top: 1px solid var(--border); }
.athlete { padding: 0 6px; }
.athlete strong { display: block; font-size: 14px; }
.athlete span { color: var(--muted); font-size: 12px; }
.side-actions { display: flex; gap: 6px; }
.asof { color: var(--muted); padding: 0 6px; font: 500 11px var(--f-mono); }
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; font-weight: 500; font-size: 13px; }
.btn:hover { border-color: var(--muted); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.main { min-width: 0; }
main { padding: 26px 28px 64px; display: grid; gap: 24px; max-width: 1360px; outline: none; }

/* page header */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; }
.page-head .eyebrow { margin-bottom: 4px; }
.eyebrow { font: 600 10px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.lede { color: var(--muted); max-width: 70ch; margin-top: 6px; font-size: 14px; }
section { display: grid; gap: 12px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; }
.sec-head p { color: var(--muted); font-size: 13px; }

/* controls */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; border-left: 1px solid var(--border); background: transparent; padding: 6px 12px; cursor: pointer; color: var(--muted);
  font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: 0.06em; }
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--ink); background: var(--wash); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.controls label { font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
input[type="date"], input[type="month"], select { font: 500 13px var(--f-mono); padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: 500 13px var(--f-body); color: var(--ink-2); background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.tile .label { font: 600 10px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tile .value { font: 600 24px/1.15 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile .value small { font: 500 12px var(--f-mono); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.tile .note { font-size: 12px; color: var(--muted); }

/* telemetry ribbon: one bordered block, 4 columns, 1px dividers */
.ribbon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ribbon .cell { background: var(--surface); padding: 14px 18px 13px; display: grid; gap: 5px; align-content: start; min-width: 0; }
.ribbon .cell[title] { cursor: help; }
.ribbon .v { font: 600 26px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.ribbon .v small { font: 500 12px var(--f-mono); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.ribbon .sub { font: 500 11px/1.3 var(--f-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ribbon .sub b { color: var(--ink-2); font-weight: 600; }
.ribbon .sub.alert b { color: var(--crit-text); }
.delta-up { color: var(--good-text); } .delta-down { color: var(--crit-text); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; align-items: center; }
.card-head h2, .card-head h3 { margin: 0; font: 600 11px/1.4 var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.card-head p { font-size: 12px; color: var(--muted); }
.card-head .legend { font-size: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.stats div { display: grid; gap: 1px; }
.stats b { font: 600 15px var(--f-mono); font-variant-numeric: tabular-nums; }
.stats b small { color: var(--muted); font-weight: 500; font-size: 11px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.span-2 { grid-column: span 2; }

/* status */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px 1px 6px; border-radius: 999px;
  background: var(--wash); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.st-good { color: var(--good-text); } .st-good i { background: var(--good); }
.st-warn { color: var(--warn-text); } .st-warn i { background: var(--warn); }
.st-crit { color: var(--crit-text); } .st-crit i { background: var(--crit); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 7px; flex: none; }

/* legends & charts */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .ln { width: 14px; height: 3px; border-radius: 2px; }
.legend .tk { width: 14px; height: 0; border-top: 2px solid var(--ink); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--f-mono); font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .endlabel { fill: var(--ink); font-weight: 600; font-size: 11.5px; }
.chart .axlabel { font-family: var(--f-body); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.chart .inklabel { fill: var(--ink-2); font-size: 11.5px; }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; min-width: 150px; z-index: 5; font-variant-numeric: tabular-nums; }
.tip b { display: block; font-weight: 600; margin-bottom: 2px; }
.tip .row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.tip strong { font-family: var(--f-mono); font-weight: 600; }
.tip .row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip .k { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--grid); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--wash); }
tbody tr.link { cursor: pointer; }
th { font: 600 10px/1.3 var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--surface); border-bottom-color: var(--border); }
td.num { font-size: 13px; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button::after { content: "↕"; color: var(--axis); font-size: 11px; }
th button[data-dir="asc"]::after { content: "↑"; color: var(--ink-2); }
th button[data-dir="desc"]::after { content: "↓"; color: var(--ink-2); }
th button:focus-visible { outline: 2px solid var(--s1); }
.num { text-align: right; }
th.num button { flex-direction: row-reverse; }
td.wrap { white-space: normal; min-width: 200px; max-width: 340px; }
.dim { color: var(--muted); }

/* states */
.loading { color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 18px 0; }
.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--axis); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--ink-2); padding: 14px 0; display: grid; gap: 2px; }
.empty strong { color: var(--ink); font-weight: 600; }
.empty span { color: var(--muted); font-size: 13.5px; }
.error { border: 1px solid var(--border); border-left: 3px solid var(--crit); background: var(--surface); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 2px; }
.error strong { color: var(--crit-text); }
.error span { color: var(--ink-2); font-size: 13.5px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--grid); }
.list li:first-child { border-top: 0; }
.when { font-family: var(--f-display); font-weight: 600; font-size: 15px; line-height: 1.1; text-transform: uppercase; }
.when small { display: block; font-family: var(--f-body); font-size: 12px; color: var(--muted); text-transform: none; font-weight: 500; }
.what small { display: block; color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.back { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); }
.prose { max-width: 70ch; white-space: pre-wrap; color: var(--ink-2); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 92px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.cal .hd { background: var(--surface); font: 600 10px var(--f-body); color: var(--muted); padding: 7px 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.cal .day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day.out { background: var(--bg); }
.cal .day.out .dn { color: var(--muted); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal .dn { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal .wk { background: var(--surface); padding: 6px 8px; font-size: 12px; color: var(--ink-2); display: grid; align-content: start; gap: 2px; font-variant-numeric: tabular-nums; }
.cal .wk b { color: var(--ink); font-size: 14px; }
.pill { display: block; text-decoration: none; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 4px; border-left: 3px solid var(--c, var(--muted));
  background: var(--wash); overflow: hidden; }
.pill.planned { background: transparent; box-shadow: inset 0 0 0 1px var(--border); border-left-style: dashed; }
.pill .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.pill .m { color: var(--muted); font-variant-numeric: tabular-nums; }
.pill:hover { background: var(--grid); }
.pill.event { border-left-color: var(--ink); font-weight: 600; }
.pill.note { border-left-color: var(--s4); }
.pill.avail { border-left-color: var(--crit); }

/* strength */
.sets { display: flex; flex-wrap: wrap; gap: 6px; }
.set { font-size: 12.5px; border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.set.done { background: var(--wash); }

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; gap: 12px; padding: 14px 16px; }
  .side nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-foot { margin-top: 0; }
  .telemetry { position: static; }
  .telemetry .brand { width: auto; }
  .ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 20px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal .wk, .cal .hd.wkh { display: none; }
  .cal .day { min-height: 70px; padding: 3px; }
  .pill .m { display: none; }
}
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }

/* ask coach */
.c-log { display: grid; gap: 18px; }
.turn.user { display: flex; justify-content: flex-end; }
.turn.user .bubble { background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 14px 14px 4px 14px; max-width: 75%; }
.turn.assistant { display: grid; gap: 8px; }
.md { line-height: 1.6; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 10px; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--f-display); text-transform: none; font-size: 19px; margin: 14px 0 6px; }
.md code { font-size: 13px; background: var(--wash); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--wash); padding: 10px; border-radius: 6px; overflow-x: auto; }
.md-table { overflow-x: auto; margin: 0 0 10px; }
.md table { font-size: 14px; width: auto; min-width: 50%; }
.md th, .md td { border: 1px solid var(--grid); padding: 5px 10px; white-space: normal; }
.md th { background: var(--wash); }
.tool-row { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); padding: 1px 0; min-width: 0; }
.tool-row .ti { width: 14px; text-align: center; flex: none; color: var(--good-text); }
.tool-row.failed .ti { color: var(--crit-text); }
.tool-row .tn { color: var(--ink-2); font-weight: 500; flex: none; }
.tool-row .ta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-row.write .tn::after { content: " · change"; color: var(--warn-text); font-weight: 600; }
.spin { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--axis); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.working { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.suggest button { padding: 5px 12px; }
.c-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.c-actions .dim { margin-right: auto; font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* workouts enhancements */
.delta { font-weight: 600; color: var(--ink-2); }
.fine { font-size: 12.5px; }
.heat-foot { display: flex; justify-content: flex-end; }
.heat-legend { display: flex; align-items: flex-end; gap: 6px; }
.heat-legend .end { font: 600 10px var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-bottom: 14px; }
.heat-legend .bin { display: grid; justify-items: center; gap: 3px; }
.heat-legend .bin i { width: 14px; height: 14px; border-radius: 3px; display: block; }
.heat-legend .bin span { font: 500 9.5px var(--f-mono); color: var(--muted); white-space: nowrap; }
input[type="search"] { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 220px; }

/* page bodies rendered after load get the same rhythm as main */
main > div[id$="-body"], main div[id$="-body"] { display: grid; gap: 20px; align-content: start; }
.card-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-tools .chips button { font-size: 12px; padding: 3px 10px; }
.card-tools .chips button[aria-pressed="false"] { opacity: 0.55; }
.card-tools .chips button[aria-pressed="false"] .dot { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--muted); }
.card-tools .chips button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }

/* training page */
.jump { position: sticky; top: var(--banner-h); z-index: 12; display: flex; flex-wrap: wrap; gap: 2px; padding-block: 8px; background: var(--bg);
  border-bottom: 1px solid var(--border); margin-top: -8px; }
.jump button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 5px 10px; border-radius: var(--radius);
  font: 600 10.5px var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; }
.jump button:hover { color: var(--ink); background: var(--wash); }
[id^="sec-"] { scroll-margin-top: calc(var(--banner-h) + 52px); }
main > .sec-head { margin-top: 10px; margin-bottom: -10px; }
main > .sec-head h2 { font-size: 20px; }
.signals { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.signal { background: var(--surface); padding: 14px 18px 16px; display: grid; gap: 6px; align-content: start; grid-template-rows: auto auto 14px auto; }
.signal .micro { display: inline-flex; align-items: center; gap: 6px; }
.signal .micro i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.signal b { font: 600 28px/1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.signal b small { font: 500 13px/1.2 var(--f-body); color: var(--muted); }
.signal > span:last-child { font-size: 12px; color: var(--muted); line-height: 1.4; }
.signal.good .micro i { background: var(--good); } .signal.warn .micro i { background: var(--warn); } .signal.crit .micro i { background: var(--crit); }
/* signal gauges: one 6px instrument strip per card, ticks and needles stand 14px tall */
.sg { position: relative; align-self: center; }
.sg-track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--grid); }
.sg-track.faint { opacity: 0.7; }
.sg-band { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: color-mix(in srgb, var(--good) 35%, transparent); }
.sg-needle, .sg-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.sg-needle { top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; }
.sg-tick { top: -3px; bottom: -3px; }
.sg-tick { background: var(--ink-2); opacity: 0.7; }
.sg-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--ink-2); }
.signal.good .sg-fill { background: var(--good); }
.sg-fill.over { border-radius: 0 3px 3px 0; background: var(--warn) !important; }
.signal.crit .sg-fill.over { background: var(--crit) !important; }
.sg-stack { display: flex; overflow: visible; background: none; box-shadow: none; gap: 2px; }
.sg-stack > span:not(.sg-tick) { height: 100%; min-width: 0; }
.sg-stack > span:first-child { border-radius: 3px 0 0 3px; } .sg-stack > span:nth-child(3) { border-radius: 0 3px 3px 0; }
.rv-kpis .signal { grid-template-rows: auto auto 22px auto; }
.sg-spark { display: block; width: 100%; height: 22px; overflow: visible; }
.sg-spark polyline { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sg-spark path { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sg-spark .base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.sg-pips { display: flex; gap: 4px; height: 6px; }
.sg-pips span { width: 18px; border-radius: 2px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--axis); }
.sg-pips span.done { background: var(--ink-2); box-shadow: none; }
.sg-pips span.missed { background: none; box-shadow: inset 0 0 0 1.5px var(--warn); }
.sg-pips span.extra { background: repeating-linear-gradient(135deg, var(--ink-2) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--ink-2); }
.sg-weeks { display: flex; gap: 3px; height: 6px; }
.sg-weeks span { flex: 1; border-radius: 2px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--grid); }
.sg-weeks span.done { background: var(--ink-2); box-shadow: none; opacity: 0.45; }
.sg-weeks span.now { background: var(--accent); box-shadow: none; }
.card .tbl .table-wrap { margin: 0; border: 0; }
.card .tbl td, .card .tbl th { padding: 6px 8px; }
@media (max-width: 820px) {
  .jump { position: static; }
    }

.legend .dt { width: 9px; height: 9px; border-radius: 50%; }
.legend .rg { width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box; }
.legend .bar { width: 5px; height: 12px; border-radius: 1px; opacity: 0.55; }
.tip-acts { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); display: grid; gap: 1px; }
.tip-acts .row span:first-child { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* collapsible rail */
.btn .ico, .rail-toggle .ico { display: none; }
.rail-toggle { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 10.5px var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; padding: 6px; border-radius: var(--radius); }
.rail-toggle .ico { display: inline-grid; place-items: center; width: 20px; font-size: 14px; letter-spacing: 0; }
.rail-toggle:hover { color: var(--ink); background: var(--wash); }
#refresh.busy .ico { animation: spin 0.8s linear infinite; }
html.rail-collapsed { --rail-w: 64px; }
html.rail-collapsed .side { padding: 18px 10px; align-items: center; }
html.rail-collapsed .lbl, html.rail-collapsed .athlete, html.rail-collapsed .asof { display: none; }
html.rail-collapsed .telemetry .brand { padding: 0; justify-content: center; }
html.rail-collapsed .side nav a { justify-content: center; padding: 8px 0; width: 42px; }
html.rail-collapsed .side nav a .n { width: 24px; height: 24px; font-size: 12px; }
html.rail-collapsed .side-foot { justify-items: center; border-top: 0; }
html.rail-collapsed .side-actions { flex-direction: column; }
html.rail-collapsed .btn .ico { display: inline; font-size: 15px; line-height: 1; }
html.rail-collapsed .side-actions .btn { width: 38px; height: 34px; padding: 0; display: grid; place-items: center; }
.shell, .telemetry .brand { transition: grid-template-columns 160ms ease, width 160ms ease; }
@media (prefers-reduced-motion: reduce) { .shell, .telemetry .brand { transition: none; } #refresh.busy .ico { animation: none; } }
@media (max-width: 820px) {
  .rail-toggle { display: none; }
  html.rail-collapsed { --rail-w: 248px; }
  html.rail-collapsed .lbl, html.rail-collapsed .athlete, html.rail-collapsed .asof { display: revert; }
}

/* session page */
.d-desc { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--grid); font-size: 14px; }
.rep-stats { align-content: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; padding-top: 6px; }
tr.rep-row td:first-child { font-weight: 600; }
tr.dim-row td { color: var(--muted); background: var(--wash); }

/* calendar (TrainingPeaks-style cards) */
.cal-scroll { overflow-x: auto; }
.cal { grid-template-columns: repeat(7, minmax(128px, 1fr)) minmax(210px, 1.35fr); min-width: 1100px; }
.cal .hd { padding: 8px 10px; }
.cal .day { min-height: 150px; padding: 6px; gap: 6px; }
.cal .dn { font: 600 12px var(--f-mono); color: var(--ink-2); padding: 2px 4px; border-radius: 4px; align-self: flex-start; }
.cal .day .dn.is-today { background: var(--accent); color: var(--accent-ink); }
.cal .day.out { background: var(--bg); }
.cal .day.out .wcard, .cal .day.out .mcard { opacity: 0.75; }
.s-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wcard { display: grid; gap: 4px; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--axis);
  border-radius: 5px; padding: 6px 8px 7px; font-size: 12px; line-height: 1.3; }
.wcard:hover { border-color: var(--muted); }
.wcard.wc-good { border-top-color: var(--good); background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.wcard.wc-warn { border-top-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.wcard.wc-crit { border-top-color: var(--crit); background: color-mix(in srgb, var(--crit) 6%, var(--surface)); }
.wcard.wc-planned { border-style: dashed; border-top-style: solid; border-top-color: var(--border); background: transparent; }
.w-top { display: flex; gap: 6px; align-items: flex-start; }
.w-title { font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-lines { display: grid; gap: 1px; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.w-lines b { font-weight: 600; font-size: 12px; }
.w-lines b small { font-weight: 500; color: var(--muted); font-size: 10.5px; }
.w-lines .ok { color: var(--good-text); }
.w-lines .p { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.w-lines span:not(.p):not(.ok) { color: var(--muted); font-size: 11px; }
.mcard { display: grid; gap: 1px; border: 1px solid var(--border); border-radius: 5px; padding: 5px 8px; background: var(--wash); font-size: 11.5px; }
.m-head { display: flex; align-items: center; gap: 5px; font: 600 10px var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 1px; }
.m-head .s-ico { width: 13px; height: 13px; color: var(--s8); }
.m-row { display: flex; justify-content: space-between; gap: 6px; }
.m-row span { color: var(--ink-2); }
.m-row b { font: 600 11.5px var(--f-mono); }
.ecard { display: grid; gap: 1px; border: 1px solid var(--ink-2); border-left: 4px solid var(--ink); border-radius: 5px; padding: 5px 8px; font-size: 12px; }
.ecard span { color: var(--muted); font-size: 11px; }
.cal .wk { padding: 10px 12px; gap: 10px; align-content: start; }
.sum-pmc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.sum-pmc span { display: block; font: 600 10px var(--f-body); text-transform: uppercase; letter-spacing: 0.06em; }
.sum-pmc b { font: 600 17px var(--f-mono); color: var(--ink); }
.sum-pmc b small { font-size: 10px; color: var(--muted); }
.sum-bar { display: grid; gap: 3px; }
.sb-head { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.sb-head b { font: 600 12.5px var(--f-mono); color: var(--ink); }
.sb-head .dim { font-family: var(--f-mono); }
.sb-track { height: 5px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.sb-track i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }
.sum-extra { display: grid; gap: 2px; font-size: 11.5px; color: var(--ink-2); }
.sum-extra b { font: 600 13px var(--f-mono); color: var(--ink); }
.cal-legend .bar { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.cal-legend .bar.outline { height: 8px; border: 1px dashed var(--muted); background: transparent; }
@media (max-width: 820px) {
  .cal { min-width: 980px; grid-template-columns: repeat(7, minmax(120px, 1fr)) 200px; }
  .cal .wk, .cal .hd.wkh { display: grid; }
}
.wcard { color: var(--ink); }


/* ask coach: full-height chat app (conversations | chat) */
main:has(.coach-app) { padding: 12px 16px; max-width: none; }
.coach-app { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: calc(100vh - var(--banner-h) - 24px); min-height: 480px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.c-history { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--rail); }
.c-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--border); }
.c-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px; align-content: start; overflow-y: auto; flex: 1; }
.c-list li { display: flex; align-items: stretch; border-radius: var(--radius); }
.c-list li a { flex: 1; min-width: 0; display: grid; gap: 2px; text-decoration: none; padding: 8px 10px; border-radius: var(--radius); }
.c-list li:hover { background: var(--wash); }
.c-list li.on { background: var(--surface); box-shadow: inset 2px 0 0 var(--accent), 0 0 0 1px var(--border); }
.c-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-meta { font-size: 11px; color: var(--muted); }
.c-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 8px; border-radius: var(--radius); font-size: 12px; opacity: 0; }
.c-list li:hover .c-del, .c-del:focus-visible, .c-del.armed { opacity: 1; }
.c-del.armed { color: var(--crit-text); font-weight: 600; }
.c-empty { padding: 8px; font-size: 12.5px; line-height: 1.4; }

.c-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.c-chat-head { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.c-head-text { flex: 1; min-width: 0; }
.c-toggle { flex: none; }
.coach-app.list-hidden { grid-template-columns: minmax(0, 1fr); }
.coach-app.list-hidden .c-history { display: none; }
.nav-sub a.all { color: var(--accent); font-weight: 500; margin-top: 2px; }
.nav-sub a.all:hover { text-decoration: underline; }
.c-chat-head h2 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; }
.c-chat-head p { font-size: 12px; margin-top: 1px; }
.c-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.c-inner { max-width: 1400px; margin: 0 auto; padding: 0 28px; }
.c-scroll .c-inner { padding-block: 20px 12px; }
.c-log { display: grid; gap: 22px; }
.turn.assistant { display: grid; gap: 10px; }
.turn.assistant .who { font: 600 10px var(--f-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.turn.user .bubble { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: 14px 14px 4px 14px; padding: 9px 14px; max-width: 70%; }
.activity { border: 1px solid var(--border); border-radius: var(--radius); background: var(--wash); font-size: 13px; }
.activity summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; color: var(--ink-2); }
.activity summary::-webkit-details-marker { display: none; }
.activity summary::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: 11px; }
.activity[open] summary::after { content: "▾"; }
.activity .a-ok { color: var(--good-text); }
.activity .a-list { padding: 4px 10px 8px 12px; border-top: 1px solid var(--border); display: grid; gap: 2px; }
.c-welcome { text-align: center; padding: 8vh 0 18px; display: grid; gap: 6px; }
.c-welcome h3 { font-size: 26px; }
.suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.suggest-grid button { text-align: left; font: 500 13.5px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer; line-height: 1.35; }
.suggest-grid button:hover { border-color: var(--accent); background: var(--wash); }
.composer { border-top: 1px solid var(--border); padding-block: 12px 10px; background: var(--surface); }
.c-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); padding: 8px 8px 8px 14px; }
.c-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.c-box textarea { flex: 1; border: 0; background: transparent; resize: none; font: inherit; color: var(--ink); max-height: 180px; padding: 6px 0; outline: none; }
.c-send { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 700; cursor: pointer; flex: none; }
.c-send:disabled { opacity: 0.4; cursor: default; }
.c-box #c-stop { height: 34px; }
.c-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; text-align: center; }
@media (max-width: 900px) {
  .coach-app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - 32px); }
  .c-toggle span { display: none; }
  .c-history { border-right: 0; border-bottom: 1px solid var(--border); max-height: 170px; }
  .c-inner { padding: 0 14px; }
}
/* sub-lists hang off their section on a guide line that starts under the number badge */
.nav-sub { display: grid; gap: 1px; margin: 2px 0 8px 20px; padding-left: 10px; border-left: 1px solid var(--border); min-width: 0; }
.side nav:not([data-section="dashboard"]) #dash-pages, .side nav:not([data-section="coach"]) #coach-recent { display: none; }
.nav-sub a { font-size: 12.5px; line-height: 1.35; color: var(--muted); text-decoration: none; padding: 5px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sub a:hover { color: var(--ink); }
/* the open item: ink text and an accent bar sitting on the guide line, not the boxed style of the main links */
.side nav .nav-sub a[aria-current="page"], .nav-sub a.on { color: var(--ink); font-weight: 600; background: none; border-color: transparent; }
.ns-item { position: relative; }
.ns-item:has(a.on)::before { content: ""; position: absolute; left: -11px; top: 4px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--accent); }
/* sidebar sub-items: the name, then its own slot for the delete button (shown on hover / keyboard focus), never over the text */
.ns-item { display: flex; align-items: center; gap: 2px; border-radius: 4px; min-width: 0; }
.nav-sub .ns-item a { flex: 1; min-width: 0; }
.ns-item:hover { background: var(--wash); }
.nav-sub .ns-item:hover a { background: none; }
.ns-del { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted);
  font: 600 11px var(--f-body); border-radius: 4px; cursor: pointer; visibility: hidden; }
.ns-item:hover .ns-del, .ns-del:focus-visible, .ns-del.armed { visibility: visible; }
.ns-del:hover { color: var(--crit-text); background: var(--surface); }
.ns-del:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.ns-del.armed { width: auto; padding: 0 6px; color: var(--surface); background: var(--crit); }
.c-log .md table { min-width: 60%; }

/* annual training plan: season timeline */
.season { display: grid; gap: 4px; margin-top: 6px; }
.season-flags, .season-months { position: relative; height: 18px; }
.season-flags .flag { position: absolute; transform: translateX(-4px); font: 600 11px var(--f-body); white-space: nowrap; color: var(--ink); }
.season-months span { position: absolute; font: 500 10.5px var(--f-mono); color: var(--muted); }
.season-bar { position: relative; display: flex; gap: 2px; height: 30px; }
.season-bar .seg { background: color-mix(in srgb, var(--c) 30%, var(--surface)); border-top: 3px solid var(--c); border-radius: 3px; min-width: 2px;
  display: flex; align-items: center; padding: 0 6px; overflow: hidden; }
.season-bar .seg span { font: 600 10.5px var(--f-body); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.season-bar .seg.cur { box-shadow: inset 0 0 0 1.5px var(--accent); }
.season-bar .today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); border-radius: 1px; }
.next-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.nw { gap: 4px; }
.nw b { font: 600 22px var(--f-mono); }
.nw b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.nw-phase { font-size: 13px; }
.nw-kind { font-size: 12px; color: var(--muted); }
.nw-kind.rec { color: var(--s1); }
.nw.now { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
@media (max-width: 900px) { .next-weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ATP week editor */
.nw { position: relative; }
.nw-acts { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.nw-acts .btn { padding: 3px 9px; font-size: 12px; text-decoration: none; }
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.55); }
.modal { width: min(440px, 100%); display: grid; gap: 12px; padding: 20px; }
.modal h3 { margin: 0; font-size: 17px; }
.fld { display: grid; gap: 5px; }
.fld input, .fld select, .fld textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 9px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fld textarea { resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-err { margin: 0; color: var(--crit-text); font-size: 13px; }
.diff { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; align-items: baseline; }
.diff dd { margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.diff s { color: var(--muted); }
.diff b { font-variant-numeric: tabular-nums; }
.fld-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
fieldset.fld { border: 0; padding: 0; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.checks input { accent-color: var(--accent); }

/* Training Plans: season planner */
.atp-hero { display: grid; gap: 14px; }
.race-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.race-chip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px 8px 8px; background: var(--surface-2); }
.race-chip > div { display: grid; }
.race-chip b { font-size: 14px; }
.race-chip .dim { font-size: 12px; }
.prio { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; font: 700 14px var(--f-mono); border: 1.5px solid var(--ink-2); color: var(--ink); }
.prio.p-a { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.atp-chart text.atp-band-t { font: 600 10.5px var(--f-body); letter-spacing: 0.04em; text-transform: uppercase; fill: var(--ink); }
.atp-chart text.atp-str-t { font: 500 10px var(--f-body); fill: var(--ink); }
.atp-chart text.atp-lane-t { font: 500 10px var(--f-mono); fill: var(--muted); text-transform: uppercase; }
.atp-chart text.atp-race-t { font: 600 11px var(--f-body); fill: var(--ink); }
.atp-chart text.atp-today-t { font: 600 10px var(--f-mono); fill: var(--accent); text-transform: uppercase; }
.atp-chart .atp-hit:hover { fill: var(--wash) !important; }
.tip-note { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); color: var(--ink-2); max-width: 240px; white-space: normal; }
.tip-hint { margin-top: 4px; color: var(--muted); font-size: 11px; }
.sec-head.sub h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.nw { border-top: 3px solid var(--c, var(--border)); }
.nw.now { border-color: var(--accent); border-top-color: var(--accent); box-shadow: none; }
.nw-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--t, var(--surface-2)); color: var(--ink); }
.tag.plain { background: transparent; border: 1px solid var(--border); color: var(--ink-2); }
.nw-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.spark { display: block; }
tr.row-past td { color: var(--muted); }

/* header settings toggle + slide-in panel */
.t-btn { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 20px; border: 0; border-left: 1px solid var(--banner-line);
  background: transparent; color: var(--banner-ink); font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; }
.t-btn:hover { background: rgba(255, 255, 255, 0.06); }
.t-btn[aria-expanded="true"], .t-btn[aria-current="page"] { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 -2px 0 var(--accent); }
.t-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.drawer-back { position: fixed; inset: var(--banner-h) 0 0 0; z-index: 40; background: rgb(0 0 0 / 0.45); display: flex; justify-content: flex-end; }
.drawer { width: min(940px, 100%); height: 100%; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--border);
  padding: 22px 26px 40px; display: grid; align-content: start; gap: 20px; animation: drawer-in 160ms ease-out; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.drawer-head h2 { margin: 2px 0 4px; font-family: var(--f-display); font-size: 30px; text-transform: uppercase; letter-spacing: 0.03em; }
.drawer-head .lede { margin: 0; max-width: 60ch; }
.drawer-x { font-size: 15px; padding: 6px 10px; }
.drawer-body { display: grid; gap: 20px; }
/* settings: thresholds in one strip, zones as a ribbon over a table */
.drawer.set { width: min(640px, 100%); padding: 20px 22px 36px; }
.drawer.set .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.drawer.set .th-strip { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.drawer.set .th { padding: 10px 12px 12px; }
.drawer.set .th .micro, .drawer.set .th > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer.set .th .micro { letter-spacing: 0.05em; }
.drawer.set .th b { font-size: 24px; }
.th-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.th { background: var(--surface); padding: 12px 16px 14px; display: grid; gap: 4px; align-content: start; }
.th b { font: 600 28px/1 var(--f-display); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 5px; }
.th b small { font: 500 12.5px var(--f-body); color: var(--muted); }
.th > span:last-child:not(.micro) { font-size: 12px; color: var(--muted); }
.zcard .card-head p b { color: var(--ink); font-weight: 600; }
.zribbon { margin: 6px 0 4px; }
.zr-bar { position: relative; height: 12px; border-radius: 3px; background: var(--surface-2); }
.zr-bar span { position: absolute; top: 0; bottom: 0; }
.zr-bar span:first-child { border-radius: 3px 0 0 3px; } .zr-bar span:nth-last-child(2) { border-radius: 0 3px 3px 0; }
.zr-thr { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.zr-ticks { position: relative; height: 16px; }
.zr-ticks em { position: absolute; top: 3px; transform: translateX(-50%); font: 500 10.5px var(--f-mono); font-style: normal; color: var(--muted); white-space: nowrap; }
.ztable td:first-child { white-space: nowrap; } .ztable .dot { margin-right: 8px; vertical-align: 1px; }
.ztable small { font-family: var(--f-body); }
.kv.prof dd { font-family: var(--f-body); }
.kv.prof .chip { font-size: 10.5px; padding: 1px 6px; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
@media (max-width: 700px) { .t-btn span { display: none; } .drawer { padding: 16px; } }

/* best-effort record tiles */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 10px; }
.rec { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface-2); }
.rec:hover { border-color: var(--muted); }
.rec b { font: 600 16px var(--f-mono); font-variant-numeric: tabular-nums; }
.rec b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.rec-sub { font: 500 11px var(--f-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-sub i { font-style: normal; color: var(--accent); text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }
.rec.fresh { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }

/* progress */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pg { display: grid; gap: 4px; align-content: start; }
.pg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pg-extra { font: 500 11px var(--f-mono); color: var(--ink-2); }
.pg-val { font: 600 28px/1.05 var(--f-display); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pg-val small { font: 500 12.5px var(--f-body); color: var(--muted); }
.pg-trend { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pg-trend.up { color: var(--good-text); } .pg-trend.down { color: var(--crit-text); }
.pg-lv { font-size: 12.5px; color: var(--muted); }
/* shared: deltas, sparklines and fill tracks (dashboard widgets, plans) */
.pg-delta { font: 600 12px var(--f-mono); color: var(--ink-2); }
.pg-delta small { font: 500 11px var(--f-body); color: var(--muted); }
.pg-delta.up { color: var(--good-text); } .pg-delta.down { color: var(--crit-text); }
.spark-lg { width: 100%; height: 46px; margin: 4px 0 2px; overflow: visible; }
.spark-lg .sp-ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-lg .sp-target { stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark-lg polyline { vector-effect: non-scaling-stroke; }
.pg-track { position: relative; height: 6px; background: var(--wash); border-radius: 3px; border: 1px solid var(--grid); }
.pg-track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.pg-track b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); transform: translateX(-2px); }
/* weekly mini chart: HTML columns (hover/focus targets) over an optional SVG line */
.wk-chart { position: relative; height: 64px; margin-top: 10px; border-bottom: 1px solid var(--axis); }
.wk-cols { position: absolute; inset: 0; display: flex; }
.wk { position: relative; flex: 1; display: flex; justify-content: center; outline: none; border-radius: 3px; }
.wk:hover, .wk:focus-visible { background: var(--wash); }
.wk:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.wk-bar { position: absolute; bottom: 0; width: min(16px, 62%); border-radius: 2px 2px 0 0; }
.wk.partial .wk-bar, .wk.partial .wk-dot { opacity: 0.45; }
.wk-dot { position: absolute; width: 7px; height: 7px; margin-bottom: -3.5px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: content-box; }
.wk-target { position: absolute; width: min(24px, 80%); height: 2px; margin-bottom: -1px; background: var(--ink); border-radius: 1px; }
.wk-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wk-line polyline { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.wk-ref { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--muted); }
.wk-axis { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.wk-key { display: inline-flex; align-items: center; gap: 5px; } .wk-key i { width: 14px; border-top: 1px dashed var(--muted); }
.pg-tip[hidden] { display: none; }
.pg-tip { position: absolute; bottom: calc(100% + 6px); z-index: 5; display: grid; gap: 1px; white-space: nowrap; padding: 6px 9px; border-radius: var(--radius);
  background: var(--banner-bg); color: var(--banner-ink); font-size: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); pointer-events: none; }
.pg-tip b { font-weight: 600; } .pg-tip span { color: var(--banner-muted); }

/* Training sub-tabs */
.subtabs { position: sticky; top: var(--banner-h); z-index: 12; display: flex; gap: 4px; background: var(--bg); border-bottom: 1px solid var(--border);
  margin: 4px 0 0; overflow-x: auto; scrollbar-width: none; }
.subtabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font: 600 12px var(--f-body); text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a:hover { color: var(--ink); }
.subtabs a:focus:not(:focus-visible) { outline: none; background: transparent; }
.subtabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.subtabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tabpanel { display: grid; gap: 18px; }
.tabpanel > .sec-head:first-child { margin-top: 0; }
@media (max-width: 760px) { .subtabs { position: static; } }

/* training load (acute vs chronic) + load focus */
.lb-band { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.lb-chronic { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.lb-acute { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; }
.lb-dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.lb-cross { stroke: var(--axis); stroke-width: 1; }
.tl-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 1000px) { .tl-grid { grid-template-columns: 1fr; } }
.tl-head { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: flex-end; }
.tl-head > div { display: grid; gap: 1px; }
.tl-head b { font: 600 22px var(--f-mono); font-variant-numeric: tabular-nums; }
.tl-head b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.tl-status { font: 600 13px var(--f-body); display: inline-flex; align-items: center; gap: 7px; }
.tl-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.tl-status.good i { background: var(--good); } .tl-status.warn i { background: var(--warn); } .tl-status.crit i { background: var(--crit); } .tl-status.low i { background: var(--s1); }
.ratio-scale { position: relative; display: grid; grid-template-columns: 8fr 5fr 2fr 5fr; gap: 2px; height: 8px; margin: 10px 0 18px; }
.ratio-scale span { border-radius: 2px; }
.ratio-scale .r-low { background: color-mix(in srgb, var(--s1) 45%, var(--surface)); }
.ratio-scale .r-opt { background: color-mix(in srgb, var(--good) 70%, var(--surface)); }
.ratio-scale .r-high { background: color-mix(in srgb, var(--warn) 70%, var(--surface)); }
.ratio-scale .r-vhigh { background: color-mix(in srgb, var(--crit) 70%, var(--surface)); }
.ratio-scale em { position: absolute; top: 12px; font: 500 10px var(--f-mono); color: var(--muted); font-style: normal; transform: translateX(-50%); }
.ratio-scale .r-mark { position: absolute; top: -5px; width: 3px; height: 18px; background: var(--ink); border-radius: 2px; transform: translateX(-1.5px); }
.focus-rows { display: grid; gap: 14px; margin-top: 6px; }
.focus-row { display: grid; gap: 5px; }
.focus-row .fr-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.focus-row .fr-top b { font-family: var(--f-mono); }
.focus-track { position: relative; height: 14px; background: var(--wash); border: 1px solid var(--grid); border-radius: 4px; }
.focus-track .ft-target { position: absolute; top: -1px; bottom: -1px; border: 1.5px dashed var(--ink-2); border-radius: 4px; }
.focus-track .ft-bar { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 3px; }
.focus-row .fr-sub { font-size: 11.5px; color: var(--muted); }
.focus-row .fr-sub .short { color: var(--warn-text); } .focus-row .fr-sub .over { color: var(--serious-text); }
.focus-head { display: grid; gap: 2px; }
.focus-head b { font: 600 17px var(--f-body); }
.legend i.dash { width: 14px; height: 0; border-top: 2px dashed var(--muted); background: none; }

/* my dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; grid-auto-flow: dense; }
.dw { grid-column: span var(--span, 1); min-width: 0; display: grid; gap: 8px; align-content: start; }
.dw .card-head { margin: 0; }
.dash-grid.editing .dw { outline: 1px dashed var(--axis); outline-offset: 3px; }
.dash-grid.editing .dw-bar { cursor: grab; }
.dw.dragging { opacity: 0.35; }
.dw-ph { grid-column: span var(--span, 1); min-height: 120px; border: 2px dashed var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -4px -4px 0; padding-bottom: 6px; border-bottom: 1px solid var(--grid); }
.dw-bar .dw-name { flex: 1 1 90px; min-width: 0; font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-bar .btn { padding: 2px 7px; font-size: 12px; min-width: 26px; }
.grip { color: var(--muted); cursor: grab; font-size: 14px; line-height: 1; }
.dash-empty { grid-column: 1 / -1; }
.mw { display: grid; gap: 4px; }
.mw-title { font-weight: 600; font-size: 15px; }
.mw-note { font-size: 11.5px; color: var(--muted); }
.mw .ratio-scale { margin: 6px 0 16px; }
.dash-wrap.editing { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.lib { display: grid; gap: 12px; position: sticky; top: calc(var(--banner-h) + 12px); max-height: calc(100vh - var(--banner-h) - 24px); overflow-y: auto; }
.lib-head h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
.lib-head p { margin: 0; }
.dash-wrap.editing .dash-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .dash-wrap.editing { grid-template-columns: 1fr; } .lib { position: static; max-height: none; } }
.lib-group { display: grid; gap: 6px; }
.lib-items { display: grid; gap: 6px; }
.lib-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: grab; }
.lib-item:hover { border-color: var(--muted); }
.lib-item > div { flex: 1; min-width: 0; display: grid; }
.lib-item b { font-size: 13px; }
.lib-item span { font-size: 11.5px; color: var(--muted); }
.lib-item .btn { padding: 2px 9px; }
.wl { list-style: none; margin: 0; padding: 0; display: grid; }
.wl a { display: grid; grid-template-columns: auto 78px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--grid); color: var(--ink); text-decoration: none; font-size: 13px; }
.wl li:last-child a { border-bottom: 0; }
.wl a:hover { background: var(--wash); }
.wl-d { font: 500 12px var(--f-mono); color: var(--muted); }
.wl-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-v { font: 500 12px var(--f-mono); color: var(--ink-2); white-space: nowrap; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dw { grid-column: span min(var(--span, 1), 2); } }
@media (max-width: 640px) { .dash-grid { grid-template-columns: 1fr; } .dw { grid-column: 1 / -1; } }
.lib[hidden] { display: none; }
/* my dashboard: pages of titled sections */
.dash-secs { display: grid; gap: 26px; min-width: 0; }
.dsec { display: grid; gap: 10px; }
.dsec-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.dsec-head h2 { margin: 0; font-size: 20px; }
.dsec-head.edit { border-bottom-style: dashed; }
.dsec-title-in, .dash-title-in { flex: 1; min-width: 0; font: 600 20px/1.2 var(--f-display); letter-spacing: 0.01em; color: var(--ink); background: transparent;
  border: 1px solid transparent; border-radius: var(--radius); padding: 2px 6px; margin-left: -7px; }
.dash-title-in { font-size: 34px; text-transform: uppercase; width: min(640px, 100%); }
.dsec-title-in:hover, .dash-title-in:hover { border-color: var(--border); }
.dsec-title-in:focus, .dash-title-in:focus { outline: 2px solid var(--accent); outline-offset: 0; background: var(--surface); }
.dsec-title-in::placeholder { color: var(--muted); font-weight: 400; }
.dash-grid .dash-empty { grid-column: 1 / -1; min-height: 70px; display: grid; place-items: center; border: 1px dashed var(--axis); border-radius: var(--radius); }
.dash-grid:not(.editing) .dash-empty { display: none; }
.dash-grid .dash-empty p { margin: 0; font-size: 13px; }
.lib-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-field { font: 500 12.5px var(--f-body); color: var(--ink); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); cursor: grab; }
.lib-field:hover { border-color: var(--accent); }
.lib-field:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dw.drop-on { outline: 2px solid var(--accent) !important; outline-offset: 3px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.dw .mw-note { margin: 4px 0 0; }
.dw-acts { display: flex; gap: 3px; margin-left: auto; }
.dw { position: relative; }
.dw-resize { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; border-radius: 0 0 6px 0;
  background: linear-gradient(135deg, transparent 50%, var(--muted) 50%, var(--muted) 58%, transparent 58%, transparent 70%, var(--muted) 70%, var(--muted) 78%, transparent 78%); opacity: .7; }
.dw-resize:hover, .dw.resizing .dw-resize { opacity: 1; background-color: color-mix(in srgb, var(--accent) 18%, transparent); }
.dw-size { position: absolute; right: 24px; bottom: 6px; font: 600 11px var(--f-mono); color: var(--accent); pointer-events: none; }
.dw.resizing { outline: 2px solid var(--accent) !important; cursor: nwse-resize; }
.dw.resizing .dw-body { opacity: .5; }


.busy-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--border);
  border-left: 3px solid var(--warn); border-radius: var(--radius); background: var(--surface); font-size: 13px; }
.busy-note[hidden] { display: none; }
.busy-note span { flex: 1; min-width: 200px; }

/* annual plan inside the calendar's weekly summary */
.sum-atp { display: grid; gap: 4px; padding: 6px 8px; margin-bottom: 4px; border-radius: 5px; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.sa-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sa-phase { font: 600 12px var(--f-body); }
.sa-edit { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 13px; }
.sa-edit:hover { color: var(--ink); }
.sa-target { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.sa-target b { font-family: var(--f-mono); color: var(--ink); }
.sa-fill { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; font-size: 11px; color: var(--muted); }
.sa-fill em { font-style: normal; font-weight: 600; }
.sa-fill.under em { color: var(--warn-text); } .sa-fill.over em { color: var(--serious-text); }
.sa-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.sa-tags .tag { font-size: 10px; padding: 1px 6px; }
.sa-note { margin: 0; font-size: 11px; color: var(--ink-2); }
.day.wk-focus { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.wk.wk-focus { box-shadow: inset 0 0 0 2px var(--accent); }
/* week panel */
.modal.wp { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.wp-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.wp-head h3 { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.wp-body { display: grid; gap: 10px; }
.wp-fill { display: grid; gap: 4px; }
.wp-fill .short { color: var(--warn-text); } .wp-fill .over { color: var(--serious-text); }
.wp-sub { margin: 6px 0 0; }
.modal-actions a.btn { text-decoration: none; }

/* Ask Coach running in the background */
.nav-sub a .spin { width: 9px; height: 9px; margin-right: 6px; vertical-align: -1px; border-width: 1.5px; }
.coach-toast { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: grid; gap: 2px; min-width: 240px; max-width: 340px; padding: 12px 14px;
  background: var(--surface); color: var(--ink); text-decoration: none; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.25); animation: drawer-in 160ms ease-out; }
.coach-toast b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach-toast:hover { border-color: var(--muted); }
.asof.sync { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.asof.sync[hidden] { display: none; }
.asof.sync .spin { width: 9px; height: 9px; border-width: 1.5px; }
html.rail-collapsed .asof.sync { font-size: 0; justify-content: center; }

/* calendar weekly summary: one reading per week */
.wk.ws { display: grid; gap: 10px; align-content: start; border-top: 3px solid var(--c); }
.ws-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ws-phase { font: 600 12.5px var(--f-body); display: inline-flex; align-items: center; gap: 6px; }
.ws-phase .dim { font-weight: 500; }
.ws-hours { display: grid; gap: 5px; }
.ws-big { display: flex; align-items: baseline; gap: 6px; }
.ws-big b { font: 600 22px var(--f-mono); font-variant-numeric: tabular-nums; }
.ws-big span { font-size: 12px; color: var(--muted); }
.ws-bar { position: relative; height: 8px; border-radius: 4px; background: var(--wash); border: 1px solid var(--grid); }
.ws-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.ws-bar .done { left: 0; background: var(--c, var(--s1)); }
.ws-bar .ahead { background: color-mix(in srgb, var(--c, var(--s1)) 35%, transparent); }
.ws-bar .tgt { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.ws-caption { font-size: 11.5px; color: var(--muted); }
.ws-caption .under { color: var(--warn-text); font-weight: 600; } .ws-caption .over { color: var(--serious-text); font-weight: 600; }
.ws-caption .ok { color: var(--good-text); }
.ws-rows { display: grid; gap: 2px; font-size: 12px; }
.ws-row { display: grid; grid-template-columns: 1fr auto 62px; gap: 8px; align-items: baseline; }
.ws-row b { font: 600 13px var(--f-mono); text-align: right; }
.ws-row .dim { font-family: var(--f-mono); text-align: right; }
.ws-th { font: 600 9.5px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ws-th span:nth-child(n+2) { text-align: right; }
.ws-pmc { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 600 12px var(--f-mono); align-items: center; }
.ws-pmc i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.ws-pmc .dim { font: 500 10px var(--f-body); }
.ws-notes summary { cursor: pointer; font-size: 11.5px; color: var(--muted); }
.ws-notes p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-2); }
.ws-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--grid); padding-top: 6px; }

/* interactive calendar */
.day { position: relative; }
.day-add { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 120ms; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; }
.day-add:hover { color: var(--ink); border-color: var(--muted); }
@media (hover: none) { .day-add { opacity: .7; } }
.wc-wrap { position: relative; }
.wc-wrap[draggable=true] { cursor: grab; }
.wc-wrap.dragging { opacity: .35; }
.w-more { position: absolute; top: 4px; right: 4px; width: 22px; height: 20px; border: 0; border-radius: 4px; background: var(--surface-2);
  color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; opacity: 0; }
.wc-wrap:hover .w-more, .w-more:focus-visible { opacity: 1; }
.w-more:hover { color: var(--ink); }
.day.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.day.drop-target.drop-copy { outline-style: dotted; }
.app-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / .25); font-size: 13.5px; max-width: calc(100vw - 32px); }
.app-toast .btn { padding: 3px 10px; }
.modal.sf { width: min(520px, 100%); }
.fld-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sf-kind { justify-self: start; }
.sf-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--grid); }
.sf-copy { display: inline-flex; gap: 4px; align-items: center; }
.sf-copy input { font: inherit; font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 6px; }
.sf-tools a.btn { text-decoration: none; }
.btn.danger { color: var(--crit-text); }
.btn.danger.armed { background: var(--crit); color: var(--surface); border-color: var(--crit); }
.wc-wrap { user-select: none; -webkit-user-select: none; }
.wc-wrap a { -webkit-user-drag: none; user-drag: none; }
.sf-kind button { white-space: nowrap; }

/* coach dock: background requests from other pages */
.coach-dock { position: fixed; right: 18px; bottom: 18px; z-index: 65; width: min(380px, calc(100vw - 36px)); max-height: calc(100vh - 120px);
  overflow-y: auto; display: grid; gap: 8px; }
.coach-dock[hidden] { display: none; }
.cd-task { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / .25); padding: 10px 12px; display: grid; gap: 6px; }
.cd-task.done { border-left-color: var(--good); }
.cd-head { display: flex; align-items: baseline; gap: 8px; }
.cd-head b { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.cd-state { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.cd-state .spin { width: 10px; height: 10px; border-width: 1.5px; }
.cd-text summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.cd-text .md { font-size: 13px; max-height: 220px; overflow-y: auto; }
.cd-open { font-size: 12px; color: var(--accent); text-decoration: none; justify-self: start; }
.cd-changes { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--good-text); }
.cd-changes .bad { color: var(--crit-text); }

/* charts inside coach answers */
.c-chart { margin: 10px 0; padding: 10px 12px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); display: grid; gap: 4px; }
.c-chart figcaption { font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.c-chart .legend:empty { display: none; }
.c-chart.pending { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.c-chart-err { color: var(--muted); font-size: 12.5px; }

/* coach memory panel */
.drawer.mem { width: min(620px, 100%); }
.mem-add { display: grid; grid-template-columns: 130px 1fr auto; gap: 6px; }
.mem-add select, .mem-add input, .mem-note textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 9px; }
.mem-list { display: grid; gap: 14px; }
.mem-list section { display: grid; gap: 6px; }
.mem-list h4 { margin: 0; }
.mem-note { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: start; }
.mem-note textarea { resize: vertical; min-height: 36px; }
.mem-meta { grid-column: 1; font-size: 11px; color: var(--muted); }
.mem-note .btn { grid-row: 1; grid-column: 2; padding: 4px 9px; }

/* weekly review */
.review { display: grid; gap: 10px; }
.review:empty { display: none; }
.rv-tools { display: flex; gap: 8px; align-items: center; }
.rv-running { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.rv-summary ul { margin: 0; padding-left: 18px; }
.rv-full summary { cursor: pointer; font-size: 12.5px; color: var(--accent); }
.rv-full .md { margin-top: 8px; }
.rv-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* weekly review */
.review { overflow: hidden; }
.rv-week { font: inherit; font-size: 12.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; }
.review .rv-full[open] summary { margin-bottom: 4px; }
.tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 2px; }
.tab-dot[hidden] { display: none; }

.rv-sub { display: block; font-size: 11.5px; color: var(--muted); }
.rv-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .rv-charts { grid-template-columns: 1fr; } }
.rv-chart { margin: 0; padding: 10px 12px 6px; border: 1px solid var(--grid); border-radius: var(--radius); display: grid; gap: 4px; min-width: 0; align-content: start; }
.rv-chart figcaption { font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.rv-analysis { border-top: 1px solid var(--grid); padding-top: 12px; display: grid; gap: 8px; }
.rv-analysis h4 { margin: 0; }

/* structured weekly analysis */
.an { display: grid; gap: 14px; }
.an-head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--wash); border-left: 3px solid var(--muted); }
.an-head.good { border-left-color: var(--good); } .an-head.warn { border-left-color: var(--warn); } .an-head.bad { border-left-color: var(--crit); }
.an-head p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; }
.an-badge { flex: none; font: 600 10.5px var(--f-body); text-transform: uppercase; letter-spacing: .07em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); margin-top: 2px; }
.an-head.good .an-badge { color: var(--good-text); } .an-head.warn .an-badge { color: var(--warn-text); } .an-head.bad .an-badge { color: var(--crit-text); }
.an-summary { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
/* coach's sections: label column + the coach's paragraph, hairline between them */
.an-secs { display: grid; border-top: 1px solid var(--grid); }
.an-sec { display: grid; grid-template-columns: 200px minmax(0, 72ch); gap: 6px 20px; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.an-sec h5 { margin: 0; display: grid; grid-template-columns: 8px 1fr; column-gap: 8px; align-items: center; align-content: start; font: 600 14px/1.3 var(--f-body); }
.an-sec h5 small { grid-column: 2; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.an-sec p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.an-sec p b, .an-take p b, .an-head p b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.an-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.an-sec.good .an-dot { background: var(--good); } .an-sec.warn .an-dot { background: var(--warn); } .an-sec.bad .an-dot { background: var(--crit); }
.an-sec.good small { color: var(--good-text); } .an-sec.warn small { color: var(--warn-text); } .an-sec.bad small { color: var(--crit-text); }
@media (max-width: 800px) { .an-sec { grid-template-columns: 1fr; } }
.an-take { padding: 12px 16px; border-radius: var(--radius); background: var(--wash); border-left: 3px solid var(--accent); }
.an-take h5 { margin: 0 0 4px; font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.an-take p { margin: 0; font-size: 14.5px; line-height: 1.55; max-width: 80ch; }
.an-still { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.an-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .an-cols { grid-template-columns: 1fr; } }
.an-col h5, .an-sessions h5 { margin: 0 0 6px; font: 600 11px var(--f-body); text-transform: uppercase; letter-spacing: .07em; }
.an-col.good h5 { color: var(--good-text); } .an-col.warn h5 { color: var(--warn-text); }
.an-col ul, .an-col ol { margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; list-style: none; }
.an-ok li { position: relative; padding-left: 18px; } .an-ok li::before { content: "✓"; position: absolute; left: 0; color: var(--good-text); font-weight: 700; }
.an-todo li { position: relative; padding-left: 18px; display: grid; }
.an-todo li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 2px; background: var(--warn); }
.an-todo li span { font-size: 12.5px; color: var(--muted); }
.an-sessions ul { list-style: none; margin: 0; padding: 0; display: grid; }
.an-sessions li { display: grid; grid-template-columns: 22px 64px minmax(120px, 220px) 1fr; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.an-sessions li:last-child { border-bottom: 0; }
.an-mark { font-weight: 700; text-align: center; color: var(--muted); }
.an-sessions li.good .an-mark { color: var(--good-text); } .an-sessions li.warn .an-mark { color: var(--warn-text); } .an-sessions li.bad .an-mark { color: var(--crit-text); }
.an-date { font: 500 12px var(--f-mono); color: var(--muted); }
.an-title { font-weight: 600; }
.an-note { color: var(--ink-2); }
@media (max-width: 700px) { .an-sessions li { grid-template-columns: 22px 60px 1fr; } .an-note { grid-column: 3; } }
.rv-head { flex-wrap: wrap; gap: 8px; }
.rv-nav { display: flex; align-items: center; gap: 8px; }
.rv-nav h3 { margin: 0; }
.rv-nav .btn { padding: 4px 10px; }
.rv-live { font: 600 10px var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: 999px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; }
.rv-empty { display: grid; gap: 8px; justify-items: start; }
.rv-empty p { margin: 0; }
.rv-sleep { margin-top: -4px; }

  .pc-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .pc-track { grid-column: 1 / -1; grid-row: 2; margin-right: 0; }
  .pc-nums { padding-left: 0; text-align: right; }
}

/* annual plan detail: execution report */
.ad-hero { display: grid; gap: 22px; padding: 22px 24px; border-top: 3px solid var(--vc, var(--axis)); }
.ad-hero.good { --vc: var(--good); } .ad-hero.warn { --vc: var(--warn); }
.ad-top { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 20px 36px; align-items: center; }
.ad-verdict h2 { font: 700 34px/1.05 var(--f-display); color: var(--ink); }
.ad-hero.good .ad-verdict h2 { color: var(--good-text); } .ad-hero.warn .ad-verdict h2 { color: var(--warn-text); }
.ad-verdict p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); max-width: 36ch; }
.ad-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.ad-figs > div { padding: 2px 18px; border-left: 1px solid var(--grid); }
.ad-figs dt { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ad-figs dd { margin: 0; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.ad-figs dd b { font: 600 32px/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.ad-figs dd span { font-size: 12.5px; } .ad-figs dd > span:first-child { font-size: 13px; }
.ad-meter { height: 4px; border-radius: 2px; background: var(--grid); position: relative; margin-top: 4px; max-width: 140px; }
.ad-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--vc, var(--ink-2)); }
.ad-bad { color: var(--crit-text); font-weight: 600; }
.ad-strip-wrap { display: grid; gap: 6px; }
.ad-where { margin: 0; font-size: 13px; color: var(--muted); } .ad-where b { font: 600 16px var(--f-display); color: var(--ink); }
.ad-strip { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; height: 30px; margin-top: 22px; }
.ad-c { position: relative; border-radius: 3px; background: var(--grid); }
.ad-c.hit { background: var(--good); } .ad-c.under { background: var(--warn); } .ad-c.over { background: var(--s1); }
.ad-c.none { background: var(--axis); }
.ad-c.now { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.ad-flag { position: absolute; bottom: calc(100% + 4px); left: 50%; white-space: nowrap; font: 600 13px var(--f-display); color: var(--ink); padding-left: 8px; border-left: 2px solid var(--ink-2); line-height: 1; padding-bottom: 2px; }
.ad-flag.p-a { border-color: var(--s8); } .ad-flag.p-b { border-color: var(--s2); }
.ad-c:last-child .ad-flag, .ad-c:nth-last-child(-n+6) .ad-flag { left: auto; right: 50%; padding: 0 8px 2px 0; border-left: 0; border-right: 2px solid var(--ink-2); }
.ad-months { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); font-size: 11.5px; color: var(--muted); }
.ad-months span { white-space: nowrap; }
.ad-key { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: var(--muted); }
.ad-key span { display: inline-flex; align-items: center; gap: 6px; }
.ad-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ad-key i.hit { background: var(--good); } .ad-key i.under { background: var(--warn); } .ad-key i.over { background: var(--s1); } .ad-key i.now { box-shadow: inset 0 0 0 2px var(--ink); }
.ad-grid { align-items: start; }
.ad-sports { display: grid; gap: 14px; }
.ad-sname { display: flex; align-items: baseline; gap: 8px; } .ad-sname b { font: 600 16px var(--f-display); }
.ad-sname span { margin-left: auto; font: 600 16px var(--f-display); font-variant-numeric: tabular-nums; }
.ad-sbar { height: 8px; border-radius: 4px; background: var(--wash); margin: 6px 0 4px; position: relative; }
.ad-sbar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.ad-smeta { margin: 0; font-size: 12.5px; color: var(--muted); }
.ad-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin-bottom: 16px; }
.ad-specs > div { display: grid; } .ad-specs span { font-size: 12.5px; color: var(--muted); }
.ad-specs b { font: 600 19px/1.2 var(--f-display); } .ad-specs small { font-size: 12px; color: var(--muted); }
.ad-races { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--grid); margin-bottom: 16px; }
.ad-race { display: flex; align-items: center; gap: 12px; } .ad-race > div { display: grid; }
.ad-race b { font: 600 16px var(--f-display); } .ad-race span:not(.prio) { font-size: 12.5px; color: var(--muted); }
.ad-missed { list-style: none; margin: 0; padding: 0; display: grid; }
.ad-missed li { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; padding: 8px 0; border-top: 1px solid var(--grid); font-size: 13.5px; }
.ad-missed li:first-child { border-top: 0; }
#ad-ask { justify-self: start; width: auto; }
@media (max-width: 1000px) { .ad-top { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ad-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; } .ad-figs > div:nth-child(3) { border-left: 0; padding-left: 0; } .ad-figs > div:first-child { padding-left: 0; border-left: 0; } .ad-months span:nth-child(even) { visibility: hidden; } }


/* ================================================================ "Console" style layer (fork: alt-ui) */
html { font-feature-settings: "tnum" 1; }
body { font: 14.5px/1.5 var(--f-body); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }
.micro, .eyebrow { font: 600 11.5px/1.3 var(--f-body); text-transform: none; letter-spacing: 0; color: var(--muted); }

/* navy sidebar in both modes: its own ink, scoped */
.side, .telemetry .brand {
  --ink: #eef1fb; --ink-2: #b3bcd6; --muted: #8b95b3; --wash: rgba(255, 255, 255, 0.06); --border: rgba(255, 255, 255, 0.09);
  --surface: #17213f; --surface-2: #1c2748; --axis: rgba(255, 255, 255, 0.16); --accent: #3b5bfd; --accent-ink: #ffffff; }
.side { background: var(--rail); border-right: 0; padding: 18px 14px; }
.side nav { gap: 4px; }
.side nav a { border: 0; border-radius: 10px; padding: 9px 12px; color: var(--ink-2); font-weight: 600; }
.side nav a:hover { background: var(--wash); color: var(--ink); }
.side nav a .n { border: 0; border-radius: 7px; background: rgba(255, 255, 255, 0.08); color: var(--ink-2); font: 700 11px var(--f-body); }
.side nav a[aria-current="page"] { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(59, 91, 253, 0.35); }
.side nav a[aria-current="page"] .n { background: rgba(255, 255, 255, 0.22); color: #fff; }
.nav-sub { border-left-color: rgba(255, 255, 255, 0.12); }
.side nav .nav-sub a[aria-current="page"], .nav-sub a.on { background: none; box-shadow: none; color: #fff; }
.ns-item:has(a.on)::before { background: #8ea2ff; }
.nav-sub a.all { color: #a9b9ff; }
.side .btn { background: transparent; border-color: rgba(255, 255, 255, 0.14); color: var(--ink-2); }
.side .btn:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--ink); }
.athlete strong { color: var(--ink); }

/* top bar: white strip, brand cell continues the navy sidebar */
.telemetry { background: var(--banner-bg); border-bottom: 1px solid var(--banner-line); box-shadow: none; }
.telemetry .brand { background: var(--rail); border-right: 0; color: #fff; font: 800 17px var(--f-body); letter-spacing: -0.01em; }
.brand-mark { background: linear-gradient(135deg, #8ea2ff, #3b5bfd); clip-path: none; border-radius: 7px; width: 26px; height: 26px; }
.t-seg { border-right: 0; padding: 0 18px; }
.t-seg + .t-seg { box-shadow: inset 1px 0 0 var(--banner-line); }
.t-val { font: 800 21px/1.1 var(--f-body); letter-spacing: -0.01em; }
.t-pill { border-radius: 999px; text-transform: none; letter-spacing: 0; font-size: 12px; background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }
.t-btn { border-left: 1px solid var(--banner-line); }

/* page head: plain bold title */
.page-head h1 { font-size: 26px; text-transform: none; letter-spacing: -0.02em; }
.dash-title-in { font: 800 26px var(--f-body); text-transform: none; letter-spacing: -0.02em; }

/* cards: white, rounded, soft shadow, no outline */
.card, .rv-chart, .signal, .th, .tile { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card { padding: 16px 18px 14px; }
.card-head { border-bottom: 0; padding-bottom: 0; }
.card-head h2, .card-head h3, .rv-chart figcaption { font: 700 15px/1.3 var(--f-body); text-transform: none; letter-spacing: -0.005em; color: var(--ink); }
.card-head p { font-size: 12.5px; }
.sec-head h2, main > .sec-head h2, .dsec-head h2 { font-size: 18px; text-transform: none; letter-spacing: -0.01em; }
.dsec-head { border-bottom: 0; }

/* KPI rows: separate cards instead of a joined strip */
.signals, .th-strip { background: transparent; border: 0; gap: 14px; overflow: visible; }
.signal { padding: 16px 18px 18px; }
.signal .micro i { width: 9px; height: 9px; border-radius: 3px; }
.signal b, .pg-val, .th b, .tile .value, .an-ev b { font-family: var(--f-body); font-weight: 800; letter-spacing: -0.02em; }
.signal b small, .pg-val small, .th b small { font-weight: 500; }
.sg-track { height: 8px; border-radius: 999px; box-shadow: none; background: var(--surface-2); }
.sg-fill { border-radius: 999px; }
.sg-weeks span, .sg-pips span { border-radius: 999px; height: 8px; }
.num, td.num, .kv dd { font-family: var(--f-body); }
.tile .label { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* tabs and range switch: pills */
.subtabs { border-bottom: 0; gap: 4px; background: transparent; padding: 2px 0; }
.subtabs a { font: 600 13.5px var(--f-body); text-transform: none; letter-spacing: 0; border: 0; border-radius: 999px; padding: 8px 16px; margin: 0; color: var(--muted); }
.subtabs a:hover { background: var(--wash); color: var(--ink); }
.subtabs a[aria-selected="true"] { background: var(--accent-tint); color: var(--accent-text); }
.seg { border: 0; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0 !important; border-radius: 999px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 6px 12px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }

/* buttons */
.btn { border-radius: 10px; border-color: var(--border); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(59, 91, 253, 0.28); }
.btn.primary:hover { filter: brightness(1.06); }

/* charts */
.chart text { font-family: var(--f-body); font-size: 11px; }
.legend { font-size: 12.5px; }
.legend .sw, .legend .dt { border-radius: 3px; }
.chip, .tl-status, .an-badge, .rv-live { border-radius: 999px; }
.an-badge { text-transform: none; letter-spacing: 0; font-size: 12px; }
.tip, .pg-tip, .tpop, .modal { border-radius: 12px; }
.drawer { background: var(--bg); }
.lib-item, .lib-field { border-radius: 10px; }
.lib-field { border-radius: 999px; }
.sg-fill { background: var(--accent); }
.telemetry { border-bottom: 0; }
.t-data, .t-btn, .telemetry > .t-seg { box-shadow: inset 0 -1px 0 var(--banner-line); }
.subtabs { background: var(--bg); }
.drawer-head h2 { text-transform: none; font-size: 26px; letter-spacing: -0.02em; }
.drawer.set .th-strip { gap: 8px; }
.drawer.set .th { padding: 10px 10px 12px; }
.drawer.set .th .micro { font-size: 11px; letter-spacing: -0.01em; }

/* ---------------- KPI cards: icon chip, figure + visual, caption */
.signal.kpi { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 16px; }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-head .micro { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-text); }
.kpi-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.signal.good .kpi-ico { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good-text); }
.signal.warn .kpi-ico { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn-text); }
.signal.crit .kpi-ico { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit-text); }
.kpi-st { display: none; }
.kpi-body { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kpi-main { display: grid; gap: 6px; min-width: 0; }
.kpi-main b { font-size: 30px; line-height: 1; }
.kpi-cap { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.kpi-viz { flex: none; overflow: visible; }
.kpi-viz .kv-c { font: 800 14px var(--f-body); fill: var(--ink); }
.kpi-viz .kv-s { font: 500 9.5px var(--f-body); fill: var(--muted); }
.kpi-viz.gauge.faint { opacity: 0.55; }
.sg-spark .ln { fill: none; stroke: var(--s7); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sg-spark path:not(.ln):not([style]) { stroke: var(--s7); }
.rv-kpis .signal.kpi { grid-template-rows: none; }

/* progress: trends as tinted pills, smoother week charts */
.pg-trend { justify-self: start; display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; }
.pg-trend.up { background: color-mix(in srgb, var(--good) 14%, transparent); }
.pg-trend.down { background: color-mix(in srgb, var(--crit) 12%, transparent); }
.wk-bar { border-radius: 999px 999px 4px 4px; width: min(14px, 50%); }
.wk-line path.ln { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.wk-dot { width: 8px; height: 8px; background: var(--surface) !important; border: 2.5px solid currentColor; }
.kpi-main b.word { font-size: 22px; letter-spacing: -0.01em; }
.sg-spark path[style] { stroke: none; }
.sg-spark path.ln { stroke: var(--s7); stroke-width: 2; stroke-linecap: round; }
.sg-spark path:not(.ln):not([style]) { stroke: var(--s7); stroke-width: 5; }
.pg-trend { border-radius: 10px; }

/* ---------------- calendar, console style: one card, hairline grid, sport-tinted session chips */
.cal { background: var(--grid); border: 0; border-radius: 16px; box-shadow: var(--shadow); gap: 1px; }
.cal .hd { background: var(--surface); font: 600 12px var(--f-body); text-transform: none; letter-spacing: 0; color: var(--muted); padding: 12px 12px 10px; }
.cal .hd.wkh { color: var(--ink-2); }
.cal .day { background: var(--surface); padding: 8px; gap: 6px; min-height: 140px; }
.cal .day.past { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.cal .day.out { background: var(--surface-2); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.cal .dn { font: 700 12.5px var(--f-body); color: var(--ink-2); padding: 3px 8px; border-radius: 999px; }
.cal .day .dn.is-today { background: var(--accent); color: var(--accent-ink); }
.cal .day.out .wcard, .cal .day.out .mcard { opacity: 0.7; }
/* session chip: sport-tinted, colour bar on the left; planned = outlined */
.wcard { border: 0; border-left: 3px solid var(--sc, var(--axis)); border-radius: 10px; padding: 7px 8px 8px 9px; gap: 4px;
  background: color-mix(in srgb, var(--sc, var(--muted)) 9%, var(--surface)); box-shadow: none; }
.wcard:hover { background: color-mix(in srgb, var(--sc, var(--muted)) 15%, var(--surface)); }
.wcard.wc-good, .wcard.wc-warn, .wcard.wc-crit { border-top: 0; background: color-mix(in srgb, var(--sc, var(--muted)) 9%, var(--surface)); }
.wcard.wc-planned { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); border-left-style: solid; border-top: 0; }
.w-top .s-ico { color: var(--sc); }
.w-title { font-size: 12.5px; }
.w-lines { display: flex; flex-wrap: wrap; gap: 2px 8px; font-family: var(--f-body); }
.w-lines b { font-size: 12px; }
.w-lines .p { flex-basis: 100%; }
.w-st { justify-self: start; font: 600 10.5px var(--f-body); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.w-st.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good-text); }
.w-st.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn-text); }
.w-st.crit { background: color-mix(in srgb, var(--crit) 13%, transparent); color: var(--crit-text); }
/* daily wellness: one row of small chips */
.mcard { display: flex; flex-wrap: wrap; gap: 4px; border: 0; padding: 0; background: none; }
.m-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); font-size: 11px; }
.m-chip span { color: var(--muted); font-weight: 500; }
.m-chip b { font: 700 11px var(--f-body); color: var(--ink); }
.ecard { border: 0; border-left: 3px solid var(--ink); border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, var(--surface)); }
/* weekly summary: hours + ring, then done vs plan */
.cal .wk.ws { border-top: 0; background: var(--surface); box-shadow: inset 3px 0 0 var(--c); padding: 12px 14px; }
.ws-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ws-big { flex-direction: column; align-items: flex-start; gap: 0; }
.ws-big b { font: 800 22px var(--f-body); letter-spacing: -0.02em; }
.ws-bar { display: none; }
.ws-rows { gap: 3px; }
.cal-legend .bar { height: 8px; width: 8px; border-radius: 999px; }

/* ---------------- annual plan, console style */
.atp-kpis { margin-bottom: 2px; }
.sec-head.sub h3 { font: 700 16px var(--f-body); text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.nw { gap: 8px; }
.nw > b { font: 800 26px/1 var(--f-body); letter-spacing: -0.02em; }
.nw-phase { justify-self: start; padding: 3px 10px 3px 8px; border-radius: 999px; font-weight: 600; font-size: 12.5px;
  background: color-mix(in srgb, var(--c) 14%, transparent); }
.nw-phase .dim { font-weight: 500; }
.nw.now { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.nw-kind { font-size: 12.5px; color: var(--muted); }
.nw-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin: 2px 0 0; }
.tag { border-radius: 999px; }
.spark rect { rx: 3px; }

/* ================================================================ motion: charts draw in once, KPIs sweep to their value,
   cards arrive in sequence on page load; everything off with prefers-reduced-motion */
@keyframes td-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes td-fade { from { opacity: 0; } }
@keyframes td-grow-y { from { transform: scaleY(0); } }
@keyframes td-grow-x { from { transform: scaleX(0); } }
@keyframes td-sweep { from { stroke-dasharray: 0 100; } }
@keyframes td-pop { 0% { opacity: 0; transform: scale(0.4); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes td-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes td-tip { from { opacity: 0; transform: translateY(4px) scale(0.97); } }

@media (prefers-reduced-motion: no-preference) {
  /* charts: lines trace left to right, areas fade in after, bars grow from the baseline with a small stagger */
  svg.enter .draw, .kpi-viz .draw, .wk-line .draw, .sg-spark .draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: td-draw 1.1s cubic-bezier(.3, .7, .2, 1) both; }
  svg.enter .area, .wk-line .area, .sg-spark .area { animation: td-fade .9s ease .35s both; }
  svg.enter .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: td-grow-y .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
  svg.enter .hbar { transform-box: fill-box; transform-origin: 0 50%; animation: td-grow-x .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
  svg.enter circle:not([style*="transparent"]) { animation: td-fade .5s ease .5s both; }
  /* KPI visuals: rings and donuts sweep to their value, the gauge needle pops in at the end */
  .kpi-viz .sweep { animation: td-sweep 1.1s cubic-bezier(.3, .7, .2, 1) both; animation-delay: calc(var(--d, 0ms) + 150ms); }
  .kpi-viz .pop { transform-box: fill-box; transform-origin: center; animation: td-pop .45s ease 1s both; }
  .kpi-viz text { animation: td-fade .6s ease .5s both; }
  /* progress week columns grow, left to right */
  .wk-bar { transform-origin: 50% 100%; animation: td-grow-y .6s cubic-bezier(.2, .8, .2, 1) both; }
  .wk:nth-child(2) .wk-bar { animation-delay: 50ms; } .wk:nth-child(3) .wk-bar { animation-delay: 100ms; } .wk:nth-child(4) .wk-bar { animation-delay: 150ms; }
  .wk:nth-child(5) .wk-bar { animation-delay: 200ms; } .wk:nth-child(6) .wk-bar { animation-delay: 250ms; } .wk:nth-child(n+7) .wk-bar { animation-delay: 300ms; }
  .sg-fill, .sg-weeks span { transform-origin: 0 50%; animation: td-grow-x .7s cubic-bezier(.2, .8, .2, 1) .2s both; }
  /* page load: cards rise into place in sequence (not while editing a dashboard, where widgets re-render on every change) */
  main .signal, main .card, main .rv-chart, main .th, .cal { animation: td-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
  .signals > :nth-child(2), .th-strip > :nth-child(2) { animation-delay: 60ms; } .signals > :nth-child(3), .th-strip > :nth-child(3) { animation-delay: 120ms; }
  .signals > :nth-child(4), .th-strip > :nth-child(4) { animation-delay: 180ms; } .signals > :nth-child(5), .th-strip > :nth-child(5) { animation-delay: 240ms; }
  .dash-grid.editing .card, .dash-grid.editing .dw { animation: none; }
  /* interaction feedback */
  .tip:not([hidden]), .pg-tip:not([hidden]) { animation: td-tip .14s ease-out both; }
  .subtabs a, .seg button, .side nav a, .btn, .wcard, .lib-field, .nav-sub a, .ns-item { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease; }
  .wcard { transition: background-color .18s ease, transform .18s ease; }
  .wcard:hover { transform: translateY(-1px); }
  .kpi-ico { transition: transform .2s ease; }
  .signal.kpi:hover .kpi-ico { transform: scale(1.08) rotate(-4deg); }
}

/* load balance: a ratio on a zoned range scale. Your value sits in a callout above; the zone you're in is in full colour */
.lbs { position: relative; padding-top: 30px; margin-top: 2px; }
.lbs-call { position: absolute; top: 0; transform: translateX(-50%); }
.lbs-call span { display: block; font: 800 12px/1 var(--f-body); color: var(--surface); background: var(--ink); padding: 5px 8px; border-radius: 8px; white-space: nowrap; }
.lbs-call::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.lbs.young .lbs-call span { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); outline: 1.5px dashed var(--muted); outline-offset: 2px; }
.lbs.young .lbs-call::after { border-top-color: var(--ink); }
.lbs-bar { display: flex; gap: 3px; height: 12px; }
.lbs-bar span { border-radius: 3px; background: color-mix(in srgb, var(--z) 28%, var(--surface)); }
.lbs-bar span.on { background: var(--z); }
.lbs-bar span:first-child { border-radius: 999px 3px 3px 999px; } .lbs-bar span:last-child { border-radius: 3px 999px 999px 3px; }
.lbs-names { display: flex; gap: 3px; margin-top: 5px; }
.lbs-names span { text-align: center; font: 500 11px var(--f-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.lbs-names span.on { font-weight: 800; color: var(--t); }
@media (prefers-reduced-motion: no-preference) { .lbs-bar span { transform-origin: 0 50%; animation: td-grow-x .6s cubic-bezier(.2,.8,.2,1) both; } .lbs-call { animation: td-fade .4s ease .55s both; } }
.signal.kpi .sg { align-self: stretch; width: 100%; }

/* ---------------- hover: cards lift with a deeper shadow; off with reduced motion and while editing a dashboard */
@media (prefers-reduced-motion: no-preference) {
  .signal.kpi, .card, .rv-chart, .nw, .th { transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease; }
  .signal.kpi:hover, .nw:hover, .th:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
  main .card:not(.review):not(:has(.card)):hover, .rv-chart:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
  .dash-grid.editing .card:hover, .drawer .card:hover, .modal:hover { transform: none; box-shadow: var(--shadow); }
  .kpi-viz { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .signal.kpi:hover .kpi-viz { transform: scale(1.06); }
  .signal.kpi:hover .lbs-bar span.on { filter: saturate(1.2) brightness(1.04); }
}
/* a calendar card waiting for TrainingPeaks to confirm a change */
@keyframes td-saving { 50% { opacity: 0.45; } }
.wc-wrap.saving { pointer-events: none; }
.wc-wrap.saving .wcard { opacity: 0.7; }
@media (prefers-reduced-motion: no-preference) { .wc-wrap.saving .wcard { animation: td-saving 1.1s ease-in-out infinite; } }

/* ---------------- calendar weekly summary: daily load bars and the intensity mix */
.wl { display: grid; gap: 4px; }
.wl-lh { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.wl-lh .dim { font-weight: 500; font-size: 10.5px; }
.wl-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; align-items: end; }
.wl-day { display: grid; gap: 2px; justify-items: center; }
.wl-col { position: relative; width: 100%; max-width: 16px; height: 34px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.wl-col i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; }
.wl-col .pl { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.wl-col .wl-dn { background: var(--accent); left: 3px; right: 3px; }
.wl-day em { font-style: normal; font-size: 10px; color: var(--muted); }
.wl-day.today em { color: var(--accent); font-weight: 700; }
.wl-mix { display: grid; gap: 4px; }
.wl-mixbar { position: relative; display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: visible; }
.wl-mixbar span:first-child { border-radius: 999px 0 0 999px; } .wl-mixbar span:last-of-type { border-radius: 0 999px 999px 0; }
.wl-mixbar span:only-of-type { border-radius: 999px; }
.wl-tgt { position: absolute; top: -3px; bottom: -3px; border: 1.5px solid var(--ink); border-radius: 4px; pointer-events: none; }
.wl-cap { font-size: 11px; color: var(--muted); }
.wl-cap .ok { color: var(--good-text); font-weight: 600; } .wl-cap .under, .wl-cap .over { color: var(--warn-text); font-weight: 600; }

/* ---------------- calendar week view: tall day columns, each session in full */
.cal.cal-week { grid-template-columns: repeat(7, minmax(150px, 1fr)) minmax(230px, 1.3fr); }
.cal.cal-week .day { min-height: 520px; padding: 10px; gap: 8px; }
.cal.cal-week .wcard { padding: 9px 10px 10px 11px; gap: 6px; }
.cal.cal-week .w-title { -webkit-line-clamp: 3; font-size: 13px; }
.w-struct { display: none; }
.w-struct.on { display: block; position: relative; height: 64px; margin: 2px -2px 0; border-radius: 6px; background: color-mix(in srgb, var(--surface) 70%, transparent); overflow: hidden; }
.w-struct .tip { white-space: nowrap; }
.w-effort { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.w-desc { font-size: 11.5px; line-height: 1.45; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.cal.cal-week .wcard:hover .w-desc { -webkit-line-clamp: 30; }
#cal-view { margin-right: 6px; }

/* planning: workout library beside the calendar */
.cal-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.lib { width: 280px; position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.lib[hidden] { display: none; }
.lib-head { display: flex; align-items: center; gap: 4px; }
.lib-head h3 { margin: 0 auto 0 0; font-size: 14px; }
.lib-head .btn { padding: 2px 8px; }
.lib-q, .lib-filters select { font: inherit; font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 8px; min-width: 0; }
.lib-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lib-hint { margin: 0; }
.lib-list { list-style: none; margin: 0 -4px; padding: 0 4px; overflow-y: auto; display: grid; gap: 4px; align-content: start; min-height: 0; }
.lib-item { width: 100%; display: grid; line-height: 1.3; grid-template-columns: auto 1fr; gap: 1px 6px; align-items: start; text-align: left; font: inherit; font-size: 12.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--sc); border-radius: var(--radius); padding: 6px 8px; cursor: grab; }
.lib-item:hover { border-color: var(--muted); border-left-color: var(--sc); }
.lib-item[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: var(--accent); border-left-color: var(--sc); }
.lib-item .s-ico { grid-row: span 2; margin-top: 1px; }
.lib-name { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 11px var(--f-mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.lib-more { padding: 6px 2px; }
body.lib-placing .cal .day { cursor: copy; }
body.lib-placing .cal .day:hover { outline: 2px dashed var(--accent); outline-offset: -3px; }
@media (max-width: 900px) { .cal-split { grid-template-columns: 1fr; } .lib { width: auto; position: static; max-height: 60vh; } }

/* while the library is open it takes the summary column's place: the days keep their width */
.cal-split:has(.lib:not([hidden])) .cal { min-width: 820px; grid-template-columns: repeat(7, minmax(112px, 1fr)); }
.cal-split:has(.lib:not([hidden])) .cal > .wkh, .cal-split:has(.lib:not([hidden])) .cal > .wk { display: none; }

/* planning: week actions */
.ws-tools { display: inline-flex; align-items: center; gap: 2px; }
.ws-plan { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font: 600 11px var(--f-body); cursor: pointer; white-space: nowrap; }
.ws-plan:hover { color: var(--ink); border-color: var(--muted); }
.modal.wkf { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.wkf-sec { border: 0; border-top: 1px solid var(--grid); margin: 0; padding: 10px 0 0; display: grid; gap: 8px; }
.wkf-sec legend { font: 600 13px var(--f-body); padding: 0 6px 0 0; }
.wkf-sec textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; resize: vertical; }
.wkf-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.wkf-presets .btn { font-size: 12.5px; padding: 4px 10px; }
.wkf-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; font-size: 13px; }
.wkf-row .fine { flex: 1 1 240px; }
.wkf-btns { display: inline-flex; gap: 6px; }
.wkf-to input { font: inherit; font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 6px; margin-left: 4px; }
.wkf-sec p { margin: 0; }

/* planning: session preview on hover */
.wprev { position: fixed; z-index: 60; width: 300px; display: grid; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgb(0 0 0 / .28); font-size: 12.5px; pointer-events: none; }
.wp-head { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; }
.wp-head b { color: var(--ink); flex: 1; text-align: left; }
.wp-head .s-ico { flex: none; margin-top: 2px; }
.wp-date { color: var(--muted); font-size: 11.5px; }
.wp-figs { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.wp-figs dt { color: var(--muted); }
.wp-figs dd { margin: 0; font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.wp-struct { display: grid; gap: 3px; }
.wp-prof { height: 56px; }
.wp-cap, .wp-wait { font-size: 11px; color: var(--muted); }
.wp-desc { margin: 0; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.wp-hint { font-size: 11px; color: var(--muted); border-top: 1px solid var(--grid); padding-top: 6px; }
@media (prefers-reduced-motion: no-preference) { .wprev { animation: td-pop 120ms ease-out; } }
@keyframes td-pop { from { opacity: 0; transform: translateY(2px); } }

/* header figures coloured by meaning */
.t-val.tone-good { color: var(--good-text); } .t-val.tone-warn { color: var(--warn-text); } .t-val.tone-crit { color: var(--crit-text); }

/* weekly summary refinements: one-line head, centred daily-load bars */
.ws-head { flex-wrap: nowrap; }
.ws-phase { min-width: 0; flex: 1 1 auto; white-space: nowrap; }
.ws-phase .ws-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ws-phase .dim, .ws-tools { flex: none; white-space: nowrap; }
.wk.ws { grid-template-columns: minmax(0, 1fr); }
.ws-plan { padding: 1px 6px; font-size: 12px; }
/* the week's call to action: ask the coach, shift or copy */
.ws-cta { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; font: 600 12.5px var(--f-body); cursor: pointer;
  color: var(--accent-ink, #fff); background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); }
.ws-cta:hover { filter: brightness(1.08); }
.ws-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the summary stays in view: week view fits more screens, and when the calendar must scroll sideways the summary column
   stays pinned to the right edge (overflow: clip keeps the rounded frame without making .cal its own scroll box) */
.cal { overflow: clip; }
.cal.cal-week { min-width: 960px; grid-template-columns: repeat(7, minmax(108px, 1fr)) minmax(216px, 1.2fr); }
.cal > .wkh, .cal > .wk { position: sticky; right: 0; z-index: 3; }
.cal > .wk { box-shadow: -8px 0 14px -10px rgb(0 0 0 / .35); }

/* sidebar toggle: an explicit button, the arrow shows which way the sidebar goes */
.rail-toggle { width: 100%; justify-content: flex-start; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); background: transparent; color: var(--ink-2);
  font: 600 12.5px var(--f-body); text-transform: none; letter-spacing: 0; border-radius: var(--radius); }
.rail-toggle:hover { color: var(--ink); border-color: var(--muted); background: var(--wash); }
.rail-toggle .rt-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-toggle .rt-chev { transform-box: fill-box; transform-origin: center; transition: transform 160ms; }
html.rail-collapsed .rail-toggle { width: 40px; height: 36px; justify-content: center; padding: 0; }
html.rail-collapsed .rail-toggle .lbl { display: none; }
html.rail-collapsed .rail-toggle .rt-chev { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .rail-toggle .rt-chev { transition: none; } }

/* logo: rounded square, a ridge and two rising trail lines, drawn in the accent */
.brand-mark { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--logo, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  background: none; clip-path: none; border-radius: 0; }
.telemetry .brand { --logo: #8ea2ff; }

/* training views: one segmented bar, the active view a filled pill */
.subtabs { width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 4px; margin-bottom: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.subtabs a { padding: 7px 16px; border-radius: 9px; white-space: nowrap; }
.subtabs a[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.subtabs a[aria-selected="true"] .tab-dot { background: var(--accent-ink); }
.subtabs { position: static; }  /* scrolls away with the page */

/* settings: coach style, four cards to pick from */
.cs { display: grid; gap: 10px; margin-bottom: 18px; }
.cs-head h3 { margin: 0; font-size: 15px; }
.cs-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.cs-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .cs-opts { grid-template-columns: 1fr; } }
.cs-opt { position: relative; display: grid; align-content: start; gap: 3px; padding: 10px 12px 11px 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.cs-opt:hover { border-color: var(--muted); }
.cs-opt input { position: absolute; left: 12px; top: 12px; margin: 0; accent-color: var(--accent); }
.cs-opt b { font-size: 13.5px; color: var(--ink); }
.cs-opt span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.cs-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.cs-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* per-chart period: a chip in the chart's (or section's) header with a small menu */
.ch-tools, .sec-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sec-head:has(.rchip) { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rchip { position: relative; flex: none; }
.rchip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font: 600 12.5px var(--f-body); color: var(--ink-2); cursor: pointer; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.rchip-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; color: var(--accent-text); }
.rchip-btn:hover, .rchip-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--accent); }
.rchip-car { font-size: 10px; color: var(--muted); }
.rchip-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 230px; display: grid; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 0 / .18); }
.rchip-menu > button { text-align: left; font: 500 13px var(--f-body); color: var(--ink-2); background: none; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.rchip-menu > button:hover, .rchip-menu > button:focus-visible { background: var(--wash); color: var(--ink); }
.rchip-menu > button[aria-checked="true"] { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }
.rchip-custom { display: grid; gap: 6px; margin-top: 4px; padding: 8px 4px 2px; border-top: 1px solid var(--grid); font-size: 12px; color: var(--muted); }
.rchip-custom label { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 6px; }
.rchip-custom input { font: inherit; font-size: 12.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; min-width: 0; }
.rchip-custom .btn { justify-self: end; padding: 4px 12px; font-size: 12.5px; }
.is-busy { opacity: .5; transition: opacity .15s; pointer-events: none; }

/* intensity mix: one 100% bar (easy / moderate / hard), the easy target marked */
.imx { display: grid; gap: 8px; padding-top: 16px; }
.imx-bar { position: relative; display: flex; gap: 2px; height: 12px; }
.imx-bar span:first-child { border-radius: 999px 3px 3px 999px; } .imx-bar span:last-of-type { border-radius: 3px 999px 999px 3px; }
.imx-bar span { border-radius: 3px; }
.imx-tgt { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.imx-tgt em { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font: 600 10.5px var(--f-body); font-style: normal; color: var(--ink-2); white-space: nowrap; }
.imx-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.imx-key i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.imx-key .imx-v { color: var(--ink); font: 700 12px var(--f-body); }
.imx-key small { font-size: 10.5px; }

/* weekly review: the blocking "coach is writing" popup */
.rv-wait .modal { width: min(400px, 100%); justify-items: center; text-align: center; padding: 28px 26px 24px; outline: none; }
.rv-wait .modal p { margin: 0; }
.rv-wait .modal-actions { justify-self: stretch; }
.spin.big { width: 34px; height: 34px; border-width: 3px; }
/* a raw (unparsed) analysis wraps instead of stretching the review */
.rv-analysis { min-width: 0; }
.rv-analysis pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }

/* coach style cards with portraits: the photo, a label pill in the coach's colour, a one-line summary */
.cs-opts { gap: 10px; }
.cs-opt { padding: 0; overflow: hidden; gap: 0; border-radius: 12px; }
.cs-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cs-pic { position: relative; display: block; aspect-ratio: 590 / 464; background: var(--surface-2); }
.cs-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.cs-opt:hover .cs-pic img { transform: scale(1.03); }
.cs-opt .cs-tag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px; border-radius: 999px;
  font: 700 12.5px var(--f-body); color: #fff; background: color-mix(in srgb, var(--cc) 88%, transparent); backdrop-filter: blur(4px); }
.cs-tag svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: rgb(255 255 255 / .18); fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cs-opt[data-k="army"] { --cc: #3f4b38; } .cs-opt[data-k="scientific"] { --cc: #4a5fe6; }
.cs-opt[data-k="balanced"] { --cc: #2c7a62; } .cs-opt[data-k="soft"] { --cc: #b2677d; }
.cs-opt .cs-check { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: none; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink, #fff); font: 800 13px/1 var(--f-body); box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.cs-sum { display: block; padding: 8px 11px 10px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.cs-opt:has(input:checked) .cs-check { display: grid; }
.cs-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--surface); }
.cs-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .cs-pic img { transition: none; } }
/* four coaches side by side; two by two on narrow screens */
.cs-opts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cs-pic { aspect-ratio: 4 / 5; }
.cs-pic img { object-position: 50% 20%; }
.cs-opt .cs-tag { left: 6px; right: 6px; bottom: 6px; justify-content: flex-start; font-size: 12px; padding-right: 8px; }
@media (max-width: 640px) { .cs-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* settings: a centred popup, one collapsible section per topic (profile first) */
.set-back { z-index: 45; }
.modal.set-modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 20px 22px 24px; gap: 14px; align-content: start; }
.set-head { display: flex; justify-content: space-between; align-items: center; }
.set-head h2 { margin: 0; font-size: 22px; }
.set-list { display: grid; gap: 8px; }
.set-sec { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.set-sec[hidden] { display: none; }
.set-sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-radius: 12px; }
.set-sec > summary::-webkit-details-marker { display: none; }
.set-sec > summary:hover { background: var(--wash); }
.set-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ss-t { font: 700 14.5px var(--f-body); color: var(--ink); }
.ss-sum { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-car { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.set-sec[open] > summary .ss-car { transform: rotate(180deg); }
.set-sec[open] > summary { border-bottom: 1px solid var(--grid); border-radius: 12px 12px 0 0; }
.ss-body { padding: 14px; display: grid; gap: 14px; }
.ss-body > p { margin: 0; }
.ss-zones { display: grid; gap: 12px; }
.ss-zones .card { box-shadow: none; }
.set-modal .th-strip { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.set-modal .cs { margin: 0; }
@media (prefers-reduced-motion: reduce) { .ss-car { transition: none; } }
/* the review's call to action: talk it through with the coach */
.rv-discuss { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; font-weight: 700; flex: none; }
.rv-discuss svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
/* actions that hand something to the coach: one recognisable style everywhere (accent tint, ✨) */
.btn.coach-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent-text, var(--ink));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.coach-cta:hover { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); border-color: var(--accent); }
.ws-big .ws-ahead { color: var(--accent-text); font-weight: 600; }

/* ATP training blocks: grouped by race cycle, one compact row per block */
.tb { display: grid; gap: 8px; }
.tb-cycle { border: 1px solid var(--border); border-radius: 12px; }
.tb-cycle > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-radius: 12px; }
.tb-cycle > summary::-webkit-details-marker { display: none; }
.tb-cycle > summary:hover { background: var(--wash); }
.tb-cycle[open] > summary { border-bottom: 1px solid var(--grid); border-radius: 12px 12px 0 0; }
.tb-cycle[open] > summary .ss-car { transform: rotate(180deg); }
.tb-cycle .ss-car { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.tb-ct { font: 700 14px var(--f-body); color: var(--ink); }
.tb-cs { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tb-list { list-style: none; margin: 0; padding: 4px 6px 6px; }
.tb-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 130px 90px 48px 78px 64px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.tb-row + .tb-row { border-top: 1px solid var(--grid); }
.tb-row.now { background: color-mix(in srgb, var(--accent) 8%, transparent); border-top-color: transparent; }
.tb-row.now + .tb-row { border-top-color: transparent; }
.tb-row.past { opacity: .6; }
.tb-name { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); min-width: 0; flex-wrap: wrap; }
.tb-name em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); }
.tb-race { font-weight: 500; font-size: 12px; color: var(--muted); }
.tb-name .chip { font-size: 11px; }
.tb-dates { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-spark { display: flex; align-items: flex-end; }
.tb-num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-num b { color: var(--ink); }
@media (max-width: 760px) { .tb-row { grid-template-columns: minmax(0, 1fr) auto auto; } .tb-dates, .tb-spark, .tb-row .tb-num.dim { display: none; } }
@media (prefers-reduced-motion: reduce) { .tb-cycle .ss-car { transition: none; } }

/* Ask Coach: the chosen coach's portrait beside its replies and in the header */
.ava { width: 34px; height: 34px; flex: none; border-radius: 50%; background-color: var(--surface-2); background-repeat: no-repeat;
  background-size: 250%; background-position: 50% 16%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.ava.lg { width: 44px; height: 44px; }
/* each coach's face centred in the circle (photo 480x377 at 250%: a 192 px window, x% = left/288, y% = top/185) */
.ava[data-coach="army"] { background-position: 52% 11%; } .ava[data-coach="scientific"] { background-position: 49% 16%; }
.ava[data-coach="balanced"] { background-position: 49% 10%; } .ava[data-coach="soft"] { background-position: 49% 17%; }
.turn.assistant { grid-template-columns: 34px minmax(0, 1fr); align-items: start; column-gap: 12px; }
.turn.assistant > .ava { position: sticky; top: 8px; }
.turn-body { display: grid; gap: 10px; min-width: 0; }
.turn.assistant .who { text-transform: none; letter-spacing: 0; font: 700 12.5px var(--f-body); color: var(--ink); }
.c-chat-head { align-items: center; }
.c-chat-head > .ava { margin-right: 4px; }
.c-with b { color: var(--ink); font-weight: 600; }

/* the coach's profile card (click a portrait in Ask Coach) */
button.ava { border: 0; padding: 0; cursor: pointer; }
button.ava:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }
button.ava:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.modal.cc { width: min(440px, 100%); padding: 0; gap: 0; overflow: hidden; max-height: calc(100vh - 40px); overflow-y: auto; }
.cc-pic { position: relative; aspect-ratio: 480 / 300; background-size: cover; background-position: 50% 22%; }
.cc-x { position: absolute; top: 10px; right: 10px; background: rgb(0 0 0 / .45); color: #fff; border-color: transparent; }
.cc-x:hover { background: rgb(0 0 0 / .6); color: #fff; }
.cc-body { display: grid; gap: 8px; padding: 16px 20px 18px; }
.cc-body h3 { margin: 0; font-size: 20px; }
.cc-body p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.cc-body .cc-tag { font-weight: 700; color: var(--accent-text, var(--accent)); }
.cc-body h4 { margin: 6px 0 0; font-size: 12.5px; color: var(--ink); }
.cc-traits { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.cc-quote { margin: 4px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--wash); border-radius: 6px; font-size: 13px; font-style: italic; color: var(--ink-2); }
.c-chat-head > button.ava { margin-right: 4px; }

/* ATP training blocks: a row opens into the block's purpose, numbers, weeks and a coach CTA */
.tb-row { grid-template-columns: minmax(0, 1.6fr) 130px 90px 48px 78px 64px 16px; cursor: pointer; }
.tb-row:hover { background: var(--wash); }
.tb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tb-row .ss-car { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.tb-row.open .ss-car { transform: rotate(180deg); }
.tb-row.open { background: var(--wash); border-radius: 8px 8px 0 0; }
.tb-detail { display: grid; gap: 12px; margin: 0 0 8px; padding: 12px 14px 14px; background: var(--wash); border-radius: 0 0 8px 8px; border-left: 3px solid var(--c); }
.tb-purpose { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.tb-purpose b { color: var(--ink); }
.tb-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.tb-weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tb-wk { width: 100%; display: grid; grid-template-columns: 44px 70px 170px minmax(0, 1fr); gap: 4px 10px; align-items: center; text-align: left; font: inherit; font-size: 12.5px;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.tb-wk:hover { border-color: var(--muted); }
.tb-weeks li.now .tb-wk { border-color: var(--accent); }
.tb-weeks li.past .tb-wk { opacity: .7; }
.tb-wn { font-weight: 700; color: var(--ink); }
.tb-wd, .tb-wh { font-variant-numeric: tabular-nums; }
.tb-wh b { color: var(--ink); }
.tb-wt { display: flex; flex-wrap: wrap; gap: 4px; }
.tb-wnote { grid-column: 2 / -1; font-size: 12px; color: var(--muted); line-height: 1.4; }
.tb-acts { display: flex; justify-content: flex-end; }
@media (max-width: 760px) { .tb-row { grid-template-columns: minmax(0, 1fr) auto auto 16px; } .tb-wk { grid-template-columns: 44px 1fr; } .tb-wt, .tb-wnote { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .tb-row .ss-car { transition: none; } }

/* first-run welcome on Overview: three steps, ticked off as they happen */
.welcome { display: grid; gap: 14px; padding: 18px 20px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: linear-gradient(0deg, var(--surface), color-mix(in srgb, var(--accent) 6%, var(--surface))); }
.welcome[hidden] { display: none; }
.wl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wl-top h2 { margin: 0; font-size: 20px; }
.wl-top p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.wl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wl-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); }
.wl-steps li.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wl-steps li.done { opacity: .65; }
.wl-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--f-body); background: var(--surface-2); color: var(--ink-2); }
.wl-steps li.next .wl-n { background: var(--accent); color: var(--accent-ink, #fff); }
.wl-steps li.done .wl-n { background: var(--good); color: #fff; }
.wl-steps h3 { margin: 0; font-size: 14.5px; }
.wl-steps p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; max-width: 70ch; }
.wl-steps .btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.wl-ok { font-size: 12.5px; font-weight: 600; color: var(--good-text); }
@media (max-width: 760px) { .wl-steps li { grid-template-columns: 30px minmax(0, 1fr); } .wl-steps li > :last-child { grid-column: 2; justify-self: start; } }

/* sign-in: a calm full-screen card in front of the app */
.signin { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg)); }
.si-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 28px 26px 24px; border-radius: 16px; box-shadow: 0 20px 50px rgb(0 0 0 / .18); }
.si-brand { display: flex; align-items: center; gap: 9px; font: 800 14px var(--f-body); letter-spacing: .02em; color: var(--ink); }
.si-brand .brand-mark { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.si-card h1 { margin: 6px 0 0; font: 800 24px var(--f-body); text-transform: none; letter-spacing: -0.01em; }
.si-sub { margin: -6px 0 4px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.si-card .fld { display: grid; gap: 5px; }
.si-card input { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.si-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.si-go { padding: 11px 14px; font-weight: 700; margin-top: 4px; }
.si-me { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--wash); font-size: 13px; }
.si-switch { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.si-switch button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent-text, var(--accent)); cursor: pointer; }
.si-switch button:hover { text-decoration: underline; }
.si-card input[name="code"] { font-family: var(--f-mono, ui-monospace); letter-spacing: .08em; text-transform: uppercase; }

/* settings: TrainingPeaks link and invites */
#set-tp p, #set-invite p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.tpc-ok::before { content: "●"; color: var(--good); margin-right: 6px; }
.tpc-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); display: grid; gap: 3px; }
.tpc-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tpc-row select, .tpc-row input { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-width: 0; flex: 1 1 200px; }
.tpc-row select { flex: 0 0 auto; }
.tpc-paste summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.tpc-paste[open] { display: grid; gap: 8px; }
.tpc-paste code { font-size: 12px; }
.inv-new { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.inv-code { font: 800 20px var(--f-mono, ui-monospace); letter-spacing: .1em; color: var(--ink); }
.inv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.inv-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--grid); }
.tpc-found { display: grid; gap: 6px; }
.tpc-acc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.tpc-acc.taken { opacity: .6; }

/* TrainingPeaks sign-in expired */
.tp-expired { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 24px 0; padding: 10px 14px;
  border-radius: 12px; font-size: 13.5px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); }
.tpc-bad::before { content: "●"; color: var(--warn); margin-right: 6px; }
.error [data-tp-reconnect] { margin-top: 8px; justify-self: start; }

/* sign-in backdrop: drifting ridges and a runner on the trail (still when motion is reduced) */
.signin { overflow: hidden; }
.si-card { position: relative; z-index: 1; }
.si-scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 72%; pointer-events: none; }
.si-ridge path { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.si-ridge.r2 path { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.si-hill { fill: color-mix(in srgb, var(--accent) 24%, var(--bg)); }
.si-trail { fill: none; stroke: var(--accent); stroke-opacity: .55; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 14; }
.si-runner { offset-path: path("M-40 560 C 180 540, 260 470, 420 455 S 700 360, 860 330 S 1120 250, 1260 270 S 1500 330, 1660 300"); offset-rotate: 0deg; }
.si-runner circle { fill: var(--accent); }
.si-runner .si-glow { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .si-ridge { animation: si-drift 140s linear infinite; }
  .si-ridge.r2 { animation-duration: 80s; }
  .si-trail { animation: si-dash 1.2s linear infinite; }
  .si-runner { animation: si-run 16s cubic-bezier(.45, .05, .55, .95) infinite; }
  .si-glow { animation: si-pulse 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
}
@media (prefers-reduced-motion: reduce) { .si-runner { offset-distance: 62%; } }
@keyframes si-drift { to { transform: translateX(-1600px); } }
@keyframes si-dash { to { stroke-dashoffset: -16; } }
@keyframes si-run { from { offset-distance: 0%; opacity: 0; } 6% { opacity: 1; } 94% { opacity: 1; } to { offset-distance: 100%; opacity: 0; } }
@keyframes si-pulse { 50% { transform: scale(1.5); opacity: .35; } }

/* welcome flow (after joining): steps on the sign-in backdrop */
.ob-card { width: min(460px, 100%); }
.ob-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.ob-steps li { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); padding: 3px 8px 3px 3px; border-radius: 999px; background: var(--wash); }
.ob-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--f-body); background: var(--surface-2); }
.ob-steps li.now { color: var(--ink); font-weight: 600; } .ob-steps li.now span { background: var(--accent); color: var(--accent-ink, #fff); }
.ob-steps li.done span { background: var(--good); color: #fff; }
.ob-body { display: grid; gap: 12px; }
.ob-body h1 { margin: 4px 0 0; font: 800 22px var(--f-body); text-transform: none; letter-spacing: -0.01em; }
.ob-found { display: grid; gap: 8px; }
.ob-wait { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--muted); font-size: 13.5px; }
.ob-acc { margin: 0; font-size: 14px; }
.ob-drop { display: grid; place-items: center; gap: 2px; padding: 22px 14px; border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; text-align: center; background: var(--wash); }
.ob-drop b { color: var(--accent-text, var(--accent)); } .ob-drop span { font-size: 12.5px; color: var(--muted); }
a.si-go { display: flex; justify-content: center; text-decoration: none; }
.ob-files { margin-top: 14px; } .ob-files summary { cursor: pointer; font-size: 13px; color: var(--muted); } .ob-files[open] summary { margin-bottom: 8px; }
.ob-drop.over, .ob-drop:hover { border-color: var(--accent); } .ob-drop.busy { opacity: .6; pointer-events: none; }
.ob-drop[hidden] { display: none; }
.ob-prog { display: grid; gap: 6px; } .ob-prog p { margin: 0; color: var(--ink-2); }
.ob-prog[hidden] { display: none; }
.ob-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ob-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.ob-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* welcome flow: goal race and season plan */
.ob-race { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--wash); }
.ob-race p { margin: 0; font-size: 14px; line-height: 1.45; }
.ob-flag { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font: 800 14px var(--f-body); background: var(--accent); color: var(--accent-ink, #fff); }
.ob-flag.plan { background: var(--s1); }
.ob-raceform[hidden] { display: none; }
.ob-raceform { display: grid; gap: 8px; }
.ob-raceform > .fine { margin: 4px 0 0; }
.ob-form { display: grid; gap: 12px; }
.ob-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.si-card select { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ob-unit { position: relative; display: grid; }
.ob-unit input { padding-right: 34px; }
.ob-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.ob-seg { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ob-seg legend { grid-column: 1 / -1; padding: 0; margin-bottom: 5px; }
.ob-seg label { cursor: pointer; }
.ob-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ob-seg span { display: grid; gap: 1px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--bg); }
.ob-seg em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.ob-seg input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.ob-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-plan { height: 92px; display: flex; align-items: flex-end; gap: 2px; padding: 6px 0 0; border-bottom: 1px solid var(--border); }
.ob-plan i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; opacity: .85; position: relative; }
.ob-plan i.race { opacity: 1; }
.ob-plan i.race::after { content: ""; position: absolute; left: 50%; top: -9px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.ob-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 12px; color: var(--muted); }
.ob-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ob-legend i { width: 9px; height: 9px; border-radius: 2px; }
@media (max-width: 420px) { .ob-row, .ob-seg { grid-template-columns: 1fr; } }
.ob-back { justify-self: start; margin: -4px 0 -8px; padding: 2px 0; border: 0; background: none; font: 600 12.5px var(--f-body); color: var(--muted); cursor: pointer; }
.ob-back:hover { color: var(--ink); }
.ob-clean { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.ob-clean label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--bg); }
.ob-clean label:has(input:checked) { border-color: var(--crit); background: color-mix(in srgb, var(--crit) 6%, var(--bg)); }
.ob-clean input { margin-top: 3px; accent-color: var(--crit); }
.ob-clean span { display: grid; gap: 1px; font-size: 13.5px; }
.ob-clean span .dim { font-size: 12px; }

/* settings: golden invite, delete account */
.inv-gold { display: grid; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--warn, #c90) 60%, var(--border)); background: color-mix(in srgb, var(--warn, #c90) 5%, var(--surface)); }
.inv-gold p { margin: 2px 0 0; }
.inv-gold .tpc-row { align-items: center; }
.acc-del { display: grid; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--crit) 35%, var(--border)); }
.acc-del p { margin: 2px 0 0; }
.acc-del > [data-del] { justify-self: start; }
.acc-del-form { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-del-form[hidden] { display: none; }
.acc-del-form input { flex: 1 1 180px; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }

/* welcome flow: the coach conversation for the season (Ask Coach, embedded) */
.ob-card.wide { width: min(880px, 100%); }
.ob-coach .coach-app { height: min(56vh, 560px); min-height: 320px; }
.ob-coach .c-chat-head { padding: 8px 12px; }
.ob-coach .c-chat-head h2 { font-size: 15px; }
@media (max-height: 700px) { .ob-coach .coach-app { height: 46vh; } }

/* coach: one panel for its work before answering (reasoning + sources read); a single live line, the timeline inside */
.work { border: 1px solid var(--border); border-radius: var(--radius); background: var(--wash); font-size: 13px; }
.work summary { cursor: pointer; list-style: none; display: grid; gap: 3px; padding: 7px 10px; color: var(--ink-2); }
.work summary::-webkit-details-marker { display: none; }
.w-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-head b { font-weight: 500; flex: none; }
.w-head .w-d { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-head::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: 11px; flex: none; }
.work[open] .w-head::after { content: "▾"; }
.work .a-ok { color: var(--good-text); }
.w-prev { padding-left: 22px; color: var(--muted); font-style: italic; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work[open] .w-prev { display: none; }
.w-list { padding: 6px 10px 9px 12px; border-top: 1px solid var(--border); display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.w-think { color: var(--muted); font-style: italic; line-height: 1.5; padding: 2px 0 2px 10px; border-left: 2px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.w-think p { margin: 0 0 4px; } .w-think p:last-child { margin: 0; }

/* welcome flow: the season questions */
.ob-big span { padding: 14px; font-size: 15px; }
.ob-seg3 { grid-template-columns: repeat(3, 1fr); }
.ob-seg3 span { text-align: center; font-weight: 500; }
.ob-row3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; }
.ob-sub { margin: 6px 0 -4px; }
.ob-kept { margin: 0; }
.ob-others { display: grid; gap: 6px; }
.ob-rrow { display: grid; grid-template-columns: 1.4fr 1.1fr .9fr 1.1fr auto; gap: 6px; align-items: center; }
.ob-rrow input, .ob-rrow select { min-width: 0; font: inherit; font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; }
.ob-rrow .ob-unit input { padding-right: 28px; width: 100%; }
.ob-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.ob-x:hover { color: var(--crit-text); background: var(--wash); }
.ob-add { justify-self: start; }
.ob-days { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ob-days legend { width: 100%; padding: 0; margin-bottom: 5px; }
.ob-days label { cursor: pointer; }
.ob-days input { position: absolute; opacity: 0; pointer-events: none; }
.ob-days span { display: inline-grid; place-items: center; min-width: 46px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); color: var(--ink-2); }
.ob-days input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); color: var(--ink); }
.ob-days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-qnav { justify-content: space-between; align-items: center; }
.ob-count { font-size: 12px; color: var(--muted); }
.ob-review { margin: 0; font-size: 13.5px; }
.ob-build { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.ob-build li { display: flex; align-items: center; gap: 10px; }
@media (max-width: 520px) { .ob-row3, .ob-seg3 { grid-template-columns: 1fr; } .ob-rrow { grid-template-columns: 1fr 1fr; } }

/* the tour: a spotlight that glides from part to part, with a note (and its arrow) that follows */
#tour { position: fixed; inset: 0; z-index: 300; --tour-ease: cubic-bezier(.22, .8, .24, 1); }
.tour-dim { position: fixed; inset: 0; width: 100%; height: 100%; animation: tour-fade .35s ease; }
.tour-shade { fill: rgb(10 14 30 / .58); }
.tour-ring { position: fixed; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 2px var(--accent);
  transition: left .5s var(--tour-ease), top .5s var(--tour-ease), width .5s var(--tour-ease), height .5s var(--tour-ease); }
.tour-ring[hidden] { display: block; opacity: 0; }
.tour-ring.pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 2px var(--accent); animation: tour-pulse 1.1s ease-out .45s 2; }
@keyframes tour-pulse { from { box-shadow: 0 0 0 2px var(--accent); opacity: .9; } to { box-shadow: 0 0 0 14px var(--accent); opacity: 0; } }
@keyframes tour-fade { from { opacity: 0; } }
.tour-tip { position: fixed; left: 50%; top: 50%; width: min(330px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 14px 16px 12px; border-radius: 14px;
  box-shadow: 0 18px 44px rgb(0 0 0 / .28); transition: left .5s var(--tour-ease), top .5s var(--tour-ease); animation: tour-fade .3s ease; }
.tour-body { display: grid; gap: 6px; transition: opacity .14s ease, transform .14s ease; }
.tour-body.swap { opacity: 0; transform: translateY(4px); }
.tour-tip h3 { margin: 0; font-size: 16px; }
.tour-tip p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tour-wait { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.tour-chs { display: flex; gap: 4px; }
.tour-chs button { flex: 1; height: 5px; padding: 0; border: 0; border-radius: 99px; background: var(--surface-2, var(--wash)); cursor: pointer; transition: background .3s ease; }
.tour-chs button.done { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2, var(--wash))); }
.tour-chs button.now { background: var(--accent); }
.tour-chs button:hover { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.tour-caret { position: absolute; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); display: none; }
.tour-tip[data-side="left"] .tour-caret { display: block; left: -6px; margin-top: -6px; }
.tour-tip[data-side="top"] .tour-caret { display: block; top: -6px; margin-left: -6px; }
.tour-tip[data-side="bottom"] .tour-caret { display: block; bottom: -6px; margin-left: -6px; }
.tour-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.tour-nav span { display: flex; gap: 6px; }
.tour-next { display: grid; gap: 6px; }
.tour-next button { display: grid; gap: 1px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, transform .15s; }
.tour-next button:hover { border-color: var(--accent); transform: translateX(2px); }
.tour-next b { font-size: 13.5px; } .tour-next span { font-size: 12px; color: var(--muted); }
.tour-offer { position: fixed; right: 20px; bottom: 20px; z-index: 250; width: min(300px, calc(100vw - 32px)); display: grid; gap: 4px; padding: 14px 16px 12px; border-radius: 14px; box-shadow: 0 16px 40px rgb(0 0 0 / .2); animation: tour-in .35s var(--tour-ease, ease); }
.tour-offer p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
@keyframes tour-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .tour-ring, .tour-tip, .tour-body, .tour-chs button { transition: none; }
  .tour-dim, .tour-tip, .tour-offer, .tour-ring.pulse::after { animation: none; }
}
.ob-card:has(.ob-qnav) { width: min(540px, 100%); }
.ob-body { min-width: 0; }
.ob-form, .ob-row3, .ob-rrow, .ob-others { min-width: 0; }
.ob-row3 > *, .ob-rrow > *, .ob-form .fld { min-width: 0; }
.ob-form input, .ob-form select, .ob-row3 input, .ob-rrow input, .ob-rrow select { width: 100%; box-sizing: border-box; }
.si-card .ob-days { display: flex; flex-wrap: wrap; gap: 6px; }
.si-card .ob-seg { display: grid; }
.tour-ring.snap, .tour-tip.snap { transition: none; }
.tour-ghost { position: fixed; z-index: 301; margin: 0; pointer-events: none; box-shadow: 0 14px 34px rgb(0 0 0 / .3); background: var(--surface); border-radius: 10px;
  transition: transform .75s cubic-bezier(.22, .8, .24, 1); }

/* ---------------- Settings page: a menu of sections, one section at a time */
.sp { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "top top" "nav main"; gap: 22px 36px; max-width: 1080px; }
.sp-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sp-top h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.sp-nav { grid-area: nav; display: grid; gap: 18px; align-content: start; position: sticky; top: calc(var(--banner-h) + 20px); }
.sp-group { display: grid; gap: 2px; }
.sp-g { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 10px 4px; }
.sp-nav a { display: grid; gap: 1px; padding: 7px 10px 8px; border-radius: 8px; text-decoration: none; color: var(--ink-2); border-left: 2px solid transparent; }
.sp-nav a[hidden] { display: none; }
.sp-nav a:hover { background: var(--wash); color: var(--ink); }
.sp-nav a.on { background: var(--accent-tint); color: var(--ink); border-left-color: var(--accent); border-radius: 0 8px 8px 0; }
.sp-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-t { font-size: 14px; font-weight: 600; }
.sp-sum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sum:empty { display: none; }
.sp-main { grid-area: main; min-width: 0; }
.sp-pane[hidden] { display: none; }
.sp-head { margin-bottom: 18px; max-width: 64ch; }
.sp-head h2 { font-size: 20px; font-weight: 700; }
.sp-head p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.sp-body { display: grid; gap: 18px; }
.sp-body > .loading { padding: 20px 0; }

/* profile: the thresholds as one instrument strip, then label / value rows on hairlines */
.sp-body .th-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--border); box-shadow: none; }
.sp-body .th { padding: 14px 16px 15px; gap: 6px; }
.sp-body .th .micro { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.sp-body .th b { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.sp-body .kv.prof { grid-template-columns: minmax(160px, 34%) 1fr; gap: 0; border-top: 1px solid var(--border); font-size: 14px; }
.sp-body .kv.prof dt, .sp-body .kv.prof dd { padding: 11px 0; border-bottom: 1px solid var(--border); }
.sp-body .kv.prof dt { color: var(--muted); }
.sp-body .kv.prof dd { color: var(--ink); font-weight: 500; }

/* zones: each zone set as a quiet block, no card chrome */
.sp-body .ss-zones { display: grid; gap: 22px; }
.sp-body .zcard { box-shadow: none; padding: 16px 18px; }

/* connection, account and invite rows read as setting rows */
.sp-body .tpc-row { padding: 2px 0; }
.sp-body .si-me { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.sp-body .acc-del { background: var(--surface); }
.sp-body .inv-gold { margin-top: 4px; }
.cs-note { margin: -6px 0 0; }

@media (max-width: 860px) {
  .sp { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "nav" "main"; gap: 14px; }
  .sp-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .sp-group { display: contents; }
  .sp-g, .sp-sum { display: none; }
  .sp-nav a { white-space: nowrap; border-left: 0; border-radius: 999px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); }
  .sp-nav a.on { border-radius: 999px; border-color: var(--accent); }
  .sp-body .th-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sp-top h1 { font-size: 26px; text-transform: none; letter-spacing: -0.02em; }
/* the thresholds read as one instrument: a single band with hairline dividers, not five cards */
.sp-body .th-strip { gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sp-body .th-strip .th { border: 0; border-radius: 0; box-shadow: none; animation: none; transform: none; background: transparent; }
.sp-body .th-strip .th + .th { border-left: 1px solid var(--border); }
.sp-body .th-strip .th:hover { transform: none; box-shadow: none; }
@media (max-width: 860px) { .sp-body .th-strip .th:nth-child(3) { border-left: 0; } .sp-body .th-strip .th:nth-child(n+3) { border-top: 1px solid var(--border); } }
.sp-body .ss-zones .zcard:only-child .card-head h3 { display: none; }  /* the section already says which zones */
.sp-body .ss-zones .zcard:only-child .card-head { justify-content: flex-start; }
.sp-main, .sp-pane { display: block; }
.sp-pane[hidden] { display: none; }
.sp-body { align-content: start; }

/* settings rows: grouped in one surface, hairlines between, the action on the right */
.sgroup-h { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 6px 0 -10px; }
.sgroup { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 13px 16px; }
.srow + .srow, .sgroup > * + .srow, .sgroup > .srow + * { border-top: 1px solid var(--border); }
.srow-l { display: grid; gap: 3px; min-width: 0; max-width: 62ch; }
.srow-l b { font-size: 14px; font-weight: 600; color: var(--ink); }
.srow-l span { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.srow-v { color: var(--ink); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.srow-l .srow-v { font-size: 12.5px; font-weight: 600; }
.srow-r { display: flex; align-items: center; gap: 8px; flex: none; }
.srow-wide { flex-wrap: wrap; }
.srow-wide .srow-r { flex: 1 1 320px; justify-content: flex-end; }
.srow-r input { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-width: 0; flex: 1 1 200px; max-width: 280px; }
.srow-muted .srow-l b { color: var(--ink-2); font-weight: 500; }
.spill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.spill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.spill.ok { color: var(--good-text); background: color-mix(in srgb, var(--good) 12%, transparent); }
.sgroup .inv-new { margin: 0 12px 12px; }
.danger-zone { border-color: color-mix(in srgb, var(--crit) 35%, var(--border)); }
.danger-zone .acc-del-form { justify-content: flex-end; flex-wrap: wrap; }
.danger-zone .acc-del-form[hidden] { display: none; }
.danger-zone .acc-del-form input { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; flex: 1 1 200px; max-width: 280px; }
.danger-zone .form-err { margin: 0 16px 12px; }
.sp-body .sgroup .srow-r .srow-v { text-align: right; }
@media (max-width: 640px) { .srow { flex-direction: column; align-items: stretch; } .srow-r { justify-content: flex-start; flex-wrap: wrap; } }
.srow-r a.btn { text-decoration: none; }

/* settings menu v2: each group its own panel, the tour its own call to action */
.sp-nav { gap: 12px; }
.sp-group { gap: 1px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sp-g { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; margin-bottom: 2px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--ink); }
.sp-g svg { width: 18px; height: 18px; padding: 3px; border-radius: 6px; background: var(--accent-tint); fill: none; stroke: var(--accent-text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; box-sizing: content-box; }
.sp-nav a { border-left: 0; border-radius: 8px; }
.sp-nav a.on { border-radius: 8px; box-shadow: inset 3px 0 0 var(--accent); }
.sp-tour { display: grid; gap: 4px; padding: 14px 14px 12px; border-radius: var(--radius); color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.sp-tour b { font-size: 14px; }
.sp-tour span { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.sp-tour > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* profile v2: who you are, thresholds coloured by what they measure, details side by side */
.sp-id { display: flex; align-items: center; gap: 14px; }
.sp-ava { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 700 18px var(--f-display); letter-spacing: .02em;
  color: #fff; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--s4))); }
.sp-id > div { display: grid; gap: 3px; }
.sp-id b { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sp-id span { font-size: 13px; color: var(--muted); }
.sp-body .th-strip .th { position: relative; padding-top: 17px; }
.sp-body .th-strip .th::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--th-c, var(--border)); }
.sp-body .th-strip .th.pw { --th-c: var(--s4); } .sp-body .th-strip .th.hr { --th-c: var(--s5); } .sp-body .th-strip .th.pace { --th-c: var(--s3); }
.sp-body .th-strip .th .micro { color: color-mix(in srgb, var(--th-c, var(--muted)) 70%, var(--ink-2)); }
.sp-body .th-strip .th b small { color: var(--muted); }
.sp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.sp-cols > div { display: grid; gap: 18px; }
.sp-cols .srow { padding: 10px 14px; }
.sp-cols .srow-l b { font-weight: 500; color: var(--muted); font-size: 13.5px; }
.sp-body .sgroup .srow-l b { font-weight: 500; }
.sp-src { margin: -6px 0 0; }
@media (max-width: 980px) { .sp-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .sp-group { display: contents; } .sp-g, .sp-tour { display: none; } }
.sp-id .sp-ava { color: #fff; font-size: 18px; }

/* zone editing: inputs, then the exact new zones next to the current ones */
.zcard .card-head { align-items: flex-start; }
.zedit-btn { margin-left: auto; }
.zcard.editing { box-shadow: 0 0 0 2px var(--accent-tint), 0 0 0 1px var(--accent); }
.zed { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 14px; }
.zed .fld { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.zed input { font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 44px 9px 12px; width: 150px; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.zed input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.zed .ob-unit em { right: 10px; font-size: 12px; }
.zed-prev { min-height: 40px; }
.zed-prev .fine .spin { vertical-align: -2px; margin-right: 4px; }
.zcmp tr.chg td:last-child b { color: var(--accent-text); }
.zcmp td b { font-weight: 600; }
.zed-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.zed-act > span { flex: 1 1 260px; }
.sp-body .ss-zones .zcard.editing .card-head h3 { display: block; }
.zed-warn { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--warn-text); background: color-mix(in srgb, var(--warn) 12%, transparent); }

/* your picture */
/* a person's picture is a span.ava; the coach's is a button.ava with its own photo rules above: keep them apart */
span.ava { display: grid; place-items: center; overflow: hidden; border-radius: 50%; flex: none; color: #fff; font-weight: 700;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--s4))); box-shadow: none; }
span.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.athlete { display: flex; align-items: center; gap: 10px; }
.athlete > div { min-width: 0; }
.ava-side { width: 34px; height: 34px; font-size: 12.5px; }
.sp-id .sp-ava { width: 64px; height: 64px; font-size: 21px; color: #fff; }
.sp-photo { position: relative; display: block; border-radius: 50%; cursor: pointer; }
.sp-photo-cta { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: rgb(10 14 30 / .55); color: #fff;
  font-size: 11.5px; font-weight: 700; opacity: 0; transition: opacity .15s ease; }
.sp-photo:hover .sp-photo-cta, .sp-photo:focus-within .sp-photo-cta { opacity: 1; }
.sp-photo:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.sp-id .sp-photo-note { font-size: 12px; color: var(--muted); }
.link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.sp-id .sp-photo-cta { color: #fff; }

/* photo framing */
.crop-back { z-index: 260; }
.crop { width: min(380px, calc(100vw - 32px)); display: grid; gap: 12px; justify-items: center; text-align: center; }
.crop h3 { margin: 0; font-size: 17px; }
.crop > p { margin: -6px 0 0; }
.crop-stage { position: relative; width: 300px; height: 300px; border-radius: 12px; overflow: hidden; cursor: grab; touch-action: none; background: var(--surface-2); }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.crop-stage canvas { width: 300px; height: 300px; display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 200px rgb(10 14 30 / .5); outline: 2px solid rgb(255 255 255 / .85); outline-offset: -1px; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 300px; color: var(--muted); font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop .modal-actions { width: 100%; justify-content: flex-end; }

/* signing in to TrainingPeaks in the server's browser */
.tps-back { z-index: 270; }
.tps { width: min(500px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; display: grid; gap: 14px; padding: 18px; }
.tps-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tps-head h3 { margin: 0 0 4px; font-size: 18px; }
.tps-head p { margin: 0; max-width: 46ch; }
.tps-form, .tps-code { display: grid; gap: 12px; }
.tps-form[hidden], .tps-code[hidden], .tps-view[hidden], .tps-alt[hidden] { display: none; }
.tps .fld input { padding: 10px 12px; font-size: 15px; }
.tps-code-q { margin: 0; }
.tps-wait { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 18px; }
.tps-wait[hidden], .tps-wait .spin[hidden] { display: none; }
.tps-alt { margin: 0; text-align: center; }
.tps-view { display: grid; gap: 10px; }
.tps-view-q { margin: 0; }
.tps-screen { position: relative; justify-self: center; width: 100%; max-width: 460px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.tps-screen canvas { display: block; max-width: 100%; touch-action: none; cursor: default; margin: 0 auto; }
.tps-kbd { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* you, top right */
.t-me { gap: 9px; padding: 0 16px 0 14px; text-transform: none; letter-spacing: 0; font-size: 13px; }
.t-me[hidden] { display: none; }
.ava-top { width: 32px; height: 32px; font-size: 12px; box-shadow: 0 0 0 2px var(--banner-bg), 0 0 0 3px var(--banner-line); }
.t-me-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-me-car { width: 14px; height: 14px; fill: none; stroke: var(--banner-muted); stroke-width: 2; stroke-linecap: round; transition: transform .15s ease; }
.t-me[aria-expanded="true"] .t-me-car { transform: rotate(180deg); }
.me-menu { position: fixed; z-index: 70; width: 250px; padding: 6px; display: grid; gap: 1px; box-shadow: 0 16px 40px rgb(0 0 0 / .22); border-radius: 12px; }
.me-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.me-head > div { display: grid; gap: 1px; min-width: 0; }
.me-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-head > div > span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ava-menu { width: 38px; height: 38px; font-size: 13px; }
.me-menu [role=menuitem] { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  font: 500 13.5px var(--f-body); color: var(--ink); text-decoration: none; cursor: pointer; }
.me-menu [role=menuitem]:hover, .me-menu [role=menuitem]:focus-visible { background: var(--wash); outline: none; }
.me-menu .me-out { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; color: var(--crit-text); }
@media (max-width: 860px) { .t-me-name, .t-me-car { display: none; } .t-me { padding: 0 10px; } }
.sgroup-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sg-link { font-size: 12.5px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.sg-link::after { content: " ↗"; }
.sg-link:hover { text-decoration: underline; }
.w-form { gap: 6px; }
.w-form .ob-unit input { width: 110px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 34px 7px 10px; box-sizing: border-box; }
.w-form .ob-unit em { right: 10px; font-size: 12px; }
.ava-blank { background: var(--accent-tint); }
.ava-blank svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; }
.t-me .t-me-name { font-weight: 600; }

/* you, top right: room for your picture and full name */
.t-me { gap: 11px; padding: 0 18px 0 16px; min-width: 190px; justify-content: flex-start; }
.t-me .ava-top { width: 36px; height: 36px; font-size: 13px; }
.t-me-text { display: grid; gap: 1px; text-align: left; min-width: 0; }
.t-me-text b { font-size: 13.5px; font-weight: 600; color: var(--banner-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.t-me-text small { font-size: 11px; font-weight: 500; color: var(--banner-muted); white-space: nowrap; }
.t-me .t-me-car { margin-left: auto; }
a.me-head { text-decoration: none; color: var(--ink); border-radius: 8px; }
a.me-head:hover, a.me-head:focus-visible { background: var(--wash); outline: none; }
.me-menu .me-strong { font-weight: 700; }
@media (max-width: 860px) { .t-me { min-width: 0; } .t-me-text, .t-me-car { display: none; } }
.me-menu a.me-head[role=menuitem] { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.inv-gold-old { margin: 0 16px 12px; }
.wl-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.wl-act a.btn { text-decoration: none; }
#setup.setup { margin-bottom: 18px; }
@media (max-width: 640px) { .wl-steps li { grid-template-columns: 30px minmax(0, 1fr); } .wl-act { grid-column: 2; justify-content: flex-start; } }

/* welcome flow v3: the runner climbs with your progress to the summit flag */
.si-flag { display: none; }
.si-pole { stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; }
.si-pennant { fill: var(--accent); transform-box: fill-box; transform-origin: 0% 50%; transform: scaleX(.35); opacity: .55; transition: transform .8s cubic-bezier(.3, 1.4, .5, 1) .9s, opacity .4s ease .9s; }
.ob-shell { position: relative; z-index: 1; width: 100%; display: grid; place-items: center; }
.ob-left { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
/* the season questions with "Your season" beside them */
.ob-card.ob-two { width: min(920px, 100%); }
.ob-card.ob-two .ob-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 26px; align-items: start; }
.ob-q { display: grid; gap: 12px; min-width: 0; }
.ob-prev { position: sticky; top: 0; display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.ob-prev-h { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ob-prev-race { display: grid; gap: 2px; }
.ob-prev-race b { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.ob-prev-race span { font-size: 12.5px; color: var(--muted); }
.ob-prev-race em { font-style: normal; font-size: 22px; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; margin-top: 4px; }
.ob-prev-others { display: grid; gap: 2px; margin: 0; font-size: 12px; color: var(--ink-2); }
.ob-prev-time { margin: 0; font-size: 13px; color: var(--ink-2); }
.ob-prev-time b { font-size: 15px; color: var(--ink); }
.ob-prev-plan { display: grid; gap: 6px; }
.ob-prev-plan .ob-plan { height: 84px; }
.ob-prev-plan p { margin: 0; }
.ob-prev-warn { font-size: 12px; color: var(--warn-text); }
/* the coaches */
.ob-card.ob-wide { width: min(820px, 100%); }
.ob-coaches { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* the coach's first words */
.ob-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.ob-note-pic { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; flex: none; }
.ob-note b { font-size: 13px; }
.ob-note p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.ob-note .ob-wait { margin: 0; }
@media (max-width: 760px) { .ob-card.ob-two .ob-body { grid-template-columns: minmax(0, 1fr); } .ob-prev { position: static; } .ob-coaches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .onboard .si-runner, .si-pennant { transition: none; } }

/* the climb: the steps on an elevation profile, the runner glides up to the summit flag at Ready */
.ob-card .ob-steps { display: none; }
.ob-climb { margin: 4px 0 6px; }
.ob-climb-art { position: relative; height: 56px; }
.ob-climb svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ob-climb-fill { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.ob-climb-line { fill: none; stroke: var(--border); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ob-climb-done { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ob-climb-art > span { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.ob-climb-art > .ob-climb-steps { inset: 0; width: auto; height: auto; }
.ob-climb-steps i { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--border); }
.ob-climb-steps i.done { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.ob-climb-steps i.now { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--surface); box-shadow: 0 0 0 2.5px var(--accent); }
.ob-climb-me::before { content: ""; position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 26%, transparent); animation: si-pulse 1.1s ease-in-out infinite; }
.ob-climb-me::after { content: ""; position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.ob-climb-flag i { position: absolute; left: 0; bottom: 0; width: 2px; height: 24px; margin-left: -1px; background: var(--ink-2); border-radius: 1px; }
.ob-climb-flag b { position: absolute; left: 1px; bottom: 13px; width: 16px; height: 11px; background: var(--muted); clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform-origin: 0 50%; transform: scaleX(.4); transition: transform .7s cubic-bezier(.3, 1.5, .5, 1) .9s, background .3s ease .9s; }
.ob-climb.summit .ob-climb-flag b { transform: scaleX(1); background: var(--good); }
.ob-climb-labels { list-style: none; margin: 0; padding: 0; position: relative; height: 16px; }
.ob-climb-labels li { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ob-climb-labels li:first-child { transform: none; } .ob-climb-labels li:last-child { transform: translateX(-100%); }
.ob-climb-labels li.done { color: var(--ink-2); }
.ob-climb-labels li.now { color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ob-climb-me::before { animation: none; } .ob-climb-flag b { transition: none; } }

/* welcome flow form v2: clear fields, the goal race as a card, chips, a slider, errors where they belong */
.ob-q .fld { display: grid; gap: 6px; }
.ob-q .fld > span:first-child, .ob-q fieldset > legend { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.ob-q .opt { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 4px; font-size: 12px; }
.ob-q input:not([type=radio]):not([type=checkbox]):not([type=range]), .ob-q select {
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--ink) 16%, var(--border)); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease; }
.ob-q input:not([type=radio]):not([type=checkbox]):not([type=range]):hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--border)); }
.ob-q input:not([type=radio]):not([type=checkbox]):not([type=range]):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ob-q input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.ob-q .fld.bad input { border-color: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 14%, transparent); }
.fld-err { font-size: 12.5px; color: var(--crit-text); font-weight: 500; }
.fld-err:empty, .fld-help:empty { display: none; }
.fld-help { font-size: 12.5px; color: var(--muted); }
.fld-help.warn { color: var(--warn-text); }
.ob-racecard { display: grid; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgb(16 24 40 / .04); }
.ob-rc-head { display: flex; align-items: center; gap: 10px; }
.ob-rc-head .ob-flag { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
.ob-rc-head b { font-size: 15px; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-chip { cursor: pointer; }
.ob-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ob-chip span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all .12s ease; }
.ob-chip:hover span { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ob-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); font-weight: 600; }
.ob-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-dists { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -4px; font-size: 12.5px; }
.ob-dists:empty { display: none; }
.ob-dists .dim { margin-right: 2px; }
.ob-dchip { border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); background: none; color: var(--accent-text); border-radius: 999px; padding: 4px 10px; font: 600 12px var(--f-body); cursor: pointer; }
.ob-dchip:hover { background: var(--accent-tint); border-style: solid; }
.ob-others-h { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.ob-others-h b { font-size: 14px; } .ob-others-h .dim { font-size: 12px; }
.ob-rrow { grid-template-columns: 1.4fr 1.15fr .85fr auto auto; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.ob-pri { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.ob-pri label { cursor: pointer; }
.ob-pri input { position: absolute; opacity: 0; pointer-events: none; }
.ob-pri span { display: block; padding: 6px 9px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ob-pri span b { color: var(--ink-2); }
.ob-pri input:checked + span { background: var(--accent-tint); color: var(--ink); } .ob-pri input:checked + span b { color: var(--accent-text); }
.ob-pri input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.ob-addrow { width: 100%; padding: 11px; border: 1.5px dashed color-mix(in srgb, var(--ink) 18%, var(--border)); border-radius: 12px; background: none; color: var(--ink-2); font: 600 13.5px var(--f-body); cursor: pointer; }
.ob-addrow:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-tint); }
/* training time */
.ob-hours { gap: 8px; }
.ob-hours-v { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ob-hours-v output { font: 800 40px/1 var(--f-display); color: var(--accent-text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ob-hours-v > span { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.ob-hours-v .ob-per { flex-basis: 100%; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ob-per:empty { display: none; }
.ob-hours input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; margin: 6px 0 0;
  background: linear-gradient(90deg, var(--accent) var(--fill, 20%), var(--surface-2) var(--fill, 20%)); }
.ob-hours input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: 0 2px 6px rgb(0 0 0 / .18); cursor: grab; }
.ob-hours input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); cursor: grab; }
.ob-hours input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.ob-hours-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.ob-suggest { justify-self: start; border: 0; background: var(--wash); border-radius: 999px; padding: 6px 12px; font: 500 12.5px var(--f-body); color: var(--ink-2); cursor: pointer; }
.ob-suggest:hover { background: var(--accent-tint); color: var(--ink); }
.ob-q fieldset.ob-days legend { margin-bottom: 7px; }
/* footer: where you are among the questions */
.ob-qnav { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.ob-qdots { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; }
.ob-qdots li { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.ob-qdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.ob-qdots li.done i { background: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.ob-qdots li.now { color: var(--ink); font-weight: 700; } .ob-qdots li.now i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
@media (max-width: 760px) { .ob-qdots li:not(.now) { font-size: 0; gap: 0; } .ob-rrow { grid-template-columns: 1fr 1fr; } }
.ob-q .ob-row3 { align-items: start; }
.ob-q .ob-row3 .fld > span:first-child { white-space: nowrap; }
/* a tall card scrolls with the page; a short one stays centred */
.signin.onboard { display: block; overflow-y: auto; }
.signin.onboard .si-scene { position: fixed; }
.ob-shell { min-height: 100%; padding: 20px 0; box-sizing: border-box; }
.ob-qnav [data-go] { white-space: nowrap; }
.ob-rrow { grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) auto auto; grid-template-areas: "name name name x" "date km pri pri"; row-gap: 6px; }
.ob-rrow [name=name] { grid-area: name; } .ob-rrow [name=date] { grid-area: date; } .ob-rrow .ob-unit { grid-area: km; }
.ob-rrow .ob-pri { grid-area: pri; justify-self: end; } .ob-rrow .ob-x { grid-area: x; }
@media (max-width: 760px) { .ob-rrow { grid-template-columns: 1fr 1fr; grid-template-areas: "name x" "date km" "pri pri"; } .ob-rrow .ob-pri { justify-self: start; } }
.ob-q fieldset.ob-days { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-q fieldset.ob-days legend { width: 100%; }

/* planning the season with the coach (welcome flow): the conversation left, the proposal right */
.ob-convo { display: grid; gap: 16px; align-content: start; max-height: min(52vh, 560px); overflow-y: auto; padding: 4px 4px 4px 0; overscroll-behavior: contain; }
.ob-convo .turn.user .bubble { max-width: 88%; }
.ob-convo .turn.user.brief .bubble { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.ob-convo .turn.user.brief .bubble b { display: block; color: var(--ink); margin-bottom: 2px; }
.ob-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.ob-ask textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; resize: vertical; min-height: 44px; }
.ob-ask textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ob-alt { margin: 0; }
.ob-alt[hidden] { display: none; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent-text, var(--accent)); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.ob-prev-next { margin: 4px 0 0; }
.ob-prop-hours { margin: 2px 0 0; display: grid; gap: 2px; }
.ob-prop-hours b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ob-prop-hours span.dim { font-size: 12px; color: var(--muted); }
.ob-prop-sum { margin: 0; font-size: 13.5px; line-height: 1.5; }
.ob-prop-phases { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ob-prop-phases b { color: var(--ink); }
.ob-prop-list b { font-size: 12.5px; }
.ob-prop-list ul { margin: 3px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ob-card.ob-two .ob-prev { max-height: calc(100vh - 140px); overflow-y: auto; }


/* ---------------------------------------------------------------- phones: tab bar, compact top bar, one column */
.tabbar { display: none; }
.dn-dow { display: none; }
@media (max-width: 760px) {
  :root { --banner-h: 56px; --tabbar-h: 60px; }
  .side { display: none; }
  .shell { grid-template-columns: 1fr; min-height: calc(100vh - var(--banner-h)); }
  main { padding: 16px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); gap: 18px; }
  /* top bar: the logo, the numbers sliding sideways, your photo */
  .telemetry { position: sticky; top: 0; padding-top: env(safe-area-inset-top); height: calc(var(--banner-h) + env(safe-area-inset-top)); overflow: hidden; }
  .telemetry .brand { width: auto; padding: 0 12px 0 14px; border-right: 0; }
  .telemetry .brand .lbl { display: none; }
  .t-data { overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .t-data::-webkit-scrollbar { display: none; }
  .t-seg { padding: 0 14px; scroll-snap-align: start; }
  .t-me { padding: 0 10px 0 6px; }
  .t-me .t-me-text, .t-me .t-me-car { display: none; }
  /* the sections, at the bottom */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted); font: 600 10.5px var(--f-body); letter-spacing: .01em; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--accent-text, var(--accent)); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2.2; }
  .tabbar a:active { transform: scale(.94); }
  /* headings and tabs that slide sideways instead of spilling out */
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head h1 { font-size: 26px; }
  .subtabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; flex-wrap: nowrap; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs a { flex: none; }
  .me-menu { width: min(280px, calc(100vw - 16px)); }
  .me-menu [role=menuitem] { padding: 11px 12px; }
  /* things that float above the page keep clear of the tab bar */
  .app-toast, .coach-dock { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .coach-dock { right: 10px; width: calc(100vw - 20px); }
}

/* phones: the calendar. Week = the days as a list (each in full), then the week summary; month = a compact grid
   where sessions are coloured bars and a tap opens that week */
@media (max-width: 760px) {
  #cal-lib, .cal-legend .bar.outline { display: none; }
  .sec-head .controls { flex-wrap: wrap; gap: 6px; }
  .cal-legend { gap: 4px 12px; font-size: 11.5px; }
  .cal-scroll { overflow: visible; }
  .cal.cal-week { display: flex; flex-direction: column; min-width: 0; gap: 0; background: none; border: 0; border-radius: 0; overflow: visible; }
  .cal.cal-week .hd { display: none; }
  .cal.cal-week .day { min-height: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; gap: 8px; }
  .cal.cal-week .day.empty { padding: 8px 12px; flex-direction: row; align-items: center; }
  .cal.cal-week .day .dn { font-size: 14px; }
  .cal.cal-week .dn-dow { display: inline; color: var(--muted); font-weight: 700; }
  .cal.cal-week .day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
  .cal.cal-week .day.out { opacity: .65; }
  .cal.cal-week .day-add { position: absolute; right: 10px; top: 8px; opacity: 1; }
  .cal.cal-week .day { position: relative; }
  .cal.cal-week .mcard { flex-direction: row; flex-wrap: wrap; }
  .cal.cal-week .wk { display: grid; border: 1px solid var(--border); border-radius: 12px; margin: 4px 0 18px; padding: 12px 14px; }
  .cal.cal-week .wcard { width: 100%; }
  /* month: compact grid */
  .cal:not(.cal-week) { grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 0; }
  .cal:not(.cal-week) .wk, .cal:not(.cal-week) .hd.wkh { display: none; }
  .cal:not(.cal-week) .hd { padding: 6px 0; text-align: center; font-size: 9.5px; letter-spacing: .04em; }
  .cal:not(.cal-week) .day { min-height: 58px; padding: 4px 3px; gap: 3px; cursor: pointer; }
  .cal:not(.cal-week) .day-add, .cal:not(.cal-week) .mcard, .cal:not(.cal-week) .pill, .cal:not(.cal-week) .w-more { display: none; }
  .cal:not(.cal-week) .dn { font-size: 11px; text-align: center; }
  .cal:not(.cal-week) .dn-today { display: none; }
  .cal:not(.cal-week) .dn.is-today { justify-self: center; align-self: center; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
  .cal:not(.cal-week) .day.today { outline: 0; box-shadow: none; }
  .cal:not(.cal-week) .wc-wrap { pointer-events: none; }
  .cal:not(.cal-week) .wcard { display: block; height: 5px; padding: 0; border-radius: 3px; overflow: hidden; font-size: 0; background: var(--sc, var(--accent)); border: 0; }
  .cal:not(.cal-week) .wcard.wc-planned { background: none; box-shadow: inset 0 0 0 1.5px var(--sc, var(--accent)); }
  .cal:not(.cal-week) .wcard > * { display: none; }
  .cal:not(.cal-week) .ecard { font-size: 0; padding: 0; text-align: center; }
  .cal:not(.cal-week) .ecard b { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; }
}

/* phones: the dashboard's widgets take their content's height; Ask Coach fills the screen between the bars */
@media (max-width: 760px) {
  .dash-grid .dw { min-height: 0 !important; }
  .dw-resize { display: none; }
  main:has(.coach-app) { padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .coach-app { height: calc(100dvh - var(--banner-h) - var(--tabbar-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0; border: 0; border-radius: 0; }
  .c-chat-head { padding: 8px 12px; gap: 8px; }
  .c-chat-head > .ava { width: 36px; height: 36px; margin-right: 0; }
  .c-chat-head h2 { font-size: 15px; }
  .c-chat-head .c-with { display: none; }
  .c-chat-head .btn { padding: 6px 10px; font-size: 13px; }
  .c-hint { display: none; }
  .ob-coach .coach-app { height: min(56vh, 560px); }
}

/* phones: dashboard pages as chips; Ask Coach's past conversations */
.dash-tabs, .c-past-btn { display: none; }
@media (max-width: 760px) {
  .dash-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px -14px 0; padding: 0 14px 2px; }
  .dash-tabs::-webkit-scrollbar { display: none; }
  .dash-tabs a { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .dash-tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .dash-tabs a.dt-new { border-style: dashed; color: var(--accent-text, var(--accent)); background: none; }
  .c-past-btn { display: inline-flex; }
  .c-past-panel { max-height: 50vh; overflow-y: auto; border-bottom: 1px solid var(--border); background: var(--surface-2); display: grid; grid-template-columns: minmax(0, 1fr); }
  .c-past-panel[hidden] { display: none; }
  .c-past-panel a { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--grid); color: var(--ink); text-decoration: none; font-size: 14px; }
  .c-past-panel a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .c-past-panel a small { flex: none; color: var(--muted); font-size: 12px; }
  .c-past-panel a.on { font-weight: 700; }
  .c-past-empty { margin: 0; padding: 14px 16px; display: flex; gap: 8px; align-items: center; }
}

/* phones: iPhone zooms into any field under 16px when you tap it; the welcome climb's step names stay apart */
@media (max-width: 760px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select { font-size: 16px !important; }
  .ob-climb-labels li { font-size: 10px; }
}

/* phones: the compact performance chart's end labels */
.pmc-compact .pmc-end-v { font: 700 13px var(--f-body); font-variant-numeric: tabular-nums; }
.pmc-compact .pmc-end-n { font: 500 10.5px var(--f-body); }
.pmc-compact .pmc-zone { fill: var(--ink-2); font-size: 9.5px; }
.pmc-compact .pmc-zone { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }

/* phones: the top bar as one calm row. The logo sits on the bar itself (no dark block); the numbers slide sideways,
   Form first (the daily "am I fresh?"), each a small label over its value, no third line; your photo at the end */
@media (max-width: 760px) {
  .telemetry { align-items: center; }
  .telemetry .brand { background: none; color: var(--banner-ink); padding: 0 6px 0 14px; height: 100%; }
  .telemetry .brand { --logo: var(--accent); }
  .telemetry .brand .brand-mark { width: 26px; height: 26px; }
  .t-data { align-self: stretch; }
  .t-seg, .telemetry button.t-seg { padding: 0 12px; gap: 1px; border-right: 0; position: relative; }
  .t-seg + .t-seg::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--banner-line); }
  .t-seg .micro { font-size: 10px; letter-spacing: .02em; max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t-val, .t-race .t-val { font-size: 17px; }
  .t-val small { font-size: 10.5px; }
  .t-sub, .t-status, .t-sync { display: none; }
  .t-seg[data-pop="tsb"] { order: -3; } .t-seg[data-pop="ctl"] { order: -2; } .t-seg[data-pop="atl"] { order: -1; }
  .t-me { align-self: center; height: 44px; padding: 0 12px 0 8px; border-left: 0; }
  .t-me .ava-top { width: 32px; height: 32px; }
}

/* phones: Settings as a phone settings screen. The list: you on top, then grouped rows (name, current value,
   chevron), the tour at the end. A section: its own screen with "‹ Settings" back; rows stack their control under
   their words */
.sp-me, .sp-back { display: none; }
@media (max-width: 760px) {
  .sp { display: block; }
  .sp-top { padding-bottom: 10px; margin-bottom: 14px; }
  .sp-list .sp-main, .sp-detail .sp-nav, .sp-detail .sp-top { display: none; }
  .sp-list .sp-me { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); text-decoration: none; color: var(--ink); }
  .sp-me .ava { width: 52px; height: 52px; font-size: 18px; }
  .sp-me span { display: grid; gap: 2px; min-width: 0; }
  .sp-me b { font-size: 17px; }
  .sp-me small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sp-list .sp-nav { position: static; display: grid; gap: 20px; }
  .sp-list .sp-group { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
  .sp-list .sp-g { display: flex; align-items: center; gap: 6px; padding: 10px 16px 6px; font-size: 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  .sp-list .sp-g svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .sp-list .sp-nav a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t c" "s c"; align-items: center; gap: 1px 10px;
    min-height: 52px; padding: 10px 14px 10px 16px; border: 0; border-radius: 0; border-left: 0; background: none; color: var(--ink); }
  .sp-list .sp-nav a + a { border-top: 1px solid var(--grid); }
  .sp-list .sp-nav a::after { content: ""; grid-area: c; width: 8px; height: 8px; border: solid var(--muted); border-width: 2px 2px 0 0; transform: rotate(45deg); }
  .sp-list .sp-nav a.on { background: none; }
  .sp-list .sp-t { grid-area: t; font-size: 15.5px; font-weight: 600; }
  .sp-list .sp-sum { display: block; grid-area: s; font-size: 13px; }
  .sp-list .sp-sum:empty { display: none; }
  .sp-list .sp-nav a.on { border-left: 0; background: none; }
  .sp-list .sp-group { padding: 0; margin: 0; }
  .sp-list .sp-g { margin: 0; }
  .sp-list .sp-tour { display: grid; gap: 8px; padding: 16px; border-radius: 14px; }
  /* one section */
  .sp-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: -6px 0 6px -4px; padding: 0 4px; font-weight: 600; font-size: 15px;
    color: var(--accent-text, var(--accent)); text-decoration: none; }
  .sp-back::before { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
  .sp-head { margin-bottom: 14px; }
  .sp-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
  .sgroup { border-radius: 14px; }
  .srow { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  .srow-l { max-width: none; }
  .srow-l b { font-size: 15px; }
  .srow-l span { font-size: 13.5px; }
  .srow-r { flex-wrap: wrap; }
  .srow-r .btn { min-height: 42px; }
  .sp-body .table-wrap { overflow-x: auto; }
}

/* phones: the calendar week as a strip of days, the week on one line, then the chosen day */
@media (max-width: 760px) {
  .cal-legend { display: none; }
  .cal-phone { display: grid; gap: 12px; }
  .cp-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
  .cp-d { display: grid; justify-items: center; gap: 2px; padding: 6px 0 7px; min-height: 64px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .cp-dow { font-size: 11px; font-weight: 600; color: var(--muted); }
  .cp-n { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
  .cp-d.past .cp-n { color: var(--ink-2); }
  .cp-d.today .cp-n { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text, var(--accent)); }
  .cp-d[aria-selected="true"] { background: var(--accent-tint, color-mix(in srgb, var(--accent) 12%, transparent)); }
  .cp-d[aria-selected="true"] .cp-n { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
  .cp-d:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  /* a day's sessions as small bars, coloured by how they went (planned ones outlined) */
  .cp-ms { display: flex; flex-direction: column; gap: 2px; width: 22px; min-height: 12px; }
  .cp-m { display: block; height: 4px; border-radius: 2px; background: var(--axis); }
  .cp-m.good { background: var(--good); } .cp-m.warn { background: var(--warn); } .cp-m.crit { background: var(--crit); }
  .cp-m.planned { background: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
  .cp-m.race { background: var(--ink); height: 5px; }
  /* the week on one line */
  .cp-week { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
  .cp-wk-t { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
  .cp-wk-t .sa-edit, .cp-wk-t .ws-tools { display: none; }
  .cp-wk-h { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
  .cp-wk-h b { font: 700 16px var(--f-body); color: var(--ink); font-variant-numeric: tabular-nums; }
  .cp-wk-h .ws-ahead { display: none; }
  .cp-week .ws-bar { display: block; grid-column: 1 / -1; --c: var(--accent); }
  .cp-wk-more { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--accent-text, var(--accent)); }
  .cp-sum[hidden] { display: none; }
  .cp-sum .wk { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
  /* the chosen day */
  .cal-phone .day { display: grid; gap: 10px; min-height: 0; padding: 0; border: 0; background: none; opacity: 1; }
  .cal-phone .day[hidden] { display: none; }
  .cal-phone .day > .dn, .cal-phone .day > .day-add { display: none; }
  .cp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .cp-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
  .cp-add { min-height: 38px; }
  .cal-phone .mcard { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; border: 0; background: none; font-size: 13px; color: var(--muted); }
  .cal-phone .m-chip { background: none; padding: 0; }
  .cal-phone .wc-wrap { position: relative; }
  .cal-phone .wcard { display: grid; gap: 6px; width: 100%; padding: 14px 44px 14px 16px; border-radius: 14px; font-size: 14px; }
  .cal-phone .w-title { font-size: 15.5px; font-weight: 700; white-space: normal; }
  .cal-phone .w-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .cal-phone .w-more { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; opacity: 1; }
  .cal-phone .ecard { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
  .cp-rest { margin: 0; padding: 22px 16px; border: 1px dashed var(--border); border-radius: 14px; text-align: center; color: var(--muted); font-size: 14px; }
}
@media (max-width: 760px) { .cp-sum .ws-hours { display: none; } }

/* the page column is the screen's width at most: wide content (stats, tables, charts) wraps or scrolls inside it */
main { grid-template-columns: minmax(0, 1fr); }
main > * { min-width: 0; }
.card, .card > * { min-width: 0; }
.tbl, .table-wrap { max-width: 100%; overflow-x: auto; }

/* planning the season on a phone: a full-screen chat (the conversation scrolls, the message box stays at the bottom);
   the coach's season opens as a sheet over it */
.ob-sheet-bar, .ob-sheet-go, .ob-see { display: none; }
@media (max-width: 760px) {
  .signin:has(.ob-chat) { padding: 0; place-items: stretch; }
  .signin:has(.ob-chat) .ob-shell { padding: 0; min-height: 0; height: 100dvh; place-items: stretch; }
  .ob-card.ob-chat { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; gap: 6px;
    padding: calc(10px + env(safe-area-inset-top)) 0 0; overflow: hidden; }
  .ob-card.ob-chat > .si-brand { padding: 0 14px; }
  .ob-card.ob-chat .ob-climb, .ob-card.ob-chat .ob-left { display: none; }
  .ob-card.ob-chat .ob-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; }
  .ob-card.ob-chat .ob-q { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  .ob-card.ob-chat .ob-q > h1 { padding: 0 14px; font-size: 19px; }
  .ob-card.ob-chat .ob-q > .si-sub { display: none; }
  .ob-card.ob-chat .ob-convo { flex: 1; min-height: 0; max-height: none; padding: 6px 14px 10px; }
  .ob-card.ob-chat .ob-convo .turn.assistant { grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px; }
  .ob-card.ob-chat .ob-convo .turn.assistant > .ava { width: 28px; height: 28px; }
  .ob-card.ob-chat .ob-convo .md { font-size: 15px; line-height: 1.5; }
  .ob-see:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 14px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--ink); font: inherit; cursor: pointer; }
  .ob-see span { font-size: 13px; font-weight: 600; color: var(--accent-text, var(--accent)); }
  .ob-see b { font-size: 14px; font-variant-numeric: tabular-nums; }
  .ob-see.fresh { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
  @media (prefers-reduced-motion: no-preference) { .ob-see.fresh { animation: ob-see-new 900ms ease-out 2; } }
  .ob-card.ob-chat .ob-ask { padding: 8px 14px 0; border-top: 1px solid var(--border); background: var(--surface); }
  .ob-card.ob-chat .ob-ask textarea { min-height: 44px; max-height: 30dvh; }
  .ob-card.ob-chat .ob-qnav { padding: 6px 14px calc(8px + env(safe-area-inset-bottom)); margin: 0; border: 0; background: var(--surface); }
  .ob-card.ob-chat .ob-qnav [data-go] { display: none; }
  .ob-card.ob-chat .ob-qnav .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  /* the sheet */
  .ob-card.ob-chat .ob-prev { position: fixed; inset: 0; z-index: 5; max-height: none; border-radius: 0; border: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--surface); overflow-y: auto; transform: translateY(100%); visibility: hidden; transition: transform 220ms ease, visibility 0s 220ms; }
  .ob-card.ob-chat .ob-prev.open { transform: none; visibility: visible; transition: transform 240ms ease; }
  .ob-card.ob-chat .ob-sheet-bar { display: flex; position: sticky; top: 0; z-index: 1; align-items: center; justify-content: space-between; gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 0 10px; background: var(--surface); border-bottom: 1px solid var(--border); margin-bottom: 10px; }
  .ob-card.ob-chat .ob-sheet-bar .btn { font-size: 13px; padding: 6px 10px; }
  .ob-card.ob-chat .ob-prev-body { display: grid; gap: 10px; }
  .ob-card.ob-chat .ob-sheet-go { display: block; position: sticky; bottom: 0; padding: 12px 0 0; background: var(--surface); }
  .ob-card.ob-chat .ob-sheet-go .btn { width: 100%; }
  @media (prefers-reduced-motion: reduce) { .ob-card.ob-chat .ob-prev, .ob-card.ob-chat .ob-prev.open { transition: none; } }
}
@keyframes ob-see-new { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (max-width: 760px) {
  .ob-card.ob-chat .ob-q > h1 { order: -1; }
  .ob-card.ob-chat .ob-convo { order: 0; }
  .ob-card.ob-chat .ob-see { order: 1; margin-top: 6px; }
  .ob-card.ob-chat .ob-ask { order: 2; }
  .ob-card.ob-chat .ob-qnav { order: 3; padding-top: 2px; }
  .ob-card.ob-chat .ob-qnav .btn { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }
  .ob-card.ob-chat .ob-prev-body > .ob-prev-h { display: none; }
  .ob-card.ob-chat .ob-ask textarea { min-height: 44px; height: 44px; }
}

/* leaving the welcome flow (taken through it again): a quiet "Finish later" in the card's top-right corner */
.ob-card { position: relative; }
.ob-exit { position: absolute; top: 16px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 8px;
  border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 13px var(--f-body); cursor: pointer; }
.ob-exit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ob-exit:hover { background: var(--wash); color: var(--ink); }
.ob-exit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-card:has(.ob-exit) .ob-climb { margin-top: 10px; }
@media (max-width: 760px) {
  .ob-exit { top: calc(8px + env(safe-area-inset-top)); right: 8px; }
}

/* phones: the plan library as a list of plans */
.plib { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plib-row { position: relative; display: grid; gap: 4px; padding: 14px 40px 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--ink); text-decoration: none; }
.plib-row::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border: solid var(--muted); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.plib-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plib-top b { font-size: 16px; }
.plib-dates { font-size: 14px; font-variant-numeric: tabular-nums; }
.plib-meta { font-size: 13px; color: var(--muted); }
.plib-races { font-size: 13px; line-height: 1.5; padding-top: 4px; border-top: 1px solid var(--grid); margin-top: 4px; }

/* the admin dashboard */
.spill.bad { color: var(--crit-text); background: color-mix(in srgb, var(--crit) 12%, transparent); }
.spill:not(.ok):not(.bad) { color: var(--muted); background: var(--wash); }
.adm-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.adm-head.good { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.adm-head.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.adm-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 18%, transparent); }
.adm-head.warn .adm-dot { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent); }
.adm-head div { display: grid; gap: 3px; }
.adm-head b { font-size: 16px; }
.adm-head span { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.adm-people { list-style: none; margin: 0; padding: 0; }
.adm-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; }
.adm-person + .adm-person { border-top: 1px solid var(--border); }
.adm-who { display: grid; gap: 2px; min-width: 0; }
.adm-who b { font-size: 14.5px; }
.adm-who > span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.adm-role { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-tint, color-mix(in srgb, var(--accent) 14%, transparent)); color: var(--accent-text, var(--accent)); vertical-align: 2px; }
.adm-facts { white-space: normal; line-height: 1.45; }
.adm-problems { display: grid; }
.adm-prob { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 16px; font-size: 12.5px; align-items: baseline; }
.adm-prob + .adm-prob { border-top: 1px solid var(--grid); }
.adm-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.adm-lvl { font-weight: 700; color: var(--warn-text); }
.adm-prob.error .adm-lvl, .adm-prob.critical .adm-lvl { color: var(--crit-text); }
.adm-msg { overflow-wrap: anywhere; color: var(--ink-2); }
.adm-none { margin: 0; padding: 14px 16px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .adm-head { grid-template-columns: auto minmax(0, 1fr); }
  .adm-head .btn { grid-column: 1 / -1; justify-self: start; }
  .adm-person { grid-template-columns: auto minmax(0, 1fr); }
  .adm-person .spill { grid-column: 2; justify-self: start; }
  .adm-prob { grid-template-columns: auto minmax(0, 1fr); }
  .adm-msg { grid-column: 1 / -1; }
  .adm-strip { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .adm-s-r { text-align: left; }
  .adm-axis { grid-template-columns: minmax(0, 1fr); }
  .adm-axis > span:first-child, .adm-axis > span:last-child { display: none; }
}

/* the admin dashboard: 24-hour strips (an hour a square), coach activity, grouped problems */
.adm-board { display: grid; gap: 10px; padding: 14px 16px; }
.adm-strip { display: grid; grid-template-columns: 136px minmax(0, 1fr) 210px; gap: 12px; align-items: center; }
.adm-s-l { font-size: 13.5px; font-weight: 600; }
.adm-s-r { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.adm-cells { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.adm-c { display: block; height: 22px; min-width: 0; padding: 0; border: 0; border-radius: 3px; background: var(--good); cursor: pointer; }
.adm-c.warn { background: var(--warn); }
.adm-c.bad { background: var(--crit); }
.adm-c.off { background: var(--wash); box-shadow: inset 0 0 0 1px var(--grid); }
.adm-c:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.adm-cells .adm-c:hover { filter: brightness(1.12); transform: scaleY(1.12); }
.adm-axis { display: grid; grid-template-columns: 136px minmax(0, 1fr) 210px; gap: 12px; margin-top: -4px; }
.adm-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.adm-note { margin: 2px 0 0; min-height: 18px; font-size: 12.5px; color: var(--ink-2); }
.adm-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.adm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.adm-legend .adm-c { width: 10px; height: 10px; border-radius: 2px; cursor: default; }
.adm-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 132px; padding: 14px 16px 10px; }
.adm-day { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; justify-items: center; }
.adm-day b { align-self: end; width: 100%; max-width: 22px; border-radius: 4px 4px 1px 1px; background: var(--accent); }
.adm-day em { position: absolute; bottom: calc(18px + var(--h, 0px)); font: 600 10.5px var(--f-body); font-style: normal; color: var(--ink-2); display: none; }

.adm-day i { font: 600 10.5px var(--f-body); font-style: normal; color: var(--muted); padding-top: 4px; }
.adm-day.today i { color: var(--accent-text, var(--accent)); }
.adm-n { font-weight: 700; color: var(--ink-2); }
.adm-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) {
  .adm-board { padding: 12px 14px; }
  .adm-strip { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l r" "c c"; gap: 4px 10px; }
  .adm-s-l { grid-area: l; } .adm-s-r { grid-area: r; text-align: right; } .adm-cells { grid-area: c; }
  .adm-c { height: 18px; }
  .adm-axis { grid-template-columns: minmax(0, 1fr); }
  .adm-axis > span:first-child, .adm-axis > span:last-child { display: none; }
  .adm-days { gap: 3px; padding: 12px 10px 8px; }
}

/* no TrainingPeaks account yet: three steps, each with its action */
.tp-new { list-style: none; counter-reset: tpn; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.tp-new li { counter-increment: tpn; position: relative; display: grid; gap: 6px; justify-items: start; padding: 12px 14px 14px 52px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tp-new li::before { content: counter(tpn); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 700 13px var(--f-body); }
.tp-new b { font-size: 15px; }
.tp-new .opt { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.tp-new span { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.tp-new .btn { margin-top: 2px; }
.tp-new-note { margin: 10px 0 0; }
.tp-new a.btn { text-decoration: none; }
.tp-new .opt { margin-left: 4px; }
