/* JTC calendar — artifact design language.
   Warm cream page, white cards, black tabs and headings, color used
   sparingly for labels and borders (fitness teal, fatigue amber,
   form red-orange, + buttons orange-red). Session chips keep the
   website's sport colors (run green, bike blue, swim teal, rest
   gray) and status language: done is solid with a
   check, skipped is muted and struck through, planned is neutral.
   Below 700px the month view becomes a compact tappable grid with
   session dots instead of an unreadable squeeze. */

body { font-family: -apple-system, "Segoe UI", Helvetica, Arial,
  sans-serif; color: #1a1a1a; margin: 0; line-height: 1.5;
  background: #f6f2e9; }
header { background: #f6f2e9; color: #1a1a1a;
  padding: 0.9rem 1rem 0.75rem; display: flex;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: center; max-width: 76rem; margin: 0 auto; }
/* Brand logo: the Get Some Coaching lockup (three forward
   chevrons in the red-to-gold gradient beside GET SOME /
   COACHING), a transparent WebP sitting directly on the cream
   header — no white box. Small in the page header, big on the
   auth pages. */
header .brand { line-height: 1; display: flex; align-items: center; }
header .brand-logo { height: 4.5rem; width: auto; display: block; }
/* Shane, Nov 8: the header logo sits in from the left edge, closer
   to the nav, not hugging the far-left corner. (Auth pages centre
   the header, so the inset applies everywhere except there.) */
body:not(.auth) header .brand { margin-left: 2rem; }

/* Auth pages (signup / login): the registration moment gets the big
   centered lockup, with the red-to-gold rule under the header. */
body.auth header { justify-content: center; text-align: center;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, #b4232f, #c4532a, #d9a441) 1; }
body.auth header .brand-logo { height: auto; width: min(24rem, 88vw); }

header .who { color: #6f6a61; font-size: 0.9rem; }
header .who a { color: #1a1a1a; }
main { max-width: 76rem; margin: 0 auto; padding: 0.25rem 1rem 1rem; }
footer { text-align: center; color: #6f6a61; font-size: 0.8rem;
  padding: 2rem 1rem; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1rem; font-weight: 800; margin: 1.25rem 0 0.5rem; }
a { color: #1a1a1a; }
a:hover { text-decoration: underline; }
/* Keyboard focus (UX-04): one visible ring on every interactive
   stop — links, buttons, tabs, chips, summaries, dialog controls,
   form fields. No outline removal anywhere on the site; the browser
   default stays the floor and this ring makes it unmistakable on
   the cream/white surfaces. */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible { outline: 3px solid #1a1a1a;
  outline-offset: 2px; }
/* Dark surfaces need a light ring instead of a black one. */
.tab.active:focus-visible, .view-toggle .toggle-active:focus-visible,
.btn:focus-visible, .mcell.selected:focus-visible,
.add-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Skip link (UX-08): parked above the viewport until keyboard
   focus, then a black bar at the top of the page. */
.skip-link { position: absolute; left: 0.75rem; top: -4rem; z-index: 100;
  background: #1a1a1a; color: #fff; font-weight: 700;
  padding: 0.6rem 1rem; border-radius: 0 0 8px 8px;
  text-decoration: none; }
.skip-link:focus { top: 0; color: #fff; }
.meta { color: #6f6a61; font-size: 0.9rem; }
.empty { color: #6f6a61; }
.muted { color: #6f6a61; }

/* Pill tabs: header Home/Calendar/Coach + Month/Week toggle.
   Selected tab is solid black with white text, the artifact look. */
.tabs, .view-toggle { display: inline-flex; gap: 0.25rem;
  border: 1px solid #e2ddd2; background: #fff;
  border-radius: 999px; padding: 0.25rem; }
.view-toggle { margin-bottom: 1rem; }
.tab, .view-toggle a, .view-toggle span { padding: 0.65rem 1rem;
  border-radius: 999px; text-decoration: none; color: #1a1a1a;
  font-weight: 600; }
.tab:hover, .view-toggle a:hover { text-decoration: none;
  background: #f6f2e9; }
.tab.active, .view-toggle .toggle-active { background: #1a1a1a;
  color: #fff; font-weight: 700; }
.calnav, .weeknav { display: flex; gap: 1rem; margin-bottom: 1rem;
  flex-wrap: wrap; }
/* Month/week prev/next links are tappable nav: give them a 44px
   tall hit area (UX-02). */
.calnav a, .weeknav a { display: inline-block; padding: 0.65rem 0.25rem; }

/* Form & Fitness strip: white card, thick black top border,
   small gray caps header with the date at the right, big bold
   numbers under small colored caps labels, short plain-English
   explanations of each number below the stats. */
.strip { background: #fff; border: 1px solid #e2ddd2;
  border-top: 4px solid #1a1a1a; border-radius: 12px;
  padding: 1rem 1.25rem 1.1rem; margin-bottom: 1.5rem; }
.strip-head { display: flex; justify-content: space-between;
  gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.strip-title { margin: 0; font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #6f6a61; }
.strip-date { color: #6f6a61; font-size: 0.9rem;
  white-space: nowrap; }
.strip-stats { display: flex; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 0.75rem; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; }
.stat-label.fit { color: #0e7490; }
.stat-label.fat { color: #9f5d10; }
.stat-label.frm { color: #be4320; }
.stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1.05;
  color: #1a1a1a; }
.stat-value.frm { color: #be4320; }
.strip-estimated { color: #6f6a61; font-size: 0.9rem;
  margin: 0.6rem 0 0; }
.strip-explain { margin-top: 0.75rem; border-top: 1px solid #e2ddd2;
  padding-top: 0.6rem; }
.strip-explain p { margin: 0.4rem 0 0; font-size: 0.92rem;
  color: #3d3a35; line-height: 1.45; }
.strip-explain p:first-child { margin-top: 0; }
.strip .meta { color: #6f6a61; margin: 0.4rem 0 0; }

/* Endurance Quote of the Day: white card under the Form & Fitness
   strip, deep red top border, small caps bronze theme label, italic
   quote, muted attribution. */
.quote-card { background: #fff; border: 1px solid #e2ddd2;
  border-top: 4px solid #b4232f; border-radius: 12px;
  padding: 1rem 1.25rem 1.1rem; margin-bottom: 1.5rem; }
.quote-theme { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #856325; }
.quote-text { margin: 0; font-size: 1.15rem; font-style: italic;
  line-height: 1.45; color: #1a1a1a; }
.quote-author { margin-top: 0.6rem; font-size: 0.9rem;
  color: #6f6a61; }

/* Your Trajectory — goal-progress card (Nov 23, 2026, Shane).
   Soft cream like the PR cards: warm white, sand border, bronze
   small-caps label, deep red accents. No artwork, no icons. */
.trajectory-card { background: #fffdf8; border: 1px solid #e3d9c2;
  border-radius: 12px; padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.trajectory-label { color: #856325; font-size: 0.8rem;
  font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; }
.trajectory-name { font-size: 1.1rem; font-weight: 700;
  margin-top: 0.25rem; color: #1a1a1a; }
.trajectory-headline { font-style: italic; font-size: 1.05rem;
  line-height: 1.45; margin: 0.6rem 0 0.75rem; color: #1a1a1a; }
.trajectory-line { margin: 0.55rem 0; line-height: 1.45;
  color: #3d3a35; }
.trajectory-goal { color: #856325; font-size: 0.8rem;
  font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-right: 0.35rem; }
.trajectory-recommendations { border-top: 1px solid #e3d9c2;
  margin-top: 1rem; padding-top: 1rem; }
.trajectory-rec-event { margin: 0.85rem 0 0.15rem;
  line-height: 1.45; color: #1a1a1a; }
.trajectory-rec-bullets { margin: 0.15rem 0 0.25rem 1.1rem;
  padding: 0; line-height: 1.45; color: #3d3a35; }
.trajectory-rec-bullets li { margin: 0.35rem 0; }

/* Month grid */
.month-grid { display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 1px; background: #e2ddd2; border: 1px solid #e2ddd2;
  border-radius: 12px; overflow: hidden; }
.weekday { background: #efe9dc; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: #6f6a61;
  padding: 0.5rem; text-align: center; }
.mday { background: #fff; padding: 0.5rem; min-height: 7.5rem; }
.mday.outside { background: #f6f2e9; }
.mday.outside .daynum { color: #6f6a61; }
.mday.today { background: #fff; box-shadow: inset 0 0 0 2px #1a1a1a; }
.daynum { font-weight: 800; color: #1a1a1a; text-decoration: none;
  display: inline-block; margin-bottom: 0.35rem;
  /* Month day numbers are tappable links: a 44px box (UX-02). */
  min-width: 2.75rem; min-height: 2.75rem; line-height: 2.75rem;
  text-align: center; padding: 0 0.25rem; box-sizing: border-box; }
.mday-chips { display: grid; gap: 0.35rem; }

/* Week totals column (8th column of the desktop month grid): done
   totals prominent, planned totals smaller and muted beside them. */
.mtotals { background: #f6f2e9; padding: 0.5rem; min-height: 7.5rem; }
.mtotals-time { font-size: 0.95rem; margin: 0 0 0.4rem; }
.mtotals-sport { font-size: 0.85rem; margin: 0 0 0.25rem; }
.mtotals-label { color: #6f6a61; }

/* Phone month grid: hidden on desktop, shown below 700px. */
.month-mobile { display: none; }
.month-week-totals { display: none; }
.mobile-day { display: none; }

/* Session chips */
.chip { display: block; border: 1px solid #e2ddd2;
  border-left: 4px solid #6f6a61; border-radius: 8px;
  padding: 0.45rem 0.55rem; text-decoration: none; color: #1a1a1a;
  background: #fff; }
.chip:hover { border-color: #c9c2b2; text-decoration: none; }
.chip-top { display: flex; gap: 0.4rem; align-items: baseline; }
.chip-sport { font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; flex-shrink: 0; }
.chip-title { font-size: 0.9rem; line-height: 1.3; }
.chip-meta { display: block; font-size: 0.8rem; color: #6f6a61; }
.chip-actuals { display: block; font-size: 0.8rem; color: #2a7d4f; }
.chip.sport-run, .homecard.sport-run { border-left-color: #2a7d4f; }
.chip.sport-run .chip-sport, .homecard.sport-run .chip-sport { color: #2a7d4f; }
.chip.sport-bike, .homecard.sport-bike { border-left-color: #2563a8; }
.chip.sport-bike .chip-sport, .homecard.sport-bike .chip-sport { color: #2563a8; }
.chip.sport-swim, .homecard.sport-swim { border-left-color: #0e7490; }
.chip.sport-swim .chip-sport, .homecard.sport-swim .chip-sport { color: #0e7490; }
.chip.sport-walk, .homecard.sport-walk { border-left-color: #8a6d3b; }
.chip.sport-walk .chip-sport, .homecard.sport-walk .chip-sport { color: #8a6d3b; }
.chip.sport-rest, .homecard.sport-rest { border-left-color: #9aa9b7;
  border-style: dashed; }
.chip.sport-rest .chip-sport, .homecard.sport-rest .chip-sport { color: #6f6a61; }
.chip.status-done .chip-title::before, .homecard.status-done .card-title::before { content: "\2713\0020";
  color: #2a7d4f; font-weight: 700; }
.chip.status-skipped, .homecard.status-skipped { opacity: 0.55; }
.chip.status-skipped .chip-title, .homecard.status-skipped .card-title { text-decoration: line-through; }

/* Home tab: day groups of enlarged session cards */
.homeday { margin-bottom: 1.5rem; }
.homeday h2 { border-top: 1px solid #e2ddd2; padding-top: 0.5rem; }
.homecard { display: block; border: 1px solid #e2ddd2;
  border-left: 4px solid #6f6a61; border-radius: 10px;
  padding: 0.7rem 0.85rem; color: #1a1a1a; margin-bottom: 0.6rem;
  background: #fff; }
.card-top { display: flex; gap: 0.4rem; align-items: baseline; }
.card-top a { color: #1a1a1a; text-decoration: none; font-size: 1rem; }
.card-top a:hover { text-decoration: underline; }
.homecard .goal { margin-top: 0.5rem; }
.homecard .goal p { margin: 0 0 0.4rem; }
.homecard textarea { width: 100%; box-sizing: border-box; }
.pain-badge { display: block; color: #9b1c1c; font-weight: 600;
  font-size: 0.8rem; }
.flag-setup { color: #9b1c1c; font-weight: 600; }
.ai-badge { display: inline-block; background: #eef4fb; color: #2563a8;
  border: 1px solid #9fc3e8; border-radius: 999px; padding: 0 0.45rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.ai-note { border-left: 4px solid #2563a8; background: #eef4fb;
  border-radius: 8px; padding: 0.5rem 0.7rem; margin: 0.5rem 0; }
.ai-note p { margin: 0.3rem 0 0; }
.notecount { display: block; color: #6f6a61; font-size: 0.8rem; }

/* Week board + summary column */
.weekgrid { display: grid; gap: 1.5rem; }
@media (min-width: 900px) {
  .weekgrid { grid-template-columns: 2fr 1fr; }
}
.day { border-top: 1px solid #e2ddd2; padding-top: 0.5rem; }
.sessions { list-style: none; padding: 0; margin: 0; }
.chip-item { margin-bottom: 0.5rem; }
.summary { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 1rem; height: fit-content; }
.summary table { width: 100%; border-collapse: collapse;
  font-size: 0.95rem; }
.summary th, .summary td { text-align: left; padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #e2ddd2; vertical-align: top; }
.summary tr.total td { font-weight: 700;
  border-top: 2px solid #1b1b1f; }

/* Day detail */
.covernote { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 0.5rem 1rem; }
.covernote h2 { margin: 0 0 0.35rem; }
.covernote p { margin: 0 0 0.35rem; }
.covernote p:last-child { margin-bottom: 0; }
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.4rem; }
.notes { list-style: none; padding: 0; }
.note { border: 1px solid #e2ddd2; border-radius: 12px;
  padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; background: #fff; }
.note.pain { border-color: #d88; background: #fdf2f2; }
.note.role-coach { background: #f6f2e9; }
.movelist { padding-left: 1.2rem; }
.movelist li { margin-bottom: 0.4rem; }

/* Per-lap bar chart on a completed session's detail page (Shane,
   Nov 8 — RestOrTrain reference): one bar per lap, server-side
   CSS only, no JS. A flex row of fixed height, bars aligned to
   the bottom; each bar's height is relative to the fastest /
   hardest lap. Colours are zones, every one saturated and distinct
   on the cream background (v2, Nov 8 — v1's pale blue and taupe
   grey read as the same wash): bike by Coggan %FTP (slate Z1,
   royal blue Z2, green Z3, orange Z4, ember Z5), run/walk by pace
   vs threshold and swim by pace vs CSS (green at or faster than
   threshold, teal 90-100%, vivid blue for the aerobic base
   70-90%, slate grey only for much slower than easy; with no
   threshold on file the bars are blue and the fastest lap is
   green). */
.lap-chart { display: flex; align-items: flex-end; gap: 2px;
  height: 140px; margin: 0.5rem 0 0.25rem; }
.lap-bar { flex: 1 1 0; min-width: 3px; border-radius: 4px 4px 0 0; }
.lapbar-z1, .lapbar-slow { background: #6e6a60; }
.lapbar-z2, .lapbar-blue { background: #1e63d6; }
.lapbar-z3, .lapbar-fast { background: #189a44; }
.lapbar-z4 { background: #d96f0e; }
.lapbar-z5 { background: #b4232f; }
.lapbar-near { background: #0e9bb5; }
.lapbar-base { background: #1f8ae8; }
.coach-athlete { border-top: 1px solid #e2ddd2; padding-top: 0.5rem; }

/* Coach overview: each athlete collapses to one row (name + arrow),
   and each athlete's workouts collapse to one row — native
   <details>, so expanding costs no request: everything on the page
   is already loaded for the week. */
.coach-athlete summary { cursor: pointer; }
.athlete-details > summary { font-size: 1.25rem; font-weight: 700;
  padding: 0.35rem 0; }
.workouts-details > summary { font-weight: 700; margin: 1rem 0 0.5rem; }

/* Coach overview rows (UX-10): the athlete links wrap instead of
   packing onto one line with the name; on phones each link is a
   full 44px tap target. */
.athlete-details > summary .coach-links { display: inline-flex;
  flex-wrap: wrap; gap: 0.25rem 1rem; }

/* Badges: the Add/Edit race form collapses to one row (heading +
   arrow) — same native <details> as the coach overview — so the
   long form no longer fills the page until it is needed. Open by
   default only while editing (the template adds `open`). */
.race-form-details > summary { font-size: 1.15rem; font-weight: 800;
  margin: 1.5rem 0 0.5rem; cursor: pointer; }

/* Progress tab: recovery + per-sport trend tiles. Numbers and
   trend words only — no charts in v1. */
.progress-grid { display: grid; gap: 0.75rem; margin: 0.75rem 0 1.5rem;
  grid-template-columns: repeat(2, 1fr); }
.ptile { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 0.75rem 1rem; }
.ptile h3 { margin: 0 0 0.35rem; }
.ptile p { margin: 0 0 0.35rem; }
.ptile p:last-child { margin-bottom: 0; }
.pbig { font-size: 1.05rem; font-weight: 700; }
.trend { font-weight: 700; }
.trend.better { color: #2a7d4f; }
.trend.slipping { color: #b4232f; }
.trend.steady { color: #6f6a61; }

/* Weekly Review: a compact scrollable box — a few lines visible,
   the rest on scroll, so the summary never fills the screen. */
.weekly-review { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 0.75rem 1rem; max-height: 10rem;
  overflow-y: auto; white-space: pre-wrap; }

/* Forms */
form { display: grid; gap: 0.6rem; max-width: 34rem; margin-top: 0.5rem; }
form label { display: grid; gap: 0.3rem; }
form[style] { display: inline; }
input, textarea, select, button { font: inherit; padding: 0.45rem;
  border: 1px solid #d8d2c4; border-radius: 8px; background: #fff; }
button { background: #1a1a1a; color: #fff; cursor: pointer;
  width: fit-content; min-height: 2.75rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
fieldset:disabled input, fieldset:disabled textarea,
fieldset:disabled select { background: #f4f1ea; }
label.inline { display: flex; gap: 0.5rem; align-items: center; }

/* Coach reconciliation note: plain-text body, one line per fact. */
.recon-body { white-space: pre-line; background: #fff;
  border: 1px solid #e2ddd2; border-left: 4px solid #1a1a1a;
  padding: 0.8rem 1rem; margin: 0.4rem 0; }

/* Phone: month view becomes a compact tappable 7-column grid; the
   full-chip desktop grid is hidden and the selected day's sessions
   list below the grid. */
@media (max-width: 700px) {
  main { padding: 0.25rem 0.75rem 0.75rem; }
  header { padding: 0.75rem; }
  /* Header tabs on phones (Nov 23, Shane): "Form Check" wrapped
     to two lines and the stretched row made every other tab
     taller. Tabs never wrap mid-label; the row wraps between
     whole pills, and items never stretch to a taller sibling. */
  .tabs { flex-wrap: wrap; align-items: center; }
  .tab { white-space: nowrap; }
  .month-grid { display: none; }
  .month-mobile { display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 1px; background: #e2ddd2; border: 1px solid #e2ddd2;
    border-radius: 12px; overflow: hidden; }
  .mweekday { background: #efe9dc; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: #6f6a61;
    padding: 0.4rem 0; text-align: center; }
  .mcell { background: #fff; padding: 0.45rem 0.2rem 0.4rem;
    text-align: center; text-decoration: none; min-height: 3.1rem;
    display: flex; flex-direction: column; align-items: center;
    gap: 0.2rem; }
  .mcell-num { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
  .mcell.today { box-shadow: inset 0 0 0 2px #1a1a1a; }
  .mcell.selected { background: #1a1a1a; color: #fff; }
  .mcell.selected .mcell-num { color: #fff; }
  .mcell.selected .mdot { box-shadow: 0 0 0 1px #fff; }
  .mcell.outside { background: #f6f2e9; }
  .mcell.outside .mcell-num { color: #6f6a61; font-weight: 600; }
  .mdots { display: flex; gap: 3px; flex-wrap: wrap;
    justify-content: center; }
  .mdot { width: 8px; height: 8px; border-radius: 50%; }
  .mdot.sport-run { background: #2a7d4f; }
  .mdot.sport-bike { background: #2563a8; }
  .mdot.sport-swim { background: #0e7490; }
  .mdot.sport-walk { background: #8a6d3b; }
  .mdot.sport-rest { background: #9aa9b7; }
  .mdot.sport-race { background: #1a1a1a; }
  .mobile-day { display: block; margin-top: 1.25rem; }
  .mobile-day .mday-chips { display: grid; gap: 0.5rem; }
  /* Phone weekly totals list (the desktop Totals column is hidden
     here): one row per week below the day grid. */
  .month-week-totals { display: block; margin-top: 1.25rem; }
  .month-week-totals h2 { font-size: 1rem; margin: 0 0 0.5rem; }
  .mweek-total { margin: 0 0 0.35rem; font-size: 0.9rem; }
  .strip-stats { gap: 1.25rem; }
  .stat-value { font-size: 1.9rem; }
  .progress-grid { grid-template-columns: 1fr; }
  /* Coach overview rows (UX-10): on phones each athlete link is a
     full 44px tap target. */
  .athlete-details > summary .coach-links a { display: inline-flex;
    align-items: center; min-height: 2.75rem; }
}

/* Home boards: event + goal cards, artifact look. Section headings
   are bold black caps with an orange circular + button at the right. */
.board-section { margin-bottom: 2rem; }
.board-head { display: flex; justify-content: space-between;
  align-items: center; gap: 1rem; }
.board-head h2 { text-transform: uppercase; margin: 0; }
.add-btn { background: #df4f26; color: #fff; border: none;
  border-radius: 50%; width: 2.75rem; height: 2.75rem; font-size: 1.5rem;
  line-height: 1; cursor: pointer; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.add-btn:hover { background: #c7431f; }
.board-grid { display: grid; gap: 1rem; margin-top: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
/* Events row (Nov 23, 2026, Shane): the event pills size to their
   content and wrap, like the calendar race pills — a grid column
   squeezed the longest pill (Little Elm) and clipped its date. */
.events-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem;
  /* flex-start, not stretch: an open pill must not stretch the
     closed pills in its row into tall empty boxes (Nov 23, 2026). */
  align-items: flex-start; }
.events-row .event-card-compact { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.event-card, .goal-card { background: #fff;
  border: 1px dashed #c9c2b2; border-radius: 12px;
  padding: 1rem 1.25rem; position: relative; }
.event-name { font-size: 1.05rem; }
.event-star { color: #1a1a1a; }
.event-date { color: #be4320; font-weight: 700; margin-top: 0.15rem; }
.event-desc, .goal-desc { color: #6f6a61; margin: 0.5rem 0 0; }
.goal-card { border-top: 4px solid #1a1a1a; }
.goal-card.goal-cat-swim { border-top-color: #0e7490; }
.goal-card.goal-cat-bike { border-top-color: #c77414; }
.goal-card.goal-cat-run { border-top-color: #df4f26; }
.goal-card.goal-cat-70\.3 { border-top-color: #1a1a1a; }
.goal-cat { font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: #1a1a1a; }
.goal-card.goal-cat-swim .goal-cat { color: #0e7490; }
.goal-card.goal-cat-bike .goal-cat { color: #9f5d10; }
.goal-card.goal-cat-run .goal-cat { color: #be4320; }
.goal-card.goal-cat-70\.3 .goal-cat { color: #1a1a1a; }
.goal-title { font-size: 1.5rem; font-weight: 800; line-height: 1.15;
  margin-top: 0.25rem; }
/* The remove × is a 44px box at the card's top right — keep the
   top lines clear of it (UX-09 companion for goal cards). */
.goal-card .goal-cat, .goal-card .goal-title { padding-right: 2.5rem; }
.card-x-form { display: inline; }
.card-x { position: absolute; top: 0.5rem; right: 0.75rem;
  background: transparent; color: #6f6a61; border: none;
  font-size: 1.25rem; line-height: 1; padding: 0; cursor: pointer;
  /* A 44px tap target (UX-02), flex-centred ×. */
  width: 2.75rem; height: 2.75rem; display: flex;
  align-items: center; justify-content: center; }
.card-x:hover { color: #1a1a1a; }

/* Compact Home event card (Nov 23, 2026, Shane): collapsed it reads
   like the calendar race pill — star + name + short date, one line,
   same 0.9rem as the pill — on a white card instead of black; click
   expands it to show the goal. No chevron (Nov 23, Shane: not
   needed — the row itself is the toggle). The remove button only
   shows once the card is open, so the collapsed pill stays clean. */
.event-card-compact { padding: 0.4rem 0.95rem; border-radius: 999px;
  border: 1px solid #d8d2c4; }
.event-card-compact[open] { border-radius: 12px; padding: 0.75rem 1.25rem; }
.event-summary { list-style: none; cursor: pointer; display: flex;
  align-items: baseline; gap: 0.35rem; white-space: nowrap;
  /* UX-01: a long event name must ellipsize inside the pill, never
     overflow it on a narrow phone. The name flex item below does
     the shrinking; the date never clips. */
  min-width: 0; overflow: hidden; }
.event-summary::-webkit-details-marker { display: none; }
.event-summary .event-name { font-size: 0.9rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  flex: 1 1 auto; }
.event-date-short { color: #be4320; font-weight: 700; white-space: nowrap;
  flex-shrink: 0; }
.event-card-compact .card-x { display: none; }
.event-card-compact[open] .card-x { display: flex; }
.event-card-compact[open] .event-summary { padding-right: 2.5rem;
  /* Clear of the 44px × box (right 0.75rem + 2.75rem wide = 3.5rem
     from the card edge; 1.25rem of that is card padding) — UX-09.
     Open, the summary may wrap instead of ellipsizing (UX-01). */
  flex-wrap: wrap; white-space: normal; }
.event-card-compact[open] .event-summary .event-name {
  white-space: normal; overflow: visible; text-overflow: clip; }
.event-card-compact .event-desc,
.event-card-compact .meta { margin-top: 0.5rem; }
dialog.popup { border: 1px solid #e2ddd2; border-radius: 12px;
  padding: 1.5rem; max-width: 32rem; width: calc(100% - 2rem); }
dialog.popup::backdrop { background: rgba(0, 0, 0, 0.35); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.form-actions button[type="button"] { background: #fff; color: #1a1a1a;
  border: 1px solid #c9c2b2; }

/* Race sessions: the calendar mirror of a dated home event. */
.chip.sport-race { border-left-color: #1a1a1a; }
.chip.sport-race .chip-sport { color: #1a1a1a; }

/* Race ★-pill strip above the calendar, mirroring the artifact:
   solid black pills, white text, wrapping to a second row. */
.race-strip { display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 0.9rem 0 0.4rem; }
.race-pill { background: #1a1a1a; color: #fff; border-radius: 999px;
  padding: 0.35rem 0.85rem; font-weight: 700; font-size: 0.9rem;
  white-space: nowrap; min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; }
/* Week totals header line under the pills. */
.week-header { font-size: 1rem; margin: 0.2rem 0 0.9rem; }

/* Onboarding nudge card on Home (non-coach athletes only). */
.onboarding-nudge { background: #fff; border: 1px solid #e2ddd2;
  border-top: 4px solid #1a1a1a; padding: 1rem 1.2rem; }
.onboarding-nudge h2 { margin: 0 0 0.4rem; }
.onboarding-nudge p { margin: 0.4rem 0; }
.btn { display: inline-block; background: #1a1a1a; color: #fff;
  border-radius: 999px; padding: 0.6rem 1.2rem; font-weight: 700;
  text-decoration: none; min-height: 48px; line-height: 1.5;
  box-sizing: border-box; }
.btn:hover { background: #000; }

/* Badges: the EXACT ChatGPT images Shane provided (Nov 8) — the
   "Metallic Race Distance Badge Collection" ovals and the "Five
   Glossy Award Rosettes", cropped with transparent backgrounds.
   NOT SVG recreations (the SVG rebuild was rejected: "looks like
   crap"). Duathlon is the one generated badge, in the same style.
   The 140.6 is the largest badge: its cell is scaled up so it reads
   biggest even in the three-across phone grid. Order: 140.6
   top-left, then Ultra, 70.3, Duathlon, 26.2, 13.1. The row is a
   grid: three across on a phone (two looks silly — Shane, Nov 8),
   more on wider screens. A count circle overlaps the medallion's
   bottom-right; a zero count only mutes the bubble, never the
   medallion. */
.badge-row { display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem;
  margin: 1rem 0 1.5rem; }
@media (min-width: 700px) {
  .badge-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.badge { position: relative; display: block;
  text-align: center; text-decoration: none; color: #1b1b1f; }
.badge-medallion-wrap { position: relative; display: block;
  width: 100%; max-width: 140px; margin: 0 auto; }
.badge-tier-pinnacle .badge-medallion-wrap { transform: scale(1.14); }
.badge-medallion { display: block; width: 100%; height: auto; }
/* The count bubble is the circular centre cropped from the star
   award rosette (Shane, Nov 8 — ChatGPT rosette reference): a
   black circle with a gold ring, the count in gold serif text
   overlaid on it. No ribbon tails — just the circle. It sits
   bottom-right of the oval, and only the ring and number mute
   when the count is 0. */
.badge-count { position: absolute; right: 0; bottom: 8px; z-index: 3;
  width: 34px; height: 34px; }
.badge-count-img { display: block; width: 100%; height: 100%; }
.badge-count-num { position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #f2c14e; font-weight: 800; font-size: 0.95rem;
  font-family: Georgia, 'Times New Roman', serif; }
.badge-label { display: block; margin-top: 0.35rem; font-size: 0.85rem;
  font-weight: 600; }
.badge-empty .badge-count-img { filter: grayscale(0.6) opacity(0.55); }
.badge-empty .badge-count-num { color: #9a937f; }
.badge-selected .badge-medallion {
  filter: drop-shadow(0 0 6px rgba(27, 27, 31, 0.85)); }
.badge-selected.badge-tier-pinnacle .badge-medallion {
  filter: drop-shadow(0 0 10px rgba(180, 35, 47, 0.65)); }
/* Personal Bests (PRs): soft cream cards (Shane, Nov 19 — the black
   cards were too much, the gold too loud; this matches the page:
   warm white card, sand border, bronze sub-label, deep JTC red value). */
.pr-grid { display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem; margin: 0.5rem 0 1.5rem; }
.pr-card { display: block; text-align: center; text-decoration: none;
  color: #1b1b1f; border: 1px solid #e3d9c2; border-radius: 10px;
  padding: 0.8rem 0.5rem; background: #fffdf8;
  box-shadow: 0 1px 3px rgba(27, 27, 31, 0.06); }
.pr-label { display: block; font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.04em; }
.pr-sub { display: block; font-size: 0.8rem; color: #856325; }
.pr-value { display: block; font-size: 1.3rem; font-weight: 800;
  font-family: Georgia, 'Times New Roman', serif; margin: 0.25rem 0;
  color: #b4232f; }
.pr-date { display: block; font-size: 0.8rem; color: #6f6a61; }
/* Confidence tag on a PR card (Phase 2 item 12): shown only when
   the card's best is Estimated, in the existing bronze sub-label
   colour — no new artwork, no redesign. Verified is the default
   and needs no tag; Unavailable cards say so in the sub-label. */
.pr-confidence { display: block; font-size: 0.8rem; color: #856325; }
.pr-selected { box-shadow: 0 0 0 2px #b4232f; }
/* Award rosettes sit ON TOP OF the oval badge (Shane, Nov 8 —
   ChatGPT rosette reference, metallic-full-distance-triathlon-
   badge.png, 1536x1024): the rosette discs overlap the bottom
   rim, covering the laurel area, and hang down below the oval.
   Measured from the reference: each disc is ~21% of the oval
   width, its centre at ~1/3 and ~2/3 of the oval width, and the
   disc top sits ~57% of a disc diameter above the oval's bottom
   edge (the disc centre just above the bottom edge). The rosette
   row is the same width as the medallion wrap so the scale is
   relative to the oval, and it is layered ABOVE the medallion
   (position + z-index): the medallion wrap is positioned, so
   without that it paints over the rosette tops and they read as
   tucked underneath the badge. Up to two, spaced apart: one
   under the left half, one under the right half. */
.badge-rosettes { position: relative; z-index: 2;
  display: flex; justify-content: space-evenly;
  width: 100%; max-width: 140px; margin: -0.9rem auto 0; }
.badge-rosettes .rosette { width: 22%; height: auto;
  flex: 0 0 auto; }
.badge-tier-pinnacle .badge-rosettes { transform: scale(1.14);
  transform-origin: top center; margin-top: -0.75rem; }
/* Event-group emblems (level 2 of the pyramid, Shane, Nov 8):
   one medallion per event series (Waco, Dallas, Texas, World
   Championship), the event name composited into the label spot,
   the distance number kept, the count bubble showing how many
   races are in that event, and that event's best podium rosette
   ON TOP OF the oval (same placement as the top level, at the
   emblem's scale). The emblem is a little larger than a year
   emblem (110px medallion vs 84px). */
.event-grid { display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1.1rem; margin: 0.5rem 0 1.5rem; }
.event-badge { position: relative; display: block;
  text-align: center; text-decoration: none; color: #1b1b1f; }
.event-medallion-wrap { position: relative; display: block;
  width: 100%; max-width: 110px; margin: 0 auto; }
.badge-tier-pinnacle .event-medallion-wrap { transform: scale(1.14); }
.event-medallion { display: block; width: 100%; height: auto; }
.event-rosettes { position: relative; z-index: 2;
  display: flex; justify-content: space-evenly;
  width: 100%; max-width: 110px; margin: -0.85rem auto 0; }
.event-rosettes .rosette { width: 22%; height: auto;
  flex: 0 0 auto; }
.badge-tier-pinnacle .event-rosettes { transform: scale(1.14);
  transform-origin: top center; margin-top: -0.7rem; }
.event-selected .event-medallion {
  filter: drop-shadow(0 0 6px rgba(27, 27, 31, 0.85)); }
.event-selected.badge-tier-pinnacle .event-medallion {
  filter: drop-shadow(0 0 10px rgba(180, 35, 47, 0.65)); }
.mini-rosettes { position: relative; z-index: 2;
  display: flex; justify-content: space-evenly;
  width: 100%; max-width: 84px; margin: -0.6rem auto 0; }
.mini-rosettes .rosette { width: 18px; height: auto;
  flex: 0 0 auto; }
/* Year emblems (level 3 of the pyramid, Shane, Nov 8): one small
   oval icon per race of the selected event, a little smaller than
   the event emblems (84px), the year in the label spot and the
   distance number kept. Tap one and that race's details show
   right underneath. The race's own honours sit ON TOP OF the oval
   as small rosettes: a podium finish wears its place rosette
   (1st/2nd/3rd), the fastest time the gold star rosette, a
   personal record the PR rosette. A race with both a place and a
   fastest/PR wears both, side by side. */
.mini-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem 0.75rem; margin: 0.5rem 0 1.5rem; }
@media (max-width: 900px) {
  .mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 400px) {
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-badge { position: relative; display: block; width: 96px;
  justify-self: center; text-align: center; text-decoration: none;
  color: #1b1b1f; }
.mini-medallion { display: block; width: 84px; height: auto;
  margin: 0 auto; }
.mini-caption { display: block; margin-top: 0.3rem; font-size: 0.75rem;
  font-weight: 600; line-height: 1.25; }
.mini-selected .mini-medallion {
  filter: drop-shadow(0 0 4px rgba(27, 27, 31, 0.7)); }
.mini-selected .mini-caption { text-decoration: underline; }
.race-table { width: 100%; border-collapse: collapse;
  font-size: 0.95rem; margin: 0.5rem 0 1.5rem; }
.race-table th, .race-table td { text-align: left;
  padding: 0.3rem 0.4rem; border-bottom: 1px solid #e2ddd2;
  vertical-align: top; }
.race-form label { display: block; margin-bottom: 0.6rem; }
.race-form input, .race-form select, .race-form textarea {
  width: 100%; box-sizing: border-box; }
.race-form input[type="checkbox"] { width: auto; }
.inline-form { display: inline; }
.link-button { background: none; border: none; padding: 0;
  color: #2563a8; text-decoration: underline; cursor: pointer;
  font-size: 0.95rem; min-height: 0; }
.race-confirm { background: #fdf8ec; border: 1px solid #d9a441;
  border-left: 4px solid #b4232f; border-radius: 12px;
  padding: 0.5rem 1rem; margin-bottom: 1rem; }
.race-confirm h2 { margin: 0 0 0.35rem; }

/* Drag-and-drop: moving planned workouts between days. The chips are
   <a> links, so the native link drag must be killed or desktop
   browsers show the red "not allowed" circle instead of our drag.
   touch-action: pan-x pan-y lets a touch starting on a chip scroll
   the page — touch-action: none used to make every scroll that began
   on a chip grab the workout instead. The long-press gate in
   calendar-drag.js (a touch drag arms only after a 450ms still hold;
   any movement before that cancels the press) is what keeps a scroll
   from becoming a drag; the JS blocks touch scrolling only once a
   drag is armed. */
.chip.draggable-chip { cursor: grab; touch-action: pan-x pan-y; -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.chip.drag-source { opacity: 0.4; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; opacity: 0.9; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.mday.drop-target, .day.drop-target, .mcell.drop-target { outline: 2px dashed #1a1a1a; outline-offset: -2px; background: #f0ead9; }

/* Form Check / bike-fit report pages (UX-11): at desktop widths the
   forms and media use the available column instead of sitting in a
   narrow strip at the left — forms widen, video and stills widen
   and centre. Below 1100px nothing changes, so mobile is untouched. */
@media (min-width: 1100px) {
  body.analysis-page form { max-width: 44rem; }
  body.analysis-page video { width: 100%; max-width: 48rem;
    display: block; margin: 0 auto; }
  body.analysis-page figure { max-width: 48rem; margin: 1rem auto; }
  body.analysis-page figure img { width: 100%; }
}
