/* Nocturne — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9; /* review round 7 (Barron): the accent moves to
     the product's blurple — OKLCH hue 289.2, the hue of the app's own Pro
     accent (#9a8fe0, --om-accent-pro) — at the same lightness the steel
     accent held (L 0.660, so the documented ratios survive) and chroma
     in the product blurple's own range (its token sits at C 0.118; the
     accent takes 0.125, from the old steel's 0.030):
     the accent now reads as an accent rather than another neutral. */
  --color-accent-2: #a7a1db; /* the machine-derived stand-in follows: same
     hue, same L 0.734, chroma at the same 2:3 proportion it held */
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;

  --color-accent-2-100: #f5f4ff;
  --color-accent-2-200: #e7e5fe;
  --color-accent-2-300: #d2cefd;
  --color-accent-2-400: #b5afe8;
  --color-accent-2-500: #9690c9;
  --color-accent-2-600: #7972a9;
  --color-accent-2-700: #5c5783;
  --color-accent-2-800: #423e5d;
  --color-accent-2-900: #2b293a;

  /* Deck section-divider ground — review round 3: saturation as presence.
     Dividers take a saturated deep indigo (hue 277, the neutral ramp's own
     family; C 0.094 — written when the accent held C 0.030, before the
     round-7 blurple raised it past the ground's) with a lighter bloom and
     a ghost tint of the same hue, while the slide grounds stay
     desaturated. Deck-scale fills only — not interface colors. */
  --color-section: #262a60;
  --color-section-glow: #353b80;
  --color-section-ghost: #4c5397;

  --font-heading: "Inter", system-ui, sans-serif;
  --font-heading-weight: 700;
  --font-body: "Inter", system-ui, sans-serif;

  --space-1: 2.8px;
  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0,0,0,0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0,0,0,0.65);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.lighten{mix-blend-mode:lighten;background-color:transparent}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
/* The native [hidden] attribute and any single-class component selector
   (.btn, .alert, .card, .dialog-backdrop, ...) tie at specificity (0,1,0);
   whichever is declared later in the cascade wins, which silently made
   hidden buttons/alerts/panels visible throughout this app the moment a
   component class also set `display`. Force [hidden] to always win instead
   of chasing every current and future component that sets display. */
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
/* A person's name as a nested page's title reads better a size down from a
   true top-level page heading (Dashboard, etc). */
.client-calendar-title { font-size: 26px; margin-bottom: 2px; }
.client-calendar-head { margin-bottom: var(--space-6); }
.calendar-back-link {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--space-4);
  font-size: 12px; color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.calendar-back-link:hover { color: var(--color-text); }
.client-identity { gap: var(--space-3); align-items: center; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
/* Rules fade to transparent at both ends instead of stopping cleanly — a
   Nocturne signature. The ramp is 48px an end (one deck baseline unit),
   painted from the same divider token. Freestanding rules fade; box
   outlines, in-control separators, and short accent marks stay solid. */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: var(--space-2);
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.input::placeholder { color: color-mix(in srgb, var(--color-text) 40%, transparent); }
textarea.input { min-height: 90px; resize: vertical; }
/* native number-input spinner reads as raw/unstyled HTML against everything
   else here — every value in this app (reps, load, RPE, RIR, rest, height,
   weight, set counts...) is typed or picked via +/- controls elsewhere, so
   the built-in stepper earns no place; remove it instead of half-styling it */
.input[type='number']::-webkit-inner-spin-button,
.input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input[type='number'] { appearance: textfield; -moz-appearance: textfield; }
.input[type='file']::file-selector-button {
  font: inherit; font-size: 13px; color: var(--color-text);
  background: var(--color-neutral-800); border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm); padding: 5px 10px; margin-right: var(--space-3);
  cursor: pointer;
}
.input[type='file']::file-selector-button:hover { background: color-mix(in srgb, var(--color-text) 7%, var(--color-neutral-800)); }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }
/* Execution/prescription-mode switchers (session builder only - the base
   .seg above is otherwise unused elsewhere in the app, confirmed via grep)
   get the mock's floating-pill treatment instead of the base connected-tab
   look: an inset 2px track, each option its own rounded pill, the checked
   one filled solid rather than just outlined. */
.block-execution-controls .seg,
.exercise-toolbar-row .seg {
  padding: 2px; border-color: var(--color-neutral-800); background: var(--color-bg);
}
.block-execution-controls .seg-opt,
.exercise-toolbar-row .seg-opt {
  padding: 5px 10px; font-family: var(--font-heading); font-weight: 500; font-size: 12px;
  border-radius: var(--radius-sm); color: var(--color-neutral-400);
}
.block-execution-controls .seg-opt + .seg-opt,
.exercise-toolbar-row .seg-opt + .seg-opt {
  border-left: none;
}
.block-execution-controls .seg-opt:has(input:checked),
.exercise-toolbar-row .seg-opt:has(input:checked) {
  color: var(--color-accent-100); background: var(--color-accent-800); box-shadow: none;
}

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-100); }
.tag-accent-2 { background: var(--color-accent-2-800); color: var(--color-accent-2-100); }
.tag-neutral { background: var(--color-neutral-800); color: var(--color-neutral-100); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid transparent; /* keeps layout; the row paints the fading rule */
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid transparent;
}
/* Row rules as row-level strips so the end-fade spans the row, not each cell. */
.table thead tr {
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.table tbody tr {
  background: linear-gradient(to right,
    transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
    color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.table tbody tr:hover {
  /* the hover tint layers over the row rule, which keeps painting */
  background:
    linear-gradient(color-mix(in srgb, var(--color-text) 4%, transparent),
                    color-mix(in srgb, var(--color-text) 4%, transparent)) no-repeat 0 0 / 100% 100%,
    linear-gradient(to right,
      transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
      color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ══════════════════════════════════════════════════════════════════════════
   Step 2 additions (Thomas Coach App migration) — layered on top of the
   authored primitives above, nothing above this line is modified.
   1) disabled states the original set didn't cover for .input/.radio/.seg-opt
   2) cards used as links/buttons (session cards, client cards, etc.)
   3) header nav — real content: link row, active state, unread badge,
      responsive icon-only collapse, and the client mobile-host bottom tab
      bar, ported from the pre-Nocturne app.css behavior it replaces.
   ══════════════════════════════════════════════════════════════════════ */

/* — disabled states — */
.input:disabled, .input[disabled] { opacity: 0.45; cursor: not-allowed; }
.radio:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.seg-opt:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }

/* — interactive cards — */
a.card, button.card, .card-interactive {
  text-align: left; text-decoration: none; color: inherit; cursor: pointer;
  border: 1px solid transparent; font: inherit;
}
a.card:hover, button.card:hover, .card-interactive:hover { border-color: var(--color-divider); }
a.card:active, button.card:active, .card-interactive:active {
  background: color-mix(in srgb, var(--color-text) 6%, var(--color-surface));
}
a.card:focus-visible, button.card:focus-visible, .card-interactive:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px;
}
a.card[aria-disabled='true'], button.card:disabled, .card-interactive[aria-disabled='true'] {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
}

/* — header nav — */
.nav { border-bottom: 1px solid var(--color-divider); }
.nav-links { display: flex; align-items: center; gap: var(--space-2); }
.nav-links form { margin: 0; }
.nav-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  min-height: 44px; /* mobile hit-target floor — DESIGN.md §6 */
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  background: transparent; border: 1px solid transparent; font: inherit; cursor: pointer;
}
.nav-link svg, .nav-link i { display: block; font-size: 16px; }
.nav-link:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.nav-link:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.nav-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.nav-link[aria-current='page'] {
  color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 12%, transparent);
}
.nav-link-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute; top: -6px; right: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 10px; font-weight: 600; line-height: 1;
  border-radius: 999px;
  background: var(--color-accent-800); color: var(--color-accent-100);
  box-shadow: 0 0 0 2px var(--color-bg);
}

/* icon-only collapse on narrow viewports. Uses a container query against
   .app-shell (container-name: app, defined below) rather than a viewport
   media query — matters inside the mobile-host desktop preview, which caps
   .app-shell's own width without changing the actual viewport. 760px is an
   engineering value carried from the pre-Nocturne CSS; DESIGN.md defines no
   breakpoint token, so it's not invented, just not derived from one either. */
@container app (max-width: 760px) {
  .nav-link-label { display: none; }
  .nav-links { gap: var(--space-1); overflow-x: auto; }
}

/* client mobile-host shell: nav-client becomes a fixed bottom tab bar,
   same structural behavior the old app.css gave body.is-mobile-host */
body.is-mobile-host:has(.nav-client) .nav-client {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50;
  width: 100%;
  border-bottom: none;
  border-top: 1px solid var(--color-divider);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg);
}
body.is-mobile-host:has(.nav-client) .nav-brand { display: none; }
body.is-mobile-host:has(.nav-client) .nav-links { width: 100%; justify-content: space-around; }
body.is-mobile-host:has(.nav-client) .nav-link { flex-direction: column; flex: 1 1 0; gap: var(--space-1); min-width: 0; }
body.is-mobile-host:has(.nav-client) .nav-link-label {
  display: block; font-size: 11px; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
body.is-mobile-host:has(.nav-client) .container {
  padding-bottom: calc(64px + var(--space-4) + env(safe-area-inset-bottom, 0px));
}

/* full-screen wizards hide chrome nav entirely — same screens/class names
   as before; screens themselves aren't rebuilt yet (step 3) */
body:has(.client-workout-wizard) .nav,
body:has(.welcome-wizard) .nav,
body:has([data-wellness-checkin]) .nav {
  display: none;
}

/* — small fixed-position debug utility (layout.php) — positioning only,
   .btn.btn-secondary.btn-icon supplies the actual look — */
.mobile-host-debug-link { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 1200; border-radius: 999px; }

/* — base page shell — app-shell/container aren't one of the six named
   primitives, but every single screen sits inside them, same reasoning as
   header nav. container-name enables the nav's @container query above.
   The .18s opacity fade is ported as-is from the pre-Nocturne CSS (JS in
   app.js toggles is-loading/is-transitioning on real navigation) — DESIGN.md
   defines no motion-duration token, so this isn't derived from one, just
   kept rather than silently dropping existing loading feedback. */
.app-shell { container-type: inline-size; container-name: app; transition: opacity 260ms cubic-bezier(.2,.8,.2,1), transform 260ms cubic-bezier(.2,.8,.2,1); }
body.is-loading .app-shell, body.is-transitioning .app-shell { opacity: 0.55; transform: translateY(6px); }
.container { width: 100%; max-width: none; margin: 0 0 var(--space-8); padding: var(--space-4); }

/* ══════════════════════════════════════════════════════════════════════════
   Semantic color ramps — danger / warning / success. DESIGN.md's own token
   set intentionally has none (mono palette + one accent) but this app's
   data model requires them (wellness check-ins are a literal red/orange/green
   enum; login/form errors; RPE bands; alert severities). Derived with the
   exact method documented above for the accent ramp: same per-step L and C
   as --color-accent-{100..900}, hue swapped only. Verified in-gamut at every
   step (no sRGB clipping). Use like the accent ramp: 700–900 tinted fills,
   500 base, 100–300 text-on-tint. Reach for these only for real severity/
   status meaning — not as a second and third brand color.
   ══════════════════════════════════════════════════════════════════════ */
:root {
  --color-danger: #da7770;
  --color-danger-100: #fff2f0;
  --color-danger-200: #fee0dd;
  --color-danger-300: #fcc4bf;
  --color-danger-400: #f89a92;
  --color-danger-500: #da7770;
  --color-danger-600: #b95954;
  --color-danger-700: #8f433f;
  --color-danger-800: #672f2c;
  --color-danger-900: #40221f;

  --color-warning: #c98934;
  --color-warning-100: #fcf4eb;
  --color-warning-200: #f7e5d1;
  --color-warning-300: #f0cea7;
  --color-warning-400: #e6aa61;
  --color-warning-500: #c98934;
  --color-warning-600: #a86b03;
  --color-warning-700: #825100;
  --color-warning-800: #5d3903;
  --color-warning-900: #3a270f;

  --color-success: #63ac66;
  --color-success-100: #f0f8f0;
  --color-success-200: #dbefdb;
  --color-success-300: #bae0bb;
  --color-success-400: #88cb89;
  --color-success-500: #63ac66;
  --color-success-600: #448d49;
  --color-success-700: #336d36;
  --color-success-800: #234d26;
  --color-success-900: #1c311c;
}

/* — alerts — mirrors the .tag/.tag-accent base+modifier pattern */
.alert {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md);
  font-size: 13px; margin: 0 0 var(--space-3);
}
.alert i, .alert svg { flex: none; font-size: 16px; }
.alert-danger { background: var(--color-danger-800); color: var(--color-danger-100); }
.alert-warning { background: var(--color-warning-800); color: var(--color-warning-100); }
.alert-success { background: var(--color-success-800); color: var(--color-success-100); }

/* — checkbox — same hidden-input + styled-sibling technique as .radio/.dot,
   square instead of round; checked state mirrors .radio's inset-ring look */
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.checkbox .box {
  width: 16px; height: 16px; flex: none; border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-divider);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.checkbox:hover .box { border-color: var(--color-accent); }
.checkbox input:checked + .box {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 3px var(--color-bg);
}
.checkbox input:focus-visible + .box { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.checkbox:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }

/* — layout utility — vertical rhythm for stacked form fields/actions,
   used across screens (not auth-specific, kept here since this is where
   it's first needed) */
.stack { display: grid; gap: var(--space-4); }
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); align-items: start; }

/* — client card (coach roster) — profile-card direction from the Nocturne
   design-system project ("Client Card.dc.html", direction 1b). Deliberately
   uses its own explicit font-weight:500/600 rather than the page's bold
   --font-heading-weight, for a quieter hierarchy than section headings.
   Onboarded clients get the glow header and full stat/check-in body;
   clients who haven't finished onboarding get a distinct dashed
   empty-state instead (no fabricated stats). */
.client-card { display: flex; flex-direction: column; padding: 0; gap: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; background: var(--color-surface); }
.client-card.is-onboarded { background: linear-gradient(180deg, var(--color-neutral-900), var(--color-surface)); }
.client-card-head { position: relative; padding: var(--space-4) var(--space-4) var(--space-3); display: flex; gap: var(--space-3); align-items: flex-start; }
.client-card.is-onboarded .client-card-head::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent-600) 30%, var(--color-accent-600) 70%, transparent);
}
.client-card-avatar {
  width: 48px; height: 48px; flex: none; border-radius: var(--radius-md); overflow: hidden;
  display: grid; place-items: center; text-decoration: none;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px; letter-spacing: 0.04em;
  color: var(--color-neutral-400); background: var(--color-neutral-900);
  box-shadow: inset 0 0 0 1px var(--color-neutral-800);
}
.client-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.client-card.is-onboarded .client-card-avatar {
  color: var(--color-accent-200); background: var(--color-accent-900);
  box-shadow: inset 0 0 0 1px var(--color-accent-700), 0 0 24px -6px var(--color-accent-700);
}
.client-card-identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.client-card-name { font-family: var(--font-heading); font-weight: 500; font-size: 17px; color: var(--color-text); text-decoration: none; }
.client-card-name:hover { color: var(--color-accent-200); }
.client-card-email { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-neutral-500); min-width: 0; }
.client-card-email span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-head-actions { display: flex; gap: 2px; flex: none; }
.client-card-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 var(--space-4) var(--space-3); }
.tag-outline-neutral { background: var(--color-neutral-900); color: var(--color-neutral-300); border: 1px solid var(--color-neutral-800); }
.client-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); }
.client-card-stat { display: flex; flex-direction: column; gap: 3px; padding: var(--space-3) var(--space-4); }
.client-card-stat + .client-card-stat { border-left: 1px solid var(--color-divider); }
.client-card-stat-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
.client-card-stat-value { font-family: var(--font-heading); font-size: 19px; font-weight: 500; }
.client-card-stat-value small { font-size: 12px; color: var(--color-neutral-500); }
.client-card-checkin { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
.client-card-checkin-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.client-card-checkin-head span:first-child { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-neutral-600); }
.client-card-checkin-head span:last-child { font-size: 12px; color: var(--color-neutral-500); }
.client-card-location { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-neutral-500); }
.client-card-actions { display: flex; gap: var(--space-2); padding: 0 var(--space-4) var(--space-4); margin-top: auto; }
.client-card-actions .btn { flex: 1; }
.client-card-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); margin: 0 var(--space-4) var(--space-4); border: 1px dashed var(--color-neutral-800); border-radius: var(--radius-md); }
.client-card-empty-title { font-family: var(--font-heading); font-weight: 500; font-size: 14px; color: var(--color-text); }
.client-card-empty-body { font-size: 13px; line-height: 1.5; color: var(--color-neutral-500); }

/* — auth screens (login, login-code, forgot/reset-password) — */
.auth-shell { display: flex; align-items: center; justify-content: center; min-height: 70dvh; }
.auth-card { width: min(430px, 100%); }
.auth-link {
  display: block; text-align: center; font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.auth-link:hover { color: var(--color-accent); }
.auth-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* — login split-screen (Nocturne design-system project, "Login.dc.html"
   direction 3a) — scoped to the login page only; the other auth screens
   (code entry, forgot/reset password, welcome wizard) keep the shared
   centered .auth-shell/.auth-card. */
.login-shell { display: flex; align-items: center; justify-content: center; min-height: 80dvh; padding: var(--space-4) 0; }
.login-split { display: flex; flex-wrap: wrap; width: 100%; max-width: 1360px; min-height: 680px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--color-bg); }
.login-form-side { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8); padding: var(--space-8); background: var(--color-bg); }
.login-brand-row { display: flex; align-items: center; gap: 10px; }
.login-brand-mark { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm); font-size: 15px; color: var(--color-accent-200); background: var(--color-accent-900); box-shadow: inset 0 0 0 1px var(--color-accent-700); }
.login-brand-name { font-family: var(--font-heading); font-size: 14px; font-weight: 500; letter-spacing: 0.01em; }
.login-body { display: flex; flex-direction: column; gap: var(--space-8); max-width: 420px; }
.login-title { margin: 0 0 var(--space-2); font-family: var(--font-heading); font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.login-subtitle { margin: 0; font-size: 14px; line-height: 1.55; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.login-field { display: flex; flex-direction: column; gap: var(--space-2); }
.login-field-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.login-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.login-field-head a { font-size: 12px; }
.login-password-wrap { position: relative; display: flex; align-items: center; }
.login-password-wrap input { padding-right: 44px; }
.login-password-toggle { position: absolute; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; color: color-mix(in srgb, var(--color-text) 55%, transparent); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; }
.login-password-toggle:hover { color: var(--color-text); border-color: var(--color-neutral-800); }
.login-password-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.login-submit { box-shadow: 0 0 28px -10px var(--color-accent-700); }
.login-client-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.login-client-hint i { flex: none; }
.login-footer { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.login-brand-side {
  position: relative; flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
  gap: var(--space-6); padding: var(--space-8); overflow: hidden;
  background: linear-gradient(160deg, var(--color-neutral-900) 0%, var(--color-surface) 55%, var(--color-accent-900) 140%);
}
.login-brand-side::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 1px;
  background: linear-gradient(180deg, transparent, var(--color-accent-600) 30%, var(--color-accent-600) 70%, transparent);
}
.login-brand-glow { position: absolute; top: -120px; right: -120px; width: 420px; height: 420px; border-radius: 999px; background: radial-gradient(circle, var(--color-accent-800), transparent 65%); opacity: 0.55; }
.login-brand-content { position: relative; display: flex; flex-direction: column; gap: var(--space-6); max-width: 420px; }
.login-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent-300); }
.login-tagline { margin: 0; font-family: var(--font-heading); font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.login-stats { display: flex; flex-wrap: wrap; gap: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }
.login-stat { display: flex; flex-direction: column; gap: 2px; }
.login-stat-value { font-family: var(--font-heading); font-size: 22px; font-weight: 500; }
.login-stat-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-neutral-500); }
@media (max-width: 860px) { .login-brand-side { display: none; } }

/* ══════════════════════════════════════════════════════════════════════════
   Step 3 additions (coach dashboard) — small, broadly-reusable extensions
   of the existing patterns rather than new one-off components.
   ══════════════════════════════════════════════════════════════════════ */

/* — layout utility — horizontal counterpart to .stack — */
.row { display: flex; flex-direction: row; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.flex-1 { flex: 1 1 auto; }

/* — layout utility — responsive two-column section pair (dashboard panels,
   any future side-by-side card layout); columns wrap to one under 640px
   container width via the same .app-shell container-query context the nav
   collapse uses */
.cols-2 { display: flex; align-items: stretch; gap: var(--space-4); }
.cols-2 > * { flex: 1 1 320px; }

.dashboard-stat-row { align-items: stretch; flex-wrap: nowrap; }
.dashboard-stat { flex: 0 0 auto; min-width: 170px; }

/* — tag severity modifiers — same base+modifier pattern as .tag-accent/
   .tag-neutral, extended to the semantic ramps added for the auth screens */
.tag-danger { background: var(--color-danger-800); color: var(--color-danger-100); }
.tag-warning { background: var(--color-warning-800); color: var(--color-warning-100); }
.tag-success { background: var(--color-success-800); color: var(--color-success-100); }

/* — status dot — small severity/state indicator, reused wherever a full
   .tag label would be too heavy (alert rows now, wellness RAG later) */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; flex: none; }
.status-dot-accent { background: var(--color-accent); }
.status-dot-danger { background: var(--color-danger); }
.status-dot-warning { background: var(--color-warning); }
.status-dot-success { background: var(--color-success); }

/* — danger button — same outline treatment as .btn-primary, on the
   semantic danger token instead of accent. Used for destructive actions
   (settings wipe, delete). */
.btn-danger { color: var(--color-danger); border-color: var(--color-danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.btn-danger:active { background: color-mix(in srgb, var(--color-danger) 22%, transparent); }

/* — avatar — circular photo or initial-letter fallback */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; flex: none;
  background: var(--color-accent-800); color: var(--color-accent-100);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 16px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* — eyebrow — small uppercase kicker for non-heading elements; same
   treatment DESIGN.md already gives h6 */
.eyebrow {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); margin: 0 0 var(--space-2);
}
.eyebrow-danger { color: var(--color-danger); }

/* — fold — native <details>/<summary>, styled as a text link trigger with
   no native marker; two label spans toggle via the [open] state instead of
   swapping text with JS */
.fold > summary.fold-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--color-accent); cursor: pointer; list-style: none;
}
.fold > summary.fold-trigger::-webkit-details-marker { display: none; }
.fold > summary.fold-trigger:hover { text-decoration: underline; }
.fold > summary.fold-trigger:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.fold .fold-label-open { display: none; }
.fold[open] .fold-label-closed { display: none; }
.fold[open] .fold-label-open { display: inline-flex; align-items: center; gap: 6px; }
.fold-body { margin-top: var(--space-3); }

/* — date picker — JS-built widget (date-picker.js), wraps a native <input
   type=date> made read-only + a trigger + a popover calendar grid. Markup
   and class names come from that script, not from view templates; styled
   here since it's used app-wide wherever [data-date-picker] appears. */
.tc-date-picker { position: relative; display: inline-block; width: 100%; }
.tc-date-picker-input { padding-right: 40px; cursor: pointer; }
.tc-date-picker-trigger {
  position: absolute; top: 0; right: 0; bottom: 0; width: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--color-accent); cursor: pointer;
}
.tc-date-picker-trigger:hover { color: var(--color-text); }
.tc-date-picker-trigger:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.tc-date-picker-popover {
  position: absolute; z-index: 60; top: calc(100% + var(--space-2)); left: 0;
  width: max(260px, 100%); padding: var(--space-3); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.tc-date-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.tc-date-picker-head strong { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 14px; text-transform: capitalize; }
.tc-date-picker-nav {
  position: relative;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--color-text); cursor: pointer;
}
.tc-date-picker-nav::after {
  content: ''; position: absolute; inset: 50% auto auto 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.tc-date-picker-nav:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.tc-date-picker-nav:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tc-date-picker-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.tc-date-picker-weekdays, .tc-date-picker-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center;
}
.tc-date-picker-weekdays span {
  font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent);
  padding: var(--space-1) 0;
}
.tc-date-picker-day {
  aspect-ratio: 1; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--color-text); cursor: pointer;
}
.tc-date-picker-day:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.tc-date-picker-day:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.tc-date-picker-day.is-outside { color: color-mix(in srgb, var(--color-text) 35%, transparent); }
.tc-date-picker-day.is-today { border-color: var(--color-accent); }
.tc-date-picker-day.is-selected { background: var(--color-accent); color: var(--color-bg); }
.tc-date-picker-day.is-disabled { opacity: 0.3; cursor: not-allowed; }
.tc-date-picker-today {
  display: block; width: 100%; margin-top: var(--space-2); padding: var(--space-2);
  font-size: 12px; text-align: center; background: transparent; border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); color: var(--color-accent); cursor: pointer;
}
.tc-date-picker-today:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.tc-date-picker-today:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* — wizard — multi-step form shell (wellness check-in, workout runner,
   welcome). Step visibility is driven by JS toggling .is-active on whatever
   carries [data-step]; width % on .wizard-progress > span is set inline by
   JS (a real runtime value, not a hard-coded one). */
.wizard { max-width: 520px; margin: 0 auto; }
.wizard-progress {
  height: 4px; border-radius: 999px; background: var(--color-neutral-800);
  overflow: hidden; margin-bottom: var(--space-3);
}
.wizard-progress span { display: block; height: 100%; background: var(--color-accent); }
[data-step] { display: none; }
[data-step].is-active { display: block; }
.wizard-actions { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.wizard-actions [data-prev-step] { margin-right: auto; }

/* — wellness RAG choice — red/orange/green maps directly onto the
   danger/warning/success ramps */
.wellness-rag-choices { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.wellness-rag-choice {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--color-surface); border: 1px solid var(--color-divider);
  color: var(--color-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.wellness-rag-choice:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.wellness-rag-choice:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.wellness-rag-choice.is-selected { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.wellness-rag-dot { width: 14px; height: 14px; border-radius: 999px; flex: none; }
.wellness-rag-dot.wellness-rag-red { background: var(--color-danger); }
.wellness-rag-dot.wellness-rag-orange { background: var(--color-warning); }
.wellness-rag-dot.wellness-rag-green { background: var(--color-success); }

/* — select — same look as .input, native element has no separate primitive */
select.input { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23e9e9ed' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}

/* — avatar size modifier — */
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }

/* — drawer — slide-in side panel (message/exercise/category/client-edit
   drawers all share this exact JS + these exact class names, set in
   app.js's setupDrawer(); .client-drawer-panel/.client-drawer-backdrop
   are hard dependencies of that shared function, not per-screen names).
   240ms matches app.js's own drawerCloseTimer so the hidden attribute
   lands exactly when the slide-out finishes, not before/after. */
.client-drawer { position: fixed; inset: 0; z-index: 70; }
.client-drawer-backdrop {
  position: absolute; inset: 0; width: 100%; border: none; cursor: pointer; padding: 0;
  background: color-mix(in srgb, var(--color-neutral-900) 60%, transparent);
  opacity: 0; transition: opacity 240ms ease;
}
.client-drawer.is-open .client-drawer-backdrop { opacity: 1; }
.client-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto;
  padding: var(--space-4); background: var(--color-surface); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform 240ms ease;
}
.client-drawer.is-open .client-drawer-panel { transform: translateX(0); }
/* wide variant — the session builder drawer needs room for the block editor */
.client-drawer-panel-wide { width: min(920px, 100vw); }

/* — session builder drawer (redesign, "Workout Builder.dc.html") — this
   drawer alone (not the shared message/client/exercise drawers above) gets
   a sticky header + independently-scrolling body + sticky footer, instead
   of the shared .client-drawer-panel's single uniformly-padded scroll
   region, since the mock's header (title, date/difficulty, templates) and
   footer (save actions) need to stay in view while the block list scrolls. */
.session-drawer-panel { padding: 0; overflow: hidden; }
.session-drawer-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.session-drawer-header {
  position: relative; flex: none; display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: linear-gradient(180deg, var(--color-neutral-900), var(--color-surface));
}
.session-drawer-header::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent-600) 25%, var(--color-accent-600) 75%, transparent);
}
.session-drawer-top-row { display: flex; align-items: flex-start; gap: var(--space-3); }
/* The close (X) button inherits .btn-ghost's default accent color; the mock
   wants it neutral like every other icon-only chrome button here. */
.session-drawer-top-row .btn-ghost { color: var(--color-neutral-400); }
.session-drawer-top-row .btn-ghost:hover { color: var(--color-text); }
.session-drawer-identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.session-drawer-context { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-drawer-context-text { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-neutral-500); }
.session-drawer-status-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; color: var(--color-accent-200); background: var(--color-accent-800);
}
.session-drawer-title-input {
  width: 100%; box-sizing: border-box; font-family: var(--font-heading); font-size: 26px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--color-text); background: transparent; border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 2px 6px; margin: 0 0 0 -6px !important; min-height: auto !important;
}
.session-drawer-title-input:hover, .session-drawer-title-input:focus-visible { border-color: var(--color-neutral-800) !important; }
.session-drawer-autosave { font-size: 11px; color: var(--color-neutral-600); }
.session-drawer-field-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.session-drawer-field-pill {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px;
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md); background: var(--color-bg);
}
.session-drawer-field-pill-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-neutral-500); flex: none; }
.session-drawer-field-pill input, .session-drawer-field-pill select {
  border: none !important; background: transparent !important; padding: 0 !important; min-height: auto !important; font-size: 13px;
}
.session-drawer-field-pill select { cursor: pointer; }
.session-drawer-spacer { flex: 1; }
.session-drawer-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); }
.session-drawer-body-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.session-drawer-body-head-label { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-neutral-500); }
.session-drawer-body-count { font-size: 11px; color: var(--color-neutral-600); }
.session-add-palette { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px dashed var(--color-neutral-800); border-radius: var(--radius-md); }
.session-add-palette-label { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-neutral-600); }
.session-add-palette-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.session-drawer-footer { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--color-divider); background: var(--color-surface); }
/* Header/footer/palette buttons match the mock's compact type scale here —
   smaller and lighter than the app's default .btn (14px/700), and neutral
   buttons read as muted neutral-300 rather than near-white .btn's default
   color: var(--color-text). Scoped to these three rows; .btn itself (used
   everywhere else in the app) is untouched. */
.session-drawer-field-row .btn:not(.btn-icon),
.session-add-palette-row .btn:not(.btn-icon),
.session-drawer-footer .btn:not(.btn-icon) {
  font-size: 12.5px; font-weight: 500; padding: 8px 12px;
}
.session-drawer-field-row .btn-secondary,
.session-add-palette-row .btn-secondary,
.session-drawer-footer .btn-secondary,
.session-drawer-footer .btn-ghost {
  color: var(--color-neutral-300);
}
.session-add-palette-row .btn-primary,
.session-drawer-footer .btn-primary {
  color: var(--color-accent-200); border-color: var(--color-accent-700);
}
.session-drawer-footer [data-save-as-template] {
  color: var(--color-neutral-400);
}

/* — message inbox / thread — */
.message-inbox-meta { display: flex; align-items: center; gap: var(--space-2); }
.message-list { display: flex; flex-direction: column; gap: var(--space-3); }
.message-row { display: flex; gap: var(--space-2); max-width: 78%; }
.message-row.sent { flex-direction: row-reverse; margin-left: auto; }
.message-bubble {
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-neutral-800);
}
.message-row.sent .message-bubble { background: var(--color-accent-800); }
.message-bubble > div { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: 2px; }
.message-bubble small { color: color-mix(in srgb, var(--color-text) 55%, transparent); font-size: 11px; }
.message-bubble p { margin: 0; font-size: 14px; }
.message-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8) 0; text-align: center; }
.message-composer {
  display: flex; align-items: flex-end; gap: var(--space-2); margin-top: var(--space-3);
  padding-top: var(--space-3); border-top: 1px solid var(--color-divider);
}
.message-composer textarea {
  flex: 1; min-height: 40px; max-height: 160px; padding: 8px 12px; font: inherit; font-size: 14px;
  color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); resize: none;
}
.message-composer textarea:focus-visible { border-color: var(--color-accent); outline-offset: 0; }

/* — custom select — app.js auto-enhances EVERY <select> on EVERY page
   (unless [multiple] or [data-preserve-native-select]) into this trigger+menu
   widget and hides the original via .native-select-hidden. That hide rule
   had no CSS at all post-reset, so the real native select and the custom
   trigger were both rendering stacked — this is the fix, not just styling.
   select.input above still matters for the opted-out native cases. */
.native-select-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.custom-select { position: relative; display: inline-block; width: 100%; }
.custom-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit; font-size: 14px;
  color: var(--color-text); background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 0.15s ease;
}
.custom-select-trigger:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.custom-select-trigger:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.custom-select-trigger:disabled { opacity: 0.45; cursor: not-allowed; }
.custom-select.is-open .custom-select-trigger { border-color: var(--color-accent); }
.custom-select-trigger i { color: color-mix(in srgb, var(--color-text) 55%, transparent); flex: none; }
.custom-select-menu {
  position: absolute; z-index: 60; top: calc(100% + var(--space-1)); left: 0; right: 0;
  max-height: 280px; overflow-y: auto; padding: var(--space-1);
  background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.custom-select-menu [data-custom-select-option] {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  width: 100%; padding: var(--space-2) var(--space-2); font: inherit; font-size: 14px; text-align: left;
  color: var(--color-text); background: transparent; border: none; border-radius: var(--radius-sm); cursor: pointer;
}
.custom-select-menu [data-custom-select-option]:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.custom-select-menu [data-custom-select-option]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.custom-select-menu [data-custom-select-option] i { opacity: 0; color: var(--color-accent); }
.custom-select-menu [data-custom-select-option][aria-selected='true'] { color: var(--color-accent); }
.custom-select-menu [data-custom-select-option][aria-selected='true'] i { opacity: 1; }

/* difficulty-select: trigger tints with the selected difficulty, same
   easy/medium/hard -> success/warning/danger mapping used on session badges */
.difficulty-select.easy .custom-select-trigger { border-color: var(--color-success); color: var(--color-success-100); }
.difficulty-select.medium .custom-select-trigger { border-color: var(--color-warning); color: var(--color-warning-100); }
.difficulty-select.hard .custom-select-trigger { border-color: var(--color-danger); color: var(--color-danger-100); }

/* — key lift cards / any button.card toggled active via JS — */
button.card.is-active, a.card.is-active { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface)); }

/* — performance chart panel — */
.performance-chart-wrap { position: relative; }
.performance-chart-wrap canvas { width: 100%; height: 220px; display: block; }
.performance-chart-tooltip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none;
  padding: 4px 8px; font-size: 11px; white-space: nowrap;
  background: var(--color-neutral-900); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.performance-chart-legend { display: flex; gap: var(--space-4); font-size: 12px; margin-top: var(--space-2); }
.performance-chart-legend .status-dot { margin-right: 6px; }

/* — spin utility — functional loading feedback (search spinners), not a
   decorative motion choice, so kept despite no DESIGN.md motion token */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 0.8s linear infinite; }

/* — exercise library — */
.exercise-category { border-bottom: 1px solid var(--color-divider); }
.exercise-category:last-child { border-bottom: none; }
.exercise-category-toggle {
  display: flex; align-items: center; gap: var(--space-2); width: 100%;
  padding: var(--space-3) 0; font: inherit; text-align: left;
  background: transparent; border: none; color: var(--color-text); cursor: pointer;
}
.exercise-category-toggle:hover { color: var(--color-accent); }
.exercise-category-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.exercise-category-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); flex: 1; }
.exercise-category-count { font-size: 12px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.exercise-category-toggle i { transition: none; }
.exercise-category.is-collapsed .exercise-category-body { display: none; }
.exercise-category-toggle[aria-expanded='true'] .ph-caret-down { transform: rotate(180deg); }
.exercise-category-body { padding-bottom: var(--space-3); }
.exercise-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) 0; border-top: 1px solid var(--color-divider);
}
.exercise-row:first-child { border-top: none; }
.exercise-row.is-exercise-saved { background: color-mix(in srgb, var(--color-success) 8%, transparent); }
.exercise-edit-form { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: 1; }
.exercise-edit-form input.input { flex: 1 1 160px; width: auto; }
.exercise-video-candidates { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.exercise-video-candidate {
  display: flex; align-items: center; gap: var(--space-3); text-align: left; padding: var(--space-2);
}
.exercise-video-candidate img, .exercise-video-candidate-thumb-fallback {
  width: 64px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex: none;
  display: flex; align-items: center; justify-content: center; background: var(--color-neutral-800);
}
.exercise-match-meta { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; margin-top: var(--space-1); }
.exercise-category-manager { display: flex; flex-direction: column; gap: var(--space-3); }
.exercise-category-manager-row { display: flex; align-items: center; gap: var(--space-2); }
.exercise-category-manager-row .input { flex: 1; }
.exercise-category-manager-count {
  min-width: 24px; text-align: center; font-size: 12px; color: color-mix(in srgb, var(--color-text) 55%, transparent);
}

/* ══════════════════════════════════════════════════════════════════════════
   Coach client calendar (7-day week board) and workout cards. These exact
   class names (.workout-card, .workout-card-head, .workout-card-actions,
   .workout-action + edit/template/duplicate/delete/feedback, .week-day,
   .day-sessions) are hard dependencies of session-builder.js and
   client-calendar-infinite.js, which generate matching markup at runtime
   (draft cards while a save is in flight) — kept as-is and styled directly
   rather than migrated to .card/.btn, so JS-generated and server-rendered
   cards stay visually identical without touching those JS files' template
   strings. Old design used solid pastel card fills per difficulty; replaced
   with the same dark .card look everywhere else uses, difficulty shown via
   a small tag instead of tinting the whole card — consistency with every
   other screen mattered more here than preserving the old color-coding.
   ══════════════════════════════════════════════════════════════════════ */
.week-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-3); align-items: start; }
/* Repeats once per week down an infinite-scroll list — a page-title-sized
   heading here would shout on every single scroll screen. */
.week-heading { font-size: 18px; margin-bottom: 2px; }
.week-heading .text-muted { font-size: 13px; font-weight: 400; }
.week-day { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.week-day > header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.week-day-title { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); min-width: 0; }
.week-day-title form { margin: 0; display: flex; align-items: center; gap: 4px; min-width: 0; }
/* A quiet annotation field (the coach's weekly skeleton note, e.g. "rest
   day") — invisible until hovered/focused rather than a full boxed .input,
   so it doesn't compete with the actual scheduled workouts below it. */
.week-structure-input {
  flex: 1; min-width: 0; font: inherit; font-size: 12px; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 2px 4px; margin: -2px -4px; transition: border-color 0.15s ease, background 0.15s ease;
}
.week-structure-input::placeholder { color: color-mix(in srgb, var(--color-text) 35%, transparent); }
.week-structure-input:hover { border-color: var(--color-divider); }
.week-structure-input:focus-visible { border-color: var(--color-accent); background: var(--color-surface); outline: none; }
[data-week-structure-status] { flex: none; font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); min-width: 10px; }
.week-day.is-today > header strong { color: var(--color-accent); }
.week-day.is-rest-day { opacity: 0.6; }
.week-structure-note input {
  width: 100%; min-height: 26px; padding: 2px 4px; font-size: 11px; color: var(--color-text);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
}
.week-structure-note input:hover, .week-structure-note input:focus-visible { border-color: var(--color-divider); }
.day-sessions { display: flex; flex-direction: column; gap: var(--space-2); min-height: 24px; }

.workout-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
  border: 1px solid transparent; text-align: left; font: inherit; color: var(--color-text);
}
.workout-card.draft { border: 1px dashed var(--color-accent); background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface)); }
.workout-card-head { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.workout-card-head span {
  font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 999px; background: var(--color-neutral-800); color: var(--color-neutral-100);
}
.workout-card.easy .workout-card-head span { background: var(--color-success-800); color: var(--color-success-100); }
.workout-card.medium .workout-card-head span { background: var(--color-warning-800); color: var(--color-warning-100); }
.workout-card.hard .workout-card-head span { background: var(--color-danger-800); color: var(--color-danger-100); }
.workout-card.completed { opacity: 0.85; }
.workout-card-head p { margin: 0; font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 14px; }
.completed-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--color-success); }
.workout-block-preview { font-size: 12px; }
.workout-block-preview strong { display: block; font-size: 12px; }
.workout-block-preview small { color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.workout-card-actions { display: flex; justify-content: flex-end; gap: 4px; }
.workout-action {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: color-mix(in srgb, var(--color-text) 65%, transparent);
  cursor: pointer;
}
/* Icon stays compact (dense calendar rows can't fit a visually 44px button
   next to 4 siblings) but the tap target itself still meets DESIGN.md's
   44px hit-target floor — an invisible ::after extends the hit area without
   growing the box in layout. Same pattern reused below for the other
   sub-44px icon controls (set duplicate/remove, drop-piece delete, date
   picker nav). */
.workout-action::after {
  content: ''; position: absolute; inset: 50% auto auto 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.workout-action:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.workout-action:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.workout-action.delete:hover { color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 10%, transparent); }
.add-block-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: var(--space-2); font-size: 12px;
  background: transparent; border: 1px dashed var(--color-divider); border-radius: var(--radius-md);
  color: color-mix(in srgb, var(--color-text) 60%, transparent); cursor: pointer;
}
.add-block-link:hover { border-color: var(--color-accent); color: var(--color-accent); }
.add-block-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════════════════
   Session block builder (session-builder.js + exercise-prescription.js) —
   the exercise/set/circuit editor inside the session drawer. Hundreds of
   bare, unclassed <input>/<select> get generated across many call sites in
   these two ~1600-line files; rather than touch every template string
   individually (high risk of missing one or breaking a template literal),
   fields are styled by scoping to #blocks (the fixed container id both
   files already target) instead of requiring a class on each one. Buttons
   and containers that already have a stable, single generation point
   (block actions, add-exercise, free-text block, card) were given real
   .btn/.card/.input classes directly in the JS — see session-builder.js.
   ══════════════════════════════════════════════════════════════════════ */
#blocks input:not([type='hidden']):not([type='checkbox']):not([type='radio']),
#blocks select,
#blocks textarea {
  min-height: 32px; padding: 7px 9px; font: inherit; font-size: 13px;
  color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: var(--radius-sm);
}
#blocks input:hover, #blocks select:hover, #blocks textarea:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
#blocks input:focus-visible, #blocks select:focus-visible, #blocks textarea:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
#blocks textarea { min-height: 60px; resize: vertical; width: 100%; }

/* — session content item chrome (drawer redesign, "Workout Builder.dc.html")
   — the shared header strip (drag handle / type icon / label / move+remove
   actions) wrapping every item kind (free text, exercise block, warmup,
   cooldown) in the session builder list. .builder-block keeps its own
   padding at 0 (overriding .card) so .builder-item-head can sit flush
   against the card edges with its own divider; body content goes inside
   .builder-item-body to restore the card's usual internal spacing. */
.builder-block { position: relative; min-width: 0; padding: 0; gap: 0; overflow: hidden; box-shadow: var(--shadow-sm); }
.builder-item-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 8px; border-bottom: 1px solid var(--color-divider); }
.builder-item-drag {
  display: grid; place-items: center; width: 20px; height: 28px; flex: none;
  color: var(--color-neutral-700); cursor: grab; touch-action: none; background: transparent; border: none; padding: 0;
}
.builder-item-drag:hover { color: var(--color-neutral-400); }
.builder-item-drag:active, .builder-item-drag.is-grabbing { cursor: grabbing; }
.builder-item-icon { flex: none; color: var(--color-neutral-500); font-size: 15px; }
.builder-item-label { flex: 1; min-width: 0; font-family: var(--font-heading); font-weight: 500; font-size: 14px; color: var(--color-text); }
.builder-item-letter {
  flex: none; font-family: var(--font-heading); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--radius-sm); color: var(--color-accent-200);
  background: var(--color-accent-900); border: 1px solid var(--color-accent-800);
}
.builder-item-title-input {
  flex: 1; min-width: 0; margin: 0 !important;
  font-family: var(--font-heading) !important; font-weight: 500 !important; font-size: 14px !important; padding: 4px 6px !important;
}
/* Same heading-weight treatment for the exercise-name field inside a
   nested-exercise card - it's a plain <input class="input" ...> with no
   dedicated class today, so it falls through to the generic #blocks input
   rule (13px/400) same as any ordinary field. .exercise-name-row already
   wraps it (see below); target the input directly, same !important
   convention as .builder-item-title-input above for the same reason
   (that generic rule outranks a single class on specificity alone). */
.exercise-name-row > input {
  font-family: var(--font-heading) !important; font-weight: 500 !important; font-size: 14px !important; padding: 4px 6px !important;
}
.builder-item-actions { display: flex; gap: 2px; flex: none; margin-left: auto; }
.builder-item-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.builder-block.is-dragging { opacity: 0.45; }
.builder-block.is-drag-over-before { box-shadow: inset 0 2px 0 0 var(--color-accent); }
.builder-block.is-drag-over-after { box-shadow: inset 0 -2px 0 0 var(--color-accent); }
.nested-exercise.is-dragging { opacity: 0.45; }
.nested-exercise.is-drag-over-before { box-shadow: 0 -2px 0 0 var(--color-accent), inset 0 0 0 1px var(--color-neutral-800); }
.nested-exercise.is-drag-over-after { box-shadow: 0 2px 0 0 var(--color-accent), inset 0 0 0 1px var(--color-neutral-800); }

.exercise-set-fill-row { display: flex; align-items: center; gap: var(--space-2); font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.exercise-set-fill-action {
  font-family: var(--font-heading); font-size: 12px; font-weight: 500; color: var(--color-accent);
  background: transparent; border: 1px solid var(--color-accent-700); border-radius: var(--radius-md);
  padding: 5px 9px; cursor: pointer;
}
.exercise-set-fill-action:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.exercise-add-set-button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-heading); font-size: 12px; font-weight: 500; color: color-mix(in srgb, var(--color-text) 70%, transparent);
  background: transparent; border: 1px dashed var(--color-divider); border-radius: var(--radius-md);
  padding: var(--space-2); cursor: pointer; margin-top: var(--space-1);
}
.exercise-add-set-button:hover { border-color: var(--color-accent); color: var(--color-accent); }

.nested-exercises { display: flex; flex-direction: column; gap: var(--space-3); }
#blocks .nested-exercise { padding: 12px; border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md); background: var(--color-neutral-900); }
.nested-exercise-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.nested-exercise-delete { margin-left: auto; }
.exercise-name-row { display: flex; align-items: center; gap: var(--space-2); }
.exercise-name-row > input { flex: 1 1 auto; min-width: 0; }

.builder-text-override-toggle { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.builder-warmup-categories { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-2); }
.builder-warmup-category { padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-bg); border: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: var(--space-2); }
.builder-warmup-category-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.builder-warmup-duration { max-width: 160px; }
.builder-warmup-items { display: flex; flex-direction: column; gap: 4px; }
.builder-warmup-item-row { display: flex; align-items: center; gap: 6px; }
.builder-warmup-item-row > input { flex: 1 1 0; min-width: 0; }
.builder-cooldown-protocol { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-2); }
.builder-cooldown-protocol-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: color-mix(in srgb, var(--color-text) 60%, transparent); flex-basis: 100%; }
.builder-cooldown-protocol label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.builder-cooldown-protocol input { width: 90px; }

.block-execution-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block-execution-hint, .block-execution-summary { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.circuit-mode-warning { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-warning); margin: var(--space-1) 0; }

.exercise-config-row, .exercise-toolbar-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0; }
.exercise-set-count { display: flex; align-items: center; gap: 6px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.exercise-set-count input { width: 56px; }

.exercise-ladder-control { display: flex; align-items: center; gap: 6px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); margin: var(--space-1) 0 var(--space-2); flex-wrap: wrap; }
.exercise-ladder-label { display: flex; align-items: center; gap: 4px; }
.exercise-ladder-start, .exercise-ladder-end, .exercise-ladder-step { width: 56px; }

.exercise-set-rows { display: flex; flex-direction: column; gap: 4px; flex: 1 1 100%; min-width: 0; }
.exercise-set-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.exercise-set-row > input, .exercise-set-row > select,
.exercise-set-row > span.exercise-set-col { flex: 1 1 0; min-width: 0; }
.exercise-set-row > input.rpe-input,
.exercise-set-row > input[data-set-field="rir"],
.exercise-set-row > span.exercise-set-col-narrow { flex: 0 0 56px; }
.exercise-set-row-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.exercise-set-label-cell { display: flex; align-items: center; gap: 4px; flex: 0 0 64px; }
.exercise-set-label { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.exercise-set-duplicate, .exercise-set-remove {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: color-mix(in srgb, var(--color-text) 60%, transparent); cursor: pointer; flex: none;
}
.exercise-set-duplicate::after, .exercise-set-remove::after {
  content: ''; position: absolute; inset: 50% auto auto 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.exercise-set-duplicate:hover, .exercise-set-remove:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.exercise-set-action-spacer { display: inline-block; width: 24px; flex: none; }
.exercise-computed-kg { font-size: 12px; color: var(--color-accent); white-space: nowrap; }

.exercise-drop-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.exercise-drop-piece {
  display: flex; align-items: center; gap: 4px; padding: 4px 6px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-sm); background: var(--color-bg);
}
.exercise-drop-piece input { width: 52px; }
.exercise-drop-piece.is-rest-segment { border-style: dashed; opacity: 0.85; }
.exercise-drop-piece-delete {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  background: transparent; border: none; color: color-mix(in srgb, var(--color-text) 55%, transparent); cursor: pointer;
}
.exercise-drop-piece-delete::after {
  content: ''; position: absolute; inset: 50% auto auto 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.exercise-drop-piece-delete:hover { color: var(--color-danger); }
.exercise-drop-actions { display: flex; gap: 4px; }
.exercise-drop-action-add, .exercise-drop-action-rest {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  background: transparent; border: 1px dashed var(--color-divider); border-radius: var(--radius-sm);
  color: var(--color-accent); cursor: pointer;
}
.exercise-drop-action-add:hover, .exercise-drop-action-rest:hover { border-color: var(--color-accent); }
.exercise-drop-rest-label { font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.exercise-drop-global-fields { padding-top: var(--space-2); border-top: 1px solid var(--color-divider); }

.exercise-cluster-rounds { display: flex; flex-direction: column; gap: var(--space-2); }
.exercise-cluster-round { padding: var(--space-2); border: 1px solid var(--color-divider); border-radius: var(--radius-sm); }
.exercise-cluster-round-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.exercise-cluster-round-fields { display: flex; gap: 6px; flex-wrap: wrap; }
.exercise-cluster-body { margin-top: var(--space-2); }
.exercise-cluster-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }

.exercise-one-rm-field, .exercise-mode-select { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.exercise-bodyweight-badge { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--color-neutral-800); background: var(--color-neutral-900); color: var(--color-neutral-300); }
.exercise-percent-toggle, .exercise-percent-controls { display: flex; align-items: center; gap: 6px; }
.exercise-create-category, .exercise-create-hint { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }

.exercise-video-button-wrap { flex: none; }
.exercise-video-button {
  width: 40px; height: 40px; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-accent); color: var(--color-bg); border: none; cursor: pointer;
  transition: background-color 0.15s ease;
}
.exercise-video-button:hover { background: var(--color-accent-400); }
.exercise-video-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.exercise-video-button i { font-size: 16px; }

.feedback-summary, .feedback-blocks { display: flex; flex-direction: column; gap: var(--space-2); }
.feedback-block { padding: var(--space-2); border: 1px solid var(--color-divider); border-radius: var(--radius-sm); }
.feedback-exercise { font-size: 13px; margin-bottom: 4px; }
.feedback-metrics { display: flex; gap: var(--space-3); font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.feedback-set, .feedback-circuit-round { font-size: 12px; padding: 2px 0; }

/* ══════════════════════════════════════════════════════════════════════════
   Client workout runner (client-workout-wizard.js, 851 lines) — full-screen
   step wizard. Same reasoning as the coach session builder: exact class
   names (.workout-step, .workout-big-action, .workout-rpe-scale-btn,
   .workout-recap-item, .exercise-validation-actions, is-active/is-complete/
   is-failed/is-valid/is-pending) are hard JS dependencies, kept as-is and
   styled directly. Nav is already hidden for this screen via the
   body:has(.client-workout-wizard) .nav rule added in step 2.
   ══════════════════════════════════════════════════════════════════════ */
.client-workout-wizard { max-width: 640px; margin: 0 auto; }
.client-workout-progress { height: 4px; border-radius: 999px; background: var(--color-neutral-800); overflow: hidden; margin-bottom: var(--space-4); }
.client-workout-progress span { display: block; height: 100%; background: var(--color-accent); }
[data-workout-step] { display: none; }
[data-workout-step].is-active { display: block; }

.workout-cover-main, .workout-cover-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.workout-cover-kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); display: flex; align-items: center; gap: 6px; }
.workout-cover-title { margin: 0; }
.workout-cover-stats { color: color-mix(in srgb, var(--color-text) 60%, transparent); font-size: 13px; }
.workout-cover-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.workout-cover-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.workout-difficulty-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--color-neutral-800); color: var(--color-neutral-100); }
.workout-difficulty-badge.easy { background: var(--color-success-800); color: var(--color-success-100); }
.workout-difficulty-badge.medium { background: var(--color-warning-800); color: var(--color-warning-100); }
.workout-difficulty-badge.hard { background: var(--color-danger-800); color: var(--color-danger-100); }
.workout-big-action { width: 100%; }

.workout-recap-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }
.workout-recap-item, .workout-cover, .workout-recap, .workout-final { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface); }
.workout-recap-item { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3); }
.workout-recap-item-icon { color: color-mix(in srgb, var(--color-text) 45%, transparent); flex: none; margin-top: 2px; }
.workout-recap-item.is-valid .workout-recap-item-icon { color: var(--color-success); }
.workout-recap-item.is-failed .workout-recap-item-icon { color: var(--color-danger); }
.workout-recap-item.is-pending .workout-recap-item-icon { color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.workout-recap-item-copy p { margin: 0; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.workout-step-actions { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
/* .workout-chapter is a mid-workout step: unlike the other .workout-step
   variants it's not one big card — per the approved mockup, the block
   title/subtitle sit at page level and each exercise gets its own card
   (below), so this is just a layout container, no surface of its own. */
.workout-chapter h2 { margin-bottom: var(--space-1); }
.workout-chapter-note {
  white-space: pre-line; font-size: 13px; margin: var(--space-3) 0;
  padding: var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); color: color-mix(in srgb, var(--color-text) 80%, transparent);
}
.block-circuit-banner, .block-execution-banner { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-accent); margin: var(--space-2) 0; }

.workout-checklist { display: flex; flex-direction: column; gap: var(--space-3); }
.workout-checklist-category { padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface); }
.workout-checklist-category-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-1); font-family: var(--font-heading); font-weight: var(--font-heading-weight); }
.workout-checklist-objective { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); margin: 0 0 var(--space-2); }
.workout-checklist-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.workout-checklist-item label { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; padding: 6px 0; cursor: pointer; }
.workout-checklist-item input[type='checkbox'] { flex: none; width: 18px; height: 18px; accent-color: var(--color-accent); }
.workout-checklist-item input[type='checkbox']:checked ~ span { color: color-mix(in srgb, var(--color-text) 50%, transparent); text-decoration: line-through; }

.workout-breathing-protocol { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface); }
.workout-breathing-protocol-values { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-2); font-size: 13px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.workout-breathing-protocol-values strong { color: var(--color-text); font-family: var(--font-heading); }

.circuit-round-group { margin: var(--space-3) 0; }
.circuit-round-group:first-child { margin-top: 0; }
.circuit-round-head { font-family: var(--font-heading); font-weight: var(--font-heading-weight); margin-bottom: var(--space-2); display: flex; align-items: center; gap: 6px; }
.circuit-round-rest { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); display: flex; align-items: center; gap: 6px; margin: var(--space-2) 0; }

.nested-exercise.client-exercise-card {
  padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface); margin-bottom: var(--space-3);
}
.nested-exercise.client-exercise-card:last-child { margin-bottom: 0; }
.client-exercise-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.client-exercise-title-group { display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: 0; }
.client-exercise-name { display: flex; align-items: center; gap: 6px; font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-exercise-index { font-size: 13px; font-weight: 700; color: var(--color-accent); flex: none; }
.client-exercise-meta { display: flex; flex-direction: column; gap: 4px; margin: var(--space-2) 0; }
.client-exercise-prescription, .memory { display: flex; align-items: center; gap: 6px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 65%, transparent); margin: 0; }
.client-exercise-note { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); white-space: pre-line; margin: 0; }

.client-set-card { padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-bg); margin-top: var(--space-2); }
.client-set-card.is-rest-segment { border: 1px dashed var(--color-divider); background: transparent; }
.client-set-card.is-complete { border: 1px solid color-mix(in srgb, var(--color-success) 40%, transparent); }
.client-set-card.is-failed { border: 1px solid color-mix(in srgb, var(--color-danger) 40%, transparent); }
@keyframes highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-warning) 0%, transparent); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-warning) 45%, transparent); }
}
.is-highlight-pulse { animation: highlight-pulse 900ms ease-out; }
.client-set-spec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.client-set-spec-badge { font-size: 12px; font-family: var(--font-heading); font-weight: var(--font-heading-weight); }
.client-set-spec-label { font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.client-set-spec-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-2); }
.client-set-spec-row {
  font-size: 12px; display: flex; align-items: baseline; gap: 4px;
  padding: 4px var(--space-2); border-radius: 999px; background: var(--color-neutral-800);
}
.client-set-spec-row dt { color: color-mix(in srgb, var(--color-text) 55%, transparent); margin: 0; }
.client-set-spec-row dd { margin: 0; font-weight: 600; }
.client-rest-segment-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }

.client-log-section-title { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); margin: var(--space-2) 0 var(--space-1); }
.client-log-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.client-log-field { display: flex; flex-direction: column; gap: 2px; }
.client-log-field-wide { grid-column: 1 / -1; margin-top: var(--space-2); }
.client-log-label { font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.client-log-field input, .client-log-field textarea {
  min-height: 34px; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-sm);
}
.client-log-field input:focus-visible, .client-log-field textarea:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
.client-log-optional { font-weight: 400; color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.client-correction-video { margin-top: var(--space-2); }
.client-correction-video-actions { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.client-correction-video-status { font-size: 12px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }

.exercise-validation-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.exercise-validation-actions button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; border-radius: var(--radius-md); font-family: var(--font-heading);
  font-weight: var(--font-heading-weight); font-size: 13px; cursor: pointer;
}
.exercise-valid { color: var(--color-success); border: 1px solid var(--color-success); background: transparent; }
.exercise-valid:hover { background: color-mix(in srgb, var(--color-success) 12%, transparent); }
.exercise-failed { color: var(--color-danger); border: 1px solid var(--color-danger); background: transparent; }
.exercise-failed:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }

.workout-global-rpe-field { margin-bottom: var(--space-3); }
.workout-final-field-label { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: var(--space-2); }
.workout-rpe-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.workout-rpe-scale-btn {
  min-height: 40px; border-radius: var(--radius-sm); font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  background: var(--color-bg); border: 1px solid var(--color-divider); color: var(--color-text); cursor: pointer;
}
.workout-rpe-scale-btn:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.workout-rpe-scale-btn[aria-checked='true'] { color: var(--color-bg); }
.workout-rpe-scale-btn.rpe-tone-low[aria-checked='true'] { background: var(--color-success); border-color: var(--color-success); }
.workout-rpe-scale-btn.rpe-tone-mid[aria-checked='true'] { background: var(--color-warning); border-color: var(--color-warning); }
.workout-rpe-scale-btn.rpe-tone-high[aria-checked='true'] { background: var(--color-danger); border-color: var(--color-danger); }
.workout-final-comment { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.workout-final-comment textarea {
  min-height: 70px; padding: 8px; font: inherit; font-size: 13px; color: var(--color-text);
  background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: var(--radius-md); resize: vertical;
}

.workout-notice { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--space-4); }
.workout-notice[hidden] { display: none; }
.workout-notice-backdrop { position: absolute; inset: 0; width: 100%; border: none; cursor: pointer; background: color-mix(in srgb, var(--color-neutral-900) 60%, transparent); }
.workout-notice-panel {
  position: relative; width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2);
  padding: var(--space-6); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.workout-notice-icon { font-size: 28px; color: var(--color-warning); }
.workout-notice-kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 55%, transparent); margin: 0; }
.workout-notice-title { margin: 0; }
.workout-notice-message { margin: 0; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.workout-notice-panel .workout-big-action { margin-top: var(--space-2); }

/* — exercise video modal (global, in every page via layout.php) — */
/* Default: a small popover anchored under the play button that opened it (positioned via
   inline top/left set in exercise-video.js), so glancing at a demo clip mid-edit doesn't
   black out the whole builder. Falls back to the original centered/dimmed dialog below
   ANCHORED_MIN_VIEWPORT_WIDTH (exercise-video.js), where there isn't room to anchor. */
.exercise-video-modal.dialog-backdrop[hidden] { display: none; }
/* .dialog-backdrop has no z-index of its own (z-index: auto), so opening this from inside
   the session builder drawer (.client-drawer, z-index: 70) would otherwise paint the video
   behind the drawer — invisible except for the trigger button itself. */
.exercise-video-modal.dialog-backdrop { background: transparent; place-items: initial; padding: 0; z-index: 80; }
.exercise-video-modal.dialog-backdrop.is-centered { background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent); place-items: center; padding: var(--space-4); }
.exercise-video-modal-backdrop { position: absolute; inset: 0; width: 100%; border: none; cursor: pointer; background: transparent; }
.exercise-video-modal-panel { position: fixed; width: min(340px, calc(100vw - 32px)); padding: 0; overflow: hidden; box-shadow: var(--shadow-lg); }
.exercise-video-modal.is-centered .exercise-video-modal-panel { position: relative; width: min(720px, 100%); }
.exercise-video-modal-close { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 1; background: var(--color-neutral-900); }
.exercise-video-modal-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--color-bg); }
.exercise-video-modal-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* — welcome / onboarding wizard — */
.welcome-wizard { max-width: 480px; margin: 0 auto; }
.welcome-wizard-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--color-neutral-800); }
.welcome-wizard-dot.is-active { background: var(--color-accent); }
.welcome-wizard-dot.is-complete { background: color-mix(in srgb, var(--color-accent) 50%, transparent); }

.avatar-capture.welcome-avatar-capture {
  position: relative; width: 120px; height: 120px; border-radius: 999px; overflow: hidden;
  background: var(--color-neutral-800); margin: 0 auto;
}
.welcome-avatar-capture img, .welcome-avatar-capture video { width: 100%; height: 100%; object-fit: cover; display: block; }
.welcome-avatar-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: color-mix(in srgb, var(--color-text) 45%, transparent);
}
.welcome-avatar-capture img[src=""], .welcome-avatar-capture img:not([src]) { display: none; }

/* — choice card — same base+selected treatment as .wellness-rag-choice —
   a real radio, styled as a full-width choice row */
.welcome-choice-card {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid var(--color-divider); cursor: pointer;
}
.welcome-choice-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.welcome-choice-card:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.welcome-choice-card:has(input:checked) { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.welcome-choice-card:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.welcome-input-with-suffix .row { align-items: center; }
.welcome-input-with-suffix input.input { flex: 1; }

/* — coach video feedback panel (coach-video-feedback.js, injected into
   [data-feedback-panel] inside the session builder drawer) — */
.coach-video-feedback { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-bg); }
.coach-video-feedback-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.coach-video-feedback-eyebrow { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-accent); }
.coach-video-feedback-badge { font-size: 10px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--color-neutral-800); color: var(--color-neutral-100); }
.coach-video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--color-neutral-900); }
.coach-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.coach-video-feedback-hint { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.coach-feedback-field { display: flex; flex-direction: column; gap: 4px; }
.coach-feedback-label { font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.coach-voice-player-wrap audio { width: 100%; }
.coach-voice-toolbar { display: flex; align-items: center; gap: var(--space-2); }
.coach-video-feedback.is-recording .coach-voice-record { color: var(--color-danger); border-color: var(--color-danger); }
.coach-video-feedback-footer { display: flex; justify-content: flex-end; }

.coach-feedback-toast-host { position: fixed; bottom: var(--space-4); right: var(--space-4); z-index: 100; }
.coach-feedback-toast {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-neutral-900);
  box-shadow: var(--shadow-md); font-size: 13px; opacity: 0; transform: translateY(8px); transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.coach-feedback-toast.is-visible { opacity: 1; transform: translateY(0); }
.coach-feedback-toast.is-success { color: var(--color-success); }
.coach-feedback-toast.is-error { color: var(--color-danger); }

/* — route hairline — a slim always-in-DOM bar fixed to the viewport top,
   shown the instant a real navigation starts (app.js adds is-navigating
   immediately, before the heavier .app-loader below is even considered) —
   Nocturne design-system project, "Screen Transition.dc.html". Unlike
   .app-loader it is never delayed, so it's the one loading signal that's
   "always on during navigation, even when the overlay stays away". */
.route-hairline { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1001; overflow: hidden; opacity: 0; transition: opacity 160ms ease; pointer-events: none; }
body.is-navigating .route-hairline, body.is-loading .route-hairline, body.is-transitioning .route-hairline { opacity: 1; }
.route-hairline span {
  display: block; width: 33%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  animation: noct-sweep 1.15s cubic-bezier(.5,0,.5,1) infinite;
}

/* — app loader — full-page overlay shown while body carries is-loading/
   is-transitioning (app.js). Stays in the DOM at all times, opacity-faded,
   the same technique the pre-Nocturne version used. app.js only adds
   is-transitioning after a short delay (fast actions never show it —
   the button's own pending state and the hairline above are enough). */
.app-loader {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--color-bg); opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
body.is-loading .app-loader, body.is-transitioning .app-loader { opacity: 1; pointer-events: auto; }
.app-loader-panel { position: relative; width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--space-5); text-align: center; }
.app-loader-glow {
  position: absolute; top: 50%; left: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px;
  border-radius: 999px; background: radial-gradient(circle, var(--color-accent-800), transparent 62%);
  animation: noct-glow 1.6s ease-in-out infinite;
}
.app-loader-tempo { position: relative; display: flex; align-items: flex-end; gap: 7px; height: 44px; }
.app-loader-tempo span {
  width: 5px; height: 100%; border-radius: 999px; transform-origin: bottom;
  background: linear-gradient(180deg, var(--color-accent-300), var(--color-accent-600));
  animation: noct-tempo 1.15s cubic-bezier(.4,0,.6,1) infinite;
}
.app-loader-tempo span:nth-child(1) { animation-delay: 0ms; }
.app-loader-tempo span:nth-child(2) { animation-delay: 110ms; }
.app-loader-tempo span:nth-child(3) { animation-delay: 220ms; background: linear-gradient(180deg, var(--color-accent-200), var(--color-accent-500)); }
.app-loader-tempo span:nth-child(4) { animation-delay: 330ms; }
.app-loader-tempo span:nth-child(5) { animation-delay: 440ms; }
.app-loader-panel small { position: relative; font-family: var(--font-heading); font-size: 13px; font-weight: var(--font-heading-weight); letter-spacing: 0.02em; color: var(--color-text); }
.app-loader-rule { width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--color-neutral-700), transparent); }
@keyframes noct-tempo { 0%, 100% { transform: scaleY(0.28); opacity: 0.35; } 45% { transform: scaleY(1); opacity: 1; } }
@keyframes noct-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@keyframes noct-glow { 0%, 100% { opacity: 0.25; transform: scale(0.9); } 50% { opacity: 0.6; transform: scale(1.06); } }
@keyframes noct-shimmer { 0% { background-position: -220% 0; } 100% { background-position: 220% 0; } }

/* — calendar infinite-scroll sentinel — client-calendar-infinite.js already
   toggles is-loading on the past/future sentinels while fetching more
   weeks; this is the one place in the app that appends real data into an
   existing list, so it's the one real fit for the design system's
   skeleton-shimmer pattern (the list's own chrome stays, rows fill in). */
[data-calendar-sentinel].is-loading {
  height: 3px; border-radius: 999px; margin: var(--space-2) 0;
  background: linear-gradient(90deg, var(--color-neutral-900) 30%, var(--color-neutral-800) 50%, var(--color-neutral-900) 70%);
  background-size: 220% 100%; animation: noct-shimmer 1.5s linear infinite;
}

/* — program week board (program-template-builder.js) — same shape as the
   client calendar's week board, different class names since it's a
   separate JS-generated tree; aliased to the same tokens/treatment rather
   than duplicated ad hoc. */
.program-week-tab {
  padding: var(--space-2) var(--space-3); font-size: 13px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--color-divider); color: var(--color-text); cursor: pointer;
}
.program-week-tab:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.program-week-tab.is-active { border-color: var(--color-accent); color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.program-week-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-3); align-items: start; margin-top: var(--space-3); }
.program-day-column { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.program-day-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.program-day-note {
  width: 100%; min-height: 26px; padding: 2px 4px; font: inherit; font-size: 11px; color: var(--color-text);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
}
.program-day-note:hover, .program-day-note:focus-visible { border-color: var(--color-divider); outline-offset: 0; }
.program-day-sessions { display: flex; flex-direction: column; gap: var(--space-2); min-height: 24px; }
.program-session-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface); }
.program-session-card-head { display: flex; flex-direction: column; gap: 2px; }
.program-session-card-head strong { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 13px; }
.program-session-card-head span { font-size: 10px; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.program-session-card.easy .program-session-card-head span { color: var(--color-success); }
.program-session-card.medium .program-session-card-head span { color: var(--color-warning); }
.program-session-card.hard .program-session-card-head span { color: var(--color-danger); }
.program-session-card-actions { display: flex; justify-content: flex-end; gap: 4px; }

