@import url("tokens.64c6d21464c4.css");

/* Root text scale. Every font-size below is in rem, so this single number
   is the whole typography dial: the athlete asked for +25% on 2026-08-16,
   which is 125% of the browser's 16px default. Placed AFTER the @import: any
   rule above an @import voids it silently, taking every token with it — the
   whole theme collapsed for exactly that on 2026-08-16. Charts don't inherit
   this; the hyperion ECharts theme carries its own matching fontSize. */
html { font-size: 125%; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* Nav is a single flat row. No submenus, no sidebar, no third level —
   the one thing the user rejected was having to hunt (spec §4). Centred
   (2026-08-17); `safe` is load-bearing: plain `center` + overflow-x
   clips the leading links off-screen the moment the row overflows on a
   narrow viewport, with no way to scroll back to them. */
.nav {
  display: flex;
  gap: 4px;
  justify-content: safe center;
  padding: 8px var(--pad);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav a:hover { color: var(--text); background: var(--bg-raised); }

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-raised);
}

main { padding: var(--pad); max-width: 1100px; margin: 0 auto; }

h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 var(--pad); }

/* Login. The only page an unauthenticated visitor sees, so it is also the
   first impression of the theme — raw browser controls here would undo it. */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--pad);
}

.login-card {
  width: 100%;
  max-width: 320px;
}

.login-card h1 {
  font-size: 1.375rem;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

.login-card p { margin: 0 0 14px; }

.login-card label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card button {
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.login-card .errorlist {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  color: var(--state-low);
  font-size: 0.8125rem;
}

/* Today. Two columns on a phone, four across on a wide screen — the 2x2 is the
   shape the athlete asked for, and it survives both. */
.day { color: var(--text-muted); font-size: 0.8125rem; margin: 0 0 var(--pad); }

.dial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 760px) {
  .dial-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.dial-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 18px;
  text-align: center;
}

.dial-card h2 {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dial { max-width: 100%; height: auto; }
.dial-value { font: 600 30px/1 var(--font-num); fill: var(--text); }
.dial-sub { font: 400 11px/1 var(--font); fill: var(--text-muted); }

/* The readiness sub-scores under the dials (2026-09-07). Coloured by the
   engine's own signal — qualities, so the --state-* tokens, as on the dials. */
.dial-breakdown {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.dial-breakdown .sub { white-space: nowrap; }
.dial-breakdown .sub-green { color: var(--state-high); }
.dial-breakdown .sub-amber { color: var(--state-mid); }
.dial-breakdown .sub-red   { color: var(--state-low); }

.reading {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.reading li {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}

.reading li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.last-ride {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  padding: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}

.last-ride-when {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.last-ride-stats { font: 500 15px/1.3 var(--font-num); }

/* Training. */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--pad); }

.stat {
  flex: 1 1 100px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat-label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value { font: 600 24px/1.2 var(--font-num); }
.stat-value small { font-size: 0.75rem; color: var(--text-muted); }

.chart { width: 100%; height: 380px; }
@media (max-width: 640px) { .chart { height: 300px; } }

/* The tall-chart box shared by Power curve, Signature and VO2max. 730px is a
   CONTRACT, not a taste: training_power.html's signature panes are solved as
   exact integers against this height — change one, change both. Health's
   vitals chart used to share this class and outgrew it; since 2026-09-08 the
   template's vitalsHeight sizes #vitals from its pane count, and the class
   is only what the box measures before the load handler runs. */
.chart-tall { height: 730px; }
@media (max-width: 640px) { .chart-tall { height: 730px; } }

/* Load's PMC is the Training page's one chart; at .chart's 380px it filled
   half a viewport and left the rest dead. */
#pmc { height: 540px; }

/* Two panes (top 40 + 120, top 210 + 120) plus the slider. */
#body { height: 400px; }

/* One grid per compared metric: FIRST_TOP + 16 + N · (96 + 34), plus 56 for axis
   labels and the slider — so 100 + 130N. Fifteen metrics since 2026-08-30.
   This is no longer only a comment: test_compare_chart_height_tracks_the_metric_count
   fails if the two drift, which is how the 4 → 14 change was caught. */
#compare { height: 2050px; }

/* One line of prose explaining a discontinued series. Muted, because it is a
   footnote to the chart above it, not a warning. Bounded to a readable
   measure — unbounded, VO2max's intro ran the full viewport width. */
.note {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0 0 10px;
  max-width: 72ch;
}

/* Health. Reuses .stat-row/.stat from Training; a card can carry more than
   one line (Sleep: duration + score), so each gets its own .stat-line rather
   than assuming a single .stat-value per card. */
.stat-line { margin-top: 6px; }
.stat-line:first-of-type { margin-top: 2px; }

.stat-sublabel {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.stat-delta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Direction is only ever coloured when it is unambiguous — resting HR down
   and HRV/sleep up are "good", the reverse is "bad". Weight carries neither
   class (views.py never assigns one): the athlete has no target for it, and
   an unearned green or red would claim a verdict that isn't ours to make. */
/* A caveat that belongs to one metric, not to the row. Smaller and dimmer than
   .stat-delta because it qualifies the number rather than describing it — used
   by HRV, where the two devices report different computations under one label,
   and by SpO2, where each device defines its own sleep window. Rendered on the
   comparison tiles and beside a card's device delta. */
.stat-note {
  margin: 6px 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* The other wearable's reading for the same day, beside the headline one. Set
   apart, not hidden: the headline is what *_unified resolved to and what the
   derived metrics consumed, so the second must read as a companion rather than
   a competing figure. -absent is the dash for "only one device measured" —
   blank space would be indistinguishable from a device that read zero. */
.stat-second {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.stat-second small { opacity: 0.75; }
.stat-second-absent { opacity: 0.5; }

/* The device difference, beside the second reading. Never .stat-delta.good/.bad
   (views.py never assigns either) — a gap between two instruments is not a
   verdict the way a trend versus baseline is. Dimmed like the device name
   beside it (.stat-second small), not given its own colour. */
.stat-second-delta {
  color: var(--text-muted);
  opacity: 0.75;
  margin-left: 4px;
}

.stat-delta.good { color: var(--state-high); }
.stat-delta.bad  { color: var(--state-low); }

/* Rides. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: var(--pad);
}

.filters select,
.filters input[type="search"],
.filters button {
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
}

.filters button { background: var(--accent); color: var(--bg); font-weight: 600; border: 0; cursor: pointer; }
.filters .check { color: var(--text-muted); font-size: 0.8125rem; display: flex; align-items: center; gap: 6px; }
.filters .calendar-link { color: var(--accent); font-size: 0.8125rem; text-decoration: none; margin-left: 4px; }
.filters .calendar-link:hover { text-decoration: underline; }

/* A page that reads as complete when it is not is worse than one that says
   it truncated — this is the "Showing 200 of 416" notice. */
.rides-count { color: var(--text-muted); font-size: 0.8125rem; margin: 0 0 10px; }

/* The table is wider than a phone. Let it scroll inside its own box rather
   than pushing the page sideways. */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.rides-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rides-table th, .rides-table td { padding: 9px 12px; white-space: nowrap; }
.rides-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  color: var(--text-muted);
  font: 600 11px/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}
.rides-table thead th a { color: inherit; text-decoration: none; }
.rides-table th.num, .rides-table td.num { text-align: right; font-family: var(--font-num); }
.rides-table tbody tr:nth-child(even) { background: var(--bg-raised); }
.rides-table td a { color: var(--accent); text-decoration: none; }
.rides-table td.name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.rides-table .caret { margin-left: 4px; }
.rides-table .empty { text-align: center; color: var(--text-muted); padding: 24px; }

/* A hue ramp, not the --state-* tokens. Those mean "how you are" — green good,
   red bad — and zone 7 is not a bad thing that happened to you, it is where
   you chose to ride. Reusing them here would make a hard interval look like a
   warning. */
.zones { display: flex; flex-direction: column; gap: 6px; }
.zone-row { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; }
.zone-name { font-size: 0.75rem; color: var(--text-muted); }
.zone-name small { opacity: 0.7; }
.zone-bar { background: var(--bg-sunken); border-radius: 4px; height: 16px; overflow: hidden; }
.zone-bar i { display: block; height: 100%; border-radius: 4px; background: var(--effort); }
.zone-bar i[data-zone="1"] { opacity: 0.30; }
.zone-bar i[data-zone="2"] { opacity: 0.42; }
.zone-bar i[data-zone="3"] { opacity: 0.55; }
.zone-bar i[data-zone="4"] { opacity: 0.68; }
.zone-bar i[data-zone="5"] { opacity: 0.80; }
.zone-bar i[data-zone="6"] { opacity: 0.90; }
.zone-bar i[data-zone="7"] { opacity: 1.00; }
.zone-time { font-size: 0.75rem; color: var(--text-muted); text-align: right; }

h2.section {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 10px;
}

/* Nutrition. The macros carry no --state-* token: there is no target, so
   there is no good or bad value to colour. The two substance cards are the
   page's one sanctioned exception (athlete-approved 2026-08-17): alcohol
   ramps through an inline hsl() between 16 and 28 g/day and both cards read
   .over-ref past their reference safe value. That exception is scoped to
   .substance-cards — never colour a macro. */
.macro-cards, .substance-cards {
  display: grid;
  gap: 12px;
  max-width: 520px;
}
.macro-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.substance-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }

.intake-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px 14px;
  text-align: center;
}
.intake-card h3 {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.intake-card .intake-value { margin: 0; font: 600 1.375rem/1.3 var(--font-num); }
.intake-card-small .intake-value { font-size: 1.125rem; }
.intake-card .intake-sub, .intake-card .intake-ref {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.intake-card .intake-ref { font-size: 0.6875rem; opacity: 0.8; }
/* Doubled selector on purpose: .intake-card .intake-sub sets a muted
   colour at two-class specificity, which a bare .over-ref (one class)
   silently loses to — the 414 mg day rendered grey. Keep this at least
   as specific as any colour rule inside the card. */
.intake-card .over-ref, .over-ref { color: var(--state-low); }

.intake-total { margin: 12px 0 0; max-width: 520px; }
.intake-total small { color: var(--text-muted); }
.empty { color: var(--text-muted); }

.foods {
  border-collapse: collapse;
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.foods td { padding: 7px 14px; border-top: 1px solid var(--border); }
.foods tr:first-child td { border-top: 0; }
.foods .food-meal {
  color: var(--text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.foods .food-name { width: 100%; }
.foods .num, .foods .food-macros {
  text-align: right;
  font-family: var(--font-num);
  white-space: nowrap;
}
.foods .food-macros { color: var(--text-muted); }
.foods .muted { color: var(--text-muted); }

/* Two panes (top 40 + 110, top 200 + 110) plus axis labels and the slider. */
#balance { height: 390px; }

/* Sub-view selector: Training's metric tabs, and Racing's Routes/Segments
   toggle. Shared, not Training-specific — the class name predates Racing.
   A segmented control (2026-08-17): sunken rail, raised active pill — the
   same raised-on-sunken language as the top nav's current page and the
   day-nav's arrows, so the three switchers read as one family. */
.viewnav {
  display: flex;
  width: fit-content;
  gap: 2px;
  margin: 0 auto var(--pad);
  padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
}
.viewnav a, .viewnav-active {
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.viewnav a { color: var(--text-muted); text-decoration: none; }
.viewnav a:hover { color: var(--text); }
.viewnav-active {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  /* The rail's 3px padding minus this border keeps every label on one
     baseline; without it the active pill sits 1px taller than its
     neighbours. */
  margin: -1px;
}

/* Time in zone. No --state-* here: there is no good or
   bad distribution. */
.zone-table {
  border-collapse: collapse;
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--pad);
}
.zone-table th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
}
.zone-table td { padding: 7px 12px; border-top: 1px solid var(--border); }
.zone-table .num { text-align: right; font-family: var(--font-num); white-space: nowrap; }
.zone-table .num small { color: var(--text-muted); margin-left: 6px; }
.zone-table .zone-total td { font-weight: 600; }

.bands { display: grid; gap: 8px; max-width: 560px; }
.band { display: grid; grid-template-columns: 90px 1fr 110px; gap: 12px; align-items: center; }
.band-label { font-size: 0.75rem; color: var(--text-muted); }
.band-value { font: 500 13px/1 var(--font-num); text-align: right; }
.band-value small { color: var(--text-muted); margin-left: 6px; }

/* The predictor is a plain GET form — the answer is a page, not a fetch, so it
   survives a reload and can be linked to. */
.predictor {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.predictor input[type="number"] {
  width: 8ch;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--text);
  font-family: var(--font-num);
}

.predictor button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
}

.predict-answer {
  margin: 4px 0 8px;
}

.predict-answer strong {
  font-family: var(--font-num);
  font-size: 1.4rem;
}

.predict-answer small {
  color: var(--text-muted);
  margin-left: 8px;
}

/* Racing route/segment detail. Leaflet needs an explicit pixel height on its
   container or it renders 0px tall and silently shows nothing — matches
   .chart's shape so the map reads as the same kind of object as the charts
   around it on this page. Leaflet's own vendored CSS supplies the map chrome
   (zoom control, attribution); this only sizes and frames the container. */
.track-map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: var(--pad);
}
@media (max-width: 640px) { .track-map { height: 300px; } }

/* Calendar. Twelve months of one year on one page — the URL's month only
   picks where the on-load script scrolls to (see the inline script in
   calendar.html), it is never a filter. Deliberately no --state-* anywhere
   here: a month's training volume is not a verdict about the athlete, the
   same reasoning as .zones above. The weekly TSS bars reuse that exact
   rail-plus-fill shape, opacity ramped by the week's own share of the
   year's biggest week rather than a fixed per-zone step, since there is no
   discrete category to key off here the way there is for power zones. */
.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  margin-bottom: var(--pad);
}
.calendar-toolbar h1 { margin: 0; }
.calendar-toolbar .viewnav { margin-bottom: 0; flex-wrap: wrap; row-gap: 4px; }
.calendar-months-nav { flex-basis: 100%; }

.calendar-month { margin-bottom: 36px; }
.calendar-month h2.section { margin-top: 0; }

.calendar-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar-table th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 10px;
  text-align: left;
  background: var(--bg-sunken);
}
/* Tall enough for a ride day's full stack — name, km · TSS, mini profile
   and the PI line (2026-08-17) — without the last line clipping. */
.calendar-day {
  vertical-align: top;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  height: 88px;
  font-size: 0.875rem;
}

.calendar-day-pi {
  display: block;
  margin-top: 2px;
  font-family: var(--font-num);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.calendar-day-out { color: var(--text-faint); }
.calendar-daynum {
  display: block;
  font-family: var(--font-num);
  color: var(--text-muted);
  margin-bottom: 3px;
}
/* Two lines, then an ellipsis: single-line nowrap cut Zwift names at the
   workout ("Zwift - TrainerRoad Cloudrip…"), which is the identifying half.
   The cell's height is a minimum, so a wrapped title grows the row. */
.calendar-ride {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.calendar-ride-stats {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-num);
  margin-bottom: 4px;
}

.calendar-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.calendar-peaks { display: flex; flex-wrap: wrap; gap: 6px; }
.calendar-peak {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.calendar-peak strong { color: var(--text); font-family: var(--font-num); margin-left: 4px; }

.calendar-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 160px;
  min-width: 140px;
}
.week-bar { background: var(--bg-sunken); border-radius: 4px; height: 8px; overflow: hidden; }
.week-bar i { display: block; height: 100%; border-radius: 4px; background: var(--effort); }

.calendar-spark { display: flex; align-items: center; gap: 8px; }
.calendar-spark svg { display: block; width: 100px; height: 24px; flex: none; }
.calendar-spark-range { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-num); white-space: nowrap; }

/* The calendar's per-ride power mini-chart: a 16px SVG strip of flat blocks,
   one per same-zone run, heights against the ride's own peak. Fills come
   from the zone identity tokens — see tokens.css for why that palette is a
   deliberate exception to the effort ramp. */
.ride-mini {
  display: block;
  width: 100%;
  height: 16px;
  margin: 2px 0 4px;
}

.calendar-list-link {
  margin-left: auto;
  white-space: nowrap;
}

/* Inline zone swatch for the Zones tables — same --zone-* palette the mini
   profiles and TIZ bars speak, as background rather than SVG fill. */
.zone-chip {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.zone-chip-1 { background: var(--zone-1); }
.zone-chip-2 { background: var(--zone-2); }
.zone-chip-3 { background: var(--zone-3); }
.zone-chip-4 { background: var(--zone-4); }
.zone-chip-5 { background: var(--zone-5); }
.zone-chip-6 { background: var(--zone-6); }
.zone-chip-7 { background: var(--zone-7); }

.pz1 { fill: var(--zone-1); }
.pz2 { fill: var(--zone-2); }
.pz3 { fill: var(--zone-3); }
.pz4 { fill: var(--zone-4); }
.pz5 { fill: var(--zone-5); }
.pz6 { fill: var(--zone-6); }
.pz7 { fill: var(--zone-7); }

/* The week-summary column after Sunday: TSS, hours and the intensity
   distribution. The stacked bar reuses the zone identity tokens (S1 = Z2's
   colour, S2 = Z4's, S3 = Z6's) as background, since the pz* classes above
   are SVG fills. */
.calendar-table th:last-child { width: 100px; }
.calendar-week-cell {
  vertical-align: top;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--bg-sunken);
  font-size: 0.75rem;
}
.calendar-week-tss {
  display: block;
  font-family: var(--font-num);
  font-weight: 600;
}
.calendar-week-hours {
  display: block;
  font-family: var(--font-num);
  color: var(--text-muted);
  margin-bottom: 5px;
}
.calendar-week-polarbar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-raised);
}
.calendar-week-polarbar i { display: block; height: 100%; }
.polar-s1 { background: var(--zone-2); }
.polar-s2 { background: var(--zone-4); }
.polar-s3 { background: var(--zone-6); }
.calendar-week-shares {
  display: block;
  font-family: var(--font-num);
  color: var(--text-muted);
  margin-top: 3px;
}
.calendar-week-label { display: block; color: var(--text-muted); margin-top: 2px; }
.calendar-week-label b { font-family: var(--font-num); font-weight: 600; color: var(--text); }

/* Today's page-summary sections: the heading IS the link to the full page,
   styled as the section heading it replaces — not browser-default blue. The
   accent on hover is the only hint it navigates, which is enough on a page
   whose every heading behaves this way. */
.today-summary { margin-top: 18px; }
.today-summary .section a {
  color: inherit;
  text-decoration: none;
}
.today-summary .section a:hover { color: var(--accent); }

/* Day navigation, shared by Today, Health and Nutrition (the stepping
   differs per page — see partials/day_nav.html). An absent edge renders
   no arrow at all. A 1fr|auto|1fr grid with EXPLICIT column assignments
   keeps the date pinned to the page's centre under the (also centred)
   top nav: with implicit placement, the days without a next arrow —
   every "today" — would shift the date sideways as you navigate. */
.day-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--pad);
}

.day-nav .day {
  grid-column: 2;
  margin: 0;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.day-nav a {
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
}

.day-nav-prev { grid-column: 1; justify-self: end; }
.day-nav-next { grid-column: 3; justify-self: start; }

.day-nav a:hover { color: var(--accent); border-color: var(--accent); }

.food-time { white-space: nowrap; }
