/* CRUCONNECT: "The Arc" design.
   Blue does the everyday work. The club's two team colors (--team-1 to
   --team-2, set on the Club settings page) fill the arcs and rings, and mark wins:
   goals hit, streaks, and PRs. Manrope carries everything; Big Shoulders
   (made for the City of Chicago) is kept for the CRUCONNECT wordmark only.
   Depth (2026-11-25): pages are a grid of raised tiles ("bento") on a darker
   page, with three-layer shadows so tiles read as sitting above it. */

:root {
  color-scheme: light;
  --page: #dfe6ef;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --ink: #0e1b2d;
  --ink-2: #3a4a60;
  --muted: #55647a; /* 4.7:1 on the page background, 5.9:1 on white */
  --line: #e1e7ef;
  --axis: #b9c5d4;
  --blue: #3b8fd6;
  --blue-ink: #1a5c9e;
  --blue-wash: rgba(59, 143, 214, 0.13);
  --btn-bg: #1a5c9e; /* filled buttons: white text passes 4.5:1 */
  --btn-fg: #fff;
  --dot: #9cc6ec;
  --up: #1a7340;
  --down: #b02f25; /* 5:1 on the pale red pill */
  /* Depth: a contact shadow, a near shadow, and a soft far one. */
  --shadow: 0 1px 2px rgba(14, 27, 45, 0.08), 0 10px 22px -10px rgba(14, 27, 45, 0.22), 0 32px 60px -28px rgba(14, 27, 45, 0.30);
  --shadow-sm: 0 1px 2px rgba(14, 27, 45, 0.10), 0 4px 12px -6px rgba(14, 27, 45, 0.22);
  --shadow-lift: 0 2px 4px rgba(14, 27, 45, 0.08), 0 16px 32px -12px rgba(14, 27, 45, 0.30), 0 40px 70px -30px rgba(14, 27, 45, 0.34);
  --edge: inset 0 0 0 1px rgba(14, 27, 45, 0.04);
  --radius: 24px;
  --radius-sm: 14px;
  --gap: 20px;
  /* The hero tile: the two team colors, darkened so white text stays readable
     whatever colors a club picks. */
  --hero: linear-gradient(135deg, color-mix(in oklab, var(--team-1) 62%, #08182c) 0%, color-mix(in oklab, var(--team-2) 55%, #08182c) 100%);

  /* Team colors: defaults until a club picks its own (Club settings). The six
     --rb-* stops blend from team 1 (start of an arc) to team 2 (full). */
  --team-1: #3b8fd6;
  --team-2: #2bb5a0;
  --rb-violet: var(--team-1);
  --rb-blue: color-mix(in oklab, var(--team-1) 80%, var(--team-2));
  --rb-green: color-mix(in oklab, var(--team-1) 60%, var(--team-2));
  --rb-yellow: color-mix(in oklab, var(--team-1) 40%, var(--team-2));
  --rb-orange: color-mix(in oklab, var(--team-1) 20%, var(--team-2));
  --rb-red: var(--team-2);
  /* Fixed status colors (not team colors): streak flame, good and missed. */
  --warm: #f28f2c;
  --good: #3fa463;
  --rainbow: linear-gradient(90deg, var(--rb-red), var(--rb-orange), var(--rb-yellow), var(--rb-green), var(--rb-blue), var(--rb-violet));

  --display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wordmark: "Big Shoulders Display", "Arial Narrow", sans-serif;

  /* Chart roles (used by the SVG charts in app.js) */
  --accent: var(--blue);
  --accent-ink: var(--blue-ink);
  --grid: var(--line);
}

/* Night colors. Used when the device is set to dark and the rower hasn't
   picked Day, or whenever the rower picks Night (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #070d16;
    --surface: #142031;
    --surface-2: #1d2b3f;
    --ink: #f0f5fb;
    --ink-2: #bccadb;
    --muted: #8e9db2;
    --line: #253449;
    --axis: #344760;
    --blue: #4c9de3;
    --blue-ink: #8cc2f2;
    --blue-wash: rgba(76, 157, 227, 0.18);
    --btn-bg: #4c9de3;
    --btn-fg: #06192d;
    --dot: #2f6fae;
    --up: #4cc07a;
    --down: #f07466;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 30px -12px rgba(0, 0, 0, 0.7), 0 36px 64px -30px rgba(0, 0, 0, 0.8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 20px 40px -14px rgba(0, 0, 0, 0.8), 0 44px 76px -30px rgba(0, 0, 0, 0.9);
    --edge: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
  :root:not([data-theme="light"]) .logo--day { display: none; }
  :root:not([data-theme="light"]) .logo--night { display: block; }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #070d16;
    --surface: #142031;
    --surface-2: #1d2b3f;
    --ink: #f0f5fb;
    --ink-2: #bccadb;
    --muted: #8e9db2;
    --line: #253449;
    --axis: #344760;
    --blue: #4c9de3;
    --blue-ink: #8cc2f2;
    --blue-wash: rgba(76, 157, 227, 0.18);
    --btn-bg: #4c9de3;
    --btn-fg: #06192d;
    --dot: #2f6fae;
    --up: #4cc07a;
    --down: #f07466;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 14px 30px -12px rgba(0, 0, 0, 0.7), 0 36px 64px -30px rgba(0, 0, 0, 0.8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 20px 40px -14px rgba(0, 0, 0, 0.8), 0 44px 76px -30px rgba(0, 0, 0, 0.9);
    --edge: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
:root[data-theme="dark"] .logo--day { display: none; }
:root[data-theme="dark"] .logo--night { display: block; }
:root .logo--night { display: none; } /* beats .hero-panel__logo's display: block */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-ink); }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font: 800 2.4rem/1.05 var(--display); letter-spacing: -0.03em; }
h2 { font: 800 1.22rem/1.2 var(--display); letter-spacing: -0.015em; }
p { margin: 0; }

.num { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { display: block; line-height: 0; }
.wordmark__logo { height: 48px; width: auto; }
.wordmark--text { display: inline-flex; align-items: center; gap: 8px; line-height: 1; color: var(--ink); text-decoration: none; }
.wordmark__mark { width: 30px; height: auto; color: var(--blue); }
.wordmark__name { font: 800 2rem/1 var(--wordmark); letter-spacing: 0.01em; }
.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-header__end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Day / Night switch */
.theme-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.theme-toggle button {
  font: 600 0.85rem/1 var(--body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--ink-2);
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle svg { width: 16px; height: 16px; flex: none; }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 35, 58, 0.14); }
.theme-toggle button[aria-pressed="true"][data-theme-choice="light"] svg { color: var(--warm); }
.theme-toggle button[aria-pressed="true"][data-theme-choice="dark"] svg { color: var(--blue-ink); }
@media (max-width: 640px) {
  .theme-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .theme-toggle button { padding: 7px 9px; }
}
.site-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--blue-ink); background: var(--blue-wash); }
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.35em;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
@media (max-width: 480px) {
  .site-header { position: static; } /* the stacked phone header scrolls away instead of covering the page */
  .wordmark__logo { height: 40px; }
  .wordmark__name { font-size: 1.7rem; }
  .site-nav a { padding: 6px 9px; font-size: 0.88rem; }
}

/* --------------------------------------------------------- club mark */
/* The club's logo, very faint, behind the cards (set on Club settings). */

.club-mark {
  position: fixed;
  inset: 120px 0 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.club-mark img { width: min(560px, 70vw); max-height: 60vh; object-fit: contain; opacity: 0.08; }

/* ---------------------------------------------------------------- page */

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.page > * + * { margin-top: var(--gap); }
.loading { color: var(--muted); }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--edge), var(--shadow);
  padding: 24px;
}
/* Title on the left, controls on the right, both lined up on the title's top. */
.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel__head > div:first-child { min-width: 0; flex: 1 1 260px; }
.panel__sub { color: var(--muted); font-size: 0.88rem; line-height: 1.45; margin-top: 6px; max-width: 62ch; }

.split { display: grid; gap: 20px; }
.split > * { min-width: 0; }
@media (min-width: 860px) {
  .split--wide-left { grid-template-columns: 3fr 2fr; }
  .split--even { grid-template-columns: 1fr 1fr; }
}

.back-link { display: inline-block; font-weight: 600; font-size: 0.95rem; text-decoration: none; }

/* -------------------------------------------------------------- buttons */

.btn {
  font: 600 0.95rem/1 var(--body);
  border-radius: 999px;
  padding: 10px 18px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { border-color: var(--axis); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover { background: color-mix(in srgb, var(--btn-bg) 82%, #000); border-color: color-mix(in srgb, var(--btn-bg) 82%, #000); }
.btn--ghost { border-color: transparent; background: var(--surface-2); }
.btn--danger { color: var(--down); }
.btn--small { padding: 7px 13px; font-size: 0.85rem; }
.btn__icon { width: 13px; height: 13px; flex: none; margin-left: -2px; }

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.segmented button {
  font: 600 0.88rem/1 var(--body);
  border: 0;
  background: none;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--blue-ink); box-shadow: 0 1px 3px rgba(20, 35, 58, 0.12); }
.segmented button:disabled { opacity: 0.4; cursor: not-allowed; }

.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.select, .race-form select, .level-select, .interest-form select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235f6e83' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px 8px;
  padding-right: 38px !important;
  cursor: pointer;
}
.select {
  font: 600 0.88rem/1.2 var(--body);
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background-color: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.select:hover { border-color: var(--axis); }

/* ------------------------------------------------------------ arc gauge */

.goal {
  display: grid;
  gap: 18px;
  align-items: center;
}
@media (min-width: 640px) {
  .goal { grid-template-columns: 1fr minmax(240px, 340px); }
}
.goal__month { color: var(--ink-2); font-weight: 600; }
.goal__meters { font-size: clamp(2.8rem, 7vw, 4.2rem); margin: 10px 0 6px; }
.goal__of { color: var(--ink-2); font-size: 1rem; }
.goal__status { margin-top: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal__status--ahead { color: var(--up); }
.goal__status--behind { color: var(--ink-2); }
.goal__status--done { color: var(--ink); }
.goal__days { color: var(--muted); font-weight: 500; }

.arc { position: relative; width: 100%; }
.arc svg { display: block; width: 100%; height: auto; overflow: visible; }
.arc__track { fill: none; stroke: var(--surface-2); stroke-linecap: round; }
.arc__fill { fill: none; stroke-linecap: round; }
.arc__fill:not([stroke]) { stroke: var(--team-1); } /* a stroke attribute means the rainbow (goal hit) */
.arc__pace { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.arc__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
}
.arc__pct { font-size: 2.2rem; }
.arc__caption { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.arc--small .arc__pct { font-size: 1.6rem; }

@media (prefers-reduced-motion: no-preference) {
  .arc__fill { transition: stroke-dashoffset 900ms cubic-bezier(0.22, 1, 0.36, 1); }
}

.goal-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.goal-edit input {
  font: 700 1.1rem var(--body);
  width: 9.5em;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--axis);
  background: var(--surface);
  color: var(--ink);
}
.goal-edit__error { color: var(--down); font-size: 0.9rem; flex-basis: 100%; }

/* ------------------------------------------------------- avatar + ring */

.ring-avatar { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring-avatar svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-avatar__track { fill: none; stroke: var(--surface-2); }
.ring-avatar__fill { fill: none; stroke-linecap: round; }
.ring-avatar__fill:not([stroke]) { stroke: var(--team-1); }
.ring-avatar--sm { width: 44px; height: 44px; }
.ring-avatar--md { width: 56px; height: 56px; }
.ring-avatar--lg { width: 96px; height: 96px; }
.avatar--sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar--md { width: 42px; height: 42px; font-size: 0.85rem; }
.avatar--lg { width: 76px; height: 76px; font-size: 1.4rem; }
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* ---------------------------------------------------------------- streak */

.streak {
  position: relative; /* keeps its hidden screen-reader text inside scrolling rows */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 10px 3px 7px;
  white-space: nowrap;
}
.streak svg { width: 15px; height: 15px; flex: none; }
.streak--hot { background: color-mix(in srgb, var(--warm) 16%, var(--surface)); }
.streak--none { color: var(--muted); font-weight: 600; }

.streak-weeks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.streak-weeks span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
}
.streak-weeks .is-active { background: var(--dot); }
.streak-weeks .is-streak { background: var(--blue); }
.streak-weeks .is-now { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--axis); }
.streak__big { font-size: 3.2rem; margin-top: 14px; }
.streak__unit { font: 600 1rem var(--body); letter-spacing: 0; color: var(--ink-2); margin-left: 8px; }

.on-a-roll { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.on-a-roll a { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--ink); min-width: 64px; }
.on-a-roll__name { font-size: 0.85rem; font-weight: 600; }

/* ----------------------------------------------------------- leaderboard */

.lanes { list-style: none; margin: 0; padding: 0; }
/* Each row: the name on its own line (starting above the avatar), then
   rank, avatar, streak and goal %, and the numbers underneath. */
.lane {
  display: grid;
  grid-template-columns: 2.2rem auto 1fr auto;
  grid-template-areas:
    ".    name   name name"
    "rank avatar meta value";
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
}
.lane:first-child { border-top: 0; }
.lane__rank { grid-area: rank; font-size: 1.3rem; color: var(--muted); text-align: center; }
.lane:nth-child(1) .lane__rank { color: var(--warm-ink); }
.lane > .ring-avatar { grid-area: avatar; }
.lane__name { font-weight: 700; color: var(--ink); text-decoration: none; display: block; line-height: 1.25; overflow-wrap: anywhere; }
.lane > .lane__name { grid-area: name; font-size: 1.05rem; }
.lane__name:hover { text-decoration: underline; }
.lane__meta { grid-area: meta; min-width: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.lane__value { grid-area: value; text-align: right; }
.lane__meters { font-size: 1.4rem; }
.lane__unit { color: var(--muted); font-size: 0.8rem; }
.lane__extra { display: none; color: var(--ink-2); font-size: 0.9rem; text-align: right; }
.lane__extra--trend { grid-area: trend; }
.lane__extra--best { grid-area: best; }
.lane__extra small { display: block; color: var(--muted); font-size: 0.75rem; }
@media (min-width: 720px) {
  .lane {
    grid-template-columns: 2.4rem auto 1fr 7rem 5.5rem auto;
    grid-template-areas:
      ".    name   name name  name name"
      "rank avatar meta trend best value";
  }
  .lane__extra { display: block; }
}
@media (max-width: 480px) {
  .panel { padding: 18px 16px; }
  .lane { grid-template-columns: 1.5rem auto 1fr auto; column-gap: 10px; }
  .lane__meters { font-size: 1.25rem; }
}

.delta { font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.delta--up { color: var(--up); }
.delta--down { color: var(--down); }
.delta--flat, .delta--new { color: var(--ink-2); }

/* ------------------------------------------------------------- PR badges */

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 8px 4px; }
.badge__medal {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 5px var(--blue);
  position: relative;
}
.badge__medal--new { box-shadow: none; }
.badge__medal--new::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 5px;
  background: conic-gradient(var(--rb-red), var(--rb-orange), var(--rb-yellow), var(--rb-green), var(--rb-blue), var(--rb-violet), var(--rb-red));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.badge__event { font-size: 1.05rem; color: var(--ink); }
.badge__result { font-weight: 700; }
.badge__note { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.badge__new { color: var(--ink); font-weight: 700; }
.badge__who { font-weight: 700; color: var(--ink); text-decoration: none; }
.badge__who:hover { text-decoration: underline; }

/* ----------------------------------------------------------- stat strip */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 0 16px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .stats--4 .stat:nth-child(3) { padding-left: 0; border-left: 0; }
}
.piece-link { font-weight: 600; }
.stat__label { color: var(--ink-2); font-size: 0.88rem; font-weight: 600; }
.stat__value { font-size: 2.3rem; margin: 6px 0 4px; }
.stat__note { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr; gap: 14px; }
  .stat { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { padding-top: 0; border-top: 0; }
}

.range-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.range-bar__dates { color: var(--muted); font-size: 0.9rem; }

/* ----------------------------------------------------------- rower head */

.who { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.who__text { display: grid; gap: 6px; }
.who__sub { color: var(--muted); font-size: 0.88rem; }
.who__chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Settings rows and the on/off switch */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting__label { font-weight: 700; }
.setting__help { color: var(--ink-2); font-size: 0.9rem; margin-top: 2px; max-width: 60ch; }
.switch {
  flex: none;
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: var(--axis);
  cursor: pointer;
}
.switch[aria-checked="true"] { background: var(--blue); }
.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 35, 58, 0.3);
}
.switch[aria-checked="true"] .switch__knob { transform: translateX(22px); }
@media (prefers-reduced-motion: no-preference) {
  .switch, .switch__knob { transition: background 160ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* -------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: 8px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
td.num-cell, th.num-cell { text-align: right; }
td.num-cell, td.nowrap { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  th, td { padding: 10px 5px; }
}

/* -------------------------------------------------------------- charts */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 12px var(--body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .bar { fill: var(--accent); }
.chart .bar.is-hover { fill: var(--accent-ink); }
.chart .hit.is-clickable { cursor: pointer; }
.chart .hit:focus { outline: none; }
.chart .dot { fill: var(--dot); stroke: var(--surface); stroke-width: 2; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .focus { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart__note { text-align: center; margin-top: -120px; margin-bottom: 96px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.88rem; color: var(--ink-2); margin: 0 0 8px; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.legend__line { width: 16px; height: 3px; border-radius: 2px; background: var(--accent); }

.chart .band { fill: var(--blue-wash); }

.trend__summary { color: var(--ink-2); font-weight: 600; margin: 0 0 10px; }
.trend__summary:empty { display: none; }

/* -------------------------------------------------------------------- day */

.chart .day-link { fill: var(--accent-ink); font-weight: 700; text-decoration: underline; }
.chart .day-hit { cursor: pointer; }
.chart .day-hit:focus { outline: none; }
.chart .day-hit:focus-visible { outline: 2px solid var(--accent); }
.chart .set-label { fill: var(--ink); font-weight: 700; }
.day__summary { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); }
.link-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }

/* ------------------------------------------------------------------- help */

.help__toc ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 20px; }
.help__toc a { font-weight: 600; }
.help__section { scroll-margin-top: 96px; }
.help__section h2 { margin-bottom: 10px; }
.help__section h3 { font: 700 1.02rem/1.3 var(--body); margin: 16px 0 6px; }
.help__section h2 + h3 { margin-top: 0; }
.help__intro { color: var(--ink-2); margin: 0 0 12px; max-width: 70ch; }
.help__list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); max-width: 75ch; }
.help__terms { margin: 0; display: grid; gap: 0; }
.help__terms div { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 4px 20px; padding: 10px 0; border-top: 1px solid var(--line); }
.help__terms div:first-child { border-top: 0; padding-top: 0; }
.help__terms dt { font-weight: 700; color: var(--ink); }
.help__terms dd { margin: 0; color: var(--ink-2); max-width: 70ch; }
@media (max-width: 600px) { .help__terms div { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- coaching */

.coach__focus { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 0 0 16px;
  padding: 12px 14px; border-radius: 12px; background: var(--blue-wash); color: var(--ink); font-weight: 600; }
.coach__focus-label { font-size: 0.8rem; font-weight: 700; color: var(--blue-ink); }
.coach__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.coach__note { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.coach__note--good { border-left-color: var(--good); }
.coach__note--work { border-left-color: var(--blue); }
.coach__tag { font-size: 0.78rem; font-weight: 700; color: var(--muted); margin: 0; }
.coach__note--good .coach__tag { color: var(--up); }
.coach__note--work .coach__tag { color: var(--blue-ink); }
.coach__title { font: 700 1.02rem/1.3 var(--body); margin: 2px 0 4px; }
.coach__text { color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; margin: 0; }
.coach-skip { margin: 0; }
.coach__group { font: 700 1.05rem/1.3 var(--body); margin: 20px 0 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.coach__focus + .coach__group { margin-top: 4px; }
.coach__kind { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
@media (max-width: 700px) { .coach__list { grid-template-columns: 1fr; } }

.spark { display: block; }
.spark .line { fill: none; stroke: var(--axis); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .end { fill: var(--blue); }

details.table-view { margin-top: 12px; }
details.table-view summary { cursor: pointer; color: var(--ink-2); font-size: 0.88rem; font-weight: 600; }
details.table-view .table-wrap { max-height: 320px; overflow-y: auto; margin-top: 8px; }

.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 9px 12px;
  border-radius: 12px;
  max-width: 240px;
  box-shadow: 0 6px 20px rgba(20, 35, 58, 0.25);
}
.tooltip strong { display: block; font-size: 0.9rem; }
.tooltip__hint { display: block; margin-top: 4px; opacity: 0.7; font-size: 0.78rem; }

/* ------------------------------------------------------- celebration */

.cheer {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}
.cheer__arc { width: 96px; height: 52px; }
.cheer__arc path { fill: none; stroke-width: 7; stroke-linecap: round; }
.cheer__title { font: 800 1.5rem/1.1 var(--display); letter-spacing: -0.02em; }
.cheer__text { color: var(--ink-2); margin-top: 6px; }
@media (max-width: 560px) {
  .cheer { grid-template-columns: auto 1fr; }
  .cheer .btn { grid-column: 1 / -1; justify-self: start; }
}
@media (prefers-reduced-motion: no-preference) {
  .cheer { animation: cheer-in 500ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  .cheer__arc path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: arc-draw 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
  .cheer__arc path:nth-child(2) { animation-delay: 80ms; }
  .cheer__arc path:nth-child(3) { animation-delay: 160ms; }
  .cheer__arc path:nth-child(4) { animation-delay: 240ms; }
  .cheer__arc path:nth-child(5) { animation-delay: 320ms; }
  .cheer__arc path:nth-child(6) { animation-delay: 400ms; }
}
@keyframes cheer-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes arc-draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------ sign-in, notices, misc */

.hero-panel { max-width: 520px; margin: 40px auto; text-align: center; }
.hero-panel__logo { display: block; width: min(320px, 80%); height: auto; margin: 0 auto 18px; }
.hero-panel__lead { font: 800 2.4rem/1.05 var(--display); margin-bottom: 12px; }
.hero-panel p { color: var(--ink-2); margin-bottom: 22px; }
.hero-panel .hero-panel__lead { color: var(--ink); margin-bottom: 12px; }
.hero-panel .fine { font-size: 0.88rem; color: var(--muted); margin-top: 22px; margin-bottom: 0; }

.notice {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.status-pill { display: inline-block; white-space: nowrap; font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.status-pill--pending { background: var(--blue-wash); color: var(--blue-ink); }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.empty { color: var(--muted); }
.fine { color: var(--muted); font-size: 0.88rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------ piece notes */

.notes__form { display: grid; gap: 12px; }
.feel { border: 0; margin: 0; padding: 0; min-width: 0; }
.feel__legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.feel__options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feel__option { position: relative; cursor: pointer; }
.feel__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.feel__option span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.feel__option:hover span { border-color: var(--axis); }
.feel__option input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.feel__option input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.notes__label { font-weight: 700; }
.notes__text {
  font: 400 1rem/1.45 var(--body); width: 100%; box-sizing: border-box; resize: vertical; min-height: 96px;
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--axis); background: var(--surface); color: var(--ink);
}
.notes__text:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.notes__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notes__status { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Feel marker in Recent pieces (own page only). */
.feel-chip { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.feel-chip--4, .feel-chip--5 { background: var(--blue-wash); color: var(--blue-ink); }

/* ---------------------------------------------------------- help figures */

.help__figure { margin: 4px 0 16px; }
.help__figure svg { display: block; width: 100%; max-width: 520px; height: auto; }
.help__figure figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 6px; max-width: 70ch; }
.help__curves { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 4px 0 16px; }
.help__curve { margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.help__curve svg { display: block; width: 100%; height: auto; }
.help__curve figcaption { font-size: 0.9rem; color: var(--ink-2); margin-top: 6px; }
.help__curve figcaption strong { color: var(--ink); display: block; }
.pm5__body { fill: var(--surface-2); stroke: var(--axis); stroke-width: 2; }
.pm5__screen { fill: #c9d3c4; stroke: var(--axis); }
.pm5__text { fill: #1b2a1b; font-family: var(--body); font-weight: 700; }
.pm5__small { fill: #3d4d3d; font-family: var(--body); font-weight: 600; }
.pm5__marker { fill: var(--blue); }
.pm5__marker-text { fill: #fff; font: 700 13px var(--body); }
.pm5__button { fill: var(--surface); stroke: var(--axis); }
.pm5__button-text { fill: var(--ink-2); font: 600 9px var(--body); }
.curve__axis { stroke: var(--axis); stroke-width: 1.5; fill: none; }
.curve__line { stroke: var(--blue); stroke-width: 3; fill: var(--blue-wash); stroke-linejoin: round; }
.curve__label { fill: var(--muted); font: 600 10px var(--body); }
.help__keyed { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; max-width: 75ch; }
.help__keyed li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--ink-2); }
.help__key { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--btn-bg); color: var(--btn-fg); font: 700 0.8rem var(--body); }
.help__keyed strong { color: var(--ink); }

/* Notes popup (piece page, the rower's own pieces only). */
.note-open { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-sizing: border-box;
  margin: auto; padding: 22px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: 0 20px 60px rgba(20, 35, 58, 0.25);
}
.note-dialog::backdrop { background: rgba(14, 22, 34, 0.45); }
.note-dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.note-dialog__head h2 { margin: 0 0 4px; }
.note-dialog__close {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2); font: 400 1.4rem/1 var(--body); cursor: pointer;
}
.note-dialog__close:hover { border-color: var(--axis); color: var(--ink); }
.note-dialog__close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Benchmark tag (notes popup, Recent pieces, chart flags). */
.bench { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
.bench__check { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.bench__check input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.bench__help { margin: 0; color: var(--muted); font-size: 0.88rem; }
.bench__name { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bench__name label { font-weight: 600; }
.bench__name input {
  font: 600 1rem var(--body); width: 14em; max-width: 100%; padding: 8px 12px; border-radius: 12px;
  border: 1.5px solid var(--axis); background: var(--surface); color: var(--ink);
}
.bench__name input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.chip-row { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bench-chip { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); white-space: nowrap; box-shadow: inset 0 -2px 0 var(--rb-violet); }
.chart .bench-flag line { stroke: var(--ink-2); stroke-width: 1.5; }
.tooltip__bench { display: grid; gap: 2px; margin: 4px 0; font-weight: 700; }

/* Rower level: "Pick your level" card and the setting. */
.level-pick__set { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.level-pick__options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.level-opt { position: relative; cursor: pointer; display: block; }
.level-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.level-opt__body { display: grid; gap: 4px; height: 100%; box-sizing: border-box; padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); }
.level-opt:hover .level-opt__body { border-color: var(--axis); }
.level-opt input:checked + .level-opt__body { border-color: var(--blue); background: var(--blue-wash); box-shadow: inset 0 0 0 1px var(--blue); }
.level-opt input:focus-visible + .level-opt__body { outline: 2px solid var(--blue); outline-offset: 2px; }
.level-opt__name { font: 700 1.05rem/1.3 var(--body); color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.level-opt__tag { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--blue); color: #fff; }
.level-opt__blurb { color: var(--ink-2); font-size: 0.9rem; line-height: 1.4; }
.level-select { flex: none; font: 600 0.95rem var(--body); padding: 8px 12px; border-radius: 12px;
  border: 1.5px solid var(--axis); background-color: var(--surface); color: var(--ink); }
.level-select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
@media (max-width: 700px) { .level-pick__options { grid-template-columns: 1fr; } }

/* Level feature cards (own page only). */
.level-card { box-shadow: var(--shadow); }
.level-card__kicker { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--blue-ink); }
.level-card__title { margin: 2px 0 6px; }
.level-card__text { margin: 0; color: var(--ink-2); max-width: 70ch; }

/* Novice milestones. */
.milestones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.milestones--next { margin-bottom: 6px; }
.milestones__head { font: 700 1rem/1.3 var(--body); margin: 18px 0 8px; }
.milestone { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.milestone--done { border-left-color: var(--good); }
.milestones--next .milestone { border-left-color: var(--blue); background: var(--blue-wash); }
.milestone__label { font-weight: 700; color: var(--ink); }
.milestone__meta { font-size: 0.86rem; color: var(--ink-2); }

/* Plain-text button, used for "Show everything". */
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--blue-ink); text-decoration: underline; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.show-all { margin: 0; }

/* Developing target and Comp race forms. */
.goal-edit label { font-weight: 600; }
.goal-edit input[type="text"] { width: 7em; }
.race-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.race-form label { display: grid; gap: 4px; font-weight: 600; font-size: 0.92rem; }
.race-form input, .race-form select {
  font: 600 1rem var(--body); padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--axis);
  background-color: var(--surface); color: var(--ink); min-width: 0;
}
.race-form input:focus-visible, .race-form select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.race-form__actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.race-form .goal-edit__error { grid-column: 1 / -1; }

/* Comp easy/hard balance. */
.balance { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.balance__row { display: grid; grid-template-columns: 70px 1fr 74px; gap: 10px; align-items: center; font-size: 0.88rem; }
.balance__week { color: var(--ink-2); }
.balance__bar { width: 100%; height: 12px; display: block; border-radius: 6px; overflow: hidden; }
.balance__easy { fill: var(--dot); }
.balance__hard { fill: var(--blue); }
.balance__none { fill: var(--surface-2); }
.balance__pct { text-align: right; font-weight: 600; color: var(--ink); }
.legend__swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend__swatch--easy { background: var(--dot); }
.legend__swatch--hard { background: var(--blue); }

/* Developing: target pace line on the Pace chart. */
.chart .target-line { stroke: var(--rb-violet); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .target-label { fill: var(--rb-violet); font-weight: 700; }

/* Novice: extra coaching notes tucked away. */
.coach__more { margin-top: 12px; }
.coach__more summary { cursor: pointer; font-weight: 700; color: var(--blue-ink); margin-bottom: 10px; }
.level-chip { cursor: pointer; font-family: inherit; border: 0; }
.level-chip:hover { text-decoration: underline; }
.level-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Goal picker: suggested date and benchmark plan (Developing and Comp). */
.race-form__hint { grid-column: 1 / -1; margin: 0; }
.bench-plan__intro { margin: 0 0 8px; }
.bench-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bench-plan__item { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px;
  border-radius: 10px; background: var(--surface-2); font-size: 0.92rem; }
.bench-plan__item--done { border-left-color: var(--good); }
.bench-plan__item--due { border-left-color: var(--blue); background: var(--blue-wash); }
.bench-plan__item--missed { border-left-color: var(--warm); }
.bench-plan__date { font-weight: 700; color: var(--ink); }
.bench-plan__state { color: var(--ink-2); }
.bench-plan__item--done .bench-plan__state::before { content: "✓ "; color: var(--up); font-weight: 700; }

/* Suggested goal target: greyed until the rower types their own. */
.goal-target__label { display: flex; gap: 8px; align-items: center; }
.suggested-tag { font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.race-form input.is-suggested { color: var(--muted); font-style: italic; }
.bench-plan__kind { display: block; font-weight: 500; font-size: 0.85rem; color: var(--ink-2); }
.note-saved { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink); white-space: pre-wrap; max-width: 75ch; }
.note-saved__label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; white-space: normal; }

/* Phone header: two compact rows (logo + Day/Night, then the nav). */
@media (max-width: 560px) {
  .site-header__inner { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px; }
  .site-header__end { display: contents; }
  .wordmark { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  .site-nav { order: 3; width: 100%; flex-wrap: nowrap; justify-content: space-between; overflow-x: auto; }
  .site-nav a { white-space: nowrap; }
}

/* Wide tables on phones: a soft edge shows there's more to scroll. */
.table-wrap {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(20, 35, 58, 0.18), transparent) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(20, 35, 58, 0.18), transparent) right center / 10px 100% no-repeat scroll;
}
.first-row { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink-2); max-width: 75ch; }
.first-row strong { color: var(--ink); }
/* Training paces table: let the split ranges wrap on phones. */
.rate-paces td, .rate-paces th { white-space: normal; }
@media (max-width: 480px) { .rate-paces { font-size: 0.88rem; } .rate-paces td, .rate-paces th { padding-left: 6px; padding-right: 6px; } }
.bench-plan__detail { display: block; font-weight: 400; font-size: 0.84rem; color: var(--muted); max-width: 60ch; }

/* ------------------------------------------------------- card hints */
.hint {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0;
  /* Centers the circle on the title's capital letters. */
  vertical-align: 0.08em;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font: 700 0.72rem/1 var(--body);
  letter-spacing: 0;
  text-transform: none;
  cursor: help;
}
/* A bigger tap area than the 20px circle shows. */
.hint::before { content: ""; position: absolute; inset: -10px; }
.hint:hover, .hint:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
.tooltip--hint { max-width: min(300px, calc(100vw - 16px)); }
.stats--hinted { position: relative; }
.stats__hint { position: absolute; top: 12px; right: 12px; }
.stats__hint .hint { margin-left: 0; vertical-align: top; }

/* ---------------------------------------------------------- public demo */

.demo-bar {
  /* Always a dark strip, in Day and Night, so it reads as the demo's own layer. */
  background: #0e1b2d;
  color: #dbe4f0;
  font-size: 0.9rem;
}
.demo-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.demo-bar__note { margin-right: auto; }
.demo-bar__views { display: inline-flex; align-items: center; gap: 4px; }
.demo-bar__views span { color: #9fb0c6; margin-right: 2px; }
.demo-bar a { color: inherit; font-weight: 600; text-decoration: none; padding: 4px 10px; border-radius: 999px; }
.demo-bar a:hover { background: rgba(255, 255, 255, 0.12); }
.demo-bar a[aria-current="true"] { background: var(--btn-bg); color: var(--btn-fg); }
.demo-bar .demo-bar__cta { background: none; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.demo-bar .demo-bar__cta:hover { background: rgba(255, 255, 255, 0.12); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(420px, calc(100% - 32px));
  background: var(--ink);
  color: var(--page);
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.interest-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.interest-form label { display: grid; gap: 4px; font-weight: 600; font-size: 0.92rem; }
.interest-form .interest-form__wide { grid-column: 1 / -1; }
.interest-form input, .interest-form select, .interest-form textarea {
  font: 500 1rem var(--body); padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--axis);
  background-color: var(--surface); color: var(--ink); min-width: 0;
}
.interest-form textarea { min-height: 96px; resize: vertical; }
.interest-form input:focus-visible, .interest-form select:focus-visible, .interest-form textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.interest-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.interest-form__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.interest-form__msg { color: var(--ink-2); }
.interest-form__msg.is-error { color: var(--down); }

.next-list { display: grid; gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.next-list li { border-top: 1px solid var(--line); padding-top: 14px; }
.next-list li:first-child { border-top: 0; padding-top: 0; }
.next-list h3 { font: 700 1.15rem/1.2 var(--body); margin: 0 0 4px; }
.next-list p { color: var(--ink-2); }
@media (max-width: 480px) {
  .demo-bar { font-size: 0.85rem; }
  .demo-bar__inner { padding: 8px 12px; gap: 6px 10px; }
  .demo-bar a { padding: 3px 8px; }
}

/* ------------------------------------------- demo club: plans, roster, settings */

.status-pill--on, .status-pill--done { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--up); }
.status-pill--tight { background: color-mix(in srgb, var(--warm) 18%, var(--surface)); color: var(--warm-ink); }
.status-pill--behind { background: color-mix(in srgb, var(--down) 14%, var(--surface)); color: var(--down); }

.plan__count { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.plan__count .num { font-size: 1.6rem; color: var(--ink); margin-right: 2px; }
.plan__goal { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-bottom: 12px; }
.plan__now { color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.plan__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan__item {
  display: grid;
  grid-template-columns: 3.2em 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
 
}
.plan__day { font: 800 0.95rem/1 var(--display); color: var(--ink-2); }
.plan__title { font-weight: 600; }
.plan__pace { color: var(--ink-2); font-size: 0.88rem; }
.plan__state { font-weight: 700; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.plan__item--done .plan__state a { color: var(--up); }
.plan__item--missed .plan__state { color: var(--warm-ink); }
.plan__edit { margin-top: 14px; }
.plan__edit summary { cursor: pointer; font-weight: 600; color: var(--blue-ink); }
@media (max-width: 560px) {
  .plan__item { grid-template-columns: 2.6em 1fr; }
  .plan__state, .plan__item .btn { grid-column: 2; justify-self: start; }
}

.plan-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; }
.plan-add label, .squad-pick { display: grid; gap: 4px; font-weight: 600; font-size: 0.88rem; }

.alert-list { margin: 10px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }

.roster td small { font-size: 0.8rem; }
.roster meter { width: 56px; height: 8px; vertical-align: middle; }
.roster meter::-webkit-meter-bar { background: var(--surface-2); border: 0; border-radius: 999px; }
.roster meter::-webkit-meter-optimum-value { background: var(--team-1); border-radius: 999px; }
.roster meter::-moz-meter-bar { background: var(--team-1); border-radius: 999px; }

.toggles td { vertical-align: middle; }
.toggle__label { font-weight: 600; }
.toggles .select { min-width: 8.5em; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.check input { width: 18px; height: 18px; accent-color: var(--team-1); margin: 0; }

.club-look { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .club-look { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.club-form { display: grid; gap: 16px; }
.club-form > label, .club-form__colors label { display: grid; gap: 4px; font-weight: 600; font-size: 0.92rem; }
.club-form input:not([type="file"]):not([type="color"]) {
  font: 500 1rem var(--body); padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--axis);
  background: var(--surface); color: var(--ink);
}
.club-form__label { font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.club-form__logo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.club-form__logo .club-form__label { flex-basis: 100%; margin: 0; }
.club-form__preview { width: 96px; height: 96px; object-fit: contain; background: var(--surface-2); border-radius: 12px; padding: 6px; }
.club-form__colors { display: flex; flex-wrap: wrap; gap: 16px; }
.club-form__colors input[type="color"] { width: 64px; height: 40px; padding: 2px; border: 1.5px solid var(--axis); border-radius: 10px; background: var(--surface); cursor: pointer; }
.club-form > .btn { justify-self: start; }
.club-look__preview { display: grid; justify-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); }
.club-look__preview .arc { width: 100%; max-width: 280px; }
.club-look__rings { display: flex; gap: 14px; }
.btn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Mid widths: five nav links plus Day/Night fit on one row (761 px and up);
   narrower, the links and switch move to a second row under the name. */
.site-nav a { white-space: nowrap; }
@media (min-width: 481px) and (max-width: 760px) {
  .site-header__inner { flex-wrap: wrap; row-gap: 6px; }
  .site-header__end { flex: 1 1 100%; flex-wrap: nowrap; justify-content: space-between; }
  .site-nav { justify-content: flex-start; flex-wrap: nowrap; }
  .site-nav a { padding: 7px 10px; }
  .theme-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .site-header__end { flex-wrap: nowrap; }
  .site-nav { flex-wrap: nowrap; }
  .site-nav a { padding: 7px 10px; }
  .wordmark__name { font-size: 1.7rem; }
  .theme-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .theme-toggle button { padding: 7px 9px; }
}

/* Text on the orange "Tight" and "Missed" labels: darker by day, lighter by night. */
:root { --warm-ink: #9a5410; --weights-ink: #5b21b6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warm-ink: #f5b26b; --weights-ink: #cbb8ff; } }
:root[data-theme="dark"] { --warm-ink: #f5b26b; --weights-ink: #cbb8ff; }

/* ===================================================== tiles (2026-11-25)
   Pages are a "bento": a grid of raised tiles in a few sizes, so the most
   important things (who, this week, the goal) get the biggest tiles.
   Desktop (980 px and up): 12 columns, sized with .s-4 / .s-5 / .s-6 /
   .s-7 / .s-8. Tablet: 12 columns, small tiles go half width. Phone: two
   columns; .s-mini tiles sit side by side, everything else is full width.
   A tile with no size class is always full width. */

.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.bento > * { grid-column: 1 / -1; min-width: 0; margin: 0; }
.bento > .s-mini { grid-column: span 1; }
@media (min-width: 700px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .bento > *, .bento > .s-mini { grid-column: 1 / -1; }
  .bento > .s-4, .bento > .s-5, .bento > .s-6, .bento > .s-7 { grid-column: span 6; }
}
@media (min-width: 980px) {
  .bento > .s-4 { grid-column: span 4; }
  .bento > .s-5 { grid-column: span 5; }
  .bento > .s-6 { grid-column: span 6; }
  .bento > .s-7 { grid-column: span 7; }
  .bento > .s-8 { grid-column: span 8; }
}
/* Tiles keep their content at the top when a row partner is taller. */
.bento > .panel:not(.stats):not(.goal):not(.week-strip) { display: flex; flex-direction: column; }
.bento > .panel.stats { display: grid; }

/* ------------------------------------------------------------ hero tile */
/* The page title tile: team colors, white text. Every page's .page-head. */

.page-head {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--hero);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 28px;
  align-items: center;
  min-height: 132px;
}
/* A faint arc in the corner, echoing the logo. */
.page-head::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -90px;
  bottom: -170px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 30px solid rgba(255, 255, 255, 0.09);
}
.page-head::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 55%);
}
.page-head h1 { color: #fff; }
.page-head .who__sub, .page-head .fine { color: rgba(255, 255, 255, 0.82); }
.page-head a:not(.btn) { color: #fff; }
.page-head .who { gap: 20px; flex-wrap: nowrap; }
.page-head .ring-avatar__track { stroke: rgba(255, 255, 255, 0.2); }
.page-head .ring-avatar__fill:not([stroke]) { stroke: #fff; }
.page-head .avatar { background: rgba(255, 255, 255, 0.95); color: #0e1b2d; }
.page-head .status-pill, .page-head .streak { background: rgba(255, 255, 255, 0.18); color: #fff; }
.page-head .streak--hot { background: rgba(255, 255, 255, 0.24); }
.page-head .btn { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.page-head .btn:hover { background: rgba(255, 255, 255, 0.26); border-color: rgba(255, 255, 255, 0.45); }
.page-head .btn--primary { background: #fff; border-color: #fff; color: #0e1b2d; }
.page-head .select { background-color: #fff; border-color: transparent; color: #0e1b2d; box-shadow: none; }
.page-head .controls { align-items: center; gap: 10px; }
.page-head :focus-visible { outline-color: #fff; }
@media (max-width: 560px) {
  .page-head { padding: 22px 20px; min-height: 0; }
  .page-head .who { gap: 14px; }
  h1 { font-size: 1.9rem; }
}

/* Inline "Squad [select]" on the coach's rower page. */
.squad-pick--inline { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; }
.page-head .squad-pick--inline { color: rgba(255, 255, 255, 0.88); }

/* ------------------------------------------------------------ stat tiles */
/* A row of totals: each stat is its own small tile. */

.stats { gap: var(--gap); background: none; box-shadow: none; padding: 0; border-radius: 0; }
.stats .stat, .stats .stat:first-child {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--edge), var(--shadow);
  padding: 22px 24px;
  border: 0;
  display: flex;
  flex-direction: column;
  min-height: 132px;
}
.stats .stat__note { margin-top: auto; padding-top: 6px; }
.stat__label { font-size: 0.82rem; letter-spacing: 0.01em; }
.stat__value { font-size: 2.1rem; margin: 14px 0 0; }
.stats__hint { top: 18px; right: 18px; }
/* One stat can be the dark accent tile. */
.stats .stat--accent { background: var(--ink); color: var(--surface); }
.stat--accent .stat__label { color: color-mix(in oklab, var(--surface) 75%, transparent); }
.stat--accent .stat__note { color: color-mix(in oklab, var(--surface) 70%, transparent); }
.stat__of { font-size: 0.5em; letter-spacing: 0; opacity: 0.65; }
.stats--1 { grid-template-columns: minmax(0, 1fr) !important; }
.stats--1 .stat { height: 100%; }
.stat__meter { display: block; width: 100%; height: 8px; margin-top: 14px; border: 0; border-radius: 999px; background: color-mix(in oklab, currentColor 14%, transparent); }
.stat__meter::-webkit-meter-bar { background: color-mix(in oklab, currentColor 14%, transparent); border: 0; border-radius: 999px; height: 8px; }
.stat__meter::-webkit-meter-optimum-value, .stat__meter::-webkit-meter-suboptimum-value, .stat__meter::-webkit-meter-even-less-good-value { background: linear-gradient(90deg, var(--team-1), var(--team-2)); border-radius: 999px; }
.stat__meter::-moz-meter-bar { background: linear-gradient(90deg, var(--team-1), var(--team-2)); border-radius: 999px; }
@media (max-width: 760px) {
  .stats--4 { row-gap: var(--gap); }
  .stats--4 .stat:nth-child(3) { padding-left: 24px; }
}
@media (max-width: 600px) {
  /* Phones: two small tiles side by side; an odd last one goes full width. */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .stats .stat, .stats .stat:first-child { padding: 18px; min-height: 116px; border-top: 0; }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat__value { font-size: 1.7rem; }
}

/* ------------------------------------------------------ rower page tiles */

.goal--stack { grid-template-columns: 1fr !important; align-content: start; }
.goal--stack .arc { max-width: 300px; margin: 6px auto 0; }
.streak-tile .streak-weeks { gap: 6px; margin-top: auto; padding-top: 18px; }
.streak-tile .streak-weeks span { width: 18px; height: 18px; }
.range-bar { padding: 4px 2px; }
.range-bar .segmented { box-shadow: var(--shadow-sm); background: var(--surface); }
.range-bar .segmented button[aria-pressed="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }

/* Inner items (plan rows, notes, milestones) read as wells inside a tile. */
.plan__item, .coach__note, .milestone, .bench-plan__item { border-radius: var(--radius-sm); }
.plan__item { padding: 12px 14px; min-height: 62px; }
.plan__title { line-height: 1.3; }
.plan__pace { margin-top: 2px; }
.plan__state { min-width: 3.6em; text-align: right; }

/* --------------------------------------------------------------- roster */

.alert-pills { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.alert-pills a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--edge), var(--shadow-sm);
  color: var(--ink); font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.alert-pills a:hover { box-shadow: var(--edge), var(--shadow); }
.alert-pills i {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 800 0.8rem/1 var(--body); font-style: normal;
  background: color-mix(in srgb, var(--warm) 20%, var(--surface)); color: var(--warm-ink);
}
.alert-pills .is-behind i { background: color-mix(in srgb, var(--down) 16%, var(--surface)); color: var(--down); }

.roster th { font-size: 0.76rem; color: var(--muted); padding: 0 12px 12px; }
.roster td { padding: 12px; }
.roster__who { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.roster__who .lane__name { white-space: nowrap; }
.roster__who small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.roster__goal { color: var(--ink-2); min-width: 170px; }
.roster__goal b { color: var(--ink); font-weight: 700; }
.roster meter { margin-right: 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 0.76rem; }
.status-pill--on::before, .status-pill--done::before, .status-pill--tight::before, .status-pill--behind::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
@media (max-width: 640px) {
  .roster__who { min-width: 150px; }
  .roster__goal { min-width: 130px; }
}

/* Buttons get a little lift too. */
.btn { box-shadow: var(--shadow-sm); }
.btn--ghost { box-shadow: none; }
.btn--primary { box-shadow: 0 1px 2px rgba(14, 27, 45, 0.12), 0 6px 14px -6px color-mix(in srgb, var(--blue) 70%, transparent); }
.segmented { box-shadow: inset 0 1px 2px rgba(14, 27, 45, 0.08); }
.segmented button { min-height: 34px; }
.segmented button[aria-pressed="true"] { box-shadow: var(--shadow-sm); }

/* Notices and the club-logo watermark sit above the darker page. */
.notice { border-radius: var(--radius-sm); }
.back-link { padding: 2px 0; }
.stat__label .hint { width: 18px; height: 18px; vertical-align: -0.35em; }

/* A column of tiles inside one bento cell; the last tile fills the height. */
.bento-stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.bento-stack > * { margin: 0; }
.bento-stack > .bento-fill { flex: 1; }
.bento-stack > .bento-fill .stat { height: 100%; }
/* Accent stat: needs to beat ".stats .stat:first-child". */
.stats .stat.stat--accent { background: var(--ink); color: var(--surface); }
.race-form__note { margin-top: 12px; }
.plan-add { align-items: flex-end; }
.plan-add .btn, .race-form__actions .btn { min-height: 40px; padding-left: 18px; padding-right: 18px; }
.toggles td:last-child { text-align: right; width: 1%; }
.toggles .select { min-width: 13.5em; text-align: left; }
.toggles td { padding-top: 14px; padding-bottom: 14px; }
@media (max-width: 600px) {
  .stats .stat__value { font-size: 1.45rem; white-space: nowrap; }
  .stats .stat:last-child:nth-child(odd) .stat__value { font-size: 1.8rem; }
}
@media (max-width: 560px) {
  .plan__state { text-align: left; min-width: 0; }
  .bento { gap: 16px; }
  .panel { padding: 20px 18px; }
}

/* Day page: "How the set went" notes, each a small well. */
.set-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.set-notes li { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); line-height: 1.45; font-size: 0.94rem; }
/* Empty placeholders (a note box before a note exists) take no grid space. */
.bento > :empty { display: none; }
.bento > .coach-skip, .bento > .fine { padding: 0 4px; }
/* A row of stat tiles has no padding of its own (beats the phone .panel padding above). */
.panel.stats { padding: 0; background: none; box-shadow: none; }
@media (max-width: 600px) { .stats .stat:nth-child(n) { padding: 18px; } }

/* ============================================ workflow changes (2026-11-25) */

/* Session type badges: erg uses the team color, the rest fixed colors. */
.type-badge { display: inline-flex; align-items: center; font: 700 0.72rem/1 var(--body); letter-spacing: 0.02em; padding: 4px 9px; border-radius: 999px; background: var(--blue-wash); color: var(--blue-ink); white-space: nowrap; }
.type-badge--weights { background: color-mix(in srgb, #8b5cf6 16%, var(--surface)); color: var(--weights-ink); }
.type-badge--cardio { background: color-mix(in srgb, var(--warm) 18%, var(--surface)); color: var(--warm-ink); }
.type-badge--other { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.plan__pace .type-badge { margin-right: 6px; vertical-align: 1px; }

/* Plan rows: the whole row opens that day; buttons sit above the link. */
.plan__item { position: relative; grid-template-columns: 3.2em minmax(0, 1fr) auto auto; }
.plan__item--weights { border-left-color: color-mix(in srgb, #8b5cf6 55%, var(--axis)); }
.plan__item--cardio { border-left-color: color-mix(in srgb, var(--warm) 55%, var(--axis)); }
.plan__item.plan__item--done { border-left-color: var(--team-1); }
.plan__item.plan__item--missed { border-left-color: var(--warm); }
.plan__open { color: var(--ink); text-decoration: none; display: block; }
.plan__open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.plan__item:has(.plan__open):hover { background: color-mix(in oklab, var(--surface-2) 70%, var(--blue-wash)); }
.plan__open:focus-visible { outline: none; }
.plan__item:has(.plan__open:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.plan__actions { position: relative; z-index: 1; display: inline-flex; gap: 6px; }
@media (max-width: 560px) {
  .plan__actions { grid-column: 2; justify-self: start; }
}

/* Plan editor: week picker and actions. */
.week-nav { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.week-nav .btn { min-width: 34px; justify-content: center; }
.week-nav__label { font-weight: 700; font-size: 0.88rem; padding: 0 8px; white-space: nowrap; }
.plan-editor__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.plan-editor__hint { margin-top: 12px; }

/* Add / edit session dialog. */
.session-dialog { width: min(600px, calc(100vw - 32px)); border-radius: var(--radius); }
.session-form { display: grid; gap: 14px; }
.session-form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.session-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.session-form input, .session-form textarea {
  font: 500 1rem/1.4 var(--body); padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--axis);
  background: var(--surface); color: var(--ink); width: 100%;
}
.session-form .select { width: 100%; border-radius: 12px; }
.session-form textarea { resize: vertical; }

/* Goals: two rows (split goal, stroke rate). */
.goal-row { padding: 14px 0; border-top: 1px solid var(--line); }
.goal-row:first-of-type { border-top: 0; padding-top: 0; }
.goal-row__label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.goal-row__value { font-size: 2rem; margin: 8px 0; }
.goal-row__to { font: 600 0.95rem var(--body); letter-spacing: 0; color: var(--muted); }
.goal-row__note { color: var(--ink-2); font-size: 0.88rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goals-card .plan__edit { margin-top: auto; padding-top: 10px; }
.key-metrics .stat__note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rate-fields { border: 0; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.rate-fields legend { font-weight: 600; font-size: 0.92rem; padding: 0; margin-bottom: 4px; }
.rate-fields input { width: 4.2em; text-align: center; }
.rate-fields label { display: block; }

/* Day of the plan: week strip, steps, coach's note, what was rowed. */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.week-strip__day {
  display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink-2); background: var(--surface-2);
}
.week-strip__day:hover { color: var(--ink); background: color-mix(in oklab, var(--surface-2) 70%, var(--blue-wash)); }
.week-strip__name { font-size: 0.78rem; font-weight: 700; }
.week-strip__num { font: 800 1.3rem/1.1 var(--display); color: var(--ink); }
.week-strip__what { font-size: 0.72rem; text-align: center; line-height: 1.2; }
.week-strip__day--rest { opacity: 0.7; }
.week-strip__day[aria-current="date"] { background: var(--ink); color: var(--surface); }
.week-strip__day[aria-current="date"] .week-strip__num { color: var(--surface); }
@media (max-width: 560px) {
  .week-strip { gap: 4px; padding: 6px; }
  .week-strip__what { display: none; }
}
.plan-day__type { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--ink); line-height: 1.45; }
.steps li::marker { color: var(--muted); font-weight: 700; }
.plan-day__target { margin-top: 16px; color: var(--ink-2); }
.coach-note { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-wash); }
.coach-note__label { font-size: 0.78rem; font-weight: 700; color: var(--blue-ink); margin-bottom: 4px; }
.plan-day__state { margin: 12px 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-2); }
.rowed { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.rowed div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.rowed dt { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.rowed dd { margin: 4px 0 0; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rowed small { display: block; flex-basis: 100%; font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.hit { font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.hit--yes { background: color-mix(in srgb, var(--good) 16%, var(--surface)); color: var(--up); }
.hit--no { background: color-mix(in srgb, var(--warm) 18%, var(--surface)); color: var(--warm-ink); }

/* Club: levels. */
.text-input { font: 600 0.95rem var(--body); padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--axis); background: var(--surface); color: var(--ink); min-width: 0; width: 100%; max-width: 260px; }
.levels td { padding-top: 12px; padding-bottom: 12px; }
.levels td:last-child .btn + .btn { margin-left: 6px; }
.style-notes { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; color: var(--ink-2); font-size: 0.88rem; }
.member-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.member-list a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 8px; border-radius: 12px; }
.member-list a:hover { background: var(--surface-2); }
.goal-row__meter { margin-top: 2px; color: var(--ink); }
.bento > .panel > .btn, .bento > .panel > a.btn { align-self: flex-start; }
.toggles td:first-child { padding-left: 0; } .toggles td:last-child { padding-right: 0; }

/* Club: Training plans card, and the Roster column in Levels. */
.levels__count { display: inline-block; min-width: 5.5em; color: var(--ink-2); font-weight: 600; margin-right: 8px; }
.plans-table td { vertical-align: middle; }
.plans-table__style { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.plans-table__n { font-weight: 600; margin-right: 6px; }
.plans-table .type-badge { margin: 2px 2px 2px 0; }

/* A group's month of plans. */
.cal { display: grid; gap: 6px; }
.cal__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; border-radius: var(--radius-sm); padding: 3px; }
.cal__row--head span { font-size: 0.76rem; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal__row.is-editing { background: var(--blue-wash); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--blue) 45%, transparent); }
.cal__day {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 92px; padding: 8px;
  border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.cal__day:hover { background: color-mix(in oklab, var(--surface-2) 65%, var(--blue-wash)); }
.cal__day.is-out { opacity: 0.45; }
.cal__num { font: 800 0.9rem/1 var(--display); color: var(--ink-2); }
.cal__day.is-today .cal__num { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); color: var(--surface); }
.cal__chip {
  display: block; font-size: 0.7rem; font-weight: 600; line-height: 1.25; padding: 3px 6px; border-radius: 6px;
  background: var(--blue-wash); color: var(--blue-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal__chip--weights { background: color-mix(in srgb, #8b5cf6 16%, var(--surface)); color: var(--weights-ink); }
.cal__chip--cardio { background: color-mix(in srgb, var(--warm) 18%, var(--surface)); color: var(--warm-ink); }
.cal__chip--other { background: var(--surface); color: var(--ink-2); }
@media (max-width: 700px) {
  .cal, .cal__row { gap: 3px; }
  .cal__day { min-height: 54px; padding: 5px; }
  /* Phones: a dot per session instead of the title. */
  .cal__chip { font-size: 0; width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--blue); display: inline-block; }
  .cal__chip--weights { background: #8b5cf6; }
  .cal__chip--cardio { background: var(--warm); }
  .cal__chip--other { background: var(--axis); }
  .cal__day { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
  .cal__num { flex-basis: 100%; }
}
/* Group plan page: rowers as compact pills so the title tile stays short. */
.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member-list li { display: block; }
.member-list a { gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 0.9rem; }
.member-list .ring-avatar--sm { width: 34px; height: 34px; }
.member-list .avatar--sm { width: 26px; height: 26px; font-size: 0.66rem; }
.cal__day.is-today .cal__num { width: 22px; height: 22px; margin: -2px 0 -2px -3px; font-size: 0.8rem; }
.select--compact { min-height: 36px; padding: 7px 34px 7px 12px; font-size: 0.86rem; box-shadow: none; }

/* Touch screens: every control is at least 44px tall. Desktop sizes stay as they are. */
@media (pointer: coarse) {
  .site-nav a, .theme-toggle button, .demo-bar a, .segmented button,
  .btn, .btn--small, .select, select, .level-select, .link-btn { min-height: 44px; }
  .site-nav a, .theme-toggle button, .demo-bar a { display: inline-flex; align-items: center; }
  .demo-bar__views { gap: 6px; }
  .btn--small { padding-top: 10px; padding-bottom: 10px; }
  .alert-pills a, .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Goals card: the gap in plain numbers, and what to do next. */
.goal-row__gap { margin-top: 8px; font-size: 1rem; font-weight: 700; color: var(--ink); }
.goal-next { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-wash); color: var(--ink); }
.goal-next__when { font-size: 0.82rem; font-weight: 700; color: var(--blue-ink); }
.goal-next__link { font-weight: 700; color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.goal-next--done { font-size: 0.92rem; color: var(--ink-2); }
/* Phones: the goal comes straight after the person, before the streak and the plan. */
@media (max-width: 640px) {
  .bento > .page-head { order: -2; }
  .bento > .goals-card { order: -1; }
}

/* Roster: who needs a look, and a card layout on phones. */
.roster__sort { margin: 0 0 10px; font-size: 0.85rem; color: var(--ink-2); }
.roster__quiet { display: block; margin-top: 4px; font-size: 0.78rem; font-weight: 600; color: var(--warm-ink); }
}
.goal-how { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.goal-how + .goal-row { border-top: 0; padding-top: 8px; }

/* Quiet page titles: only a person's own page keeps the team-color banner. */
.bento > .page-head.page-head--quiet { grid-column: 1 / -1; }
.page-head--quiet { background: none; color: var(--ink); box-shadow: none; border-radius: 0; padding: 4px 2px 16px; min-height: 0; border-bottom: 1px solid var(--line); overflow: visible; }
.page-head--quiet::before, .page-head--quiet::after { display: none; }
.page-head--quiet h1 { color: var(--ink); }
.page-head--quiet .who__sub, .page-head--quiet .fine { color: var(--muted); max-width: 70ch; }
.page-head--quiet a:not(.btn) { color: var(--blue-ink); }
.page-head--quiet .btn { background: var(--surface); border-color: var(--line); color: var(--ink); }
.page-head--quiet .btn:hover { background: var(--surface); border-color: var(--axis); }
.page-head--quiet .btn--ghost { background: var(--surface-2); border-color: transparent; }
.page-head--quiet :focus-visible { outline-color: var(--blue); }

/* Team goals: counts by status, no names beside Close or Behind. */
.team-goals__big { font-size: 2.6rem; margin: 4px 0 12px; }
.team-goals__big span { font: 600 1rem var(--body); letter-spacing: 0; color: var(--muted); }
.team-goals__bar { display: flex; gap: 4px; height: 14px; }
.team-goals__bar .team-goals__seg { flex: 1; border-radius: 999px; }
.team-goals__seg--done { background: var(--up); }
.team-goals__seg--on { background: var(--good); }
.team-goals__seg--tight { background: var(--warm); }
.team-goals__seg--behind { background: var(--down); }
.team-goals__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.88rem; color: var(--ink-2); }
.team-goals__legend li { display: inline-flex; align-items: center; gap: 8px; }
.team-goals__dot { width: 10px; height: 10px; border-radius: 50%; }
.team-goals__me { margin: 18px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 600; }
.team-goals__wins-title { margin: 22px 0 8px; font-size: 1rem; }
.team-goals__wins { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }

/* Roster alert chips name the next step. */
.alert-pills__act { margin-left: 4px; font-weight: 700; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; }
/* Coach view of a rower: the goal editor stays closed until asked for. */
#coach-goal-edit { margin-top: 4px; }
.style-notes__title { margin: 14px 0 4px; font-weight: 700; color: var(--ink-2); }
/* The group name sits under a rower's name on phones only; desktop has the Group column. */

/* Hidden labels inside a scrolling table must not widen the whole page. */
.table-wrap { position: relative; }
/* Narrower screens: the roster drops the columns a coach needs least. */

/* Quiet page titles need air between the title and the line under it. */
.page-head--quiet h1 { margin-bottom: 10px; line-height: 1.15; }

/* ------------------------------------------------- demo feedback */
.fb-button { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40; min-height: 52px; padding: 14px 22px; font-size: 1rem; box-shadow: 0 0 0 3px var(--surface), var(--shadow-lift); }
.fb-button svg { width: 20px; height: 20px; flex: none; }
/* Room at the end of the page, so the button never hides the last row. */
.has-feedback .page { padding-bottom: 112px; }
.has-feedback .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.fb-form { display: grid; gap: 14px; }
.fb-field { display: grid; gap: 6px; font-weight: 700; font-size: 0.92rem; min-width: 0; }
.fb-field input { font: 500 1rem var(--body); padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--axis); background: var(--surface); color: var(--ink); min-width: 0; width: 100%; box-sizing: border-box; }
.fb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fb-dialog .feel__option span { min-height: 44px; display: inline-flex; align-items: center; padding-left: 18px; padding-right: 18px; }
.fb-msg { margin: 0; color: var(--down); font-weight: 600; }
.fb-msg:empty { display: none; }


/* Club settings: switch list with per-group overrides (replaces the 20-select grid). */
.switch-list { list-style: none; margin: 0; padding: 0; }
.switch-row { padding: 14px 0; border-top: 1px solid var(--line, rgba(20,35,58,.1)); }
.switch-row:first-child { border-top: 0; }
.switch-row__main { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; min-height: 44px; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { width: 46px; height: 26px; border-radius: 999px; background: #9aa6b6; position: relative; transition: background .18s; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s; }
.switch input:checked + .switch__track { background: var(--btn-bg, var(--team-1)); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--team-1); outline-offset: 3px; }
.switch-row__groups { margin-top: 6px; }
.switch-row__groups summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted); min-height: 32px; display: inline-flex; align-items: center; }
.group-overrides { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.group-overrides li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .switch__track, .switch__track::after { transition: none; } }

/* Phone tables (2026-12-03): no sideways scrolling at 375px. */
.show-sm { display: none; }
.show-sm-sr { display: none; }
@media (max-width: 640px) {
  .show-sm { display: inline; }
  .show-sm-sr { display: inline; }
  .table-wrap th, .table-wrap td { padding-left: 3px; padding-right: 3px; }
  .parts th, .parts td { font-size: 0.85rem; }
  .table-wrap .feel-chip { padding-left: 6px; padding-right: 6px; }
  /* Groups table becomes one card per group. */
  table.levels:not(.plans-table) thead { display: none; }
  table.levels:not(.plans-table), table.levels:not(.plans-table) tbody, table.levels:not(.plans-table) tr { display: block; width: 100%; }
  table.levels:not(.plans-table) tr { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.levels:not(.plans-table) tr:last-child { border-bottom: 0; }
  table.levels:not(.plans-table) td { display: block; padding: 0; border: 0; }
  table.levels:not(.plans-table) td:nth-child(1) { grid-column: 1 / -1; }
  table.levels:not(.plans-table) td:nth-child(1) .text-input { width: 100%; }
  table.levels:not(.plans-table) td:nth-child(2) { grid-column: 1 / -1; }
  table.levels:not(.plans-table) td:nth-child(2) .select { width: 100%; }
  table.levels:not(.plans-table) td.num-cell { text-align: right; }
}

/* Rower page "Today" strip (2026-12-03): first thing on your own page. */
.today-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: 14px; background: color-mix(in srgb, var(--team-1) 24%, #0b1626); color: #fff;
  box-shadow: 0 6px 18px rgba(20, 35, 58, .18); }
.today-strip__label { margin: 0; font-size: .8rem; font-weight: 700; color: rgba(255,255,255,.72); }
.today-strip__title { margin: 2px 0 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.today-strip__sub { margin: 4px 0 0; font-size: .9rem; color: rgba(255,255,255,.82); max-width: 60ch; }
.today-strip .btn--primary { background: #fff; color: #0b1626; border-color: #fff; }
.today-strip .btn--small { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.today-strip--done .today-strip__title::before { content: '✓ '; color: var(--good, #3cb371); }
.today-strip--rest { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.today-strip--rest .today-strip__label, .today-strip--rest .today-strip__sub { color: var(--muted); }
.today-strip--rest .btn--small { color: var(--ink); border-color: var(--line); }
.page-head--slim { padding-top: 14px; padding-bottom: 14px; }
.page-head--slim h1 { font-size: clamp(1.4rem, 3.2vw, 1.9rem); }
@media (max-width: 640px) { .today-strip { padding: 16px; } .today-strip .btn { width: 100%; justify-content: center; } }
@media (max-width: 979px) { .bento > .today-strip { order: -3; } }
/* The strip already names the next session, so the goals card doesn't repeat it. */
.bento:has(.today-strip) .goal-next { display: none; }

/* Oar-blade accent (2026-12-03): done plan sessions carry a small blade, and progress
   bars are a shaft ending in a blade, both in the club's team colors. */
.blade { width: 26px; height: 11px; fill: var(--team-1); vertical-align: -1px; margin-right: 6px; flex: none; }
.plan__item--done .plan__state { color: var(--ink-2); display: inline-flex; align-items: center; justify-content: flex-end; }
.blade-bar { display: block; width: 100%; height: 16px; margin-top: 14px; overflow: visible; background: none; border-radius: 0; }
.roster__bar.blade-bar { display: inline-block; width: 72px; margin: 0 6px 0 0; vertical-align: middle; }
.blade-bar__track { fill: color-mix(in oklab, currentColor 14%, transparent); }
.blade-bar__shaft { fill: var(--team-1); }
.blade-bar__blade { fill: var(--team-1); }
.stat--accent .blade-bar__blade, .stat--accent .blade-bar__shaft { fill: color-mix(in srgb, var(--team-1) 70%, #fff); }

/* Demo bar in Night (2026-12-03): quieter, so it doesn't outshine the page. Declared twice,
   like the other Night colors: device setting and the Night switch. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-bar { background: #0b1420; color: #aebbd0; border-bottom: 1px solid #1d2b3f; }
  :root:not([data-theme="light"]) .demo-bar a[aria-current="true"] { background: #24364f; color: #e6edf6; }
  :root:not([data-theme="light"]) .demo-bar .demo-bar__cta { color: #d3dcea; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }
}
:root[data-theme="dark"] .demo-bar { background: #0b1420; color: #aebbd0; border-bottom: 1px solid #1d2b3f; }
:root[data-theme="dark"] .demo-bar a[aria-current="true"] { background: #24364f; color: #e6edf6; }
:root[data-theme="dark"] .demo-bar .demo-bar__cta { color: #d3dcea; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); }

/* Private workouts (Concept2 privacy = private): owner-only marker. */
.private-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; color: var(--muted); border: 1px solid currentColor; }
.private-note { margin-top: 6px; color: var(--muted); font-size: 0.85rem; max-width: 60ch; }

/* Roster rebuild (critique 2026-12-03): two sections, five columns, one reason line. */
.roster { border-collapse: separate; border-spacing: 0; width: 100%; }
.roster th { white-space: nowrap; }
.roster td { border-bottom: 1px solid var(--line); }
.roster__row { cursor: pointer; }
.roster__row:hover td, .roster__row:hover + .roster__reason td, .roster__reason:hover td { background: var(--surface-2); }
.roster__label th { padding: 18px 12px 8px; font-size: 0.82rem; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--line); text-align: left; }
.roster__section:first-of-type .roster__label th { padding-top: 6px; }
.roster__count { display: inline-flex; min-width: 22px; justify-content: center; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 0.74rem; background: var(--surface-2); color: var(--ink-2); }
.roster__section--needs .roster__count { background: color-mix(in srgb, var(--warm) 22%, var(--surface)); color: var(--warm-ink); }
.roster__row--needs td { border-bottom: 0; padding-bottom: 4px; }
.roster__reason { cursor: pointer; }
.roster__reason td { padding: 0 12px 12px 60px; }
.roster__reason td { display: table-cell; }
.roster__why { font-size: 0.85rem; font-weight: 600; color: var(--warm-ink); margin-right: 12px; }
.roster__why.is-behind { color: var(--down); }
.roster__act { vertical-align: middle; }
.roster__section--rest .roster__row td { padding-top: 9px; padding-bottom: 9px; }
.roster__name { font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.roster__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.roster__who small.roster__group { display: block; }
.roster__by { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.roster__goal { min-width: 0; white-space: nowrap; }
.roster__none { color: var(--muted); }
.roster__week { white-space: nowrap; }
.roster__week .num { font-size: 0.85rem; color: var(--ink-2); }
.roster__last { white-space: nowrap; color: var(--ink-2); font-size: 0.88rem; }
.segmented__count { font-size: 0.75em; opacity: 0.7; margin-left: 2px; }
.stat--warn .stat__value { color: var(--warm-ink); }

@media (max-width: 760px) {
  /* Phones and small tablets: one card per rower, reason and action inside it. */
  .roster, .roster tbody { display: block; }
  .roster thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .roster__label { display: block; }
  .roster__label th { display: block; padding: 14px 2px 8px; border: 0; }
  .roster__row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px 14px 10px; margin-top: 10px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); }
  .roster__row:not(.roster__row--needs) { border-radius: var(--radius-sm); padding-bottom: 14px; }
  .roster__row td, .roster__reason td { display: block; padding: 0; border: 0; background: none !important; }
  .roster__row td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .roster__row td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  .roster__row td:nth-child(2) { grid-column: 1 / -1; }
  .roster__row td:nth-child(4) { grid-column: 1; }
  .roster__row td:nth-child(5) { grid-column: 2; text-align: right; }
  .roster__reason { display: block; padding: 0 14px 14px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--surface-2); }
  .roster__reason td { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .roster__name { display: inline-flex; align-items: center; min-height: 44px; }
  .roster__who small.roster__group { margin-top: -8px; }
  .roster td.empty { display: block; }
}
/* Keep the floating Feedback button from covering the last rows and links. */
main { padding-bottom: 88px; }
@media (max-width: 640px) {
  /* Roster tiles become one compact row of three counts, so rowers come sooner. */
  .roster-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; background: none; box-shadow: none; }
  .roster-stats .stat { padding: 12px; min-height: 0; }
  .roster-stats .stat__label { font-size: 0.74rem; line-height: 1.25; }
  .roster-stats .stat__value { font-size: 1.6rem; margin-top: 4px; }
  .roster-stats .stat__note, .roster-stats .blade-bar { display: none; }
  .roster-stats .stat:last-child:nth-child(odd) { grid-column: auto; }
  .roster-stats .stat:last-child:nth-child(odd) .stat__value { font-size: 1.6rem; }
  .segmented__count { display: inline; }
}

/* Detector clean-up (critique 2026-12-03): no thick side stripes on rounded cards.
   State is carried by text, badges and the oar blade instead. */
.notice, .level-card { border: 1px solid var(--line); }

/* Status pills: Reached gets its own look so it never reads as On track, and every
   pill clears 4.5:1 with room to spare. */
.status-pill--on { color: #155c33; }
.status-pill--done { background: var(--btn-bg); color: var(--btn-fg); }
.status-pill--done::before { background: currentColor; }
.status-pill--tight { color: #7a4a00; }
.status-pill--behind { color: #9a261d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-pill--on { color: #6fd69a; }
  :root:not([data-theme="light"]) .status-pill--tight { color: #f2c06b; }
  :root:not([data-theme="light"]) .status-pill--behind { color: #ff9a90; }
}
:root[data-theme="dark"] .status-pill--on { color: #6fd69a; }
:root[data-theme="dark"] .status-pill--tight { color: #f2c06b; }
:root[data-theme="dark"] .status-pill--behind { color: #ff9a90; }
.week-strip__day--done::after, .week-strip__day--missed::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--team-1); }
.week-strip__day--missed::after { background: var(--warm); }
/* Coach view: the plan editor ends where its sessions end, beside the taller tools column. */
.bento > section:has(#pe-title) { align-self: start; }

/* Rower settings popup (coach view, opened from the name plate). */
.rs-dialog { width: min(620px, calc(100vw - 32px)); }
.rs-list { list-style: none; margin: 0; padding: 0; }
.rs-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.rs-row--group { margin-top: 14px; }
.rs-row__label { margin: 0; font-weight: 700; }
.rs-row__help { margin: 2px 0 0; font-size: 0.84rem; color: var(--muted); }
.rs-row .select { flex: none; min-width: 11.5em; }
.rs-dialog__sub { margin: 18px 0 2px; font-size: 0.8rem; font-weight: 800; color: var(--ink-2); }
.rs-dialog__note { margin: 12px 0 0; }
@media (max-width: 560px) {
  .rs-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .rs-row .select { width: 100%; }
}
.blade--crossed { width: 30px; height: 21px; vertical-align: middle; }

/* ====================================================== page shell (2026-12-04)
   Top row: wordmark, page title, Day/Night. Then the club or rower card with the
   nav under it (left), the page (middle) and the key numbers (right, the rail),
   all starting level. On desktop both sides stay put while the middle scrolls.
   body[data-frame]: bare (signed out), side (no numbers: the page runs wide), rail.
   Approved from design/roster-preview.html and rower-preview.html. */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand theme" "side side" "rail rail" "head head" "main main";
  gap: 14px;
  padding: 12px 12px 0;
}
body[data-frame="side"] .shell { grid-template-areas: "brand theme" "side side" "head head" "main main"; }
body[data-frame="bare"] .shell { grid-template-areas: "brand theme" "main main"; }
.shell__brand { grid-area: brand; align-self: center; padding: 4px 6px; }
.shell__brand .wordmark__name { font-size: 1.7rem; }
.shell__theme { grid-area: theme; align-self: center; }
.shell__head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-width: 0; }
.shell__head:empty { display: none; }
.shell__side { grid-area: side; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.shell__rail { grid-area: rail; min-width: 0; }
.shell > .page { grid-area: main; max-width: none; margin: 0; padding: 0 0 96px; min-width: 0; container-type: inline-size; }
body[data-frame="bare"] .shell__side, body[data-frame="bare"] .shell__head { display: none; }
body[data-frame="bare"] .shell > .page { width: 100%; max-width: 1200px; margin: 0 auto; }

/* Top row: the page's title */
.head__titles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-width: 0; }
.head__title { margin: 0; font: 800 2.2rem/1.1 var(--display); letter-spacing: -0.03em; color: var(--ink); }
.head__eyebrow { margin: 0; color: var(--muted); font-size: 0.95rem; font-weight: 700; }
.shell__head .link-row { gap: 14px; }
.shell__head .range-bar { padding: 0; }
.shell__head > .page-head--quiet { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 0; border: 0; min-height: 0; }
.shell__head > .page-head--quiet h1 { margin: 0; font-size: 2.2rem; }
.shell__head > .page-head--quiet .who__sub { margin: 4px 0 0; font-size: 0.92rem; }

/* Left: the nav card (on phones a row of links above the card) */
.navcard { order: -1; padding: 6px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--edge), var(--shadow-sm); }
.shell .site-nav { display: flex; flex-wrap: nowrap; align-items: stretch; justify-content: space-between; gap: 2px; overflow-x: auto; }
.shell .site-nav a { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 10px; white-space: nowrap; }
.nav-icon { display: none; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The demo note, view switcher and sign-up link, inside the nav card */
.shell .navcard .demo-bar { border: 0; background: none; color: var(--muted); font-size: 0.8rem; margin-top: 6px; }
.shell .navcard .demo-bar__inner { display: flex; flex-direction: column; align-items: stretch; gap: 10px; max-width: none; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.shell .navcard .demo-bar__note { margin: 0; line-height: 1.45; font-weight: 500; }
.shell .navcard .demo-bar a { padding: 0; border-radius: 6px; color: var(--blue-ink); font-weight: 700; }
.shell .navcard .demo-bar a:hover { background: none; text-decoration: underline; }
.shell .navcard .demo-bar__views { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.shell .navcard .demo-bar__views span { flex-basis: 100%; margin: 0 0 2px; color: var(--muted); font-weight: 700; }
.shell .navcard .demo-bar__views a { padding: 5px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-weight: 600; }
.shell .navcard .demo-bar__views a:hover { text-decoration: none; color: var(--ink); }
.shell .navcard .demo-bar__views a[aria-current="true"] { background: var(--btn-bg); color: var(--btn-fg); }
.shell .navcard .demo-bar .demo-bar__cta { box-shadow: none; color: var(--blue-ink); background: none; }

/* Left: the colorful card. The club on most pages, the rower on a rower's page. */
.shell .page-head--card { display: block; padding: 22px; min-height: 0; }
.page-head--card:empty { display: none; }
.page-head--card::after { right: -110px; bottom: -150px; width: 300px; height: 300px; border-width: 28px; }
.idcard__badge { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 14px; background: rgba(255, 255, 255, 0.95); color: #0e1b2d; font-size: 0.86rem; font-weight: 800; }
.idcard__badge img { width: 100%; height: 100%; object-fit: contain; }
.idcard__kicker { margin: 18px 0 0; color: rgba(255, 255, 255, 0.78); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.idcard__name { margin: 4px 0 0; color: #fff; font: 800 1.5rem/1.1 var(--display); letter-spacing: -0.02em; }
.idcard__meta { margin: 8px 0 0; color: rgba(255, 255, 255, 0.82); font-size: 0.84rem; font-weight: 500; }
.page-head--rower .who { display: flex; align-items: center; gap: 16px; }
.page-head--rower h1 { margin: 0; font-size: 1.75rem; line-height: 1.02; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.page-head--rower .ring-avatar--lg { width: 84px; height: 84px; }
.page-head--rower .avatar--lg { width: 66px; height: 66px; font-size: 1.15rem; }
.page-head--rower .who__chips { margin-top: 16px; }
.page-head--rower .who__sub { margin: 10px 0 0; }
.page-head--rower .controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Right: the key numbers, grouped in one soft card under a heading */
.shell__rail { display: grid; gap: 10px; align-content: start; padding: 12px; border-radius: 30px; background: color-mix(in oklab, var(--surface) 45%, var(--page)); box-shadow: var(--edge), var(--shadow-sm); }
.shell__rail > * + * { margin-top: 0; }
.rail__label { margin: 0; padding: 8px 10px 4px; color: var(--ink-2); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.shell__rail .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.shell__rail .stats .stat, .shell__rail .streak-tile { min-height: 0; padding: 18px 20px; border-radius: 18px; box-shadow: var(--edge), var(--shadow-sm); }
.shell__rail .stat__value, .shell__rail .streak__big { margin-top: 10px; font: 800 3rem/0.9 var(--wordmark); letter-spacing: 0.005em; }
.shell__rail .stat__value { font-size: 2.6rem; white-space: nowrap; }
.shell__rail .stat__of { margin-left: 6px; font-size: 0.48em; opacity: 0.6; }
.shell__rail .streak__unit { margin-left: 6px; color: var(--ink-2); font: 700 0.86rem/1 var(--body); letter-spacing: 0; }
.shell__rail .streak-tile h2 { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.shell__rail .streak-tile .panel__sub { margin-top: 8px; font-size: 0.8rem; }
.shell__rail .streak-tile .streak-weeks { gap: 4px; padding-top: 12px; }
.shell__rail .streak-tile .streak-weeks span { width: 11px; height: 11px; }

/* The page's own tiles size to the middle column, not the window. */
@container (min-width: 700px) and (max-width: 979px) {
  .bento > .s-4, .bento > .s-5, .bento > .s-6, .bento > .s-7 { grid-column: span 6; }
  .bento > .s-8 { grid-column: 1 / -1; }
}
@container (max-width: 699px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > *:not(.s-mini) { grid-column: 1 / -1; }
}

/* Tablet: the left column appears; numbers sit in a row above the page. */
@media (min-width: 960px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr) auto; grid-template-areas: "brand head theme" "side rail rail" "side main main"; gap: 24px 28px; padding: 20px 24px 0; }
  body[data-frame="side"] .shell { grid-template-areas: "brand head theme" "side main main"; }
  body[data-frame="bare"] .shell { grid-template-areas: "brand . theme" "main main main"; }
  .shell__brand { padding: 0 8px; }
  .shell__brand .wordmark__name { font-size: 1.8rem; }
  .shell__side { position: sticky; top: 16px; gap: 14px; }
  .navcard { order: 0; padding: 14px 12px; border-radius: var(--radius); box-shadow: var(--edge), var(--shadow); }
  .shell .site-nav { flex-direction: column; gap: 4px; overflow: visible; }
  .shell .site-nav a { flex: none; justify-content: flex-start; padding: 0 14px; }
  .nav-icon { display: block; }
  .shell .navcard .demo-bar { margin-top: 18px; }
  .shell__rail .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

/* Desktop: three columns. Numbers move to the right; both sides stay put. */
@media (min-width: 1280px) {
  .shell { grid-template-columns: 272px minmax(0, 1fr) 260px; grid-template-areas: "brand head theme" "side main rail"; max-width: 1720px; margin: 0 auto; }
  body[data-frame="side"] .shell { grid-template-areas: "brand head theme" "side main main"; }
  .shell__theme { justify-self: stretch; }
  .shell__theme button { flex: 1; justify-content: center; }
  .shell__rail { position: sticky; top: 16px; }
  .shell__rail .stats { grid-template-columns: 1fr; }
}

/* Short screens: the side columns scroll with the page rather than cut off. */
@media (min-width: 960px) and (max-height: 820px) {
  .shell__side, .shell__rail { position: static; }
}

/* Roster in the shell: last row sits under the week bar; the reason gets a text link. */
.roster__who-col { width: 42%; }
.roster__weekbar { display: inline-flex; align-items: center; gap: 8px; }
.roster__week .roster__last { display: block; margin-top: 4px; color: var(--muted); font-size: 0.8rem; }
.roster__why, .roster__why.is-behind { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.roster__why::before { content: ""; flex: none; width: 3px; height: 14px; border-radius: 2px; background: var(--warm); }
.roster__why.is-behind::before { background: var(--down); }
.roster__act { display: inline-flex; align-items: center; min-height: 32px; color: var(--blue-ink); font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.roster__act::after { content: "→"; margin-left: 5px; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
@media (hover: hover) and (pointer: fine) { .roster__act:hover::after { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .roster__act::after { transition: none; } }
@media (max-width: 760px) {
  .roster__row td:nth-child(4) { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .roster__week .roster__last { margin: 0; }
  .roster__act { min-height: 44px; }
}

/* Phones: the club card is left out (the rower card stays on a rower's page), and the
   Roster counts sit in one compact row, so the rowers come sooner. */
@media (max-width: 959px) {
  .shell .page-head--card:not(.page-head--rower) { display: none; }
}
@media (max-width: 640px) {
  .shell__rail .roster-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .shell__rail .roster-stats .stat { padding: 12px; }
  .shell__rail .roster-stats .stat__value { font-size: 2rem; margin-top: 6px; }
  .shell__rail .stat__value { font-size: 2.2rem; }
}

/* Pages with the right-hand numbers column (2026-12-04): the middle is too narrow to pair
   cards without one being stretched to match a taller neighbour, so each card takes the
   full width, one under the other. No empty space inside a card. */
body[data-frame="rail"] .bento > *:not(.s-mini) { grid-column: 1 / -1; }
body[data-frame="rail"] .badges { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
/* Goals at full width: the goal on the left, how you get there on the right. */
.goals-card__cols { display: grid; gap: 0 32px; }
@container (min-width: 640px) {
  .goals-card__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .goals-card__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .goals-card__pair .goal-row { border-top: 0; padding-top: 8px; }
  /* The goal sits in a soft panel as tall as the row, its gap line pinned to the bottom. */
  .goals-card__col:first-child { display: flex; flex-direction: column; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface-2); }
  .goals-card__col:first-child > .goal-row { flex: 1; display: flex; flex-direction: column; padding: 0; border: 0; }
  .goals-card__col:first-child .goal-row__gap { margin-top: auto; padding-top: 12px; }
  .goals-card__col .goal-how { margin-top: 0; }
}

/* ------------------------------------------ motion layer (motion.js) */
/* Ported from CRU Rowing 2026-12-04. motion.js does the moving; these are the shapes
   it needs. Everything here that moves is skipped under reduced motion. */

/* Loading placeholders: appear only if loading takes a beat, then pulse softly. */
.skel { display: grid; gap: 20px; }
.skel__panel { display: grid; gap: 14px; align-content: start; min-height: 180px; }
.skel__panel--short { min-height: 120px; }
.skel__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skel__bar { display: block; height: 14px; width: 70%; border-radius: 7px; background: var(--surface-2); }
.skel__bar--s { width: 38%; }
.skel__bar--m { width: 46%; height: 18px; }
.skel__bar--xl { width: 60%; height: 34px; }
.skel__bar--big { width: 58%; height: 44px; border-radius: 10px; }
.skel__bar--title { width: 160px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.skel__head { display: flex; align-items: center; gap: 18px; padding: 8px 0; }
.skel__circle { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); flex: none; }
.skel__lines { display: grid; gap: 10px; flex: 1; }
.skel__lines .skel__bar { background: color-mix(in srgb, var(--surface) 80%, transparent); }
@media (max-width: 560px) { .skel__stats { grid-template-columns: 1fr; } .skel__stats > :nth-child(n+2) { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .skel { animation: skel-in 200ms 120ms both cubic-bezier(0.23, 1, 0.32, 1); }
  .skel__bar, .skel__circle { animation: skel-pulse 1.1s ease-in-out infinite alternate; }
}
@keyframes skel-in { from { opacity: 0; } }
@keyframes skel-pulse { to { opacity: 0.55; } }

/* Toggle groups: one pill slides to the tapped option. */
.segmented.has-pill { position: relative; }
.segmented.has-pill button { position: relative; z-index: 1; }
.segmented.has-pill button[aria-pressed="true"] { background: none; box-shadow: none; }
.segmented__pill {
  position: absolute; top: 0; left: 0; border-radius: 999px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(20, 35, 58, 0.12);
  transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), width 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 150ms ease;
}
.segmented__pill.is-still { transition: none; }
/* The range bar's chosen option is filled dark, so its pill is too. */
.range-bar .segmented__pill { background: var(--ink); box-shadow: none; }

/* Pieces the motion layer moves. */
.lanes { overflow: clip; overflow-clip-margin: 6px; }
.streak svg { transform-origin: 50% 85%; }
.arc__pace { transform-box: fill-box; transform-origin: center; }
.cheer { position: relative; }
.burst { position: absolute; width: 0; height: 0; pointer-events: none; }
.burst span { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%; opacity: 0; }
.blade-bar__shaft { transform-box: fill-box; transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) {
  .arc__fill { transition-duration: 600ms; }
}

/* PR circles draw in clockwise the first time they scroll into view. */
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
.badge__medal.is-drawing::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; padding: 6px;
  background: conic-gradient(transparent var(--sweep), var(--surface) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ring-sweep 760ms cubic-bezier(0.23, 1, 0.32, 1) var(--draw-delay, 0ms) both;
}
.badge__medal.is-drawing .badge__event { animation: event-in 420ms cubic-bezier(0.23, 1, 0.32, 1) calc(var(--draw-delay, 0ms) + 200ms) both; }
[data-reveal] .is-waiting .badge__medal::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; padding: 6px; background: var(--surface);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
[data-reveal] .is-waiting .badge__event { opacity: 0; }
@keyframes ring-sweep { from { --sweep: 0deg; } to { --sweep: 360deg; } }
@keyframes event-in { from { opacity: 0; transform: scale(0.8); } }

/* ---------------------------------------- audit P1 fixes (2026-12-04) */

/* Phones and tablets: the page title comes first, then the numbers as one short row,
   then the page. (The rail used to stack as tall tiles above the title.) */
@media (max-width: 959px) {
  .shell { grid-template-areas: "brand theme" "side side" "head head" "rail rail" "main main"; }
  .shell__rail { display: flex; gap: 8px; padding: 8px; border-radius: 22px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .shell__rail::-webkit-scrollbar { display: none; }
  .shell__rail .rail__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .shell__rail .stats { display: contents; }
  .shell__rail .stats .stat, .shell__rail .streak-tile { flex: 0 0 auto; min-width: 132px; padding: 12px 14px; border-radius: 16px; scroll-snap-align: start; }
  .shell__rail .stat__label, .shell__rail .streak-tile h2 { font-size: 0.76rem; line-height: 1.25; }
  .shell__rail .stat__value, .shell__rail .streak__big { margin-top: 6px; font-size: 1.85rem; }
  .shell__rail .stat__note, .shell__rail .streak-tile .panel__sub { margin-top: 6px; font-size: 0.74rem; max-width: 22ch; }
  .shell__rail .streak-tile .streak-weeks, .shell__rail .blade-bar { display: none; }
}

/* Recent pieces on phones: "Only you" sits under the date, so the Feel column fits. */
@media (max-width: 640px) {
  td .private-chip { display: table; margin: 4px 0 0; }
}

/* Roster on desktop: four columns fit the middle column. The goal date and the last-row
   line wrap under their main value instead of widening the table. */
@media (min-width: 761px) {
  .roster__who { min-width: 0; }
  .roster__goal { white-space: normal; }
  .roster__goal .roster__by { display: block; margin-top: 2px; }
  .roster td { padding: 12px 10px; }
}

/* Feedback button: on wide screens it sits in the empty foot of the left column,
   not over the cards; on phones it is a round icon button. */
@media (min-width: 960px) and (min-height: 821px) {
  .fb-button { right: auto; left: max(24px, calc((100vw - 1720px) / 2 + 24px)); width: 264px; justify-content: center; }
}
/* Laptops 960 to 1279 wide: the rail tiles sit in one row, so big numbers step down. */
@media (min-width: 960px) and (max-width: 1279px) {
  .shell__rail .stat__value { font-size: clamp(1.9rem, 2.4vw + 0.4rem, 2.6rem); }
}
@media (max-width: 959px), (max-height: 820px) {
  .fb-button { width: 56px; height: 56px; min-height: 56px; padding: 0; border-radius: 50%; justify-content: center; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .fb-button__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------------------------------------- audit P2 fixes (2026-12-04) */

/* Piece page: when the pace chart takes the full row, Stroke rate and Heart rate sit
   side by side under it instead of one half-width column with empty space beside it. */
@container (min-width: 560px) and (max-width: 979px) {
  .bento > .bento-stack { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}

/* Phones: back links sit on their own line above the page title, not squeezed beside it. */
@media (max-width: 640px) {
  .head__titles .link-row { display: flex; width: 100%; margin-bottom: 2px; }
  .head__titles .back-link { display: inline-flex; align-items: center; min-height: 44px; }
  .head__titles { display: block; }
}

/* Touch screens: every remaining control gets a 44px tap area (audit 2026-12-04).
   The "?" hints keep their small look; an invisible ring around them takes the tap. */
@media (pointer: coarse) {
  .shell .site-nav a { min-height: 44px; }
  .back-link { display: inline-flex; align-items: center; min-height: 44px; }
  summary { padding-block: 12px; }
  .btn, .plan-add .btn, .race-form__actions .btn { min-height: 44px; }
  .hint { position: relative; }
  .hint::after { content: ""; position: absolute; inset: -13px; }
  .link-btn { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ------------------------------------------ demo pulse question (2026-12-04) */
/* One card, bottom right, above the round Feedback button on smaller screens. */
.pulse { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 45; width: min(360px, calc(100vw - 28px)); box-sizing: border-box; background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); padding: 18px 18px 16px; box-shadow: 0 0 0 1px var(--axis), var(--shadow-lift); }
.pulse__kicker { margin: 0 0 4px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #5a6878); }
.pulse__q { margin: 0 36px 12px 0; font-weight: 700; font-size: 1.02rem; line-height: 1.35; }
.pulse__answers { display: flex; flex-wrap: wrap; gap: 8px; }
.pulse__answer { min-height: 44px; padding: 8px 16px; }
.pulse__close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; color: inherit; font-size: 1.5rem; line-height: 1; border-radius: 50%; cursor: pointer; }
.pulse__close:hover { background: var(--axis); }
.pulse__msg { margin: 8px 0 0; color: var(--down); font-weight: 600; }
.pulse__msg:empty { display: none; }
.pulse.is-done .pulse__q { margin-bottom: 10px; }
@media (max-width: 959px), (max-height: 820px) {
  .pulse { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  @keyframes pulse-in { from { opacity: 0; transform: translateY(12px); } }
}

/* ------------------------------------------------ demo page tour (2026-12-04) */
/* A ring around the feature being explained (clicks pass through), and a tip card. */
.tour-ring { position: fixed; z-index: 60; pointer-events: none; border-radius: 18px; box-shadow: 0 0 0 3px var(--btn-bg), 0 0 0 9999px rgba(10, 20, 35, 0.32); }
.tour { position: fixed; z-index: 61; width: min(340px, calc(100vw - 24px)); box-sizing: border-box; background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); padding: 16px 18px 14px; box-shadow: 0 0 0 1px var(--axis), var(--shadow-lift); }
.tour.is-docked { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.tour.is-docked.is-top { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); }
.tour__kicker { margin: 0 0 4px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tour__title { margin: 0 0 4px; font-size: 1.08rem; line-height: 1.3; }
.tour__text { margin: 0 0 12px; line-height: 1.45; }
.tour__bar { height: 4px; border-radius: 4px; background: var(--axis); overflow: hidden; margin-bottom: 12px; }
.tour__bar span { display: block; height: 100%; background: var(--btn-bg); transform-origin: left; animation: tour-bar linear both; }
.tour.is-paused .tour__bar span { animation-play-state: paused; }
@keyframes tour-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tour__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour__actions .btn { min-height: 44px; }
.tour__skip { margin-left: auto; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: 600 0.92rem var(--body); text-decoration: underline; cursor: pointer; }
.tour__skip:hover { color: var(--ink); }
/* While a tour runs the round Feedback button and the pulse card stay out of the way,
   except when the tour is pointing at the Feedback button itself. */
.has-tour .pulse { display: none; }
.demo-bar__tour { margin-left: 6px; padding: 4px 10px; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.demo-bar__tour:hover { background: rgba(127, 140, 160, 0.16); }
@media (prefers-reduced-motion: no-preference) {
  .tour { animation: pulse-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .tour-ring { transition: top 320ms cubic-bezier(0.2, 0.8, 0.2, 1), left 320ms cubic-bezier(0.2, 0.8, 0.2, 1), width 320ms cubic-bezier(0.2, 0.8, 0.2, 1), height 320ms cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .tour__bar span { animation: none; transform: scaleX(1); opacity: 0.35; }
}
