/* ==========================================================================
   Χοχλιός team portal — design system
   One stylesheet, mobile-first. Butter-yellow panels, greyish black, navy
   headlines, mountain ridge bands (like the team's posts). Roboto Condensed
   Black/Bold for headlines, Roboto Mono for typewriter-style labels.
   ========================================================================== */

/* ---------- tokens ---------- */

:root {
  /* brand colours, identical in both themes */
  --graphite: #3a3936;          /* the team's greyish black */
  --butter: #f8e6a0;
  --butter-deep: #f0d468;
  --navy: #1d2b44;
  --cream: #f4efe0;             /* text on graphite / navy */
  --on-butter: var(--graphite);

  /* surfaces & text (light theme) */
  --paper: #fbf6e7;
  --paper-2: #f5edd2;
  --surface: #ffffff;
  --surface-2: #fdf9ee;
  --ink: var(--graphite);
  --ink-2: #3e3c38;
  --muted: #6f6a5f;
  --faint: #a29c8e;             /* decorative only (icons, dots), never text */
  --line: #ece3c8;
  --line-2: #f2ebd8;
  --accent: var(--navy);
  --accent-soft: #e4e9f2;
  --accent-ink: var(--navy);
  --sidebar: var(--graphite);

  /* status & category tones: text colour + soft background, all ≥ 4.5:1 */
  --ok: #1f6b2c;      --ok-soft: #e1f2dc;
  --warn: #7a4f00;    --warn-soft: #fcefc6;
  --pending: #5d5a54; --pending-soft: #efece4;
  --danger: #a8281c;  --danger-soft: #fbe3de; --on-danger: #fff;
  --navy-c: var(--navy); --navy-soft: #e4e9f2;
  --green: #1f6b2c;   --green-soft: #e0f2d9;
  --orange: #a8400c;  --orange-soft: #fde6d8;
  --sky: #1f5590;     --sky-soft: #e2ecf8;
  --violet: #5a3aa8;  --violet-soft: #ece6f9;
  --rose: #9a2d3c;    --rose-soft: #fae3e6;
  --stone: #58574f;   --stone-soft: #ecebe5;

  /* radius scale */
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  /* type scale (text never below --fs-xs) */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14.5px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 21px;
  --fs-2xl: 24px;
  --fs-3xl: 34px;

  --shadow-sm: 0 1px 2px rgba(58, 57, 54, .06);
  --shadow: 0 1px 2px rgba(58, 57, 54, .05), 0 10px 28px -14px rgba(58, 57, 54, .22);
  --shadow-lg: 0 2px 4px rgba(58, 57, 54, .05), 0 24px 48px -20px rgba(58, 57, 54, .32);
  --ring: 0 0 0 3px rgba(29, 43, 68, .25);

  --font: "Roboto Condensed", "Arial Narrow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tabbar-h: 68px;
  --topbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tap: 44px;
  --w-narrow: 760px;
  --w-medium: 860px;

  --ridge: var(--paper);        /* mountains take the page colour, so panels flow into the page */
  --athlete-w: 1120px;
  --ridge-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 0H400V41L386 37 370 42 354 34 338 40 322 31 306 37 290 28 274 35 258 26 242 33 228 23 212 30 198 20 184 27 170 16 156 22 142 10 130 14 118 6 104 18 92 12 80 22 66 16 52 29 40 24 26 36 14 33 0 38Z'/%3E%3C/svg%3E");
  /* athlete page atmosphere: contour lines + two soft glows instead of a flat colour */
  --topo: rgba(58, 57, 54, .085);
  --glow-a: rgba(248, 230, 160, .75);
  --glow-b: rgba(198, 214, 238, .45);
  --page-end: #fdfbf5;
  --route: rgba(58, 57, 54, .30);
  color-scheme: light;
}

/* dark theme: follows the device unless the user picked light; always when the user picked dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f1e1c; --paper-2: #252422; --surface: #292826; --surface-2: #302f2c;
    --ink: var(--cream); --ink-2: #d3cdbd; --muted: #9c968a; --faint: #6f6a60;
    --line: #3d3b37; --line-2: #343230;
    --accent: var(--butter); --accent-soft: #2c3548; --accent-ink: #c9d6f0; --sidebar: #2c2b29;
    --ok: #7fd08a; --ok-soft: #1c3320; --warn: #f3c552; --warn-soft: #3a2f10;
    --pending: #b9b3a6; --pending-soft: #2b2a26; --danger: #ff8a7a; --danger-soft: #3d1c18; --on-danger: #2a0f0b;
    --navy-c: #b8c8e8; --navy-soft: #253047; --green: #86d68f; --green-soft: #1b3320;
    --orange: #ff9a62; --orange-soft: #3d2215; --sky: #8cbcf3; --sky-soft: #172a3f;
    --violet: #b9a2f5; --violet-soft: #251d3d; --rose: #f597a4; --rose-soft: #3a1b21;
    --stone: #b3b2a8; --stone-soft: #2a2a27;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .8);
    --ring: 0 0 0 3px rgba(248, 230, 160, .35);
    --topo: rgba(244, 239, 224, .055); --glow-a: rgba(248, 230, 160, .07); --glow-b: rgba(120, 150, 210, .08); --page-end: #1b1a18; --route: rgba(244, 239, 224, .2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1f1e1c; --paper-2: #252422; --surface: #292826; --surface-2: #302f2c;
  --ink: var(--cream); --ink-2: #d3cdbd; --muted: #9c968a; --faint: #6f6a60;
  --line: #3d3b37; --line-2: #343230;
  --accent: var(--butter); --accent-soft: #2c3548; --accent-ink: #c9d6f0; --sidebar: #2c2b29;
  --ok: #7fd08a; --ok-soft: #1c3320; --warn: #f3c552; --warn-soft: #3a2f10;
  --pending: #b9b3a6; --pending-soft: #2b2a26; --danger: #ff8a7a; --danger-soft: #3d1c18; --on-danger: #2a0f0b;
  --navy-c: #b8c8e8; --navy-soft: #253047; --green: #86d68f; --green-soft: #1b3320;
  --orange: #ff9a62; --orange-soft: #3d2215; --sky: #8cbcf3; --sky-soft: #172a3f;
  --violet: #b9a2f5; --violet-soft: #251d3d; --rose: #f597a4; --rose-soft: #3a1b21;
  --stone: #b3b2a8; --stone-soft: #2a2a27;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .8);
  --ring: 0 0 0 3px rgba(248, 230, 160, .35);
  --topo: rgba(244, 239, 224, .055); --glow-a: rgba(248, 230, 160, .07); --glow-b: rgba(120, 150, 210, .08); --page-end: #1b1a18; --route: rgba(244, 239, 224, .2);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh;
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; letter-spacing: .005em;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.005em; line-height: 1.15; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
[hidden] { display: none !important; }
::selection { background: var(--butter); color: var(--on-butter); }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }
.i-muted { color: var(--muted); }
.i-butter { color: var(--butter-deep); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* typewriter labels, as in "ΟΜΑΔΙΚΗ ΑΠΟΣΤΟΛΗ" / "24K 550m+" */
.eyebrow, .feed-kind, .event-type, .side-label, .stat > span, .mhead, .detail .d-label,
.date-tile span, .date-tile small, .kpi-hero h2, .feed-meta {
  font-family: var(--mono); font-weight: 600; letter-spacing: .14em;
}
.eyebrow { display: block; font-size: var(--fs-xs); text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------- layout ---------- */

.shell { min-height: 100dvh; }
body.athlete, body.coach {
  background:
    radial-gradient(900px 520px at 8% -120px, var(--glow-a), transparent 70%),
    radial-gradient(800px 520px at 100% 0, var(--glow-b), transparent 70%),
    linear-gradient(var(--paper) 0, var(--page-end) 900px) var(--page-end);
}
body.athlete::before, body.coach::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--topo);
  -webkit-mask: url("/img/topo.svg") center / cover no-repeat; mask: url("/img/topo.svg") center / cover no-repeat;
}
.main { min-width: 0; }
.page { width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 28px); }
.page.narrow { max-width: 720px; }
.w-narrow { max-width: var(--w-narrow); }
.w-medium { max-width: var(--w-medium); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 800; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .hide-desktop { display: none !important; } }
@media (max-width: 639px) { .hide-mobile { display: none !important; } }

.grid-2, .dash-grid, .detail-grid, .form-row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-2 > *, .dash-grid > *, .detail-grid > *, .form-row > * { min-width: 0; }
.detail-grid { gap: 12px; margin-top: 14px; }
.form-row { gap: 14px; }
@media (min-width: 640px) {
  .form-row.cols-2, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.dash-side { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.dash-side > * { min-width: 0; }
@media (min-width: 1080px) {
  .dash-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .dash-side { gap: 20px; }
}
/* wide screens: three columns (months | events | feed + inbox) */
@media (min-width: 1440px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .dash-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* ---------- race route (decorative, beside the page column) ---------- */

/* Two fixed strips in the side gaps; each only appears when the gap is wider than the strip,
   so the stations never sit under content and are always ≥ 24% of the strip height apart. */
.route-art { display: none; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  --col-center: 50%; --col-half: calc(var(--athlete-w) / 2 - 16px); }
.coach .route-art { --col-center: calc(50% + 132px); --col-half: 640px; }
.coach:has(.page.wide) .route-art { --col-half: 700px; }
.ra-strip { position: absolute; top: 96px; bottom: 32px; width: 132px; }
.coach .ra-strip { top: 40px; }
.ra-left { left: calc(var(--col-center) - var(--col-half) - 148px); }
.ra-right { left: calc(var(--col-center) + var(--col-half) + 16px); }
.ra-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ra-line path { fill: none; stroke: var(--route); stroke-width: 1.6; stroke-dasharray: 6 6; stroke-linecap: round;
  vector-effect: non-scaling-stroke; }
.ra-st { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transform: translate(-50%, -17px); }
.ra-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); box-shadow: var(--shadow-sm); }
.ra-dot .i { width: 18px; height: 18px; stroke-width: 1.7; }
.ra-st b { padding: 1px 7px; border-radius: var(--radius-pill); font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: color-mix(in srgb, var(--paper) 88%, transparent); }
.ra-st.finish .ra-dot { background: var(--butter); border-color: var(--butter-deep); color: var(--on-butter); }
/* station points sit exactly on segment ends of the paths in fragments/route.html */
.s1 { left: 60px; top: 84%; } .s2 { left: 84px; top: 54%; } .s3 { left: 52px; top: 24%; }
.s4 { left: 64px; top: 80%; } .s5 { left: 44px; top: 56%; } .s6 { left: 76px; top: 32%; } .s7 { left: 56px; top: 10%; }
@media (min-width: 1440px) and (min-height: 620px) { .athlete .route-art { display: block; } }
@media (min-width: 1860px) and (min-height: 620px) { .coach .route-art { display: block; } }
@media (max-width: 1979px) { .coach:has(.page.wide) .route-art { display: none; } }

/* ---------- top bar, tab bar, sidebar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .spacer { flex: 1; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-logo { display: block; height: 44px; width: auto; }
.brand-logo.md { height: 72px; }
.brand-logo.lg { height: auto; width: min(320px, 72vw); }
.brand-word { display: inline-flex; flex-direction: column; line-height: .9; color: var(--graphite); transform: rotate(-4deg); }
.brand-word small { font-family: var(--mono); font-size: 8px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.brand-word b { font-size: var(--fs-2xl); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; }
.brand-word i { font-style: normal; font-weight: 800; font-size: var(--fs-md); align-self: flex-end; margin-top: -2px; }
.brand-word.md b { font-size: var(--fs-3xl); }
.brand-word.md i { font-size: var(--fs-lg); }
.brand-word.lg b { font-size: 64px; }
.brand-word.lg small { font-size: var(--fs-sm); }
.brand-word.lg i { font-size: var(--fs-3xl); }
.topbar .brand-word { color: var(--ink); }
.brand-plate { display: flex; justify-content: center; padding: 14px 12px; margin-bottom: 14px;
  background: var(--butter); border-radius: var(--radius); }

.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: background .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.96); }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }
.badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--danger); color: var(--on-danger); font-size: var(--fs-xs); font-weight: 800; line-height: 19px; text-align: center;
  box-shadow: 0 0 0 2px var(--paper);
}
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--butter); color: var(--on-butter); font-weight: 800; font-size: var(--fs-md); letter-spacing: .02em;
}
.avatar.sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar.lg { width: 64px; height: 64px; font-size: var(--fs-2xl); }
.avatar.premium { background: var(--graphite); color: var(--butter); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding: 6px 8px var(--safe-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--muted); border-radius: var(--radius-sm); transition: color .15s;
}
.tab .i { width: 22px; height: 22px; }
.tab .badge { position: absolute; top: 4px; left: calc(50% + 6px); box-shadow: 0 0 0 2px var(--surface); }
.tab.active { color: var(--ink); }
.tab.active::before { content: ""; position: absolute; top: 2px; width: 44px; height: 30px; border-radius: var(--radius-sm);
  background: var(--butter); z-index: -1; transform: translateY(4px); }
.tab.active .i { color: var(--on-butter); }

.top-nav { display: none; }
@media (min-width: 860px) {
  .athlete .tabbar { display: none; }
  .athlete .page { padding-bottom: 64px; }
  .athlete .topbar { height: 68px; padding: 0 max(28px, calc((100% - var(--athlete-w)) / 2 + 16px)); }
  .top-nav { display: flex; gap: 4px; padding: 5px; margin: 0 auto; border-radius: var(--radius-pill);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
  .top-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-pill);
    font-weight: 700; font-size: var(--fs-md); color: var(--muted); }
  .top-nav a:hover { color: var(--ink); }
  .top-nav a.active { background: var(--graphite); color: var(--butter); }
  .top-nav .i { width: 18px; height: 18px; }
}

.sidebar { display: none; }
@media (min-width: 960px) {
  .coach .shell { display: grid; grid-template-columns: 264px 1fr; }
  .coach .topbar, .coach .tabbar { display: none; }
  .coach .page { padding: 32px 40px 64px; max-width: 1360px; }
  .coach .page.wide { max-width: 1480px; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh;
    padding: 22px 16px; background: var(--sidebar); color: var(--cream); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
    font-weight: 700; font-size: var(--fs-md); color: rgba(244, 239, 224, .74); transition: background .15s, color .15s; }
  .side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .side-nav a.active { background: var(--butter); color: var(--on-butter); }
  .side-nav a .badge { margin-left: auto; box-shadow: none; }
  .side-label { margin: 18px 12px 6px; font-size: var(--fs-xs); text-transform: uppercase; color: rgba(244, 239, 224, .5); }
  .side-foot { margin-top: auto; padding: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, .08); }
  .side-foot .account-btn { width: 100%; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--cream); }
  .side-foot .account-btn:hover { background: rgba(255, 255, 255, .06); }
  .side-foot .account-btn .avatar { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: none; }
  .side-foot .who { flex: 1; min-width: 0; line-height: 1.2; }
  .side-foot .who b { display: block; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-foot .who small { color: rgba(244, 239, 224, .6); font-size: var(--fs-xs); }
}

/* dropdown menus */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); animation: pop .16s var(--ease); color: var(--ink);
}
.menu-panel a, .menu-panel button {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px;
  border-radius: var(--radius-sm); border: 0; background: none; cursor: pointer;
  font-weight: 700; font-size: var(--fs-md); text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-panel .mp-icon { width: 30px; height: 30px; border-radius: var(--radius-xs); display: grid; place-items: center;
  background: var(--b, var(--surface-2)); color: var(--c, var(--ink-2)); }
.menu-panel .mp-icon .i { width: 16px; height: 16px; }

/* personal menu behind the avatar */
.account-btn { display: flex; align-items: center; gap: 10px; min-height: var(--tap); border-radius: var(--radius-pill); cursor: pointer; }
.account-btn .avatar { width: 38px; height: 38px; font-size: var(--fs-sm); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.account-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.account-menu.up .menu-panel { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }
.menu-head { min-width: 0; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.menu-head b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 800; }
.menu-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-sm); }
.account-id { display: flex; align-items: center; gap: 14px; }
.account-id .grow { min-width: 0; }
.account-id b { display: block; font-size: var(--fs-lg); font-weight: 800; }
.account-id small { display: block; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.account-link { margin-top: 30px; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* theme & language controls */
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); }
.lang-switch button { border: 0; background: none; cursor: pointer; padding: 5px 9px; border-radius: var(--radius-xs);
  font-family: var(--mono); font-weight: 600; font-size: var(--fs-xs); letter-spacing: .08em; color: var(--muted); }
.lang-switch button.active { background: var(--ink); color: var(--paper); }

/* the black-on-transparent logo gets a butter plate on dark backgrounds */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar .brand-logo { background: var(--butter); padding: 3px 8px; border-radius: var(--radius-sm); height: 46px; }
  :root:not([data-theme="light"]) .topbar .brand-word { color: var(--butter); }
}
:root[data-theme="dark"] .topbar .brand-logo { background: var(--butter); padding: 3px 8px; border-radius: var(--radius-sm); height: 46px; }
:root[data-theme="dark"] .topbar .brand-word { color: var(--butter); }

/* ---------- headings ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-head h1, .hero h1, .event-hero h1, .auth-card h1, .profile-head h1 {
  font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.02;
}
.page-head h1 { font-size: clamp(30px, 8vw, 42px); }
.page-head p.lead { margin-top: 6px; color: var(--muted); font-weight: 500; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted);
  font-weight: 700; font-size: var(--fs-md); }
.back:hover { color: var(--ink); }

.section { margin-top: 30px; scroll-margin-top: 80px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: var(--fs-xl); }
.section-head .more { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-md); font-weight: 700; color: var(--accent-ink); }
.section-head .count { color: var(--muted); font-weight: 700; margin-left: 6px; }
.day-head { margin: 16px 0 10px; }
.day-head h2 { font-size: var(--fs-base); }

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

.btn {
  --bg: var(--surface); --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); cursor: pointer; user-select: none; white-space: nowrap;
  font-weight: 700; font-size: var(--fs-md); letter-spacing: .01em;
  transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn .i { width: 18px; height: 18px; }
.btn-primary { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.btn-butter { --bg: var(--butter); --fg: var(--on-butter); --bd: var(--graphite); }
.btn-butter:hover { background: var(--butter-deep); }
.btn-ghost { --bg: transparent; --bd: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn-danger { --fg: var(--danger); --bd: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { min-height: 50px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-xs { min-height: 30px; padding: 0 10px; border-radius: var(--radius-xs); font-size: var(--fs-xs); gap: 6px; }
.btn-xs .i { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.invisible { visibility: hidden; }

/* ---------- cards ---------- */

.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
@media (min-width: 640px) { .card-pad { padding: 22px; } }
.card-pad.head { padding-bottom: 8px; }
.card-pad.notice-pad { padding-top: 0; padding-bottom: 6px; }
.card-title { font-size: var(--fs-base); font-weight: 800; margin-bottom: 4px; }
.card-sub { color: var(--muted); font-size: var(--fs-md); }
.card-head { display: flex; align-items: flex-end; gap: 12px; padding: 18px 18px 12px; }
.card-head .eyebrow { margin-bottom: 2px; }
.card-head h2 { font-size: var(--fs-xl); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.card-divided { border-top: 1px solid var(--line-2); }

/* ---------- pills & chips ---------- */

.pill {
  --c: var(--pending); --b: var(--pending-soft);
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--b); color: var(--c); font-size: var(--fs-sm); font-weight: 800; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.tone-ok { --c: var(--ok); --b: var(--ok-soft); --t: var(--c); }
.tone-warn { --c: var(--warn); --b: var(--warn-soft); --t: var(--c); }
.tone-pending { --c: var(--pending); --b: var(--pending-soft); --t: var(--c); }
.tone-danger { --c: var(--danger); --b: var(--danger-soft); --t: var(--c); }
.tone-navy { --c: var(--navy-c); --b: var(--navy-soft); --t: var(--c); }
.tone-green { --c: var(--green); --b: var(--green-soft); --t: var(--c); }
.tone-orange, .tone-amber { --c: var(--orange); --b: var(--orange-soft); --t: var(--c); }
.tone-butter { --c: var(--on-butter); --b: var(--butter); --t: var(--ink); }
.tone-sky { --c: var(--sky); --b: var(--sky-soft); --t: var(--c); }
.tone-violet { --c: var(--violet); --b: var(--violet-soft); --t: var(--c); }
.tone-rose { --c: var(--rose); --b: var(--rose-soft); --t: var(--c); }
.tone-stone { --c: var(--stone); --b: var(--stone-soft); --t: var(--c); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-sm); font-weight: 700;
  color: var(--ink-2); white-space: nowrap;
}
.chip .i { width: 14px; height: 14px; }
.chip.xs { height: 22px; padding: 0 8px; font-size: var(--fs-xs); }
.chip-premium { background: var(--graphite); color: var(--butter); border-color: var(--graphite); }
.chip-basic { background: var(--surface-2); }
.chip-audience { background: transparent; border-style: dashed; color: var(--muted); }

/* ---------- toasts ---------- */

/* phones: just above the tab bar; wider screens: bottom right, away from titles and buttons */
.toasts { position: fixed; z-index: 60; left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 960px) { .toasts { left: auto; right: 24px; bottom: 24px; width: 400px; } }
.auth .toasts { bottom: 16px; }
.toast {
  pointer-events: auto; position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  font-size: var(--fs-md); font-weight: 600; line-height: 1.35;
  animation: toast-in .28s var(--ease); transition: opacity .3s, transform .3s;
}
.toast .toast-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); }
.toast .toast-icon .i { width: 16px; height: 16px; }
.toast .toast-text { flex: 1; min-width: 0; }
.toast .toast-close { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0;
  border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.toast .toast-close:hover { background: var(--surface-2); color: var(--ink); }
.toast.err { border-left-color: var(--danger); }
.toast.err .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- forms ---------- */

.form { display: flex; flex-direction: column; gap: 18px; }
.form-card { padding: 18px; }
@media (min-width: 640px) { .form-card { padding: 26px; } }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section + .form-section, .form-section.divided { padding-top: 20px; border-top: 1px solid var(--line-2); }
.form-section > h3 { font-size: var(--fs-base); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field.w-xs { max-width: 200px; }
.field > label, .field > legend, .label-row > label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); padding: 0; }
.field .hint { font-size: var(--fs-sm); color: var(--muted); }
.field-error { font-size: var(--fs-sm); font-weight: 700; color: var(--danger); }

.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: var(--fs-base); /* 16px prevents iOS zoom */
  transition: border-color .15s, box-shadow .15s, background .15s; appearance: none; -webkit-appearance: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 38px; background-repeat: no-repeat; background-position: right 13px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f6a5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.input-icon { position: relative; margin-bottom: 12px; }
.input-icon .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-icon .input { padding-left: 40px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input ~ span {
  display: inline-flex; align-items: center; gap: 7px; min-height: var(--tap); padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: var(--fs-md);
  color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.seg input ~ span:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.seg input:checked ~ span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg input:focus-visible ~ span { box-shadow: var(--ring); }
.seg .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--faint)); }
.seg input ~ span .i { width: 18px; height: 18px; }
.check-chip input ~ span > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; position: relative; width: 44px; height: 26px; border-radius: var(--radius-pill); margin-top: 1px;
  background: var(--line); transition: background .2s; }
.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, .25); transition: transform .2s var(--ease); }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .track::after { transform: translateX(18px); }
.switch input:focus-visible ~ .track { box-shadow: var(--ring); }
.switch .label b { display: block; font-size: var(--fs-md); font-weight: 700; }
.switch .label small { display: block; color: var(--muted); font-size: var(--fs-sm); }

.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip input ~ span {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: var(--fs-md);
}
.check-chip input ~ span::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: var(--radius-xs);
  border: 1.5px solid var(--faint); background: var(--surface); transition: background .15s, border-color .15s; }
.check-chip small { margin-left: auto; color: var(--muted); font-weight: 700; font-size: var(--fs-xs); }
.check-chip input:checked ~ span { border-color: var(--accent); background: var(--accent-soft); }
.check-chip input:checked ~ span::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E") center/14px no-repeat;
}
.check-chip input:focus-visible ~ span { box-shadow: var(--ring); }
.audience-box { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.audience-box .hint { margin: 0 0 10px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
@media (max-width: 639px) {
  .form-actions.sticky {
    position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px); z-index: 5;
    padding: 10px; margin: 0 -6px; border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .form-actions.sticky .btn { flex: 1; }
}

/* ---------- lists ---------- */

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 60px;
  border-top: 1px solid var(--line-2); transition: background .15s; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .title { font-weight: 700; font-size: var(--fs-base); }
.list-item .sub { color: var(--muted); font-size: var(--fs-sm); }
.list-item .chev { color: var(--faint); }
.card > .list > .list-item:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card > .list > .list-item:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--surface-2); color: var(--faint); margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: var(--fs-base); }

/* ---------- date tile & event rows ---------- */

.date-tile { flex: none; width: 54px; height: 60px; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--b, var(--accent-soft)); color: var(--c, var(--accent)); line-height: 1; }
.date-tile span { font-size: var(--fs-xs); text-transform: uppercase; }
.date-tile b { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.03em; margin: 3px 0 2px; }
.date-tile small { font-size: var(--fs-xs); }

.event-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line-2); transition: background .15s; }
.event-row:first-child { border-top: 0; }
a.event-row:hover { background: var(--surface-2); }
.event-main { flex: 1; min-width: 0; }
.event-type { font-size: var(--fs-xs); text-transform: uppercase; color: var(--t, var(--c, var(--muted))); }
.event-main h4 { font-size: var(--fs-base); margin: 2px 0 3px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .i { width: 15px; height: 15px; }
.event-line { display: flex; align-items: center; }
.event-line + .event-line { border-top: 1px solid var(--line-2); }
.event-line .event-row { flex: 1; min-width: 0; border-top: 0; }
.event-side { flex: none; margin-right: 12px; }
.event-side + .event-side { margin-left: -4px; }
@media (max-width: 639px) { .event-line .event-row .chev { display: none; } .event-line .event-row { padding-right: 6px; } }

/* week navigator */
/* an arrow with nowhere to go stays in place, faded, and says why on hover */
.icon-btn.disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.icon-btn.disabled:hover { background: var(--surface); }
.week-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.week-nav .week-title { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: center; }
.week-nav .week-title b { font-size: var(--fs-lg); font-weight: 900; }
.week-nav .week-title small { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }

.week-nav .week-today { flex-basis: 100%; justify-content: center; }
@media (min-width: 640px) {
  .week-nav .week-title { flex: 0 1 auto; text-align: left; min-width: 220px; }
  .week-nav .week-today { flex-basis: auto; }
}

/* ---------- mountain ridge band ---------- */

.ridge-band {
  position: absolute; left: -3px; right: -3px; bottom: -2px; height: 58px; pointer-events: none;
  background: var(--ridge);   /* the shape is a mask, the colour follows --ridge */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 38 14 33 26 36 40 24 52 29 66 16 80 22 92 12 104 18 118 6 130 14 142 10 156 22 170 16 184 27 198 20 212 30 228 23 242 33 258 26 274 35 290 28 306 37 322 31 338 40 354 34 370 42 386 37 400 41V60H0Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 38 14 33 26 36 40 24 52 29 66 16 80 22 92 12 104 18 118 6 130 14 142 10 156 22 170 16 184 27 198 20 212 30 228 23 242 33 258 26 274 35 290 28 306 37 322 31 338 40 354 34 370 42 386 37 400 41V60H0Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

/* ---------- athlete home ---------- */

.hero {
  position: relative; overflow: hidden; padding: 22px 20px 78px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--butter); color: var(--on-butter);
  animation: rise .35s var(--ease);
}
.athlete .hero {
  border-radius: var(--radius-lg); padding-bottom: 82px;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 56px) no-repeat, var(--ridge-top) bottom / 100% 58px no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 56px) no-repeat, var(--ridge-top) bottom / 100% 58px no-repeat;
}
.athlete .hero .ridge-band { display: none; }
.athlete .hero { background: url("/img/topo-ink.svg") right -160px top -120px / 1100px auto no-repeat, var(--butter); }
@media (min-width: 1024px) {
  .athlete .hero { padding: 30px 36px 88px; }
  .res-hero .hero-chips { position: absolute; right: 36px; bottom: 92px; margin: 0; }
}
.hero .eyebrow { color: rgba(58, 57, 54, .65); }
.hero h1 { font-size: clamp(32px, 9vw, 46px); color: var(--navy); }
.hero h1 em { font-style: normal; color: var(--graphite); }
.hero .hero-note { margin-top: 8px; max-width: 46ch; color: rgba(58, 57, 54, .78); font-weight: 500; }
.hero .hero-note.quip { max-width: 52ch; color: var(--graphite); font-weight: 700; }
.hero .hero-note.coach-note { margin-top: 4px; }
.page-head .lead.quip { font-style: italic; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.chip-glass { background: rgba(255, 255, 255, .55); border-color: rgba(58, 57, 54, .14); color: var(--graphite); }
.chip-glass.ok { background: var(--graphite); border-color: var(--graphite); color: var(--butter); }
.chip-glass.pending { background: #fff; border-color: rgba(154, 100, 0, .35); color: #7a4f00; }
.chip-glass.danger { background: #a8281c; border-color: #a8281c; color: #fff; }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.notice .notice-icon { flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.notice b { display: block; font-size: var(--fs-base); font-weight: 800; }
.notice p { color: var(--ink-2); font-size: var(--fs-md); margin-top: 2px; }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.notice.danger .notice-icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.notice.info { background: var(--sky-soft); border-color: color-mix(in srgb, var(--sky) 20%, transparent); }
.notice.info .notice-icon { color: var(--sky); background: color-mix(in srgb, var(--sky) 14%, transparent); }

.spotlight { display: grid; gap: 16px; padding: 18px; border-radius: var(--radius-lg); border-top: 6px solid var(--butter);
  background: var(--surface); box-shadow: var(--shadow); }
.spotlight-top { display: flex; gap: 14px; align-items: center; }
.spotlight .date-tile { width: 64px; height: 72px; border-radius: var(--radius); }
.spotlight .date-tile b { font-size: 27px; }
.spotlight h3 { font-size: var(--fs-lg); margin-top: 2px; }
.spotlight .desc { color: var(--ink-2); }
.bring { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); }
.bring .i { color: var(--accent); margin-top: 1px; }
.spotlight-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.spotlight-actions .btn { flex: 1 1 auto; }

/* ---------- feed ---------- */

.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-card { position: relative; display: flex; gap: 14px; padding: 16px; scroll-margin-top: 90px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: rise .35s var(--ease) both; }
.feed-card:target { box-shadow: var(--ring), var(--shadow); }
.feed-icon { flex: none; width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--b, var(--accent-soft)); color: var(--c, var(--accent)); }
.feed-icon.sm { width: 36px; height: 36px; }
.feed-body { flex: 1; min-width: 0; }
.feed-meta { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.feed-kind { color: var(--t, var(--c, var(--accent))); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.feed-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.feed-card h3 { font-size: var(--fs-lg); margin-top: 4px; }
.feed-text { margin-top: 6px; color: var(--ink-2); font-size: var(--fs-md); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.feed-event { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.feed-event span { display: inline-flex; align-items: center; gap: 6px; }
.feed-event .i { width: 16px; height: 16px; color: var(--c, var(--accent)); }
.feed-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.feed-coach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.feed-card.personal { border-color: color-mix(in srgb, var(--navy-c) 30%, var(--line-2)); box-shadow: inset 4px 0 0 var(--navy-c), var(--shadow); }
.chip-personal { margin-top: 8px; gap: 4px; background: var(--navy-soft); border-color: transparent; color: var(--navy-c); }
.chip-personal .i { width: 12px; height: 12px; }

/* one-line event cards in the athlete feed: the details live on the event page */
.feed-mini { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 12px 14px; scroll-margin-top: 90px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.feed-mini:hover { border-color: var(--line); }
.feed-mini .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feed-mini .title { font-size: var(--fs-md); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-mini small { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.feed-mini .chev { flex: none; color: var(--faint); }

/* ---------- athlete home ---------- */

.home-grid { display: flex; flex-direction: column; gap: 30px; margin-top: 30px; }
.home-grid .section { margin-top: 0; }
.home-main, .home-side { display: contents; }
.home-notice { order: 1; }
.home-links { order: 2; }
.home-events { order: 3; }
.home-feed { order: 4; }
.home-link-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.home-link { min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-size: var(--fs-md); font-weight: 800; }
.home-link:hover { border-color: var(--line); }
.home-link .ql-icon { flex: none; width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--b); color: var(--c); }
.home-link .grow { min-width: 0; }
.home-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.home-link .ext { display: none; flex: none; width: 16px; height: 16px; color: var(--faint); }
@media (min-width: 1024px) {
  .page.narrow.home-page { max-width: var(--athlete-w); }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 32px; align-items: start; }
  .home-main, .home-side { display: block; min-width: 0; }
  .home-main > .section + .section, .home-side > .section + .section { margin-top: 30px; }
  .home-link-list { grid-template-columns: 1fr; }
  .home-link .ext { display: block; }
}

/* ---------- coach dashboard ---------- */

.kpi-hero { position: relative; overflow: hidden; padding: 22px; border-radius: var(--radius-lg);
  background: var(--navy); color: var(--cream); box-shadow: var(--shadow-lg); }
:root[data-theme="dark"] .kpi-hero { border: 1px solid #2c3a55; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi-hero { border: 1px solid #2c3a55; } }
.kpi-hero .eyebrow { color: rgba(244, 239, 224, .65); }
.kpi-hero h2 { font-size: var(--fs-md); }
.kpi-big { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.kpi-big b { font-size: clamp(46px, 13vw, 64px); font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.kpi-big b small { font-size: .5em; opacity: .55; }
.kpi-big span { font-weight: 700; opacity: .75; }
.progress { display: block; width: 100%; height: 10px; margin-top: 16px; border: 0; border-radius: var(--radius-pill); overflow: hidden;
  -webkit-appearance: none; appearance: none; background: color-mix(in srgb, currentColor 14%, transparent); color: var(--butter); }
.progress::-webkit-progress-bar { background: transparent; }
.progress::-webkit-progress-value { background: var(--butter); border-radius: var(--radius-pill); }
.progress::-moz-progress-bar { background: var(--butter); border-radius: var(--radius-pill); }
.kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
@media (min-width: 640px) { .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi-mini { min-width: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, currentColor 7%, transparent); }
.kpi-mini b { display: block; font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.kpi-mini span { font-size: var(--fs-sm); font-weight: 700; opacity: .8; }
.kpi-mini.alert b { color: #ff9b8a; }
.kpi-mini.warn b { color: #ffcf6e; }
.kpi-mini.ok b { color: var(--butter); }
.kpi-hero .btn { margin-top: 16px; }
.overdue-card { border-top: 6px solid var(--danger); }

/* dashboard overview */
.dash-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (min-width: 900px) { .dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.stat-tile { min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: border-color .15s; }
.stat-tile:hover { border-color: var(--line); }
.stat-tile .st-icon { flex: none; width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--b); color: var(--c); }
.stat-tile .st-body { min-width: 0; display: flex; flex-direction: column; }
.stat-tile b { font-size: var(--fs-2xl); font-weight: 900; line-height: 1.05; }
.stat-tile .st-body > span { margin-top: 2px; font-size: var(--fs-sm); font-weight: 700; }
.stat-tile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.dash-list .card-head { align-items: center; padding-bottom: 8px; }
.dash-list .card-head h2 { font-size: var(--fs-lg); }
.dash-list .list-item .chev { color: var(--faint); }
.dash-list .n-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.dash-list .list-item.unread .title { font-weight: 800; }
@media (max-width: 899px) {
  /* phones: the icon sits in the corner so the numbers and their notes get the full width */
  .stat-tile { position: relative; padding: 12px 14px; }
  .stat-tile .st-icon { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; }
  .stat-tile .st-icon .i { width: 16px; height: 16px; }
  .stat-tile .st-body { width: 100%; }
  .stat-tile b { padding-right: 36px; }
}
.dash-list .card-foot { padding: 4px 16px; }
.dash-list .card-foot .kbd-link { display: flex; align-items: center; min-height: var(--tap); }
.empty.compact { padding: 18px 16px 22px; gap: 6px; }
.empty.compact .empty-icon { width: 40px; height: 40px; }
.empty.compact .btn { margin-top: 6px; }

/* ---------- months ---------- */

.month-title { display: flex; align-items: center; gap: 10px; }
.month-title h1 { flex: 1; min-width: 0; }
.summary-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }

.filter-bar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; margin-bottom: 12px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar.sticky { position: sticky; top: var(--topbar-h); z-index: 6; margin: 0 -16px 12px; padding: 8px 16px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (min-width: 960px) { .coach .filter-bar.sticky { top: 0; margin: 0 0 12px; padding: 8px 0; } }
.filter-bar button { flex: none; height: 36px; padding: 0 14px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: var(--fs-sm); }
.filter-bar button .n { margin-left: 4px; color: var(--muted); }
.filter-bar button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter-bar button.active .n { color: color-mix(in srgb, var(--paper) 75%, transparent); }

.mtable { overflow: hidden; }
.mhead { display: none; }
.mrow { display: grid; gap: 12px; grid-template-columns: 1fr auto; grid-template-areas: "who status" "toggles toggles";
  padding: 14px 16px; border-top: 1px solid var(--line-2); scroll-margin-top: 120px; }
.mrow:first-of-type { border-top: 0; }
.mrow:target, .res-item:target { background: color-mix(in srgb, var(--butter) 30%, var(--surface)); }
.mrow .who { grid-area: who; display: flex; align-items: center; gap: 12px; min-width: 0; }
.mrow .who b { display: block; font-size: var(--fs-base); font-weight: 800; }
.mrow .who small { color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.mrow .status { grid-area: status; align-self: center; }
.mrow .toggles { grid-area: toggles; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.mrow .pkg-col { display: none; }
@media (min-width: 900px) {
  .mhead, .mrow { grid-template-columns: minmax(200px, 1.4fr) 110px 190px 190px 170px 52px; grid-template-areas: none; align-items: center; }
  .mhead { display: grid; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
    font-size: var(--fs-xs); text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
  .mrow { padding: 10px 16px; }
  .mrow .who, .mrow .status { grid-area: auto; }
  .mrow .pkg-col { display: block; }
  .mrow .toggles { display: contents; }
  .mrow .t-paid { order: 3; }
  .mrow .t-prog { order: 4; }
  .mrow .status { order: 5; }
  .mrow .remind { order: 6; }
}

.toggle { width: 100%; min-height: 46px; padding: 6px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  border-radius: var(--radius-sm); border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--muted);
  font-weight: 800; font-size: var(--fs-sm); text-align: left;
  transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease); }
.toggle:active { transform: scale(.97); }
.toggle .box { flex: none; width: 22px; height: 22px; border-radius: var(--radius-xs); border: 1.5px solid var(--faint); display: grid; place-items: center; }
.toggle .box .i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.toggle .t { line-height: 1.15; }
.toggle .t small { display: block; font-weight: 600; font-size: var(--fs-xs); opacity: .85; }
.toggle:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); color: var(--ink-2); }
.toggle.on { border-style: solid; border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.toggle.on .box { background: var(--ok); border-color: var(--ok); color: #fff; }
:root[data-theme="dark"] .toggle.on .box { color: var(--graphite); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toggle.on .box { color: var(--graphite); } }
.toggle.on .box .i { opacity: 1; }
.toggle.late { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); background: var(--danger-soft); }
.toggle.late .box { border-color: var(--danger); }

.quick-months { overflow: hidden; }
.qm-row { display: grid; gap: 12px; padding: 14px 16px; }
.qm-row + .qm-row { border-top: 1px solid var(--line-2); }
.qm-month { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.qm-month .eyebrow { width: 100%; margin: 0; }
.qm-month b { font-size: var(--fs-lg); font-weight: 900; }
.qm-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .qm-row { grid-template-columns: minmax(0, 1fr) 420px; align-items: center; } }

/* ---------- athletes & profile ---------- */

.athlete-row .meta-right { display: flex; align-items: center; gap: 8px; }
@media (max-width: 560px) { .athlete-row .hide-sm { display: none; } }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { font-size: var(--fs-2xl); }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.status-grid > * { min-width: 0; }
.stat { padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.stat > span { display: block; font-size: var(--fs-xs); text-transform: uppercase; color: var(--muted); }
.stat b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: var(--fs-lg); font-weight: 900; }
.stat .ok-mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; }
.stat .ok-mark .i { width: 14px; height: 14px; stroke-width: 3; }

.link-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 68px; border-top: 1px solid var(--line-2); }
.link-tile:first-child { border-top: 0; }
.link-tile .lt-icon { flex: none; width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--b, var(--surface-2)); color: var(--c, var(--ink-2)); }
.link-tile .lt-text { flex: 1; min-width: 0; }
.link-tile .lt-text b { display: block; font-weight: 800; font-size: var(--fs-base); }
.link-tile .lt-text small { color: var(--muted); font-size: var(--fs-sm); }
.link-tile.locked { opacity: .6; }

.benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: var(--fs-md); }
.benefits li .i { flex: none; width: 20px; height: 20px; padding: 3px; border-radius: 50%; stroke-width: 3;
  background: var(--butter); color: var(--on-butter); margin-top: 1px; }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: var(--fs-sm); font-family: var(--mono); }
.secret { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius);
  background: var(--butter); color: var(--on-butter); border: 1.5px dashed rgba(58, 57, 54, .4); }
.secret code { font-size: var(--fs-xl); font-weight: 800; letter-spacing: .06em; font-family: var(--mono); }

/* ---------- resources ---------- */

.res-cat { scroll-margin-top: 90px; }
.res-cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.res-cat-head .ci { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--b); color: var(--c); }
.res-cat-head h2 { font-size: var(--fs-lg); }
.res-cat-head small { display: block; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); }
.res-item { scroll-margin-top: 90px; }
.cat-jump { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 18px; padding: 2px 16px 4px; scrollbar-width: none; }
.cat-jump::-webkit-scrollbar { display: none; }
.cat-jump a { flex: none; }

.quicklinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .quicklinks { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quicklinks a { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); font-weight: 800; font-size: var(--fs-md); }
.quicklinks a .ql-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--b); color: var(--c); }
.quicklinks a small { display: block; color: var(--muted); font-weight: 600; font-size: var(--fs-xs); margin-top: -6px; }

/* ---------- event detail ---------- */

.event-hero { padding: 22px 20px; border-radius: var(--radius-lg); background: var(--b); color: var(--ink); }
.event-hero .event-type { color: var(--c); }
.event-hero h1 { font-size: clamp(26px, 7vw, 34px); margin: 6px 0 10px; }
.event-hero .when { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-base); }
.event-hero .when .i { color: var(--c); }
.detail { padding: 16px; }
.detail.span-all { grid-column: 1 / -1; }
.detail .d-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; }
.detail .d-label .i { width: 16px; height: 16px; }
.detail p { font-weight: 600; }
.detail p.plain { font-weight: 500; }
.detail .btn { margin-top: 12px; }

/* ---------- notifications ---------- */

.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--surface-2); }
.notif .n-icon { flex: none; width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); }
.notif .n-icon[class*="tone-"] { background: var(--b); color: var(--c); }
.notif:not(.unread) .n-icon { opacity: .75; }
.notif .n-title { font-weight: 700; font-size: var(--fs-md); }
.notif.unread .n-title { font-weight: 800; }
.notif .n-body { display: block; color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.notif .n-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; font-size: var(--fs-xs);
  color: var(--muted); font-weight: 700; }
.notif .n-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-top: 6px; }

/* ---------- settings ---------- */

.settings-nav { position: sticky; top: var(--topbar-h); z-index: 6; display: flex; gap: 6px; overflow-x: auto;
  margin: 0 -16px 8px; padding: 8px 16px; scrollbar-width: none;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav a { flex: none; }
@media (min-width: 960px) { .coach .settings-nav { top: 0; margin: 0 0 8px; padding: 8px 0; } }
.settings-group { scroll-margin-top: 130px; }
.settings-group .section-head p { color: var(--muted); font-size: var(--fs-md); }

/* ---------- desktop: main column + side column ---------- */

.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.split-main, .split-aside { min-width: 0; }
.split-aside { display: grid; gap: 16px; align-content: start; }
.only-wide { display: none; }
@media (min-width: 1200px) {
  .split { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
  .split-aside { position: sticky; top: 24px; }
  .only-wide { display: grid; }
  .only-narrow { display: none !important; }
}
/* forms and single-column pages sit in the middle instead of hugging the sidebar */
@media (min-width: 1200px) { .coach .w-narrow, .coach .w-medium { margin-inline: auto; } }
.athlete .page.narrow.wide { max-width: 720px; }
@media (min-width: 1024px) { .athlete .page.narrow.wide { max-width: var(--athlete-w); } }

.side-card .card-head { padding-bottom: 6px; }
.side-card .card-head h2 { font-size: var(--fs-lg); }
.side-card .list-item { padding-top: 9px; padding-bottom: 9px; font-size: var(--fs-md); }
.side-card .list-item b { font-size: var(--fs-lg); font-weight: 900; }
.menu-list { display: grid; padding: 4px 8px 10px; }
.menu-list a { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: var(--fs-md); font-weight: 700; }
.menu-list a:hover { background: var(--surface-2); }
.menu-list .mp-icon { flex: none; width: 30px; height: 30px; border-radius: var(--radius-xs); display: grid; place-items: center;
  background: var(--b, var(--surface-2)); color: var(--c, var(--ink-2)); }
.menu-list .mp-icon .i { width: 16px; height: 16px; }
.menu-list .chev { margin-left: auto; color: var(--faint); }
.count-badge { min-width: 28px; height: 24px; padding: 0 8px; border-radius: var(--radius-pill); display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 800; }
.side-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.side-stats b { display: block; font-size: var(--fs-2xl); font-weight: 900; line-height: 1.05; }
.side-stats span { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }

/* mini month */
.mini-month { padding: 12px 12px 14px; }
.mini-month .mm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mini-month .mm-head b { font-size: var(--fs-md); font-weight: 800; }

.mini-month table { width: 100%; border-collapse: separate; border-spacing: 0 2px; table-layout: fixed; }
.mini-month th { padding: 4px 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-align: center; }
.mini-month td { padding: 0; text-align: center; }
.mini-month tr.sel td { background: var(--accent-soft); }
.mini-month tr.sel td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.mini-month tr.sel td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.mini-month td a { position: relative; display: grid; place-items: center; height: 40px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.mini-month td a:hover { background: var(--surface-2); }
.mini-month td a.out { color: var(--muted); font-weight: 600; }
.mini-month td a.today span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--paper); }
.mini-month td a i { position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.mini-month td a.today i { bottom: 1px; }

/* settings / account: section list on the side */
@media (min-width: 1200px) {
  .with-nav-body { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 32px; align-items: start; }
  .with-nav-body > .settings-nav { position: sticky; top: 24px; flex-direction: column; overflow: visible; margin: 0; padding: 0;
    background: none; border: 0; }
  .with-nav-body > .settings-nav .chip { justify-content: flex-start; height: auto; min-height: var(--tap); border-radius: var(--radius-sm);
    border-color: transparent; background: none; font-size: var(--fs-md); }
  .with-nav-body > .settings-nav .chip:hover { background: var(--surface); border-color: var(--line-2); }
  .with-nav-main > .section:first-child { margin-top: 0; }
}

/* athlete plan page and resources */
.plan-grid { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .plan-grid > div > .section:first-child { margin-top: 0; }
}
@media (min-width: 1024px) {
  .res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
}

/* ---------- athlete resources ---------- */

.home-link-list.auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 1024px) { .home-link-list.auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .home-link-list.auto .home-link .ext { display: block; } }
.filter-bar button .n { margin-left: 4px; color: var(--muted); font-weight: 600; }
.filter-bar button.active .n { color: inherit; opacity: .8; }
.res-hero { margin-bottom: 4px; }
.res-hero .hero-chips .i { width: 15px; height: 15px; }
.res-layout { display: grid; gap: 14px; }
.res-rail { display: grid; gap: 12px; align-content: start; min-width: 0; }
.res-panel { display: grid; gap: 10px; min-width: 0; }
.res-rail .input-icon { margin-bottom: 0; }
.res-rail .res-cats { margin-bottom: 0; }
.res-rail .rail-label { display: none; }
.res-quick { order: -1; }
.res-cats .dot { display: none; }
.res-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); align-content: start; }
.res-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--c); transition: border-color .15s, box-shadow .15s, transform .15s; }
.res-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.res-card[hidden] { display: none; }
.res-card .rc-top { display: flex; align-items: center; gap: 8px; }
.rc-icon { flex: none; width: 30px; height: 30px; border-radius: var(--radius-xs); display: grid; place-items: center;
  background: var(--b); color: var(--c); }
.rc-icon .i { width: 16px; height: 16px; }
.res-card .rc-cat { color: var(--t, var(--c)); font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; }
.res-card .chip-premium { margin-left: auto; }
.res-card .rc-title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; }
.res-card .rc-desc { color: var(--ink-2); font-size: var(--fs-md); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.res-card .rc-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px;
  color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.res-card .rc-foot .i { width: 16px; height: 16px; }
.res-card .rc-go { margin-left: auto; color: var(--faint); }
@media (min-width: 1024px) {
  .res-layout { grid-template-columns: 272px minmax(0, 1fr); gap: 28px; align-items: start; }
  .res-rail { position: sticky; top: 88px; gap: 18px; }
  .res-quick { order: 0; }
  .res-panel { display: block; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
  .res-rail .rail-label { display: block; margin: 16px 4px 6px; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .res-quick .rail-label { margin-top: 0; }
  .res-cats { flex-direction: column; gap: 2px; overflow: visible; padding: 0; }
  .res-cats button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px;
    border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; font-weight: 700; }
  .res-cats button:hover { background: var(--surface-2); }
  .res-cats button > span:first-of-type { flex: 1; }
  .res-cats button .n { margin-left: auto; }
  .res-cats .dot { display: block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink)); }
  .res-cats button.active .dot { background: var(--paper); }
  .res-quick .home-link-list.auto { grid-template-columns: 1fr; }
  .res-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .res-card { min-height: 176px; padding: 18px; }
}

/* ---------- who saw / opened (coach) ---------- */

.seen { flex-basis: 100%; order: 10; font-size: var(--fs-sm); color: var(--muted); }
.seen summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; list-style: none; }
.seen summary::-webkit-details-marker { display: none; }
.seen summary .i { width: 16px; height: 16px; }
.seen[open] summary { color: var(--ink); }
.seen p { margin-top: 6px; color: var(--ink-2); }
.seen-count { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.seen-count .i { width: 16px; height: 16px; }

/* the athlete's own TrainingPeaks link */
.tp-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tp-form .input { flex: 1 1 260px; min-width: 0; }

/* ---------- select several, the update page, the athlete picker ---------- */

.bulk-bar { position: sticky; top: var(--topbar-h); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm); }
@media (min-width: 960px) { .coach .bulk-bar { top: 8px; } }
.bulk-bar [data-bulk-submit][hidden] { display: none; }
.bulk-all { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.bulk-all input, .bulk-check input { width: 18px; height: 18px; accent-color: var(--ink); cursor: pointer; }
.feed-card.clickable { position: relative; }
.feed-card.clickable .bulk-check { position: absolute; top: 14px; right: 14px; z-index: 2; }
.feed-card.clickable h3 { padding-right: 28px; }
.feed-card .stretched { color: inherit; }
.feed-card .stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.feed-card.clickable:hover { box-shadow: var(--shadow); }
.feed-card.clickable .seen { position: relative; z-index: 2; }
.feed-card .chev { color: var(--faint); }
.list-item.has-check { gap: 12px; padding-top: 0; padding-bottom: 0; }
.list-item.has-check .row-link { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; padding: 13px 0; min-height: 60px; }
.list-item.has-check .bulk-check { flex: none; display: grid; place-items: center; }
.feed-view .fv-head { display: flex; align-items: center; gap: 10px; }
.feed-view .fv-kind { color: var(--t, var(--c)); font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; }
.picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.picker-tools .input-icon { flex: 1 1 220px; margin: 0; }
.picker-pages { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.check-chip[hidden] { display: none; }

/* ---------- today's weather ---------- */

.weather { display: grid; gap: 8px; max-width: 380px; padding: 12px 14px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(58, 57, 54, .12); color: var(--graphite);
  animation: rise .3s var(--ease); }
.weather[hidden] { display: none; }
.weather .wx-now { display: flex; align-items: center; gap: 10px; min-width: 0; }
.weather .wx-icon { flex: none; width: 34px; height: 34px; stroke-width: 1.7; }
.weather .wx-temp { flex: none; font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.weather .wx-text { display: grid; min-width: 0; }
.weather .wx-place { display: flex; align-items: center; gap: 4px; min-width: 0; font-weight: 800; }
.weather .wx-place .i { flex: none; width: 14px; height: 14px; }
.weather .wx-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weather small { color: inherit; opacity: .75; font-size: var(--fs-sm); font-weight: 600; }
.weather .wx-tip { font-size: var(--fs-md); font-weight: 700; line-height: 1.4; }
.hero .weather { position: relative; z-index: 1; margin-top: 16px; }
@media (min-width: 1024px) {
  .athlete .hero .weather { position: absolute; top: 28px; right: 32px; width: 330px; margin: 0; }
  .athlete .hero h1, .athlete .hero .hero-note { max-width: calc(100% - 370px); }
}
.weather .wx-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.weather .wx-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none;
  color: inherit; font: inherit; font-size: var(--fs-sm); font-weight: 800; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; }
.weather .wx-link .i { width: 14px; height: 14px; }
.weather .wx-note { opacity: .85; }
.weather .wx-search { display: grid; gap: 6px; }
.weather .wx-search[hidden] { display: none; }
.weather .wx-search .input-icon { margin: 0; }
.weather .wx-results { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.weather .wx-results button { display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 0;
  padding: 8px 10px; border: 0; border-radius: var(--radius-xs); background: transparent; color: inherit; text-align: left;
  font: inherit; cursor: pointer; }
.weather .wx-results button:hover, .weather .wx-results button:focus-visible { background: rgba(255, 255, 255, .7); }
.weather .wx-results b { font-weight: 800; }
.weather .wx-results small { opacity: .7; }
.weather .wx-results .none { padding: 6px 10px; opacity: .75; font-size: var(--fs-sm); }
/* on the coach's dashboard: a slim bar under the greeting */
.page-head .weather { margin-top: 14px; max-width: 760px; background: var(--surface); border-color: var(--line-2);
  color: var(--ink); box-shadow: var(--shadow-sm); }
@media (min-width: 720px) {
  .page-head .weather { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
  .page-head .weather .wx-tip { flex: 1 1 240px; padding-left: 16px; border-left: 3px solid var(--butter-deep); }
  .page-head .weather .wx-note, .page-head .weather .wx-actions, .page-head .weather .wx-search { flex-basis: 100%; }
}
.page-head .weather .wx-results button:hover { background: var(--surface-2); }
/* coaches: actions under the name on phones, at the right on wider screens */
.coach-row { flex-wrap: wrap; }
.coach-row .title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.coach-actions { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 8px; padding-left: 52px; }
@media (min-width: 720px) { .coach-actions { flex: none; padding-left: 0; margin-left: auto; } }

/* the dashboard's bar takes the whole row, with a little scene of today's sky on the right */
.weather .wx-art { display: none; }
.dash-head > .weather { flex: 1 1 100%; max-width: none; margin-top: 0; }
@media (min-width: 720px) {
  .dash-head > .weather { position: relative; min-height: 116px; padding-right: calc(min(34%, 340px) + 16px); }
  .dash-head .weather .wx-art { --wx-sky: #bfdcef; display: block; position: absolute; top: 0; right: 0; bottom: 0;
    width: min(34%, 340px); overflow: hidden; border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28%); mask-image: linear-gradient(to right, transparent, #000 28%); }
}
.wx-art svg { display: block; width: 100%; height: 100%; }
.wx-art .wx-sky { fill: var(--wx-sky); transition: fill .4s; }
.wx-art .wx-far { fill: #8d8a82; opacity: .55; }
.wx-art .wx-near { fill: var(--graphite); }
.wx-art .wx-trail { fill: none; stroke: var(--butter-deep); stroke-width: 1.6; stroke-dasharray: 4 4; stroke-linecap: round; }
.wx-art .wx-runner { fill: none; stroke: var(--butter); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  animation: wx-bob .7s ease-in-out infinite alternate; }
.wx-art .wx-sun circle { fill: var(--butter-deep); }
.wx-art .wx-rays { fill: none; stroke: var(--butter-deep); stroke-width: 2.4; stroke-linecap: round;
  transform-origin: 186px 34px; animation: wx-spin 24s linear infinite; }
.wx-art .wx-moon { fill: #f4ecd0; }
.wx-art .wx-stars { fill: #fff; animation: wx-twinkle 3s ease-in-out infinite alternate; }
.wx-art .wx-cloud { fill: #fff; opacity: .95; animation: wx-drift 9s ease-in-out infinite alternate; }
.wx-art .wx-cloud.c2 { animation-duration: 12s; animation-direction: alternate-reverse; }
.wx-art .wx-rain { fill: none; stroke: #e8f1fa; stroke-width: 1.6; stroke-linecap: round; animation: wx-fall .9s linear infinite; }
.wx-art .wx-snow { fill: #fff; animation: wx-fall 3.2s linear infinite; }
.wx-art .wx-bolt { fill: var(--butter-deep); animation: wx-flash 4s steps(1) infinite; }
.wx-art .wx-fog { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .7;
  animation: wx-drift 7s ease-in-out infinite alternate; }
.wx-art .wx-gust { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; opacity: .9;
  animation: wx-gust 2.6s ease-in-out infinite; }
.wx-art .wx-sun, .wx-art .wx-moon, .wx-art .wx-stars, .wx-art .wx-cloud, .wx-art .wx-rain, .wx-art .wx-snow,
.wx-art .wx-bolt, .wx-art .wx-fog, .wx-art .wx-gust { display: none; }
[data-sky="sun"] .wx-sun,
[data-sky="cloud-sun"] .wx-sun, [data-sky="cloud-sun"] .c1,
[data-sky="cloud"] .wx-cloud,
[data-sky="cloud-fog"] .c2, [data-sky="cloud-fog"] .wx-fog,
[data-sky="cloud-rain"] .wx-cloud, [data-sky="cloud-rain"] .wx-rain,
[data-sky="cloud-snow"] .wx-cloud, [data-sky="cloud-snow"] .wx-snow,
[data-sky="cloud-lightning"] .wx-cloud, [data-sky="cloud-lightning"] .wx-rain, [data-sky="cloud-lightning"] .wx-bolt,
[data-sky="wind"] .wx-gust, [data-sky="wind"] .c2,
[data-sky="moon"] .wx-moon, [data-sky="moon"] .wx-stars { display: inline; }
.weather[data-sky="cloud-sun"] .wx-art { --wx-sky: #c9e0ef; }
.weather[data-sky="cloud"] .wx-art { --wx-sky: #cfd8e0; }
.weather[data-sky="cloud-fog"] .wx-art { --wx-sky: #d8dcdf; }
.weather[data-sky="cloud-rain"] .wx-art { --wx-sky: #93a5b8; }
.weather[data-sky="cloud-snow"] .wx-art { --wx-sky: #d9e5ef; }
.weather[data-sky="cloud-lightning"] .wx-art { --wx-sky: #56647a; }
.weather[data-sky="wind"] .wx-art { --wx-sky: #c4e0ec; }
.weather[data-sky="moon"] .wx-art { --wx-sky: var(--navy); }
.weather[data-sky="cloud-rain"] .wx-cloud, .weather[data-sky="cloud-lightning"] .wx-cloud { fill: #dfe4ea; }
.weather[data-sky="cloud-lightning"] .wx-cloud.c1 { fill: #b7c0cc; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-bob { to { transform: translateY(-1.5px); } }
@keyframes wx-twinkle { to { opacity: .45; } }
@keyframes wx-drift { from { transform: translateX(-4px); } to { transform: translateX(6px); } }
@keyframes wx-fall { from { transform: translate(1.5px, -6px); opacity: 0; } 30% { opacity: 1; }
  to { transform: translate(-1.5px, 8px); opacity: 0; } }
@keyframes wx-flash { 0%, 100% { opacity: 0; } 62% { opacity: 1; } 66% { opacity: 0; } 70% { opacity: 1; } 74% { opacity: 0; } }
@keyframes wx-gust { from { transform: translateX(-10px); opacity: 0; } 40% { opacity: .9; } to { transform: translateX(14px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .weather { animation: none; }
  .wx-art * { animation: none !important; }
  .wx-art .wx-bolt { opacity: 1; }
}

/* ---------- welcome tour ---------- */

.tour-root { position: fixed; inset: 0; z-index: 100; }
.tour-root.dim { background: rgba(20, 19, 17, .58); }
.tour-spot { position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(20, 19, 17, .58), 0 0 0 3px var(--butter), 0 0 24px 6px rgba(248, 230, 160, .45);
  transition: top .3s var(--ease), left .3s var(--ease), width .3s var(--ease), height .3s var(--ease); }
.tour-card { position: fixed; z-index: 101; width: min(380px, calc(100vw - 24px)); padding: 20px 20px 16px;
  border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--butter); outline: none; animation: rise .25s var(--ease); }
.tour-card.at-middle { top: 50%; left: 50%; translate: -50% -50%; }
.tour-card .tour-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; font-size: 22px; line-height: 1; }
.tour-card .snail { width: 150px; margin: -4px 0 8px -6px; }
.tour-card h2 { font-size: var(--fs-xl); font-weight: 900; padding-right: 32px; }
.tour-card p { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.55; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.tour-dots { display: flex; gap: 4px; flex: 1; }
.tour-dots span { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--line); transition: width .2s; }
.tour-dots span.on { width: 18px; background: var(--ink); }
.tour-count { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
@media (max-width: 639px) {
  .tour-card { left: 12px; right: 12px; width: auto; }
  .tour-card.at-bottom { bottom: calc(12px + var(--safe-bottom)); }
  .tour-card.at-top { top: 12px; }
  .tour-dots { display: none; }
  .tour-count { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-card, .tour-dots span { transition: none; animation: none; }
}

/* ---------- "Πλήρωσα" ---------- */

.pay-box { display: grid; gap: 12px; margin-top: 12px; }
.card-pad > .pay-box:first-child { margin-top: 0; }
.pay-how { padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px dashed var(--line); }
.pay-label { margin-bottom: 4px; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); }
.pay-form { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-form .input { flex: 1 1 200px; min-width: 0; }
.pay-done { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; }
.toggle.reported { border-color: var(--ok); background: var(--ok-soft); }
.toggle .reported { color: var(--ok); font-weight: 700; }

/* ---------- event answers ("Θα έρθω") and race results ---------- */

.rsvp-card { margin-top: 14px; border-top: 4px solid var(--butter-deep); }
.rsvp-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rsvp-head .card-title { font-size: var(--fs-xl); }
.rsvp-count { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: var(--fs-md); font-weight: 700; }
.rsvp-full { color: var(--danger); }
.chip.rsvp-mine.yes { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.rsvp-mine.no { background: var(--pending-soft); border-color: transparent; color: var(--pending); }
.rsvp-form { margin-top: 16px; }
.rsvp-form .field { margin-bottom: 14px; }
.rsvp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rsvp-actions .btn { flex: 1 1 140px; max-width: 220px; }
.rsvp-who { display: grid; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.rsvp-dist { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font-family: var(--mono); font-size: var(--fs-xs);
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rsvp-dist b { color: var(--ink); font-size: var(--fs-sm); }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.people li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--line-2); font-size: var(--fs-md); font-weight: 700; }
.people li.me { background: var(--butter); border-color: var(--butter-deep); color: var(--on-butter); }
.muted-people li { color: var(--muted); font-weight: 600; }
.card-title .count { margin-left: 6px; color: var(--muted); }
.rsvp-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.rsvp-tag.yes { color: var(--ok); }
.rsvp-tag.no { color: var(--muted); }

.race-card { overflow: hidden; }
.race-top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.race-top:hover { background: var(--surface-2); }
.race-top h3 { font-size: var(--fs-lg); font-weight: 800; }
.race-top .meta { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.race-top .chev { flex: none; color: var(--faint); }
.race-body { padding: 0 16px 16px; }
.race-body .rsvp-who { margin-top: 10px; }

.result-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; }
.result-form .field { flex: 1 1 140px; margin: 0; }
.result-form .grow-field { flex: 3 1 220px; }
.rail-title { margin: 22px 0 10px; font-size: var(--fs-base); font-weight: 800; }
.results { display: grid; gap: 14px; }
.result-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.result-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-2); font-weight: 700; }
.result-list li:first-child { border-top: 0; }
.result-list li.me { background: color-mix(in srgb, var(--butter) 45%, var(--surface)); }
.result-list .rank { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-size: var(--fs-sm); font-weight: 800; }
.result-list li:first-child .rank { background: var(--butter); color: var(--on-butter); }
.result-list .note { max-width: 40%; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.result-list .time { font-family: var(--mono); font-size: var(--fs-md); }

.result-edit { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.result-edit:first-of-type { margin-top: 10px; }
.result-edit .who { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.result-edit form { display: flex; flex-wrap: wrap; gap: 8px; }
.result-edit form .input { flex: 1 1 110px; width: auto; min-width: 0; }
.result-edit form input[name="note"] { flex: 3 1 160px; }
@media (min-width: 1100px) { .result-edit { grid-template-columns: 200px minmax(0, 1fr); align-items: center; } }

.facts { display: grid; gap: 10px; margin: 8px 0 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.facts .link { color: var(--accent-ink); text-decoration: underline; }

/* reading page */
.res-article { max-width: 720px; margin-inline: auto; }
.res-article .ra-head { margin: 8px 0 18px; }
.res-article .ra-cat { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--t, var(--c));
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.res-article h1 { font-size: clamp(28px, 7vw, 40px); font-weight: 900; text-transform: uppercase; line-height: 1.02; }
.res-article .lead { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-base); font-weight: 500; }
.res-article .ra-meta { margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.res-article .ra-link { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.res-article .ra-link small { color: var(--muted); font-weight: 600; }
.prose { padding: 22px; font-size: var(--fs-base); line-height: 1.65; color: var(--ink); }
.prose > * + * { margin-top: 12px; }
.prose h2 { margin-top: 22px; font-size: var(--fs-xl); font-weight: 900; }
.prose h3 { margin-top: 18px; font-size: var(--fs-lg); font-weight: 800; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.prose strong { font-weight: 800; }
@media (min-width: 640px) { .prose { padding: 28px 32px; } }
.textarea-long { min-height: 280px; line-height: 1.55; }

/* ---------- small date dialog (program ready on…) ---------- */

.date-pop { width: min(360px, calc(100vw - 32px)); margin: auto; padding: 18px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.date-pop:popover-open { display: grid; gap: 14px; }
.date-pop::backdrop { background: rgba(31, 30, 28, .35); }
.date-pop .dp-head b { display: block; font-size: var(--fs-lg); font-weight: 800; }
.date-pop .dp-head small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.date-pop .dp-pick label { display: block; margin-bottom: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.date-pop .dp-row { display: flex; gap: 8px; }
.date-pop .dp-row .input { flex: 1; min-width: 0; }
.date-pop .dp-clear { color: var(--danger); }
.date-pop .dp-close { justify-self: center; }

/* ---------- athlete account: deactivate / delete ---------- */

.danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--line-2)); }
.danger-zone .dz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; }
.danger-zone .dz-row + .dz-row { border-top: 1px solid var(--line-2); }
.danger-zone .dz-row b { display: block; font-size: var(--fs-md); }
.danger-zone .dz-row p { margin-top: 2px; color: var(--muted); font-size: var(--fs-sm); }
.danger-zone details.dz-row { display: block; }
.danger-zone details.dz-row > summary { color: var(--danger); }

/* ---------- access choice (new athlete), login extras ---------- */

.access-password { display: grid; gap: 14px; }
[data-access-when][hidden] { display: none !important; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row label { margin: 0; }
.label-row .kbd-link { display: inline-flex; align-items: center; min-height: 32px; }

/* ---------- pagination ---------- */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.pager-step.disabled { visibility: hidden; }
.pager-pages { display: none; align-items: center; gap: 4px; }
.pager-pages a, .pager-pages .current { min-width: 40px; height: 40px; padding: 0 8px; display: grid; place-items: center;
  border-radius: var(--radius-sm); font-size: var(--fs-md); font-weight: 700; }
.pager-pages a { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.pager-pages a:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.pager-pages .current { background: var(--ink); color: var(--paper); }
.pager-pages .gap { padding: 0 4px; color: var(--muted); }
.pager-status { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
@media (min-width: 640px) { .pager-pages { display: flex; } .pager-status { display: none; } }

.view-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.view-tabs .chip { height: 36px; padding: 0 14px; }
.view-tabs .chip small { font-size: var(--fs-xs); font-weight: 800; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- auth & first login ---------- */

.auth { position: relative; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--paper); color: var(--ink); }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 76px 20px 64px; background: var(--butter); color: var(--on-butter); }
.auth-art .brand-logo.lg { width: min(230px, 58vw); }
@media (max-height: 700px) and (max-width: 899px) { .auth-art { padding: 72px 20px 48px; } .auth-art .brand-logo.lg { width: min(180px, 48vw); } }
.auth-art .auth-copy { display: none; }
.auth-art .eyebrow { color: rgba(58, 57, 54, .65); }
.auth-art h2 { font-size: 52px; font-weight: 900; text-transform: uppercase; line-height: .98; letter-spacing: -.01em;
  color: var(--navy); max-width: 11ch; }
.auth-art h2 em { font-style: normal; color: var(--graphite); }
.auth-panel { display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px 40px; }
.auth-card { width: 100%; max-width: 400px; }

/* show / hide password (the button is added by app.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 52px; }
.pw-toggle { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: var(--radius-xs); background: transparent;
  color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle[aria-pressed="true"] { color: var(--ink); }

/* live password checklist */
.pw-rules { margin-top: 8px; }
.pw-meter { height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--danger); transition: width .25s, background .25s; }
.pw-rules.s1 .pw-meter i { width: 25%; }
.pw-rules.s2 .pw-meter i { width: 50%; background: var(--warn); }
.pw-rules.s3 .pw-meter i { width: 75%; background: var(--warn); }
.pw-rules.s4 .pw-meter i { width: 100%; background: var(--ok); }
.pw-strength { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.pw-rules ul { display: grid; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; }
.pw-rules li { position: relative; padding-left: 20px; color: var(--muted); font-size: var(--fs-sm); }
.pw-rules li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--line); }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { left: 2px; top: .3em; width: 10px; height: 5px; border-radius: 0; background: none;
  border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); }

/* the snail that looks away while you look at your password */
.snail { display: block; width: 170px; height: auto; margin: 0 0 6px -8px; overflow: visible;
  --look-x: 0; --look-y: 0; --sn-ink: #2b2a27; }
.snail .sn-line, .snail .sn-ring { fill: none; stroke: var(--sn-ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.snail .sn-ring { stroke-width: 3.2; }
.snail .sn-speed { stroke-width: 3; opacity: .55; }
/* drawn on the page itself: follow the text colour so they show in dark mode too */
.snail .sn-stem, .snail .sn-speed { stroke: var(--ink); }
.snail .sn-body { fill: var(--butter); stroke: var(--sn-ink); stroke-width: 4; stroke-linejoin: round; }
.snail .sn-shell circle { fill: #b4b5b2; stroke: var(--sn-ink); stroke-width: 4; }
.snail .sn-spiral { stroke-width: 3.4; }
.snail .sn-cheek { fill: #f3b8a0; opacity: 0; transition: opacity .3s; }
.snail .sn-white { fill: #fff; }
.snail .sn-pupil { fill: var(--sn-ink); transition: transform .18s ease-out;
  transform: translate(calc(var(--look-x) * 1px), calc(var(--look-y) * 1px)); }
.snail .sn-lid { fill: var(--butter); transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0);
  transition: transform .22s ease-in; }
.snail .sn-closed { opacity: 0; stroke-width: 3; transition: opacity .15s .1s; }
.snail .sn-stalk { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.snail:not(.peek) .sn-lid { animation: sn-blink 6s 2s infinite; }
@keyframes sn-blink { 0%, 95%, 100% { transform: scaleY(0); } 97% { transform: scaleY(1); } }
.snail.peek .sn-lid { transform: scaleY(1); }
.snail.peek .sn-closed { opacity: 1; }
.snail.peek .sn-cheek { opacity: .9; }
.snail.peek .sn-stalk-1 { transform: rotate(-16deg); }
.snail.peek .sn-stalk-2 { transform: rotate(14deg); }
@media (prefers-reduced-motion: reduce) {
  .snail *, .snail:not(.peek) .sn-lid { animation: none !important; transition: none !important; }
}
.auth-card h1 { font-size: var(--fs-3xl); }
.auth-card .lead { margin-top: 6px; color: var(--muted); }
.auth-tools { position: absolute; top: 14px; right: 14px; z-index: 2; display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.1fr 1fr; grid-template-rows: none; }
  .auth-art { align-items: flex-start; justify-content: space-between; padding: 48px 48px 140px; }
  .auth-art .auth-copy { display: block; }
  .auth-art .brand-logo.lg { width: min(320px, 72vw); }
  .auth-art .ridge-band { height: 130px; }
  .auth-panel { align-items: center; }
}

.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.setup-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: var(--fs-md); color: var(--muted); }
.setup-steps .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.setup-steps .dot .i { width: 15px; height: 15px; }
.setup-steps li.current { color: var(--ink); border-color: var(--ink); }
.setup-steps li.current .dot { background: var(--butter); color: var(--on-butter); }
.setup-steps li.done { color: var(--ok); }
.setup-steps li.done .dot { background: var(--ok); color: #fff; }

.error-page { min-height: 100dvh; display: grid; place-items: center; padding-bottom: 40px; }
.error-page .card { max-width: 440px; text-align: center; }
.error-page h1 { font-size: var(--fs-2xl); }

/* ---------- misc ---------- */

.divider { height: 1px; background: var(--line-2); margin: 18px 0; border: 0; }
.kbd-link { font-weight: 800; color: var(--accent-ink); }
.kbd-link:hover { text-decoration: underline; text-underline-offset: 3px; }
details.disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 800; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .i { transition: transform .2s; }
details.disclosure[open] > summary .i { transform: rotate(90deg); }

/* 44px targets on touch screens; mouse users keep the compact sizes */
@media (pointer: coarse) {
  .btn-sm, .btn-xs { min-height: var(--tap); }
  .icon-btn, .month-nav a { width: var(--tap); height: var(--tap); }
  .btn-icon { width: var(--tap); }
  .filter-bar button { height: var(--tap); }
  .lang-switch button { min-height: var(--tap); min-width: var(--tap); }
  .toast .toast-close { width: var(--tap); height: var(--tap); }
  .back, .section-head .more, .card-head .more { min-height: var(--tap); display: inline-flex; align-items: center; }
  details.disclosure > summary { min-height: var(--tap); }
  .label-row .kbd-link { min-height: var(--tap); }
  .pager-pages a, .pager-pages .current { min-width: var(--tap); height: var(--tap); }
  .view-tabs .chip { height: var(--tap); }
  a.chip { height: var(--tap); padding: 0 14px; }
  .tab { min-height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.menu-lang { padding: 8px 12px; }
.event-row .chev { color: var(--faint); }
.create-menu > summary { list-style: none; }
.create-menu .menu-panel { left: 0; right: auto; }
@media (min-width: 640px) { .create-menu .menu-panel { left: auto; right: 0; } }
/* dashboard: «Νέο» sits up by the greeting, a butter pill whose caret says it opens a menu */
.dash-head { align-items: flex-start; }
.dash-head > div:first-child { flex: 1 1 520px; min-width: 0; }
.create-btn { gap: 6px; padding-inline: 16px 12px; border-radius: var(--radius-pill); box-shadow: var(--shadow-sm); }
.create-btn .caret { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s var(--ease); }
.create-menu[open] .create-btn .caret { transform: rotate(-90deg); }
.create-menu[open] .create-btn { box-shadow: var(--ring); }
@media (min-width: 640px) { .dash-head .create-menu { margin-top: 18px; } }
.month-title h1 { font-size: clamp(26px, 7vw, 42px); text-align: center; }
@media (min-width: 640px) { .month-title { justify-content: flex-start; } .month-title h1 { flex: 0 1 auto; text-align: left; } }
