/* XC Training: Jesuit red and gold. Fonts are stored with the app (SIL Open Font License). */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --brand-red: #A6192E; --brand-red-dark: #7E1222; --brand-gold: #C99A2E; --brand-gold-light: #F3D58A; --brand-black: #1B1B1F;
  --on-red: #FFFFFF; --on-red-soft: #FFF1F1;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-anthropic-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-anthropic-serif: var(--font-display);
  --cds-font-size-caption: 12.5px; --cds-font-size-body: 15px; --cds-font-size-heading: 17px; --cds-font-size-title: 24px;
  --cds-font-weight-medium: 600;
  --cds-gap-xs: 4px; --cds-gap-sm: 8px; --cds-gap-md: 14px; --cds-gap-lg: 22px; --cds-gap-xl: 32px;
  --cds-pad-xs: 4px; --cds-pad-sm: 8px; --cds-pad-md: 12px; --cds-pad-lg: 18px; --cds-pad-xl: 28px;
  --cds-radius: 12px; --cds-dur-slow: 300ms; --cds-ease-out: cubic-bezier(.2, .7, .2, 1);
  --color-bg: #F6F4F1; --color-panel: #FFFFFF; --color-fg: #1B1B1F; --color-fg-muted: #5E5850;
  --color-border-line: #E4DED6; --color-input-line: #CFC7BC; --color-soft: #EFEBE5; --color-gold-tint: #F1E7D0; --color-gold-ink: #5C4410;
  --color-ok: #1F6E43; --color-warn: #8A5A00; --color-bad: #A6192E; --color-alert-bg: #FDF1E8; --color-alert-ink: #8A3A08;
  --cds-chart-muted: #B9B1A6; --cds-chart-status-critical: #A6192E; --cds-chart-grid: #ECE7E0;
  --cds-chart-axis: #9A9187; --cds-chart-reference: #6E665C; --cds-surface-popover: #FFFFFF;
  --cds-border: #D9D2C8; --cds-shadow-popover: 0 6px 18px rgba(27, 27, 31, .14); --cds-text-secondary: #5E5850;
  --dash-c1: #3B3833; --dash-c2: #B07D1A; --dash-c3: #4F7CA8; --dash-c4: #7A5195; --dash-c5: #2A9D8F; --dash-c6: #8C564B; --dash-c7: #6C757D; --dash-c8: #B5838D;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-bg: #151413; --color-panel: #1E1C1A; --color-fg: #EEEAE4; --color-fg-muted: #B3AAA0;
    --color-border-line: #34302C; --color-input-line: #4A443E; --color-soft: #2A2724; --color-gold-tint: #3A3020; --color-gold-ink: #F3D58A;
    --color-ok: #6FCF97; --color-warn: #E8B04B; --color-bad: #FF8A8A; --color-alert-bg: #3A2418; --color-alert-ink: #FFB98A;
    --cds-chart-muted: #5E5850; --cds-chart-status-critical: #FF6B6B; --cds-chart-grid: #2C2926;
    --cds-chart-axis: #7A7168; --cds-chart-reference: #A79E94; --cds-surface-popover: #26231F;
    --cds-border: #3D3833; --cds-shadow-popover: 0 6px 18px rgba(0, 0, 0, .5); --cds-text-secondary: #B3AAA0;
    --dash-c1: #D9D3CB; --dash-c2: #E3B24F; --dash-c3: #7FB0E0; --dash-c4: #B48AD6; --dash-c5: #5CCFBF; --dash-c6: #D99A8C;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-bg); color: var(--color-fg); font-family: var(--font-anthropic-sans); font-size: var(--cds-font-size-body); line-height: 1.5; }
a { color: var(--brand-red); }
a:hover { color: var(--brand-red-dark); }
@media (prefers-color-scheme: dark) { a { color: #FF9C9C; } a:hover { color: #FFC2C2; } }
:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 2px; }

/* Staff header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 10px 28px; background: var(--brand-red); color: var(--on-red); border-bottom: 5px solid var(--brand-gold); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; color: var(--on-red); text-decoration: none; }
.brand:hover { color: var(--on-red); }
.brand img { height: 40px; width: auto; display: block; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-gold-light); }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; flex: 1; }
.top .who { color: var(--on-red-soft); font-size: var(--cds-font-size-caption); }
.top form { margin: 0; }
.top button { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, .6); }
main { max-width: 1180px; margin: 0 auto; padding: var(--cds-pad-xl); }
main.wide { max-width: 1440px; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.1; margin: 0 0 var(--cds-gap-sm); }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 0 0 var(--cds-gap-sm); }
.muted { color: var(--color-fg-muted); }
.small { font-size: var(--cds-font-size-caption); }
.card { background: var(--color-panel); border: 1px solid var(--color-border-line); border-radius: 16px; padding: var(--cds-pad-lg); margin-bottom: var(--cds-gap-lg); min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--cds-gap-lg); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: var(--cds-gap-md); margin-bottom: var(--cds-gap-lg); }
.stat { background: var(--color-panel); border: 1px solid var(--color-border-line); border-radius: 16px; padding: var(--cds-pad-md) var(--cds-pad-lg); }
.stat b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.1; }
.flash { border-radius: 12px; padding: var(--cds-pad-sm) var(--cds-pad-md); margin-bottom: var(--cds-gap-md); border: 1px solid var(--color-border-line); background: var(--color-panel); }
.flash.error { border-color: var(--color-bad); color: var(--color-bad); }
.flash.ok { border-color: var(--color-ok); }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.list th { text-align: left; color: var(--color-fg-muted); font-weight: 600; border-bottom: 1px solid var(--color-border-line); padding: 7px 8px; white-space: nowrap; }
table.list td { border-bottom: 1px solid var(--color-border-line); padding: 7px 8px; vertical-align: top; }
table.list td.num, table.list th.num { text-align: right; }
.scroll { overflow-x: auto; }
form.inline { display: inline; }
.form-row { display: flex; flex-wrap: wrap; gap: var(--cds-gap-sm) var(--cds-gap-md); align-items: flex-end; margin-bottom: var(--cds-gap-sm); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 500; color: var(--color-fg-muted); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--color-fg); font-size: var(--cds-font-size-body); font-weight: 400; }
input, select, textarea, button { font: inherit; color: var(--color-fg); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=url], input[type=email], input[type=tel], select, textarea {
  background: var(--color-panel); border: 1px solid var(--color-input-line); border-radius: 10px; padding: 8px 10px; min-width: 0; min-height: 40px; font-size: 16px; }
textarea { width: 100%; min-height: 4.5rem; }
button, .button { background: var(--brand-red); color: #FFFFFF; border: 1px solid var(--brand-red); border-radius: 10px; padding: 8px 14px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
button:hover, .button:hover { background: var(--brand-red-dark); border-color: var(--brand-red-dark); color: #FFFFFF; }
button.secondary { background: transparent; color: var(--color-fg); border-color: var(--color-input-line); }
button.secondary:hover { background: var(--color-soft); color: var(--color-fg); }
/* The Boys / Girls switch beside the Groups and VDOT titles: the team not shown is an outlined button. */
.title-row { align-items: center; margin-bottom: 0; }
/* Groups page: each group's badge in a fixed-width slot, so the name boxes line up in a column. */
td.group-cell { white-space: nowrap; }
td.group-cell .pill-slot { display: inline-block; width: 8.5rem; vertical-align: middle; }
.team-switch { margin-bottom: 0; gap: 8px; }
.team-switch a.button.secondary { background: transparent; color: var(--color-fg); border-color: var(--color-input-line); }
.team-switch a.button.secondary:hover { background: var(--color-soft); color: var(--color-fg); }
button.danger { background: transparent; color: var(--color-bad); border-color: var(--color-bad); }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--color-fg-muted); text-decoration: underline; font-weight: 500; }
button[disabled] { background: var(--color-border-line); border-color: var(--color-border-line); color: var(--color-fg-muted); cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--color-border-line); background: var(--color-soft); color: var(--color-fg-muted); white-space: nowrap; }
.pill.good { background: var(--color-gold-tint); border-color: transparent; color: var(--color-gold-ink); }
.pill.bad { background: transparent; color: var(--color-bad); border-color: var(--color-bad); }
.pill.warn { color: var(--color-warn); border-color: var(--color-warn); background: transparent; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--color-gold-ink); background: var(--color-gold-tint); border-radius: 999px; padding: 1px 9px; }
code.copy { user-select: all; background: var(--color-soft); border: 1px solid var(--color-border-line); padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }
.ins { border-top: 1px solid var(--color-border-line); padding: var(--cds-pad-md) 0; }
.ins:first-child { border-top: 0; padding-top: 0; }
.ins h3 { margin: 4px 0; font-size: 16px; }
.ins p { margin: 4px 0; max-width: 75ch; }
.pri-High { color: var(--color-bad); font-weight: 600; } .pri-Medium { color: var(--color-warn); font-weight: 600; } .pri-Low { color: var(--color-fg-muted); }
.answer { white-space: pre-wrap; max-width: 75ch; }
.dash-skeleton:empty, .dash-skeleton { position: relative; }
.dash-skeleton:empty::before { content: ""; display: block; height: 100%; min-height: 1em; border-radius: 6px; background: var(--color-border-line); opacity: .5; }
span.dash-skeleton { color: transparent; }

/* Athlete pages: phone first */
.athlete-page main { max-width: 560px; padding: 0 0 32px; }
.hero { background: var(--brand-red); color: var(--on-red); padding: 22px 20px 24px; border-bottom: 5px solid var(--brand-gold); display: flex; flex-direction: column; gap: 10px; }
.hero .team { display: flex; align-items: center; gap: 12px; }
.hero .team img { height: 48px; width: auto; }
.hero .team span { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-gold-light); }
.hero h1 { margin: 0; color: #FFFFFF; font-size: 44px; line-height: 1; }
.hero .hero-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: relative; }
:is(.hero, .coach-title) .group-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border-radius: 999px; background: var(--brand-gold); color: #1B1B1F; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
:is(.hero, .coach-title) .group-btn:hover, :is(.hero, .coach-title) .group-btn:focus-visible { filter: brightness(1.08); }
:is(.hero, .coach-title) .group-pop { position: static; }
:is(.hero, .coach-title) .group-pop summary { list-style: none; cursor: pointer; }
:is(.hero, .coach-title) .group-pop summary::-webkit-details-marker { display: none; }
:is(.hero, .coach-title) .group-pop summary::after { content: "▾"; margin-left: 6px; font-size: 12px; }
:is(.hero, .coach-title) .group-pop[open] summary::after { content: "▴"; }
:is(.hero, .coach-title) .group-card { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; background: var(--color-panel); color: var(--color-fg); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); width: min(360px, 100%); box-sizing: border-box; }
:is(.hero, .coach-title) .group-card .facts > div { background: var(--color-bg); }
.hero p { margin: 0; color: var(--on-red-soft); font-size: 15px; line-height: 1.45; }
.hero a.back { color: var(--on-red-soft); font-weight: 500; text-decoration: none; }
.stack { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.stack > .flash { margin: 0; }
.panel { background: var(--color-panel); border: 1px solid var(--color-border-line); border-radius: 16px; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel p { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.facts > div { background: var(--color-bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.facts dt, .facts .k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--color-fg-muted); }
.facts dd, .facts .v { margin: 0; font-size: 15px; font-weight: 500; }
.facts .big { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.05; }
.big-btn { height: 52px; width: 100%; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .02em; border-radius: 12px; }
.ghost-btn { height: 48px; width: 100%; background: var(--color-panel); color: var(--brand-red); border: 1px solid var(--brand-red); border-radius: 12px; font-weight: 600; }
.ghost-btn:hover { background: var(--color-soft); color: var(--brand-red-dark); }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--color-input-line); border-radius: 12px; font-size: 15px; font-weight: 400; color: var(--color-fg); cursor: pointer; flex-direction: row; }
.consent input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--brand-red); }
.notice { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--color-gold-tint); color: var(--color-gold-ink); border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.notice a { color: var(--color-gold-ink); font-weight: 700; white-space: nowrap; }
.notice.medal-note { justify-content: flex-start; }
.notice.medal-note .medal-icon { font-size: 28px; line-height: 1; }
.notice.medal-note form { margin-left: auto; }
.notice.medal-note .close { background: transparent; border: 0; color: var(--color-gold-ink); font-size: 22px; min-width: 44px; min-height: 44px; padding: 0; cursor: pointer; }
.hero .medals { margin-left: auto; display: flex; gap: 2px; position: relative; }
.hero .medal-pop { position: static; }
.hero .medal-pop summary { list-style: none; cursor: pointer; }
.hero .medal-pop summary::-webkit-details-marker { display: none; }
.hero .medal-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 26px; line-height: 1; border-radius: 50%; }
.hero .medal-btn:focus-visible { outline: 2px solid var(--brand-gold); }
.hero .medal-pop[open] .medal-btn { background: rgba(255,255,255,.18); }
.hero .medal-card { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: min(300px, calc(100vw - 32px)); box-sizing: border-box; background: var(--color-panel); color: var(--color-fg); border-radius: 14px; padding: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 15px; }
.alert { background: var(--color-alert-bg); color: var(--color-alert-ink); border-radius: 12px; padding: 12px; font-size: 14px; }
fieldset.pick { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
fieldset.pick legend { font-size: 14px; font-weight: 600; color: var(--color-fg-muted); padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .lvl { position: relative; display: block; flex-direction: row; color: var(--color-fg); }
.chip input, .lvl input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--color-input-line); background: var(--color-panel); font-size: 15px; font-weight: 500; cursor: pointer; }
.lvls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.lvl span { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 52px; border-radius: 12px; border: 1px solid var(--color-input-line); background: var(--color-panel); font-family: var(--font-display); font-weight: 700; font-size: 20px; cursor: pointer; line-height: 1; }
.lvl span small { font-family: var(--font-anthropic-sans); font-size: 10px; font-weight: 500; color: var(--color-fg-muted); margin-top: 3px; }
.chip input:checked + span, .lvl input:checked + span { background: var(--brand-red); border-color: var(--brand-red); color: #FFFFFF; }
.lvl input:checked + span small { color: var(--on-red-soft); }
.chip input:focus-visible + span, .lvl input:focus-visible + span { outline: 3px solid var(--brand-gold); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--color-fg-muted); }
.runs { list-style: none; margin: 0; padding: 0; }
.runs li { border-top: 1px solid var(--color-border-line); }
.runs li:first-child { border-top: 0; }
.runs a.row, .runs .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; color: var(--color-fg); text-decoration: none; }
.runs .row .l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.runs .row .d { font-weight: 600; }
.runs .row .r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.runs .mi { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; }
.runs .mi small { font-size: 15px; color: var(--color-fg-muted); font-weight: 600; }
.foot { margin: 4px 20px 0; font-size: 14px; color: var(--color-fg-muted); }
input[type=file] { font-size: 15px; max-width: 100%; }

/* Charts with dropdowns */
.ac-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ac-controls select { width: 100%; }
.ac-chart { position: relative; min-height: 240px; }
.ac-chart svg { display: block; overflow: visible; }
.ac-chart text { font-family: var(--font-anthropic-sans); }
.ac-tick { fill: var(--color-fg-muted); font-size: 11px; }
.ac-val { fill: var(--color-fg); font-size: 11px; font-variant-numeric: tabular-nums; }
.ac-summary { font-size: 14px; color: var(--color-fg-muted); margin: 0; }
.ac-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--color-fg-muted); }
.ac-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ac-empty { color: var(--color-fg-muted); font-size: 14px; padding: 2rem 0; text-align: center; }
.ac-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--cds-surface-popover); border: 1px solid var(--cds-border); border-radius: 10px; box-shadow: var(--cds-shadow-popover); padding: 6px 10px; font-size: 12.5px; line-height: 1.4; max-width: 16rem; }
@media (max-width: 640px) { main { padding: var(--cds-pad-md); } .top { padding: 8px 14px; } .athlete-page main { padding: 0 0 24px; } }
/* My races: seasons and comparisons */
.race-view h3.season { margin: 14px 0 4px; font-size: 17px; display: flex; gap: 10px; align-items: baseline; }
.race-view h3.season:first-child { margin-top: 0; }
td.num.faster { color: var(--color-ok); font-weight: 600; }
td.num.slower { color: var(--color-bad); font-weight: 600; }
.race-pick { display: flex; flex-direction: column; gap: 4px; }
.race-pick select { width: 100%; max-width: 100%; }
.nowrap { white-space: nowrap; }
/* Workout paces */
.wpace { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--color-border-line); }
.wpace:first-of-type { border-top: 0; padding-top: 0; }
.wpace .d { font-weight: 600; }
.wpace .facts > div { display: flex; flex-direction: column; gap: 2px; }


.rhr-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.rhr-cal .wd { font-size: 12px; color: var(--color-fg-muted); text-align: center; }
.rhr-cal .day { min-height: 46px; padding: 2px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: var(--color-panel); color: var(--color-fg); border: 1px solid var(--color-border-line); font-weight: 500; }
.rhr-cal .day .n { font-size: 12px; line-height: 1.1; }
.rhr-cal .day .v { font-size: 15px; font-weight: 700; line-height: 1.1; min-height: 1.1em; }
.rhr-cal .day.done { background: var(--color-ok); border-color: var(--color-ok); color: var(--color-panel); }
.rhr-cal .day.garmin { background: color-mix(in srgb, var(--color-ok) 22%, var(--color-panel)); border-color: var(--color-ok); color: var(--color-fg); }
.rhr-cal .day.today { border-width: 2px; border-color: var(--brand-gold); }
.rhr-cal .day[aria-pressed="true"] { outline: 3px solid var(--brand-red); outline-offset: 1px; }
.rhr-cal .day.off { background: none; border: 0; }
.rhr-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.rhr-key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rhr-key .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--color-ok); }
.rhr-key .sw.done { background: var(--color-ok); }
.rhr-key .sw.garmin { background: color-mix(in srgb, var(--color-ok) 22%, var(--color-panel)); }
.vdot-board { display: flex; flex-direction: column; gap: 22px; max-width: 1040px; }
.vdot-group { width: 100%; border-collapse: collapse; background: color-mix(in srgb, var(--g) 38%, #FFFFFF); color: #1B1B1F; min-width: 560px; }
.vdot-group th, .vdot-group td { border: 1px solid color-mix(in srgb, var(--g) 70%, #000000 12%); padding: 4px 10px; text-align: center; }
.vdot-group thead th { background: var(--g); color: var(--g-ink); font-weight: 700; }
.vdot-group thead th.name { font-size: 20px; }
.vdot-group td.name { font-weight: 700; font-size: 17px; white-space: nowrap; }
.vdot-group td.name a { color: inherit; text-decoration: none; }
.vdot-group td.name a:hover { text-decoration: underline; }
.vdot-group td.v { font-weight: 700; font-size: 17px; }
.vdot-group td.mark { color: #A6192E; font-weight: 700; }
.vdot-group input { background: #FFFFFF; color: #1B1B1F; }
[hidden] { display: none !important; }
.rhr-more summary { color: var(--brand-red); font-weight: 600; }
.vdot-group thead th { white-space: nowrap; }
th.sort-head { cursor: pointer; user-select: none; white-space: nowrap; }
th.sort-head::after { content: " ↕"; opacity: .35; font-size: .85em; }
th.sort-head[aria-sort="ascending"]::after { content: " ▲"; opacity: .8; }
th.sort-head[aria-sort="descending"]::after { content: " ▼"; opacity: .8; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: color-mix(in srgb, var(--brand-gold) 14%, transparent); }
details.meet > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
details.meet > summary::-webkit-details-marker { display: none; }
details.meet > summary h2 { margin: 0; }
details.meet > summary h2::before { content: "▸ "; color: var(--brand-red); }
details.meet[open] > summary h2::before { content: "▾ "; }
details.meet[open] > summary { margin-bottom: 10px; }
.vdot-group td.pace { font-variant-numeric: tabular-nums; }
.vdot-group { table-layout: fixed; min-width: 820px; }
.vdot-group col.name { width: 19%; }
.vdot-group col.v { width: 12%; }
.vdot-group col.sb { width: 9%; }
.vdot-group td.sb { font-weight: 600; }
.vdot-group col.pace { width: 12%; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; display: inline-block; }
.avatar.blank { display: inline-flex; align-items: center; justify-content: center; background: var(--color-bg); border: 1px solid var(--color-border-line); color: var(--color-fg-muted); font-size: 12px; font-weight: 700; }
.avatar.big { width: 72px; height: 72px; margin-right: 14px; }
h1.with-photo { display: flex; align-items: center; }
.hero-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-gold); flex: none; }
td.nowrap, .nowrap { white-space: nowrap; }
img.zoom { cursor: zoom-in; }
dialog.photo-zoom { padding: 0; border: 0; border-radius: 16px; background: var(--color-panel); max-width: min(92vw, 420px); }
dialog.photo-zoom::backdrop { background: rgba(0, 0, 0, .7); }
dialog.photo-zoom figure { margin: 0; cursor: zoom-out; }
dialog.photo-zoom img { display: block; width: 100%; height: auto; border-radius: 16px 16px 0 0; }
dialog.photo-zoom figcaption { padding: 10px 14px; font-weight: 700; text-align: center; color: var(--color-fg); }
table.compact th, table.compact td { padding-top: 3px; padding-bottom: 3px; vertical-align: middle; }
table.compact .avatar { width: 26px; height: 26px; margin-right: 6px; }
table.compact .avatar.blank { font-size: 10px; }
table.compact .pill { padding-top: 0; padding-bottom: 0; font-size: 13px; }
table.compact code.copy { font-size: 12px; padding: 1px 6px; }
details.plink > summary { cursor: pointer; color: var(--brand-red); font-weight: 600; font-size: 13px; }
details.plink[open] { min-width: 260px; }
details.plink[open] > summary { margin-bottom: 4px; }
ol.entries { columns: 2 260px; margin: 8px 0 12px; padding-left: 1.6em; } ol.entries li { break-inside: avoid; padding: 2px 0; }
.coach-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: relative; }
.coach-title h1 { margin: 0; }
.no-time { color: var(--color-fg-muted); letter-spacing: 1px; }
/* Reports: printable "paper" pages */
.paper { background: #FFFFFF; color: #1B1B1F; border-radius: 14px; padding: 28px 32px; max-width: 1000px; box-shadow: 0 2px 14px rgba(0,0,0,.08); margin-top: 12px; }
.paper a { color: inherit; text-decoration: none; }
.paper-head { display: flex; align-items: center; gap: 14px; border-bottom: 4px solid var(--brand-gold); padding-bottom: 12px; margin-bottom: 18px; }
.paper-head img { height: 52px; }
.paper-team { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--brand-red); text-transform: uppercase; letter-spacing: .5px; }
.paper-kind { font-size: 13px; color: #6B645C; font-weight: 600; letter-spacing: .3px; }
.paper-title { margin: 0 0 4px; font-size: 28px; }
.paper-sub { margin: 0 0 16px; color: #6B645C; font-size: 14px; }
.paper-h2 { margin: 22px 0 8px; font-size: 18px; color: var(--brand-red); }
.paper-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.paper-table th { background: #1B1B1F; color: #FFFFFF; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 7px 8px; text-align: left; }
.paper-table th.num, .paper-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.paper-table td { padding: 6px 8px; border-bottom: 1px solid #E4DED6; }
.paper-table tbody tr:nth-child(even) td { background: #F7F4F0; }
.paper-table td.faster { color: #1F6E43; font-weight: 600; } .paper-table td.slower { color: #A6192E; }
.paper-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid #E4DED6; font-size: 12px; color: #6B645C; }
.ov-head { display: flex; align-items: center; gap: 18px; border-bottom: 4px solid var(--brand-gold); padding-bottom: 16px; margin-bottom: 18px; }
.ov-head h1 { margin: 2px 0 6px; font-size: 34px; }
.ov-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-red); flex: none; }
.ov-photo.blank { display: inline-flex; align-items: center; justify-content: center; background: #F7F4F0; color: #6B645C; font-weight: 700; font-size: 28px; }
.ov-tags { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: #6B645C; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: #F7F4F0; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid transparent; }
.kpi.accent { border-top-color: var(--brand-red); }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #6B645C; font-weight: 600; }
.kpi .v { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.1; color: #1B1B1F; }
.kpi .s { font-size: 12px; color: #6B645C; }
.small-kpis .v { font-size: 22px; }
.ov-block { margin-bottom: 18px; break-inside: avoid; }
.ov-block h2 { font-size: 17px; margin: 0 0 4px; color: var(--brand-red); }
.ov-note { margin: 0 0 6px; font-size: 12px; color: #6B645C; }
.ov-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ov-two .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .paper { padding: 18px 16px; } .ov-two { grid-template-columns: 1fr; } .paper-table { font-size: 12px; } }
@media print {
  header.top, .no-print, .flash, .skip { display: none !important; }
  body, main { background: #FFFFFF !important; }
  main { padding: 0 !important; max-width: none !important; }
  .paper { box-shadow: none; padding: 0; max-width: none; border-radius: 0; margin: 0; }
  .paper-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpi, .paper-table tbody tr:nth-child(even) td, .pill, .paper-head, .ov-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: letter; margin: 0.5in; }
}
details.panel.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.panel.fold > summary::-webkit-details-marker { display: none; }
details.panel.fold > summary::after { content: "▸"; color: var(--brand-red); font-size: 20px; }
details.panel.fold[open] > summary::after { content: "▾"; }
details.panel.fold:not([open]) { gap: 0; }

.up-arrows { display: inline-flex; align-items: center; gap: 0; margin-left: 4px; vertical-align: middle; }
.up-arrows svg + svg { margin-left: -7px; }   /* several arrows sit close together */
.up-arrows small { color: #177A42; font-weight: 700; margin-left: 2px; }   /* the "+9": 4.5:1 or better on white and the shaded columns */
@media (prefers-color-scheme: dark) { .up-arrows small { color: #6FCF97; } }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 8px; background: var(--color-panel); border: 1px solid var(--color-border-line); border-radius: 999px; padding: 6px 12px 6px 8px; }
.badge > span { display: flex; flex-direction: column; line-height: 1.15; }
.badge small { color: var(--color-fg-muted); font-size: 12px; }
.badge-vdot { border-color: #1F9D55; } .badge-pr { border-color: var(--brand-gold); } .badge-training { border-color: var(--brand-red); }
.hero .badges .badge { background: rgba(255,255,255,.95); color: #1B1B1F; border-color: transparent; }
.hero .badges .badge small { color: #5E5850; }
details.edit-box > summary { cursor: pointer; color: var(--brand-red); font-weight: 600; } details.edit-box[open] { flex-basis: 100%; margin: 6px 0 10px; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--color-border-line); margin: 16px 0 12px; }
nav.tabs a { padding: 8px 14px; border-radius: 10px 10px 0 0; text-decoration: none; color: var(--color-fg-muted); font-weight: 600; margin-bottom: -2px; border-bottom: 3px solid transparent; }
nav.tabs a:hover { color: var(--brand-red); }
nav.tabs a[aria-current="page"] { color: var(--brand-red); border-bottom-color: var(--brand-red); background: var(--color-panel); }
details.fold-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.fold-card > summary::-webkit-details-marker { display: none; }
details.fold-card > summary h2 { margin: 0; }
details.fold-card > summary::after { content: "▸"; color: var(--brand-red); font-size: 20px; }
details.fold-card[open] > summary::after { content: "▾"; }
details.fold-card[open] > summary { margin-bottom: 10px; }
details.card.meet { margin-bottom: 8px; padding-top: 12px; padding-bottom: 12px; }
details.card.meet > summary h2 { font-size: 20px; }
.group-card .facts.paces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.group-card .facts.paces .big { font-size: 22px; }
.badges { margin-top: 10px; }
.coach-title + .badges { margin: 12px 0 8px; }

.announcement { background: #FFF8E6; border: 1px solid var(--brand-gold); border-left: 6px solid var(--brand-gold); border-radius: 12px; padding: 12px 16px; color: #1B1B1F; }
.announcement .ann-title { font-weight: 700; font-size: 17px; }
.announcement .ann-body { white-space: pre-wrap; margin-top: 4px; font-size: 15px; }
details.ann-row { border-top: 1px solid var(--color-border-line); padding: 6px 0; }
details.ann-row > summary { cursor: pointer; }
details.ann-row[open] > summary { margin-bottom: 8px; }
details.paces-preview > summary { cursor: pointer; color: var(--brand-red); font-weight: 600; margin-top: 4px; } table.parts input, table.parts select { min-height: 36px; }
.part-paces td { vertical-align: top; } .part-paces td.num b { font-size: 17px; }

/* weekly mileage goal bars */
.miles-bar { display: inline-block; vertical-align: middle; width: 9rem; height: 10px; border-radius: 5px; background: var(--color-soft); overflow: hidden; }
.miles-bar.big { display: block; width: 100%; height: 14px; border-radius: 7px; margin: 4px 0 12px; }
.miles-bar > span { display: block; height: 100%; background: var(--brand-red); border-radius: inherit; }
.miles-bar > span.met { background: var(--color-ok); }
td.ok { color: var(--color-ok); }
table.mileage { table-layout: fixed; width: 100%; }
table.mileage th:first-child { width: 34%; }
table.mileage th:last-child { width: 7rem; }
/* Week page: one row per athlete, the totals, then a cell per day. */
.week-table th, .week-table td { vertical-align: top; text-align: center; }
.week-table th.who, .week-table td.who, .week-table tr.group-row td { text-align: left; }
table.list.week-table td.num, table.list.week-table th.num, table.list.week-table th.day { text-align: center; }
/* A line before each day, and every other day shaded, so the seven days read as columns. */
.week-table th.day, .week-table td.day { border-left: 2px solid var(--color-border-line); }
.week-table td.day.d1, .week-table td.day.d3, .week-table td.day.d5,
.week-table th.day.d1, .week-table th.day.d3, .week-table th.day.d5 { background: rgba(27, 27, 31, .045); }
@media (prefers-color-scheme: dark) {
  .week-table td.day.d1, .week-table td.day.d3, .week-table td.day.d5,
  .week-table th.day.d1, .week-table th.day.d3, .week-table th.day.d5 { background: rgba(255, 255, 255, .05); }
}
/* On pace for the week's miles and points: green 90%+, amber 80-89%, red below. */
.pace-good { color: #1E7B34; font-weight: 700; }
.pace-warn { color: #8A5200; font-weight: 700; }   /* 5:1 or better on the shaded and tinted cells (was #B26A00, under 4.5:1) */
.pace-bad { color: #D0191B; font-weight: 700; }
td.pace-good { background: color-mix(in srgb, #1E7B34 10%, transparent); }
td.pace-warn { background: color-mix(in srgb, #B26A00 12%, transparent); }
td.pace-bad { background: color-mix(in srgb, #D0191B 10%, transparent); }
.week-table a.tag { text-decoration: none; display: inline-block; }
.week-table a.tag:hover, .week-table a.pill:hover { text-decoration: underline; }
.week-table a.pill { text-decoration: none; }
.week-table td.who { white-space: nowrap; font-weight: 600; position: sticky; left: 0; background: var(--color-panel); z-index: 1; }
.week-table th.who { position: sticky; left: 0; background: var(--color-panel); z-index: 2; }
.week-table td.day, .week-table th.day { min-width: 92px; font-size: 12.5px; line-height: 1.45; }
.week-table td.day .tag { margin-top: 2px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-table .today { background: color-mix(in srgb, var(--brand-gold) 12%, transparent); }
.week-table td.future { opacity: .7; }
.week-table tr.group-row td { background: var(--color-soft); padding-top: 6px; padding-bottom: 6px; }
.week-table details.flags summary { cursor: pointer; color: var(--color-warn); font-weight: 600; }
.week-table details.flags ul { margin: 4px 0 0; padding-left: 16px; font-weight: 400; white-space: normal; max-width: 240px; }
/* An athlete's times by distance and training zone. */
.pace-grid th[scope="row"] { white-space: nowrap; }
.pace-grid td { font-variant-numeric: tabular-nums; }
.pace-grid tr.per-mile th, .pace-grid tr.per-mile td { border-top: 2px solid var(--color-border-line); font-weight: 600; }
.pace-grid .short { display: none; }
@media (max-width: 520px) {
  .pace-panel { padding-left: 10px; padding-right: 10px; }
  .pace-grid { font-size: 12.5px; }
  .pace-grid th, .pace-grid td { padding-left: 3px; padding-right: 3px; }
  .pace-grid .long { display: none; }
  .pace-grid .short { display: inline; }
}
/* The team's place and score beside a race's name on the Races page. */
.team-result { font-family: var(--font-body, inherit); font-weight: 500; color: var(--color-fg-muted); margin-left: 6px; }
.team-result b { color: var(--color-fg); }
/* A report opened from a link (such as the Week page's Pain button) stands out. */
tr:target td { background: color-mix(in srgb, var(--brand-gold) 22%, transparent); }
@media (prefers-color-scheme: dark) {
  .pace-good { color: #7BD88F; } .pace-warn { color: #F5B94A; } .pace-bad { color: #FF8A80; }
}
/* Courses: the standard distances as small buttons, kilometers and miles on their own rows. */
.course-distances { border: 0; padding: 0; margin: 4px 0 10px; }
.course-distances legend { font-weight: 600; margin-bottom: 6px; }
.course-distances .dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.course-distances .dist-row > .small { width: 5.5rem; }
.course-distances .chip span { height: 34px; padding: 0 12px; font-size: 14px; }

/* athlete page: weekly miles and points on one line; folding panels with a status beside the title */
.facts.one-line { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.facts.one-line > div { padding: 10px 8px; min-width: 0; }
.facts.one-line .big { font-size: 24px; }
.facts.one-line .k { font-size: 11px; letter-spacing: .04em; }
details.panel.fold > summary h2 { margin: 0; }
details.garmin-fold > summary { gap: 10px; }
details.garmin-fold > summary h2 { margin-right: auto; }
details.panel.fold > summary .rhr-sum { margin-left: auto; margin-right: 10px; }
details.sub-fold > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details.sub-fold > summary::-webkit-details-marker { display: none; }
details.sub-fold > summary h3::after { content: " ▸"; color: var(--brand-red); }
details.sub-fold[open] > summary h3::after { content: " ▾"; }
details.sub-fold[open] { display: flex; flex-direction: column; gap: 10px; }
/* athlete page: a slimmer header so more of the page shows */
.hero.compact { padding: 10px 16px 12px; gap: 6px; border-bottom-width: 4px; }
.hero.compact .team img { height: 26px; }
.hero.compact .team span { font-size: 12px; }
.hero.compact h1 { font-size: 30px; }
.hero.compact .hero-title { gap: 10px; }
.hero.compact .hero-photo { width: 46px; height: 46px; border-width: 2px; }
.hero.compact .group-btn { min-height: 30px; font-size: 14px; padding: 2px 12px; }
/* Athletes page: everything centered except the athlete's name */
table.list.centered th, table.list.centered td, table.list.centered td.num, table.list.centered th.num { text-align: center; }
table.list.centered th:first-child, table.list.centered td:first-child { text-align: left; }
/* Folded Garmin and privacy panels: their status badges line up at the right, one above the other */
details.garmin-fold > summary .pill { margin-left: auto; min-width: 8.5rem; justify-content: center; text-align: center; box-sizing: border-box; }
/* Newsletter */
.newsletter .nl-head { border-bottom: 4px solid var(--brand-gold); padding-bottom: 10px; margin-bottom: 6px; }
.newsletter .nl-head .nl-team { font-family: var(--font-display); color: var(--brand-red); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; font-size: 14px; }
.newsletter .nl-head h1 { margin: 2px 0; }
.nl-sec { padding: 12px 0; border-bottom: 1px solid var(--color-border-line); }
.nl-sec:last-child { border-bottom: 0; }
.nl-sec h2 { color: var(--brand-red); margin: 0 0 8px; font-size: 20px; }
.nl-sec .nl-big { font-weight: 700; font-size: 17px; margin: 4px 0; }
.nl-text { white-space: pre-line; margin-top: 6px; }
.nl-days { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.nl-days dt { font-weight: 600; }
.nl-days dd { margin: 0; }
.nl-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.nl-photos figure { margin: 0; }
.nl-photos img { width: 100%; height: auto; border-radius: 8px; display: block; }
.nl-edit.off { opacity: .6; }
.nl-edit textarea { width: 100%; box-sizing: border-box; }
.nl-savebar { position: sticky; bottom: 0; background: var(--color-bg); padding: 10px 0; z-index: 3; }
.nl-photo-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--color-border-line); }
.nl-photo-row img { border-radius: 6px; flex: none; }
.nl-photo-form { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
ul.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.nl-race table.list { width: auto; min-width: min(100%, 360px); }
/* Workouts list: one header row per day, its workouts beneath */
table.workouts-by-day tr.day-row th { background: var(--color-soft); color: var(--color-fg); font-size: 14px; padding-top: 8px; padding-bottom: 8px; }
/* Week page: the reason behind each colour, shown when "Show why" is ticked */
.week-table .why { display: none; }
.week-table.show-why .why { display: block; font-size: 11px; line-height: 1.3; font-weight: 400; color: var(--color-fg-muted); white-space: normal; max-width: 150px; margin: 2px auto 4px; }
/* Top bar: the menu in labelled groups (Today, Athletes, Training, Racing, Team, Admin). On wide screens the brand, the group
   labels and the signed-in user share one row, and each label opens its links in a small panel below it. */
.top nav { flex: 1 1 auto; min-width: 0; }
.top .nav-group { position: relative; }
.top .nav-label { background: transparent; color: var(--on-red-soft); border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  min-height: 36px; padding: 6px 10px; gap: 6px; font-weight: 500; }
.top .nav-label::after { content: "▾"; font-size: 11px; opacity: .85; }
.top .nav-label[aria-expanded="true"]::after { content: "▴"; }
.top .nav-label:hover, .top .nav-label[aria-expanded="true"] { background: rgba(255, 255, 255, .12); border-color: transparent; color: #FFFFFF; }
.top .nav-group.current .nav-label { color: #FFFFFF; border-bottom-color: var(--brand-gold-light); }
.top .nav-title { display: none; }
.top .nav-links { display: none; list-style: none; margin: 0; padding: 6px 0; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 12rem;
  background: var(--cds-surface-popover); border: 1px solid var(--cds-border); border-top: 3px solid var(--brand-gold); border-radius: 0 0 10px 10px; box-shadow: var(--cds-shadow-popover); }
.top .nav-group.open .nav-links { display: block; }
.top:not(.js-menu) .nav-group:is(:hover, :focus-within) .nav-links { display: block; }   /* without JavaScript, pointing or tabbing opens a group */
.top .nav-links a { display: block; padding: 8px 16px; color: var(--color-fg); text-decoration: none; font-weight: 500; white-space: nowrap; }
.top .nav-links a:hover { background: var(--color-soft); color: var(--color-fg); }
.top .nav-links a[aria-current="page"] { color: var(--brand-red); font-weight: 600; box-shadow: inset 3px 0 var(--brand-gold); }
@media (prefers-color-scheme: dark) { .top .nav-links a[aria-current="page"] { color: #FF9C9C; } }
.top .top-user { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-left: auto; }
.top .top-user button { min-height: 30px; padding: 2px 12px; font-size: 13px; }
/* The menu wrapper is invisible to the layout on wide screens; on phones it folds behind the Menu button. */
.top .top-menu { display: contents; }
.top .menu-btn { display: none; }
@media (max-width: 760px) {
  .top { flex-wrap: nowrap; justify-content: space-between; padding: 8px 14px; gap: 10px; position: relative; }
  .top .brand img { height: 32px; }
  .top .brand span { font-size: 15px; letter-spacing: .05em; }
  .top .menu-btn { display: inline-flex; flex: none; min-height: 36px; padding: 4px 14px; }
  .top.js-menu .top-menu { display: none; }
  .top.js-menu.menu-open { flex-wrap: wrap; }
  .top.js-menu.menu-open .top-menu { display: block; flex-basis: 100%; padding: 2px 0 4px; }
  /* Phones: every group open, its name above its links */
  .top .top-menu nav { display: block; }
  .top .nav-group { padding: 6px 0 2px; }
  .top .nav-group + .nav-group { border-top: 1px solid rgba(255, 255, 255, .18); }
  .top .nav-label { display: none; }
  .top .nav-title { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-gold-light); }
  .top .nav-links, .top:not(.js-menu) .nav-group:is(:hover, :focus-within) .nav-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px;
    position: static; min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .top .nav-links a { padding: 7px 0; color: var(--on-red-soft); border-bottom: 2px solid transparent; white-space: normal; }
  .top .nav-links a:hover { background: none; color: #FFFFFF; }
  .top .nav-links a[aria-current="page"] { color: #FFFFFF; border-bottom-color: var(--brand-gold-light); box-shadow: none; }
  .top .top-user { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .25); flex-basis: 100%; }
  .top:not(.js-menu) { flex-wrap: wrap; }   /* without JavaScript the menu just shows */
  .top:not(.js-menu) .top-menu { display: block; flex-basis: 100%; }
  .top:not(.js-menu) .menu-btn { display: none; }
}
.adj { color: var(--color-ok); font-weight: 600; }
.runs .r .adj { display: block; }
/* Coach pages: the top bar stays in view while scrolling; links to a spot on the page land below it */
.top { position: sticky; top: 0; z-index: 50; }
html { scroll-padding-top: calc(var(--top-h, 0px) + 8px); }
@media (max-width: 760px) { .top.menu-open .top-menu { max-height: calc(100vh - 70px); overflow-y: auto; } }
.alumni-faces { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
/* Team calendar */
.cal-list, .cal-items { list-style: none; margin: 0; padding: 0; }
.cal-day { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--color-border-line); }
.cal-day:last-child { border-bottom: 0; }
.cal-day.today .cal-date { background: var(--brand-red); color: #FFFFFF; }
.cal-date { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; border-radius: 10px; background: var(--color-soft); padding: 4px 0; line-height: 1.1; }
.cal-date .dow, .cal-date .mon { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.cal-date .dnum { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.cal-items { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cal-item { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.cal-time { flex: none; width: 128px; font-size: 13px; color: var(--color-fg-muted); font-variant-numeric: tabular-nums; }
.cal-what { flex: 1; min-width: 160px; }
.cal-actions { margin-left: auto; }
.cal-item.kind-meet .cal-time { color: var(--brand-red); font-weight: 600; }
@media (max-width: 520px) { .cal-time { width: 100%; } }
/* Workout parts: drag handle and arrows to reorder */
table.parts td.drag { width: 1%; color: var(--color-fg-muted); }
table.parts .handle { cursor: grab; padding: 0 6px; font-size: 16px; user-select: none; }
table.parts .move-up, table.parts .move-down { font-size: 11px; padding: 0 2px; min-width: 24px; min-height: 24px; text-decoration: none; }
table.parts tr.dragging { opacity: .45; }
@media (pointer: fine) { table.parts .move-up, table.parts .move-down { opacity: .5; } }
/* Phones: each part becomes a small card, its fields two to a row with their names above them */
@media (max-width: 600px) {
  .parts-wrap { overflow-x: visible; }
  table.parts, table.parts tbody, table.parts tfoot { display: block; }
  table.parts thead { display: none; }
  table.parts tr.part { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; align-items: end;
    grid-template-areas: "move move pts rm" "sets sets reps reps" "dist dist zone zone" "hr hr rest rest" "note note note note";
    padding: 10px 12px 12px; margin-bottom: 10px; border: 1px solid var(--color-border-line); border-radius: 12px; background: var(--color-panel); }
  table.parts tr.part > td { display: block; padding: 0; border: 0; min-width: 0; }
  table.parts tr.part > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 13px; font-weight: 500; color: var(--color-fg-muted); }
  table.parts tr.part input, table.parts tr.part select { width: 100% !important; }
  table.parts tr.part > td.drag { grid-area: move; width: auto; display: flex; gap: 6px; align-self: center; }
  table.parts td.drag .handle { display: none; }   /* dragging needs a mouse; the arrows move a part on a phone */
  table.parts .move-up, table.parts .move-down { min-width: 40px; min-height: 36px; font-size: 13px; border: 1px solid var(--color-input-line); border-radius: 8px; }
  table.parts td.p-sets { grid-area: sets; } table.parts td.p-reps { grid-area: reps; }
  table.parts tr.part > td.p-dist { grid-area: dist; display: flex; flex-wrap: wrap; gap: 0 6px; white-space: normal; }
  table.parts td.p-dist::before { flex-basis: 100%; }
  table.parts td.p-dist input { flex: 1 1 0; width: auto !important; -moz-appearance: textfield; appearance: textfield; }
  table.parts td.p-dist input::-webkit-inner-spin-button { display: none; } table.parts td.p-dist select { flex: none; width: auto !important; }
  table.parts td.p-zone { grid-area: zone; } table.parts td.p-hr { grid-area: hr; } table.parts td.p-rest { grid-area: rest; }
  table.parts td.p-note { grid-area: note; }
  table.parts td.p-points { grid-area: pts; align-self: center; text-align: right; }
  table.parts td.p-remove { grid-area: rm; align-self: center; text-align: right; }
  table.parts tfoot tr { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  table.parts tfoot td { display: block; border: 0; padding: 0; }
  table.parts tfoot td:empty { display: none; }
}
.week-table.show-why .why-target { text-align: left; max-width: 260px; white-space: normal; margin: 6px 0 0; }

.squad-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,.2); }
.squad-week + .squad-week { margin-top: var(--cds-gap-lg); }
.squad-name { white-space: nowrap; }
.squad-earlier > summary { cursor: pointer; font-weight: 600; color: var(--brand-red); margin-top: var(--cds-gap-lg); }
.season-year + .season-year { margin-top: var(--cds-gap-lg); }
.season-part { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-border-line); }
.season-part label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.season-part input { width: 100%; box-sizing: border-box; }
.season-part.current .season-name input { font-weight: 700; }
.season-year button { margin-top: 12px; }
@media (max-width: 600px) { .season-part { grid-template-columns: 1fr 1fr; } .season-part .season-name { grid-column: 1 / -1; } }
.scoring-form fieldset { border: 1px solid var(--color-border-line); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.scoring-form legend { padding: 0 6px; font-weight: 700; }
.race-picks { display: flex; flex-direction: column; gap: 4px; max-height: 18em; overflow-y: auto; }
.calendar-btn { align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
#rhr > summary { gap: 10px; flex-wrap: nowrap; }
#rhr > summary h2 { flex: 1 1 auto; min-width: 0; }
.rhr-chips { display: flex; gap: 8px; margin-left: auto; margin-right: 8px; }
.rhr-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4.5em; padding: 4px 10px; border-radius: 10px; background: var(--color-bg); border: 1px solid var(--color-border-line); line-height: 1.15; }
.rhr-chip .k { font-size: 11px; color: var(--color-muted, #6b6b6b); white-space: nowrap; }
.rhr-chip b { font-family: var(--font-display); font-size: 22px; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alerts > * { margin: 0; }
#rhr-form .rhr-for { display: block; margin-bottom: 6px; }
#rhr-form .rhr-entry { display: flex; align-items: flex-start; gap: 12px; }
#rhr-form .rhr-box { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
#rhr-form .rhr-box input { width: 6em; text-align: center; }
#rhr-form .rhr-entry button { min-height: 44px; }
.map-link { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.year-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 8px; padding-bottom: 2px; }
.year-tab { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--color-border-line); background: var(--color-bg); color: inherit; font-weight: 600; cursor: pointer; }
.year-tab[aria-selected="true"] { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.video-link { font-weight: 600; white-space: nowrap; }
.how-points > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; list-style: none; }
.how-points > summary::-webkit-details-marker { display: none; }
.how-points > summary::before { content: "▸"; color: var(--brand-red); font-size: 16px; transition: transform .15s; }
.how-points[open] > summary::before { transform: rotate(90deg); }
.vdot-move .arrow { display: inline-block; margin: 0 6px; font-weight: 700; }
.vdot-move .arrow.up { color: var(--color-ok); }
.vdot-move .arrow.down { color: var(--color-bad); }
.vdot-move .arrow.same, .vdot-move .arrow.new { color: var(--color-muted, #888); }
.vdot-move .was { color: var(--color-muted, #888); }
.zone-head { text-align: center; white-space: nowrap; }
.zone-head .zone-name { font-weight: 700; }
.wc-charts { min-height: 200px; }
.wc-charts .wc-title { font-size: 13px; font-weight: 600; fill: var(--color-fg); }
.wc-charts .wc-axis { font-size: 11px; fill: var(--color-muted, #6b6b6b); }
.wc-charts .wc-rep { font-size: 11px; font-weight: 700; fill: var(--color-fg); }
.wc-band { fill: color-mix(in srgb, var(--color-ok) 22%, transparent); }
.wc-band.easy { fill: color-mix(in srgb, var(--cds-chart-reference) 16%, transparent); }
.wc-key { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.wc-sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.wc-sw.band { background: color-mix(in srgb, var(--color-ok) 30%, transparent); }
.wc-sw.easy { background: color-mix(in srgb, var(--cds-chart-reference) 25%, transparent); }
.wc-sw.pause { background: repeating-linear-gradient(45deg, var(--cds-chart-muted) 0 2px, transparent 2px 5px); }
.run-link { text-decoration: none; color: inherit; }
.run-link b { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.wc-rec { margin: 10px 0; }
.wc-table td.rec { text-align: center; }
.sections-grid th.sec-head { vertical-align: bottom; height: 7.5em; padding: 4px 2px; }
.sections-grid th.sec-head span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; }
.sections-grid input[type=checkbox] { width: 20px; height: 20px; }
.rec-pill { margin-top: 4px; font-size: 12px; text-decoration: none; }
.wc-sum { margin: 12px 0 4px; }
.wc-flag { margin: 2px 0; color: var(--color-bad); }
#effort > form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
#effort .effort-done { margin-left: auto; margin-right: 8px; color: var(--color-ok); font-weight: 600; }
.wc-athlete > .card { border: 0; padding: 0; margin: 0; background: transparent; }
.workouts-by-day .parts-col { min-width: 24rem; }
.workouts-by-day .part-line { white-space: nowrap; line-height: 1.5; }
.workouts-by-day .part-line + .part-line { border-top: 1px dashed var(--color-border-line); }
.workouts-by-day .groups-col { width: 1%; white-space: nowrap; }
.zone-line { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.group-up { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; padding: 1px 7px; }
.group-up svg { flex: none; }
.hero .hero-move { display: inline-flex; align-items: center; gap: 6px; background: var(--color-panel); border-radius: 999px; padding: 4px 10px; }
/* Team calendar: a workout's parts, one per line. */
.cal-parts { list-style: none; margin: 2px 0 0; padding: 0; }
.cal-item.kind-workout .cal-time { color: var(--color-fg-muted); }
/* Courses: a YouTube link box for each distance ticked, and distance tags that open their video. */
.course-videos { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.course-videos legend { font-weight: 600; margin-bottom: 6px; }
fieldset.course-videos label.video-row { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; }
.course-videos .video-row[hidden] { display: none; }
.course-videos .video-row .dist { width: 5.5rem; font-weight: 600; }
.course-videos .video-row input { flex: 1; max-width: 32rem; }
a.tag.video-tag { text-decoration: none; }
a.tag.video-tag:hover { text-decoration: underline; }
/* Athlete page: the week's miles and points as compact panels. */
.week-panel { padding: 12px 14px; gap: 8px; }
.week-panel h2 { font-size: 18px; margin: 0; }
.week-panel .miles-bar.big { height: 8px; margin: 0; }
.week-panel .facts { gap: 6px; }
.week-panel .facts > div { padding: 6px 8px; gap: 1px; border-radius: 10px; }
.week-panel .facts .k { font-size: 10.5px; }
.week-panel .facts .big { font-size: 20px; }
.week-panel .facts .small { font-size: 12px; line-height: 1.3; }
.week-panel > p.small, .week-panel .how-points { margin: 0; font-size: 12px; }
.course-routes { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--color-border-line); }
.course-routes h3 { margin: 0 0 4px; }
.route-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.route-list .dist { display: inline-block; width: 5.5rem; font-weight: 600; }
a.route-link { white-space: nowrap; }

/* Race Day boards (coach page) */
.rd-board { display: grid; gap: 10px; }
.rd-links { display: grid; gap: 10px; }
.rd-url { width: min(100%, 30em); font-size: 13px; padding: 4px 6px; }

/* Dashboard: four tabs, each with athletes in collapsible bands */
.dash-tabs { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px; border-bottom: 1px solid var(--color-border-line); margin: 12px 0 14px; }
@media (max-width: 560px) { .dash-tabs { grid-template-columns: 1fr 1fr; } }
.dash-tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: inherit; opacity: .7; padding: 10px 14px; margin-bottom: -1px; white-space: nowrap; cursor: pointer; min-height: 44px; }
.dash-tabs button[aria-selected="true"] { opacity: 1; border-bottom-color: var(--brand-red); }
.dash-band { margin-bottom: 12px; }
.dash-band > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.dash-band > summary::-webkit-details-marker { display: none; }
.dash-band > summary::before { content: "▸"; font-size: 14px; transition: transform .15s; }
.dash-band[open] > summary::before { transform: rotate(90deg); }
.dash-band > summary h2 { margin: 0; font-size: 1.1rem; }
.dash-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.dash-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 8px 0; border-top: 1px solid var(--color-border-line); }
.dash-list li:first-child { border-top: 0; }
.dash-pct { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.dash-detail { grid-column: 1 / -1; }
.dash-bar { grid-column: 1 / -1; display: block; width: 100%; max-width: 28rem; margin: 4px 0 2px; }
.band-top .dash-bar > span { background: var(--color-ok); }
.band-mid .dash-bar > span { background: var(--color-warn); }
.band-low .dash-bar > span { background: var(--color-bad); }
@media (prefers-reduced-motion: reduce) { .dash-band > summary::before { transition: none; } }

/* Daniels' session limits on the Workouts page, and warning messages */
.flash.warn { border-color: var(--color-warn); }
.limit-warn { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--color-warn); background: var(--color-soft); border-radius: 6px; }
.limit-warn > summary { cursor: pointer; font-weight: 600; font-size: 0.9em; }
.limit-list { margin: 2px 0 6px; padding-left: 18px; }
.limit-list li { margin: 2px 0; }
.vdot-hints > summary { cursor: pointer; list-style: none; }
.vdot-hints > summary h2 { display: inline; }
.vdot-hint { border-top: 1px solid var(--color-border-line); padding: 10px 0; }
.vdot-hint table { margin-top: 6px; }

/* Running-form analysis */
.form-top { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 18px; align-items: center; }
.form-figure { width: 100%; height: auto; color: var(--color-fg); }
.form-score { font-family: var(--font-display, inherit); font-size: 3rem; font-weight: 700; color: var(--brand-red); line-height: 1; }
.form-check > summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; font-weight: 600; }
.form-check > summary::-webkit-details-marker { display: none; }
.form-check .fc-val { font-variant-numeric: tabular-nums; text-align: right; }
.form-check.good .fc-val { color: var(--color-good); }
.form-check.low .fc-val, .form-check.high .fc-val { color: var(--color-bad); }
.form-check p { margin: 6px 0; }
.form-curves { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.form-curve { margin: 0; }
.form-curve figcaption { font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; }
.form-curve svg { width: 100%; height: auto; }
.form-curve .grid { stroke: var(--color-border-line); stroke-width: 1; }
.form-curve text { font-size: 9px; fill: var(--color-fg-muted); }
#status.bad { color: var(--color-bad); }
@media (max-width: 560px) { .form-top { grid-template-columns: 1fr; } .form-figure { max-width: 180px; } }

/* Running-form results screen (form-view.js): a dark, app-like panel */
.fv { background: #121212; color: #eee; border-radius: 18px; padding: 10px; font-family: Inter, system-ui, sans-serif; }
.fv-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.fv-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.fv-stage canvas { position: absolute; inset: 0; pointer-events: none; }
.fv-stage.fv-anim { background: radial-gradient(circle at 50% 35%, #2a2a2a, #0d0d0d 75%); aspect-ratio: 4 / 3; max-height: 60vh; }
.fv-controls { display: flex; align-items: center; gap: 10px; padding: 12px 4px; }
.fv-play { background: #ff5a1f; color: #fff; border: 0; border-radius: 10px; width: 46px; height: 42px; font-size: 16px; cursor: pointer; }
.fv-speed { background: #262626; color: #fff; border: 0; border-radius: 12px; padding: 0 12px; height: 42px; font-weight: 700; cursor: pointer; }
.fv-controls input[type=range] { flex: 1; accent-color: #ff5a1f; }
.fv-tabs { display: flex; gap: 4px; border-bottom: 1px solid #2a2a2a; margin: 4px 0 12px; overflow-x: auto; }
.fv-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: #bbb; font: inherit; font-size: 1.02rem; padding: 10px 14px; cursor: pointer; }
.fv-tabs button[aria-selected="true"] { color: #ff6a2b; border-bottom-color: #ff6a2b; }
.fv-total { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; background: #1e1e1e; border-radius: 18px; padding: 14px 18px; margin-bottom: 12px; }
.fv-total-label { font-size: 1.25rem; color: #ddd; }
.fv-total-num { font-size: 2.6rem; font-weight: 600; }
.fv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fv-card { text-align: left; background: #1e1e1e; color: #eee; border: 0; border-radius: 18px; padding: 14px 14px 0; display: flex; flex-direction: column; gap: 6px; cursor: pointer; font: inherit; min-height: 230px; }
.fv-card[aria-expanded="true"] { grid-column: 1 / -1; }
.fv-card-top { display: flex; align-items: center; gap: 12px; }
.fv-sub { color: #aaa; font-size: .9rem; }
.fv-big { font-size: 1.6rem; font-weight: 600; }
.fv-name { color: #ddd; font-size: 1.05rem; margin-top: 6px; }
.fv-verdict { font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.fv-val { color: #bbb; font-size: .85rem; font-variant-numeric: tabular-nums; }
.fv-val span { color: #888; }
.fv-pri { display: flex; align-items: center; gap: 8px; color: #ff6a2b; font-size: .85rem; margin-top: auto; }
.fv-pri b { background: #3a1d12; border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.05rem; flex: none; }
.fv-more p { margin: 4px 0; font-size: .9rem; color: #ddd; }
.fv-tap { background: #2a2a2a; margin: 8px -14px 0; padding: 8px; text-align: center; border-radius: 0 0 18px 18px; font-size: .85rem; color: #ddd; }
.fv-card.good .fv-verdict { color: #9be07e; }
.fv-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fv-metric { background: #1e1e1e; border-radius: 18px; padding: 14px; }
.fv-metric p, .fv-note { color: #aaa; font-size: .85rem; margin: 6px 0 0; }
.fv-chart { background: #1e1e1e; border-radius: 18px; padding: 12px; margin: 12px 0 0; }
.fv-chart figcaption { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.fv-chart figcaption span { font-weight: 400; font-size: .8rem; color: #bbb; display: flex; gap: 6px; align-items: center; }
.fv-chart i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.fv-chart svg { width: 100%; height: auto; }
.fv-chart text { fill: #999; font-size: 9px; }
@media (max-width: 380px) { .fv-big { font-size: 1.3rem; } .fv-verdict { font-size: 1rem; } }
/* the results screen's own buttons, not the app's red ones */
.fv button { min-height: 0; box-shadow: none; text-transform: none; letter-spacing: normal; }
.fv button.fv-card, .fv button.fv-card:hover, .fv button.fv-card:focus, .fv button.fv-card:active { background: #1e1e1e !important; color: #eee !important; text-align: left; align-items: stretch; justify-content: flex-start; }
.fv button.fv-card:focus-visible { outline: 2px solid #ff6a2b; outline-offset: 2px; }
.fv .fv-card-top, .fv .fv-name, .fv .fv-verdict, .fv .fv-val { text-align: left; }
.fv .fv-card-top { justify-content: flex-start; }
.fv button.fv-play, .fv button.fv-play:hover { background: #ff5a1f !important; color: #fff !important; }
.fv button.fv-speed, .fv button.fv-speed:hover { background: #262626 !important; color: #fff !important; }
.fv .fv-tabs button, .fv .fv-tabs button:hover { background: none !important; border-radius: 0; }
.fv .fv-tap { align-self: stretch; }
.form-athlete { display: grid; gap: 4px; max-width: 26rem; margin-bottom: 12px; font-weight: 600; }

/* Cards holding wide tables span the whole row of a card grid, so their columns aren't squeezed into tall rows */
.grid > .wide-card { grid-column: 1 / -1; }

/* Season plan: phase colors (the school year strip, the season path) */
.phase-strip { display: flex; gap: 2px; flex: 1; min-width: 0; }
.ph { display: inline-block; height: 14px; flex: 1; min-width: 4px; border-radius: 3px; background: var(--color-soft); }
.ph.key { width: 12px; flex: none; vertical-align: -2px; }
.ph1 { background: #7FB77E; } .ph2 { background: #4F7CA8; } .ph3 { background: #D98E04; } .ph4 { background: #A6192E; }
.ph.now { outline: 2px solid var(--color-text, #222); outline-offset: 1px; }

/* ---------- course flyover (flyover.html, flyover.js) ---------- */
.flyover {
  --fly-c1: var(--brand-red); --fly-c2: var(--brand-gold); --fly-c3: var(--color-fg);
  --fly-land: #F0EBE0; --fly-park: #F5EBC8; --fly-water: #D9D5CD; --fly-road: #DCD5C8; --fly-strip: #E9E3D6; --fly-contour: #E8C6C3;
  --fly-ghost1: #E3A9AB; --fly-ghost2: #F6DA85; --fly-ghost3: #B8B3AA; --fly-case: #1C1A1A; --fly-halo: var(--color-bg);
  --fly-fill1: #E7A4A6; --fly-fill2: #F7DC8A; --fly-fill3: #B4AFA8; --fly-area: #E8E1D3; --fly-line: var(--color-border-line);
  max-width: 1240px; margin: 0 auto;
}
@media (prefers-color-scheme: dark) {
  .flyover {
    --fly-c1: #E0333B; --fly-c2: #F2B705;
    --fly-land: #1E1A18; --fly-park: #2A2416; --fly-water: #333A40; --fly-road: #3A3430; --fly-strip: #2C2724; --fly-contour: #4A2A2A;
    --fly-ghost1: #6E2A2D; --fly-ghost2: #6B5414; --fly-ghost3: #55504A; --fly-case: #0C0A09;
    --fly-fill1: #7A2A2E; --fly-fill2: #7A6014; --fly-fill3: #5A5550; --fly-area: #2C2724;
  }
}
.fly-back { margin: 0 0 6px; }
.fly-head h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 46px); line-height: .95; margin: 0 0 16px; }
.fly-head h1 small { display: block; font-family: inherit; font-weight: 400; font-size: 16px; color: var(--color-fg-muted); margin-top: 6px; }
.fly-stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.fly-map { position: relative; background: var(--fly-land); border: 1px solid var(--color-border-line); border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; max-height: 70vh; width: 100%; touch-action: none; }
.fly-map svg { width: 100%; height: 100%; display: block; }
#fly-offmap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
#fly-offmap[hidden] { display: none; }
.fly-credit { position: absolute; right: 6px; bottom: 6px; font-size: 11px; line-height: 1.2; color: #FFFFFF; background: rgba(0, 0, 0, .55); padding: 2px 6px; border-radius: 6px; pointer-events: none; }
.fly-credit[hidden] { display: none; }
.fly-map.on-photo .fly-ghost { stroke-width: 4; opacity: .9; }
.fly-map .fly-land, .fly-map .land { fill: var(--fly-land); }
.fly-map .park { fill: var(--fly-park); } .fly-map .water { fill: var(--fly-water); } .fly-map .lot { fill: var(--fly-road); }
.fly-map .road { fill: none; stroke: var(--fly-road); stroke-linecap: round; stroke-linejoin: round; }
.fly-map .strip { fill: none; stroke: var(--fly-strip); stroke-width: 16; stroke-linecap: round; }
.fly-map .track { fill: var(--fly-park); stroke: var(--fly-road); stroke-width: 6; }
.fly-map .contour { fill: none; stroke: var(--fly-contour); stroke-width: 1.2; }
.fly-ghost, .fly-case, .fly-route { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.fly-ghost { stroke-width: 3; } .fly-case { stroke: var(--fly-case); stroke-width: 9; } .fly-route { stroke-width: 5; }
.fly-mk { fill: var(--color-bg); stroke: var(--color-fg); } .fly-mk.on { fill: var(--color-fg); }
.fly-start { fill: var(--fly-c1); stroke: var(--fly-halo); } .fly-finish { fill: var(--color-fg); stroke: var(--fly-halo); }
#fly-ring { stroke: var(--color-fg); } .fly-dot { fill: var(--color-bg); stroke: var(--color-fg); }
.fly-map text { font-family: var(--font-display); paint-order: stroke; stroke: var(--fly-halo); stroke-width: 3px; stroke-linejoin: round; }
.fly-map .t-lab { fill: var(--color-fg-muted); font-weight: 600; }
.fly-map .t-cp, .fly-map .t-mk { fill: var(--color-fg); font-weight: 800; }
.fly-map .t-flag { fill: var(--fly-c1); font-weight: 800; }
.fly-panel { display: flex; flex-direction: column; gap: 16px; }
.fly-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fly-fig b { display: block; font-family: var(--font-display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.fly-fig span { font-size: 14px; color: var(--color-fg-muted); }
.fly-section { border-left: 6px solid var(--seg, var(--fly-c1)); padding: 4px 0 4px 14px; }
.fly-section h2 { font-family: var(--font-display); font-size: 28px; line-height: 1; margin: 0 0 4px; }
.fly-section p { margin: 0; color: var(--color-fg-muted); font-size: 15px; }
.fly-note { font-family: var(--font-display); font-size: 23px; line-height: 1.15; min-height: 56px; }
.fly-note small { display: block; font-family: var(--font-body, inherit); font-size: 14px; color: var(--color-fg-muted); }
.fly-legend { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.fly-legend div { display: flex; align-items: center; gap: 10px; opacity: .45; }
.fly-legend div.on { opacity: 1; font-weight: 600; }
.fly-legend i { width: 34px; height: 9px; border-radius: 5px; box-shadow: 0 0 0 1.5px var(--fly-case); flex: none; }
.fly-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fly-controls button { background: var(--color-soft); color: var(--color-fg); border-color: var(--color-border-line); }
.fly-controls button:hover { background: var(--color-border-line); color: var(--color-fg); border-color: var(--color-border-line); }
.fly-controls button[aria-pressed="true"] { background: var(--color-fg); color: var(--color-bg); border-color: var(--color-fg); }
.fly-controls button.fly-play { background: var(--brand-red); color: #FFFFFF; border-color: var(--brand-red); min-width: 92px; }
.fly-controls button[hidden] { display: none; }
.fly-speeds { display: inline-flex; gap: 4px; }
.fly-profile { margin-top: 20px; }
.fly-hint { font-size: 15px; color: var(--color-fg-muted); margin: 0 0 8px; }
.fly-scrub { position: relative; height: 170px; background: var(--color-soft); border: 1px solid var(--color-border-line); border-radius: 14px; padding: 14px 18px 34px 58px; touch-action: none; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.fly-plot { position: relative; width: 100%; height: 100%; }
.fly-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fly-grid { position: absolute; left: -52px; right: 0; height: 0; border-top: 1px dashed var(--fly-line); }
.fly-grid span { position: absolute; left: 0; top: -10px; font-size: 13px; color: var(--color-fg-muted); font-variant-numeric: tabular-nums; }
.fly-ticks { position: absolute; left: 0; right: 0; bottom: -28px; height: 20px; font-size: 13px; color: var(--color-fg-muted); }
.fly-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.fly-ticks span.first { transform: none; } .fly-ticks span.last { transform: translateX(-100%); }
.fly-cursor { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-left: -1.5px; background: var(--color-fg); pointer-events: none; }
.fly-knob { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--fly-c1); border: 4px solid var(--color-fg); box-shadow: 0 0 0 3px var(--color-bg); pointer-events: none; }
.fly-about { margin-top: 22px; font-size: 14px; color: var(--color-fg-muted); max-width: 72ch; }
@media (max-width: 860px) {
  .fly-stage { grid-template-columns: 1fr; }
  .fly-map { max-height: none; }
  .fly-fig b { font-size: 32px; }
  .fly-scrub { height: 150px; padding-left: 50px; }
}
@media (max-width: 600px) { .fly-ticks span.half { display: none; } }
.course-flyovers textarea { width: 100%; font-family: inherit; }
.flyover-item { border: 1px solid var(--color-border-line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.flyover-item summary { cursor: pointer; }
.flyover-item .dist { display: inline-block; width: 5.5rem; font-weight: 600; }
.flyover-item label { display: block; margin-bottom: 8px; }

/* Courses: tracing the route on the area's satellite photo */
.trace-wrap { position: relative; width: 100%; max-width: 900px; margin-top: 8px; border-radius: 8px; overflow: hidden; touch-action: manipulation; }
.trace-wrap img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.trace-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.trace-wrap.centring svg { cursor: copy; }

/* A run typed in by hand (manual_runs.py), not from a watch */
.tag.manual-tag { color: var(--color-fg-muted); background: var(--color-soft); border: 1px dashed var(--color-input-line); }

/* Tap targets (WCAG 2.2: at least 24 × 24 px). Links in tables and lists get vertical padding: on an inline link it makes the tap
   area taller without changing the line height, so dense tables such as the Week page keep their height. Links and small link
   buttons that sit as blocks take the padding back with a negative margin, so nothing moves. */
:is(table.list td, table.list th, .dash-who, p) > a:not(.button, .pill, .tag, .zone-line, .rec-pill),
p > a:only-child:not(.button, .pill, .tag), main > a.small, a.map-link, .vdot-group td.name a { padding-block: 5px; }
.notice > a, .panel-head > a, .hero a.back { padding-block: 4px; margin-block: -4px; }
table.list td a.pill { min-height: 24px; margin-block: -1px; }
table.list td button.link { min-height: 24px; margin-block: -2px; }
.form-row button.link { min-height: 24px; }
table.list td summary { padding-block: 3px; margin-block: -3px; }
.week-table a.zone-line { padding-block: 4px; margin-top: 0; margin-bottom: -4px; }   /* was margin-top: 4px */
.week-table a.tag { padding-top: 3px; padding-bottom: 3px; margin-bottom: -4px; }

/* Form drills (drills.py, drill-anim.js) */
.drill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.drill-card { background: var(--color-panel); border: 1px solid var(--color-border-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-margin-top: 70px; }
.drill-card h3 { margin: 0; font-size: 18px; }
.drill-anim canvas { display: block; width: 100%; height: 220px; background: var(--color-soft); border-radius: 10px; }
.drill-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.drill-bar button { padding: 4px 12px; font-size: 14px; min-height: 32px; }
.drill-bpm { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; margin: 0; }
.drill-bpm input { width: 5em; margin: 0; padding: 4px 8px; }
.drill-steps { margin: 0; padding-left: 1.3em; font-size: 15px; }
.drill-steps li { margin-bottom: 3px; }
.drill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
