@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-display: swap; src: url(fonts/big-shoulders-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url(fonts/big-shoulders-display-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 900; font-display: swap; src: url(fonts/big-shoulders-display-latin-900-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(fonts/public-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url(fonts/public-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-display: swap; src: url(fonts/public-sans-latin-700-normal.woff2) format("woff2"); }

/* Road: asphalt ground, centre-line yellow for PBs and race day, blue for workouts, green for easy, orange for heat. */
:root {
  --bg: #26282b;
  --panel: #2f3236;
  --panel-2: #383c41;
  --rule: #454a50;
  --text: #eceae4;
  --muted: #a3a8ae;
  --line: #f5c518;
  --quality: #8aa8f7;
  --quality-deep: #4f72d6;
  --easy: #66c497;
  --heat: #f09a4a;
  --strength: #c9a2f2;
  --good: #7fd6a2;
  --bad: #ff9a8f;
  --paper: #fbfbf8; --ink: #1b1c1e; --ink-muted: #696a66; --paper-rule: #dedcd5;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --r: 6px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 400 16px/1.5 var(--body); background-color: var(--bg);
  background-image: radial-gradient(rgba(255,255,255,.03) 1px, transparent 1.2px), radial-gradient(rgba(0,0,0,.16) 1px, transparent 1.2px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px;
}
a { color: var(--quality); }
:focus-visible { outline: 3px solid var(--line); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 3px; font-size: 14px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh; }
.rail { padding: 20px 12px; border-right: 1px solid var(--rule); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; font: 900 30px/0.95 var(--display); color: var(--text); text-decoration: none; margin: 0 8px; }
.brand small { display: block; font: 400 13px/1.35 var(--body); color: var(--muted); margin-top: 5px; }
.test-server { display: inline-block; margin: 10px 8px 0; padding: 2px 8px; border-radius: 999px; font: 700 12px/1.6 var(--body); color: var(--heat); border: 1px solid currentColor; }
.centre { height: 4px; margin: 16px 8px 14px; background: repeating-linear-gradient(90deg, var(--line) 0 22px, transparent 22px 38px); }
.rail nav a { display: block; padding: 7px 10px; border-radius: 4px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.rail nav a:hover { background: var(--panel); }
.rail nav a[aria-current="page"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--line); }
.rail nav .sep { height: 1px; background: var(--rule); margin: 8px 6px; }
.rail .add { display: block; margin: 14px 4px 0; text-align: center; }
main { padding: 26px 30px 70px; max-width: 1260px; width: 100%; min-width: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 12px 16px; display: flex; align-items: center; gap: 12px; overflow-x: auto; }
  .brand { font-size: 24px; margin: 0; flex: none; }
  .brand small, .centre { display: none; }
  .rail nav { display: flex; gap: 2px; }
  .rail nav a { white-space: nowrap; padding: 6px 9px; }
  .rail nav .sep { display: none; }
  .rail .add { margin: 0; flex: none; }
  main { padding: 18px 16px 56px; }
}

/* ---------- type */
h1 { font: 900 clamp(36px, 5vw, 52px)/0.98 var(--display); margin: 0 0 6px; }
h2 { font: 800 28px/1.05 var(--display); margin: 38px 0 12px; }
h3 { font: 800 21px/1.1 var(--display); margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 22px; max-width: 72ch; }
.muted { color: var(--muted); }
.big { font: 900 48px/0.95 var(--display); font-variant-numeric: tabular-nums; }
.mid { font: 800 28px/1.02 var(--display); font-variant-numeric: tabular-nums; }
.k { font-size: 14px; color: var(--muted); }

/* ---------- surfaces */
.panel { background: var(--panel); border-radius: var(--r); padding: 18px 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-hero { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid-hero { grid-template-columns: 1fr 1fr; } .grid-hero > :first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .grid2, .grid3, .grid-hero { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 250px; }
.chart-box.tall { height: 300px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { padding: 12px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: -1px; }
.stat .v { font: 800 28px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 16px; }
.stat .s { font-size: 13px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px 16px; }
.tone-good { color: var(--good); } .tone-warn { color: var(--heat); } .tone-bad { color: var(--bad); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--muted); }
.dot.good { background: var(--good); } .dot.warn { background: var(--heat); } .dot.bad { background: var(--bad); }
.verdict { font: 800 24px/1.15 var(--display); margin: 4px 0 8px; }
ul.flags { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* tags */
.tag { display: inline-block; font: 700 14px/1 var(--display); letter-spacing: .02em; padding: 4px 7px 3px; border-radius: 3px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.c-easy, .c-recovery, .c-long { color: var(--easy); background: rgba(102,196,151,.13); }
.c-st-l, .c-st-m, .c-st-s, .c-tempo, .c-intervals { color: var(--quality); background: rgba(138,168,247,.14); }
.c-race { color: var(--line); background: rgba(245,197,24,.14); }
.c-strength, .c-cross { color: var(--strength); background: rgba(201,162,242,.14); }

/* ---------- week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--panel); border-radius: var(--r); overflow: hidden; }
.day { padding: 10px 11px 12px; border-right: 1px solid var(--rule); min-height: 112px; text-decoration: none; color: inherit; display: block; }
.day:last-child { border-right: 0; }
.day:hover { background: var(--panel-2); }
.day .dn { font: 700 15px/1 var(--display); color: var(--muted); }
.day.today { box-shadow: inset 0 3px 0 var(--line); }
.day.today .dn { color: var(--text); }
.day .w { font-weight: 600; font-size: 14px; line-height: 1.25; margin-top: 7px; }
.day .m { font: 800 21px/1 var(--display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.day .p { font-size: 13px; color: var(--muted); }
.day.planned .m { color: var(--muted); font-weight: 700; }
@media (max-width: 860px) {
  .week { grid-template-columns: 1fr; }
  .day { border-right: 0; border-bottom: 1px solid var(--rule); min-height: 0; display: grid; grid-template-columns: 58px 1fr auto; column-gap: 10px; align-items: baseline; }
  .day .w, .day .m { margin-top: 0; }
  .day .w:has(.tag) { display: none; }
  .day .m { text-align: right; white-space: nowrap; }
  .day .p { grid-column: 2 / -1; }
}

/* ---------- rep strip: one bar per work rep; height = power, colour = against target */
.strip { display: flex; align-items: flex-end; gap: 3px; height: 74px; padding-top: 16px; }
.rep { flex: 1 1 0; min-width: 12px; max-width: 46px; position: relative; background: var(--quality); border-radius: 2px 2px 0 0; }
.rep.fast { background: #cdd9fb; }
.rep.slow { background: var(--heat); }
.rep b { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font: 700 13px/1 var(--display); white-space: nowrap; color: var(--text); }
.rep i { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font: 600 12px/1 var(--display); font-style: normal; color: #14171a; }
.strip.dense .rep b { display: none; }
.strip-row { display: grid; grid-template-columns: 160px 1fr 230px; gap: 18px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.strip-row:last-child { border-bottom: 0; }
.strip-row .meta strong { display: block; font: 800 18px/1.1 var(--display); color: var(--text); }
.strip-row .meta { font-size: 14px; color: var(--muted); }
.strip-row .meta a { color: inherit; text-decoration: none; }
.strip-row .stats-t { font-size: 14px; line-height: 1.45; }
@media (max-width: 860px) { .strip-row { grid-template-columns: 1fr; gap: 6px; } }
.legend { display: flex; gap: 16px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--k); vertical-align: -1px; }

/* ---------- tables, lists */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 7px 8px; border-bottom: 1px solid var(--rule); }
td { padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; font-variant-numeric: tabular-nums; }
td.n, th.n { text-align: right; }
tr:last-child td { border-bottom: 0; }
tr.hl td { background: rgba(240,154,74,.10); }
.table-wrap { overflow-x: auto; }
.best { color: var(--line); font-weight: 700; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { padding: 9px 0 9px 16px; border-bottom: 1px solid var(--rule); position: relative; }
.notes li:last-child { border-bottom: 0; }
.notes li::before { content: ""; position: absolute; left: 0; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.notes li.good::before { background: var(--good); } .notes li.warn::before { background: var(--heat); }
.d-good { color: var(--good); font-weight: 600; } .d-bad { color: var(--heat); font-weight: 600; }

.log-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) 64px 60px 50px 52px 170px; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--rule); align-items: baseline; text-decoration: none; color: inherit; }
.log-row:hover { background: var(--panel-2); }
.log-row .n { text-align: right; font-variant-numeric: tabular-nums; }
.log-row.planned, .log-row.rest, .log-row.missed { color: var(--muted); }
.log-head { font-size: 13px; color: var(--muted); font-weight: 600; }
.log-head:hover { background: transparent; }
.weekhead { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 6px; gap: 12px; flex-wrap: wrap; }
.weekhead h2 { margin: 0; }
@media (max-width: 860px) { .log-row { grid-template-columns: 70px minmax(0, 1fr) 56px; } .log-row .opt { display: none; } }

/* ---------- coach */
.coach { background: var(--panel); border-radius: var(--r); padding: 18px 22px; border-left: 3px solid var(--quality); }
.coach h2 { font-size: 21px; margin: 18px 0 6px; }
.coach h2:first-child { margin-top: 0; }
.coach p { margin: 0 0 10px; max-width: 72ch; }
.coach ul { margin: 0 0 10px; padding-left: 20px; max-width: 72ch; }
.coach li { margin-bottom: 4px; }
.coach .foot { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------- forms */
.btn { display: inline-block; font: 700 15px/1 var(--body); padding: 10px 15px; border-radius: 4px; border: 2px solid var(--line); background: var(--line); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: transparent; color: var(--bad); border-color: #7f3a33; }
.btn.small { padding: 7px 11px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: wait; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.stack { display: grid; gap: 16px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px 16px; margin: 0; background: var(--panel); }
legend { font: 800 19px/1 var(--display); padding: 0 6px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 14px; }
.fields .wide { grid-column: 1 / -1; }
.fields .w2 { grid-column: span 2; }
@media (max-width: 520px) { .fields .w2 { grid-column: 1 / -1; } }
label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
label small { font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: 400 16px/1.3 var(--body); color: var(--text); background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; padding: 8px 9px; }
input:focus, select:focus, textarea:focus { border-color: var(--quality); outline: none; }
input[type=checkbox] { display: inline; width: auto; margin: 0 7px 0 0; accent-color: var(--line); }
textarea { min-height: 70px; resize: vertical; }
.flash { background: var(--panel); border-left: 3px solid var(--line); padding: 10px 14px; margin-bottom: 18px; }
.flash.err { border-color: var(--bad); }
.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.tabs { display: flex; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 99px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--text); color: var(--ink); border-color: var(--text); }

/* CPA */
.cpa-out .row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.cpa-out .row:last-child { border-bottom: 0; }
.cpa-out .row.on { font-weight: 700; }
.cpa-out .pace { font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.heatflag { display: inline-block; margin-top: 8px; color: var(--heat); font-weight: 600; }

/* ---------- bibs (races) */
.bibs { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 24px 20px; }
.bib { --band: #d93a2b; --band-ink: #fff; position: relative; display: flex; flex-direction: column; text-decoration: none; background: var(--paper); color: var(--ink); border-radius: 5px; box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 10px 22px -12px rgba(0,0,0,.6); transition: transform .15s ease; }
.bib:hover { transform: translateY(-2px) rotate(-.4deg); }
.bib::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 5px;
  background: radial-gradient(circle at 13px 13px, var(--bg) 4.5px, rgba(0,0,0,.25) 5.5px, transparent 6px),
    radial-gradient(circle at calc(100% - 13px) 13px, var(--bg) 4.5px, rgba(0,0,0,.25) 5.5px, transparent 6px),
    radial-gradient(circle at 13px calc(100% - 13px), var(--bg) 4.5px, rgba(0,0,0,.25) 5.5px, transparent 6px),
    radial-gradient(circle at calc(100% - 13px) calc(100% - 13px), var(--bg) 4.5px, rgba(0,0,0,.25) 5.5px, transparent 6px); }
.bib-band { background: var(--band); color: var(--band-ink); padding: 10px 30px 9px; border-radius: 5px 5px 0 0; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bib-band .name { font: 800 19px/1.05 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bib-band .yr { font: 700 16px/1 var(--display); opacity: .85; }
.bib-body { padding: 10px 22px 12px; text-align: center; flex: 1; }
.bib-num { font: 900 clamp(58px, 6.5vw, 72px)/0.95 var(--display); font-variant-numeric: tabular-nums; }
.bib-num.word { color: var(--ink-muted); }
.bib-dist { font: 800 18px/1 var(--display); margin-top: 6px; }
.bib-meta { font-size: 14px; color: var(--ink-muted); margin-top: 4px; }
.bib-tab { border-top: 2px dashed var(--paper-rule); margin: 0 14px; padding: 9px 14px 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; min-height: 46px; }
.bib-tab .place { font-weight: 700; }
.bib-tab .pace { font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bib-tab img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.pb-flag { position: absolute; top: 34px; right: -8px; z-index: 2; background: var(--line); color: var(--ink); font: 900 17px/1 var(--display); padding: 6px 8px 5px; transform: rotate(4deg); box-shadow: 0 3px 6px rgba(0,0,0,.35); }
.bib.upcoming { --band: var(--line); --band-ink: var(--ink); }
.bib.dnf .bib-body, .bib.dns .bib-body { opacity: .75; }
.band-0 { --band: #d93a2b; } .band-1 { --band: #1f5fbf; } .band-2 { --band: #1d7f55; } .band-3 { --band: #d9731c; } .band-4 { --band: #6a3fa0; } .band-5 { --band: #1b1c1e; }
.hero { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; }
.hero .bib:hover { transform: none; }
.hero .bib-num { font-size: clamp(74px, 9vw, 100px); }
.hero-photo { all: unset; display: block; cursor: zoom-in; border-radius: 6px; overflow: hidden; background: var(--panel); min-height: 280px; position: relative; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-photo.empty-photo { display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; cursor: default; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.ribbons { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.ribbon { background: var(--line); color: var(--ink); font: 800 18px/1 var(--display); padding: 8px 22px 7px 14px; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%); }
.gallery { columns: 3 240px; column-gap: 12px; }
.gallery button { all: unset; display: block; margin: 0 0 12px; cursor: zoom-in; border-radius: 4px; overflow: hidden; break-inside: avoid; position: relative; }
.gallery button:focus-visible { outline: 3px solid var(--line); }
.gallery .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.gallery .cover-tag { position: absolute; top: 8px; left: 8px; background: var(--line); color: var(--ink); font: 800 14px/1 var(--display); padding: 4px 6px 3px; }
.upload { border: 2px dashed var(--rule); border-radius: 6px; padding: 16px; margin-top: 14px; }
.upload input[type=file] { border: 0; padding: 0; background: transparent; }
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1200px, 96vw); max-height: 96vh; color: var(--text); }
dialog.lightbox::backdrop { background: rgba(10,10,11,.92); }
.lb-img { max-height: 76vh; width: auto; margin: 0 auto; border-radius: 4px; }
.lb-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }
.lb-bar form { display: flex; gap: 8px; align-items: center; margin: 0; }
.lb-bar input { margin: 0; min-width: 220px; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); } .lb-prev { left: 12px; } .lb-next { right: 12px; }
.halves { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0 4px; }
.halves div { font-size: 14px; color: var(--muted); }
.halves b { display: block; font: 800 26px/1.05 var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
tr.fast td:first-child { box-shadow: inset 3px 0 0 var(--good); } tr.slow td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

/* PB board */
.board { border-top: 2px solid var(--text); }
.pb-row { display: grid; grid-template-columns: 180px 220px 1fr auto; gap: 18px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--rule); }
.pb-row .dist { font: 900 32px/1 var(--display); }
.pb-row .time { font: 900 52px/0.95 var(--display); font-variant-numeric: tabular-nums; color: var(--line); }
.pb-row .time.none { font-size: 21px; color: var(--muted); font-weight: 700; }
.pb-row .where a { color: var(--text); font-weight: 700; text-decoration: none; }
.pb-row .where div { font-size: 14px; color: var(--muted); }
.pb-row .pace { font: 700 20px/1 var(--display); color: var(--muted); text-align: right; white-space: nowrap; }
.pb-row details { grid-column: 1 / -1; }
.pb-row summary { cursor: pointer; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .pb-row { grid-template-columns: 1fr auto; gap: 4px 12px; } .pb-row .where { grid-column: 1 / -1; } .pb-row .pace { display: none; } .pb-row .time { font-size: 42px; } }

/* prediction */
.pred-big { font: 900 clamp(56px, 8vw, 88px)/0.9 var(--display); color: var(--line); font-variant-numeric: tabular-nums; }
.method { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.method:last-child { border-bottom: 0; }
.method .t { font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.method .d { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.range-bar { position: relative; height: 10px; background: var(--panel-2); border-radius: 5px; margin: 18px 0 26px; }
.range-bar span { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--text); border-radius: 2px; }
.range-bar span.c { background: var(--line); width: 6px; top: -6px; height: 22px; }
.range-bar label { position: absolute; top: 18px; transform: translateX(-50%); font-size: 12px; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .bib:hover { transform: none; } }

.summary { display: flex; gap: 28px; flex-wrap: wrap; margin: 8px 0 22px; }
.summary div { font-size: 14px; color: var(--muted); }
.summary b { display: block; font: 900 38px/1 var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.pbstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.pbstrip a { padding: 12px 14px; text-decoration: none; color: var(--text); border-right: 1px solid var(--rule); }
.pbstrip a:hover { background: var(--panel); }
.pbstrip .d { font-size: 14px; color: var(--muted); }
.pbstrip .t { font: 800 30px/1.05 var(--display); font-variant-numeric: tabular-nums; color: var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 22px; }
.chips a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--rule); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.chips a[aria-current="page"] { background: var(--text); color: var(--ink); border-color: var(--text); }
.year { display: flex; align-items: baseline; gap: 14px; margin: 40px 0 16px; }
.year h2 { margin: 0; font-size: 40px; }
.year span { color: var(--muted); }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; }
.lede { color: var(--muted); max-width: 64ch; margin: 0 0 22px; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; gap: 0; } }
.report { font-size: 17px; line-height: 1.65; max-width: 68ch; }
.report p { margin: 0 0 14px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; }
.good { color: var(--good); } .bad { color: var(--bad); }
form.sheet { background: var(--panel); border-radius: 6px; padding: 24px 26px; display: grid; gap: 24px; max-width: 980px; }
form.sheet h3 { border-bottom: 2px solid var(--rule); padding-bottom: 6px; margin-bottom: 14px; }

/* Ask the coach */
.ask { background: var(--panel); border-radius: var(--r); padding: 16px 20px; margin-top: 22px; border-left: 3px solid var(--line); }
.ask h3 { margin-bottom: 10px; }
.ask-thread { display: grid; gap: 10px; margin-bottom: 12px; max-height: 520px; overflow-y: auto; }
.ask-q { justify-self: end; max-width: 80%; background: var(--panel-2); padding: 8px 12px; border-radius: 10px 10px 2px 10px; white-space: pre-line; }
.ask-a { max-width: 92%; }
.ask-a h2 { font-size: 18px; margin: 10px 0 4px; }
.ask-a p, .ask-a ul { margin: 0 0 8px; max-width: 72ch; }
.ask-form textarea { min-height: 54px; }
.ask-form .actions { margin-top: 8px; }

/* carb load */
.carb-set { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; }
.carb-set label { margin: 0; flex: 1 1 120px; }
.carb-set input, .carb-set select { margin-bottom: 0; }
.carb-tips { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: .92em; }
.carb-tips li + li { margin-top: 4px; }
.carb-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.carb-day { display: block; text-decoration: none; color: inherit; border: 1px solid transparent; }
.carb-day:hover { border-color: var(--rule); }
.carb-day.on { border-color: var(--line); }
.carb-total { font-family: var(--display); font-size: 2.4rem; font-weight: 700; line-height: 1.1; margin: 4px 0 8px; }
.carb-total small { font-family: var(--body); font-size: .9rem; font-weight: 400; color: var(--muted); }
.meter { position: relative; height: 10px; background: var(--rule); border-radius: 5px; overflow: hidden; }
.meter b { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 28%, transparent); }
.meter i { position: relative; display: block; height: 100%; background: var(--quality); border-radius: 5px; }
.meter i.in { background: var(--good); }
.meter i.over { background: var(--heat); }
@media (max-width: 760px) { .carb-total { font-size: 2rem; } #foodlist td:nth-child(2), #foodlist th:nth-child(2) { display: none; } }
td.num, th.num { white-space: nowrap; }
.ask-looked { margin-top: 8px; font-size: 13px; color: var(--muted); }
.splits-sec { margin-top: 18px; }
.splits-sec > summary { cursor: pointer; list-style: none; margin-bottom: 10px; }
.splits-sec > summary::-webkit-details-marker { display: none; }
.splits-sec > summary h2::after { content: " ▾"; font-size: .6em; color: var(--muted); }
.splits-sec:not([open]) > summary h2::after { content: " ▸"; }

/* workouts */
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.wk-card { display: block; text-decoration: none; color: inherit; border: 1px solid transparent; }
a.wk-card:hover { border-color: var(--rule); }
.wk-card[hidden] { display: none; }
.wk-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.wk-head .k { white-space: nowrap; }
.wk-sum { margin-top: 6px; font-size: 14px; }
.wk-tgt { margin-top: 8px; font-variant-numeric: tabular-nums; }
.wk-table td { vertical-align: top; }
.wk-rep td { background: color-mix(in srgb, var(--line) 10%, transparent); }
.wk-in td:first-child { padding-left: 22px; }
.wk-text { white-space: pre-wrap; font-size: 12.5px; background: var(--bg); padding: 10px; border-radius: 6px; margin: 8px 0 0; }
.wk-editor { display: grid; gap: 8px; }
.wk-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wk-row select, .wk-row input { margin: 0; width: auto; }
.wk-row [hidden] { display: none; }
.wk-repeat { border: 1px dashed var(--rule); border-radius: 8px; padding: 8px 10px; display: grid; gap: 8px; }
.wk-rephead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-tools button { background: none; border: 1px solid var(--rule); color: var(--muted); border-radius: 5px; width: 28px; height: 28px; cursor: pointer; }
.wk-tools button:hover { color: var(--ink); border-color: var(--muted); }

/* plans */
.approach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.approach { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; font-weight: 400; margin: 0; }
.approach input { width: auto; margin: 3px 0 0; }
.approach:has(input:checked) { border-color: var(--line); background: color-mix(in srgb, var(--line) 8%, transparent); }
.plan-weeks { width: 100%; border-collapse: collapse; table-layout: fixed; }
.plan-weeks th { font-size: 12px; color: var(--muted); text-align: left; padding: 6px; }
.plan-weeks td { vertical-align: top; padding: 6px; border-top: 1px solid var(--rule); font-size: 13px; }
.plan-weeks td.wk { width: 92px; }
.plan-weeks td.mi { width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.plan-weeks .ses { display: block; line-height: 1.3; margin-bottom: 4px; color: inherit; text-decoration: none; }
.plan-weeks .ses .k { display: block; font-size: 11.5px; }
.plan-weeks .ses.q { font-weight: 600; }
.plan-weeks .ses.race { color: var(--line); font-weight: 700; }
.plan-weeks .ses.done::before { content: "✓ "; color: var(--good); }
.plan-weeks tr.now td { background: color-mix(in srgb, var(--line) 7%, transparent); }
.phase-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--rule); color: var(--muted); margin-top: 3px; }
.phase-base { --p: #6c8ebf; } .phase-build { --p: #66c497; } .phase-peak { --p: #f5c518; } .phase-taper { --p: #c58bd8; }
.phase-tag[class*="phase-"] { border-color: var(--p); color: var(--p); }
@media (max-width: 900px) { .plan-weeks, .plan-weeks tbody, .plan-weeks tr, .plan-weeks td { display: block; width: auto !important; } .plan-weeks thead { display: none; }
  .plan-weeks td.pday:empty { display: none; } .plan-weeks td.pday::before { content: attr(data-dow) " "; color: var(--muted); font-size: 11px; } }
.cw-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cw-grid select { font-size: 13px; }
@media (max-width: 900px) { .cw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#custom-week { display: none; }
form:has(input[name="approach"][value="custom"]:checked) #custom-week { display: block; }
.approach.custom-card { border-style: dashed; }

/* double days on the plan form: show only the fields for the chosen kind */
#doubles .dbl-t, #doubles .dbl-e { display: none; }
#doubles:has(select[name="doubles"] option[value="threshold"]:checked) .dbl-t,
#doubles:has(select[name="doubles"] option[value="both"]:checked) .dbl-t { display: grid; }
#doubles:has(select[name="doubles"] option[value="threshold"]:checked) ul.dbl-t,
#doubles:has(select[name="doubles"] option[value="both"]:checked) ul.dbl-t { display: block; }
#doubles:has(select[name="doubles"] option[value="easy"]:checked) .dbl-e,
#doubles:has(select[name="doubles"] option[value="both"]:checked) .dbl-e { display: grid; }
.plan-weeks .ses .slot { font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
.plan-weeks .ses.pm { margin-top: 2px; padding-top: 4px; border-top: 1px dashed var(--rule); }

/* weekly review */
.review-item.applied, .review-item.dismissed { opacity: .7; }
.review-item.pending { border-left: 3px solid var(--line); }
.tag.good { color: var(--good); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }

/* the session form shows the structured workout only while it's planned */
form:has(select[name="status"] option[value="done"]:checked) #planned-workout { display: none; }

/* strength and cross-training */
.log-row.cross .x-meta { color: var(--muted); font-size: 14px; }
.sets-list { display: flex; flex-wrap: wrap; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.sets-list span { white-space: nowrap; }
.guess { color: var(--heat); font-size: 13px; }
.plan-weeks .ses.lift { color: var(--strength); border-left: 2px solid var(--strength); padding-left: 5px; }
.ses.lift.done { opacity: .75; }
.ses.lift.skipped { text-decoration: line-through; opacity: .6; }

/* Sign-in */
main.auth { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
main.auth h1 { margin-bottom: 16px; }
main.auth form label { margin-bottom: 14px; }
main.auth pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.signout { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 12px; overflow-wrap: anywhere; }
.signout button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
