/* Pure Focus app - DARK SYSTEM. Brand brief compliance:
   - Canvas #030303, warm cards #1b1815, gold #b47e37.
   - Unbounded for headlines, Mulish for body.
   - NO gradients, NO shadows, NO neon. Thin hairline borders only. */

/* BL-16b (2026-05-16) perf — Google Font @imports moved to <link rel="stylesheet">
   in base.html <head>. Loading via @import here was render-blocking sequential
   (browser downloads app.css → parses → discovers @import → downloads font CSS
   → downloads font files). Parallel <link> tags in <head> cut ~300-500ms off
   first paint on mobile. Same fonts, same weights, identical visuals. */

:root {
  --canvas: #030303;
  --warm: #1b1815;
  --warm-raised: #2b2520;
  --hairline: #2b2520;
  --hairline-dim: #1f1c19;
  --text: #fdfdff;
  --text-secondary: #c2bfbc;
  --text-dim: #8a8785;
  --gold: #b47e37;
  --gold-hi: #d8b58f;
  --red: #e93d3d;   /* anti-pattern only */
  --radius: 4px;    /* flat, minimal */
  --radius-card: 8px;
  /* Top-header height. Single source of truth so msg-wrap / chat-wrap can
     subtract the right amount from 100dvh on every body+viewport combo.
     Adjusted by media-query overrides below. */
  --pf-header-h: 56px;
}
/* Mobile, client (or unauthenticated): header is single-row, ~52px */
@media (max-width: 768px) {
  :root { --pf-header-h: 52px; }
}
/* Mobile, coach: header is two rows (brand + horizontal nav), ~84px measured.
   This MUST match the actual computed height of body.coach-body header.top
   on mobile - if the header layout changes, bump this. */
@media (max-width: 768px) {
  body.coach-body { --pf-header-h: 84px; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Bundle AB-2 (2026-04-30) — Global native-form-box purge.
   Project-wide sweep extending Bundle AA-1: every coach + client
   surface had bare <input>, <select>, <textarea> elements rendering
   the default browser white-pill / grey-1px-border look. Manou
   flagged this as breaking the smoky-dark + gold + Fraunces/Inter
   design system across many routes (account, integrations,
   meal_library, daily_system_edit, diet_plan_edit, programme_*,
   workout_session, scheduler, supplements_edit, exercise_library,
   onboarding, body_stats, food, etc).

   FIX: a single low-specificity baseline that styles ALL native
   form elements with the smoky-dark + gold treatment. Component-
   specific rules further down the cascade (.field, .pd-meta,
   .ex-cardio-fields, .meal-form, .sch-field, etc) override as
   needed — they have higher specificity OR come later in source
   order. This means EVERY current and future bare input/select/
   textarea is automatically safe.

   Excludes: type=checkbox, type=radio, type=range, type=color,
   type=file, type=image, type=submit, type=reset, type=button —
   those have their own visual semantics. type=hidden is excluded
   automatically because it's display:none.

   Verified Bundle AA-1 .pd-meta + .prog-sched-* rules sit further
   down and continue to override (lines 11200+).
   ============================================================ */
/* Selector specificity note: we use :not() with a comma-list inside,
   which CSS treats as the highest-specificity argument => `[type=...]` =>
   (0,1,0). Combined with the bare `input` element => total (0,1,1). That
   is INTENTIONALLY at-or-just-above bare element specificity but BELOW
   any `.field input[type=...]` rule (0,1,1 + class = 0,2,1) so component-
   specific rules continue to override. Older browsers without :not(list)
   support (pre-Safari 14, Chrome 87 minus) gracefully fall back to the
   `input, select, textarea` shorthand below — checkbox/radio inputs
   would then ALSO get the dark treatment, which is a non-issue because
   everywhere we use checkboxes they're hidden or have their own .auth-
   remember / .ex-muscle-opt overrides. */
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"], [type="submit"], [type="reset"], [type="button"]),
select,
textarea {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(180, 126, 55, 0.20);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  outline: none;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  transition: border-color .14s ease, background .14s ease;
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"], [type="submit"], [type="reset"], [type="button"]):focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"], [type="submit"], [type="reset"], [type="button"])::placeholder,
textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.85;
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"], [type="submit"], [type="reset"], [type="button"]):disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* iOS Safari: kill default rounded white look on date/time/search inputs. */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="search"] {
  background: rgba(0, 0, 0, 0.30);
  color: var(--text);
}
/* Custom select arrow — replaces native white dropdown caret with a gold
   chevron drawn via SVG data-uri. Works in Chrome/Safari/Firefox. */
select {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23b47e37' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px 7px;
  padding-right: 34px;
}
select::-ms-expand { display: none; }
/* <option> dropdown menu: native OS-controlled in most browsers; the best
   we can do is set the dark colors so on browsers that respect them
   (Firefox, recent Chrome) the menu reads dark. iOS Safari ignores. */
select option {
  background: #1b1815;
  color: var(--text);
}
/* Webkit search inputs ship with a magnifying glass + cancel cross by
   default — kill them so the search field matches the input baseline. */
input[type="search"] {
  -webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}
/* Number-input spinners on Firefox + Webkit: keep default, just colour them. */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.5;
}
/* Autofill: Chrome/Safari paint the input yellow on autofill. Force the
   smoky-dark colours via an absurd inset-shadow trick. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.30) inset;
  caret-color: var(--text);
  border-color: rgba(180, 126, 55, 0.20);
}
/* Reusable utility classes — coach + client templates that want the
   baseline by name (e.g. for clarity or future bundles) can use these.
   Identical to the bare baseline above. */
.pf-input,
.pf-select,
.pf-textarea {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(180, 126, 55, 0.20);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  transition: border-color .14s ease, background .14s ease;
}
.pf-input:focus,
.pf-select:focus,
.pf-textarea:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
}
/* End Bundle AB-2 baseline. */
/* Bundle Z (2026-04-30): kill iOS Safari/Chrome pull-to-refresh elastic
   bounce that was sucking the fixed bottom-tabs UP into the viewport
   when the user dragged the page down. `overscroll-behavior-y: contain`
   on body+html stops the gesture from chaining to the browser-native
   pull-to-refresh AND stops the body's overscroll glow from animating
   the fixed children. The fixed `.bottom-tabs` is anchored to
   visualViewport via `--pf-vv-offset` so it's not affected by body
   scroll regardless. See Bundle Z brief Bug 2. */
html, body {
  /* Bundle AA (2026-04-30) — `none` is stronger than `contain`. `none`
     disables BOTH the rubberband bounce AND the chained pull-to-refresh that
     pulls the fixed bottom-tabs up. iOS 16+ honors this; older WebKit ignores
     gracefully. See AA-7. */
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

h1, h2, h3, h4, .display {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 32px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 28px 0 12px; font-weight: 500; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
p, li { color: var(--text-secondary); }
p.sub { color: var(--text-dim); margin: 0 0 24px; }

a { color: var(--gold-hi); text-decoration: none; }
a:hover { color: var(--gold); }

.gold { color: var(--gold); }
.gold-hi { color: var(--gold-hi); }

/* --- Top header ---
   Bundle Z (2026-04-30): safe-area-inset-top ensures the logo doesn't
   collide with the iOS status bar (battery / time) on installed PWAs +
   black-translucent status-bar style. Uses env() with fallback 0 so it's
   a no-op outside of iOS standalone. See feedback Bug 1 in Bundle Z. */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  border-bottom: 1px solid var(--hairline-dim);
  background: var(--canvas);
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
}
header.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
header.top .brand img {
  height: 26px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);  /* logo PNG is dark; invert for dark bg */
  opacity: 0.95;
}
header.top nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
header.top nav a {
  color: var(--text-dim);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: color 180ms;
}
header.top nav a:hover { color: var(--text); text-decoration: none; }
header.top nav a.active { color: var(--text); }

/* Hide top nav links on mobile - bottom tab handles it for clients.
   Coaches keep the top nav (they have no bottom-tab equivalent), with
   horizontal scroll for the 6 items on narrow screens. */
@media (max-width: 768px) {
  body:not(.coach-body) header.top nav a.nav-item { display: none; }
  body.coach-body header.top {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 6px;
  }
  body.coach-body header.top nav {
    width: 100%;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  body.coach-body header.top nav::-webkit-scrollbar { display: none; }
  body.coach-body header.top nav a.nav-item {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 10px;
  }
  body.coach-body header.top nav a.nav-item.active {
    background: rgba(180, 126, 55, 0.12);
    color: var(--gold);
  }
}

/* --- Bottom tab bar (mobile, client-only) ---
   Bundle X (2026-04-30): iOS Chrome shows a sticky bottom install-prompt
   that doesn't shrink the layout viewport — so `bottom: 0` ends up BEHIND
   the prompt with a visible gap to the user. Fix: anchor to the visual
   viewport's actual bottom via `--pf-vv-offset` (set by a small resize
   listener in base.html). When no prompt is showing, the offset is 0 and
   the tab bar pins to the safe-area edge as before. When a prompt eats
   ~100px from the bottom, the offset becomes that height and the tab bar
   sits flush above the prompt — no gap.
   See feedback_real_device_qa_required.md (bottom-nav detachment).
*/
.bottom-tabs {
  display: none;
  position: fixed;
  /* visualViewport offset (px) — JS updates this on resize/scroll. 0 in
     the no-prompt baseline. */
  bottom: var(--pf-vv-offset, 0px);
  left: 0;
  right: 0;
  background: var(--canvas);
  border-top: 1px solid var(--hairline-dim);
  z-index: 10;
  /* env(safe-area-inset-bottom) is still applied so iOS Safari home-bar
     spacing stays correct. When the install prompt shows, vv-offset
     dominates and safe-area effectively folds into the prompt's own
     padding (the prompt sits below the tab bar). */
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
  transition: bottom .14s ease;
  /* Bundle AA (2026-04-30) — force own GPU compositor layer so iOS Safari's
     pull-to-refresh elastic bounce can't drag the fixed nav with it. The
     translateZ(0) hint pins it to the layout viewport, not the visual one.
     See AA-7 in feedback ledger. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: bottom;
  backface-visibility: hidden;
}
@media (max-width: 768px) {
  .bottom-tabs.visible { display: flex; }
  /* Reserve scroll-padding equal to nav height + visualViewport offset so
     the user can scroll the page content up past whatever the prompt
     covers. dvh (dynamic viewport height) handles browser-bar autohide
     across iOS Safari + iOS Chrome — vh would be wrong on both. */
  body:has(.bottom-tabs.visible) main {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0) + var(--pf-vv-offset, 0px));
    min-height: 100dvh;
  }
  /* Fallback for browsers without :has() */
  main {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0) + var(--pf-vv-offset, 0px));
  }
}
.bottom-tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 0;
  letter-spacing: 0.04em;
}
.bottom-tabs a.active { color: var(--gold); }
.bottom-tabs a svg { width: 22px; height: 22px; stroke-width: 1.8; fill: none; stroke: currentColor; }

/* --- Main layout --- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* --- Cards --- */
.card {
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  border-radius: var(--radius-card);
  padding: 20px;
  margin: 12px 0;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.card .value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 30px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
}
.card .unit { font-size: 14px; color: var(--text-dim); margin-left: 4px; font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
.card .meta { color: var(--text-dim); font-size: 12px; margin-top: 6px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

/* --- Action tiles (dashboard quick access) --- */
.action-tile {
  display: block;
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  border-radius: var(--radius-card);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 200ms, background 200ms;
}
.action-tile:hover {
  border-color: var(--gold);
  background: var(--warm-raised);
  text-decoration: none;
  color: var(--text);
}
.action-tile .tile-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--gold);
}
.action-tile .tile-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 4px;
}
.action-tile .tile-sub { font-size: 13px; color: var(--text-dim); }
.action-tile .tile-badge {
  display: inline-block;
  margin-left: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--gold);
  color: var(--canvas);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* --- Brief --- */
.brief {
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  border-left: 2px solid var(--gold);
  padding: 20px 24px;
  border-radius: var(--radius-card);
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text-secondary);
}
.brief h3 { color: var(--text-dim); margin: 0 0 12px; }

/* --- Buttons - gold pill, black text, no shadow --- */
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--canvas);
  border: 0;
  border-radius: 999px;
  padding: 12px 28px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 180ms;
}
.btn:hover { background: var(--gold-hi); text-decoration: none; color: var(--canvas); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
}
.btn.secondary:hover { background: var(--warm); border-color: var(--gold); color: var(--text); }
.btn.block { display: block; width: 100%; }
.btn.small { padding: 8px 18px; font-size: 13px; }

/* --- Forms --- */
.field { margin: 16px 0; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.field input[type=email],
.field input[type=text],
.field input[type=number],
.field input[type=password],
.field input[type=tel],
.field input[type=url],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--warm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 180ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
}

/* --- Auth page --- */
.auth-wrap {
  max-width: 420px;
  margin: 8vh auto;
  padding: 40px 24px;
  text-align: center;
}
.auth-tabs {
  display: flex;
  gap: 2px;
  margin: 24px 0 20px;
  padding: 4px;
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  border-radius: 999px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: color 180ms, background 180ms;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.on { color: var(--canvas); background: var(--gold); }
.auth-form { text-align: left; }
.auth-form .field { margin: 14px 0; }
.auth-form .field label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500;
}
.auth-remember {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-dim); margin: 12px 0 16px;
  cursor: pointer;
  user-select: none;
}
.auth-remember input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}
@media (max-width: 600px) {
  .auth-wrap { padding: 24px 18px; margin: 4vh auto; }
}
.auth-wrap .brand-mark {
  margin-bottom: 18px;
}
.auth-wrap .brand-mark img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.96;
}
.auth-wrap .tagline {
  color: var(--text-dim);
  margin-bottom: 40px;
  font-size: 15px;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-card);
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
  /* Long error strings (HTTP errors, untrimmed names, URLs) used to push past
     the card on small screens. These three lines force them to wrap inside. */
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.flash.success { background: rgba(180, 126, 55, 0.08); color: var(--gold); border-color: rgba(180, 126, 55, 0.3); }
.flash.error   { background: rgba(233, 61, 61, 0.08); color: var(--red); border-color: rgba(233, 61, 61, 0.3); }
/* Soft amber note — for "I assumed X" warnings that aren't failures. Reads
   as helpful context, not a blocker. Used in /food preview-warnings. */
.flash.info    { background: rgba(244, 236, 220, 0.04); color: rgba(244, 236, 220, 0.78); border-color: rgba(180, 126, 55, 0.18); }

/* --- Status pills --- */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--warm);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  border: 1px solid var(--hairline);
}
.status-badge.connected { color: var(--gold); border-color: rgba(180, 126, 55, 0.35); }
.status-badge.disconnected { color: var(--text-dim); }
.stale { color: var(--text-dim); font-size: 12px; }

/* --- AI coach chat (kept, restyled) --- */
.chat-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--pf-header-h, 56px));
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 15px;
}
.msg.user {
  background: var(--gold);
  color: var(--canvas);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;  /* user text is plain, preserve newlines */
}
.msg.assistant {
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.msg.refusal { border-color: var(--red); }

/* Assistant markdown body: paragraphs/lists/headings render cleanly.
   No top margin on the first block - the bubble's own padding handles it. */
.msg.assistant > *:first-child { margin-top: 0; }
.msg.assistant > *:last-child { margin-bottom: 0; }
.msg.assistant p { margin: 0 0 10px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  margin: 14px 0 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.msg.assistant ul, .msg.assistant ol {
  margin: 4px 0 10px;
  padding-left: 22px;
}
.msg.assistant li { margin: 2px 0; }
.msg.assistant li + li { margin-top: 3px; }
.msg.assistant strong { font-weight: 700; color: var(--text); }
.msg.assistant em { font-style: italic; }
.msg.assistant code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hairline-dim);
  padding: 1px 6px;
  border-radius: 5px;
}
.msg.assistant pre {
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hairline-dim);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
.msg.assistant pre code {
  background: none; border: 0; padding: 0; border-radius: 0;
}
.msg.assistant a { color: var(--gold); text-decoration: underline; }
.msg.assistant a:hover { color: var(--gold-hi); }
.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 0 20px;
  border-top: 1px solid var(--hairline-dim);
}
.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: var(--warm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.chat-input input:focus { outline: none; border-color: var(--gold); }

/* --- Premium "live coach" thinking + typing indicator ---------------------
   Replaces the old static "..." bubble. While the model spins up + deliberates
   the bubble shows a breathing gold orb, a wave of dots, and a rotating status
   line (driven by chat.js). The first answer token swaps this for live typing
   with a blinking caret, so the wait reads as the coach actively working. */
.msg.assistant.is-thinking {
  padding: 13px 16px;
}
.coach-think {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 20px;
}
.coach-think-orb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, var(--gold-hi, #d6a25a), var(--gold) 65%, rgba(180,126,55,0.55));
  box-shadow: 0 0 0 0 rgba(180, 126, 55, 0.45);
  animation: coachOrbBreathe 1.7s ease-in-out infinite;
}
.coach-think-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.coach-think-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.55;
  animation: coachDotWave 1.2s ease-in-out infinite;
}
.coach-think-dots i:nth-child(2) { animation-delay: 0.15s; }
.coach-think-dots i:nth-child(3) { animation-delay: 0.3s; }
.coach-think-label {
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  /* Subtle left-to-right shimmer sweep across the text. Falls back to a flat
     text-secondary colour where background-clip:text isn't supported. */
  background: linear-gradient(100deg,
    var(--text-secondary) 0%, var(--text-secondary) 35%,
    var(--gold-hi, #d6a25a) 50%,
    var(--text-secondary) 65%, var(--text-secondary) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: coachLabelShimmer 2.6s linear infinite;
  transition: opacity 0.2s ease;
}
.coach-think-label.fading { opacity: 0; }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .coach-think-label { -webkit-text-fill-color: currentColor; color: var(--text-secondary); }
}
.coach-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  border-radius: 1px;
  background: var(--gold);
  vertical-align: text-bottom;
  animation: coachCaretBlink 1s steps(1, end) infinite;
}
@keyframes coachOrbBreathe {
  0%, 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(180, 126, 55, 0.45); }
  50%      { transform: scale(1.12); box-shadow: 0 0 10px 3px rgba(180, 126, 55, 0); }
}
@keyframes coachDotWave {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  40%      { transform: translateY(-3px); opacity: 1; }
}
@keyframes coachLabelShimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes coachCaretBlink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .coach-think-orb, .coach-think-dots i, .coach-think-label, .coach-caret {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .coach-caret { opacity: 1; }
}

/* --- Coach queue --- */
.queue-item {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 16px;
  margin: 10px 0;
}
.queue-item .cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}
.queue-item .client { color: var(--text-dim); font-size: 13px; margin-top: 8px; }
.queue-item .msg-client { margin: 8px 0; padding: 10px 12px; background: var(--canvas); border-radius: 6px; }
.queue-item .msg-draft { margin: 8px 0; padding: 10px 12px; background: rgba(180, 126, 55, 0.06); border-radius: 6px; font-size: 14px; color: var(--text-secondary); }
.queue-item .actions { margin-top: 12px; display: flex; gap: 8px; }
.queue-item .actions button { font-size: 13px; padding: 8px 16px; }

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  padding: 40px 20px;
  letter-spacing: 0.04em;
}
footer a { color: var(--text-dim); }

/* ===================================================================
   MOBILE POLISH - majority of users are on phones. Hyper-optimized.
   =================================================================== */

/* Prevent iOS Safari from zooming form fields on focus (requires >=16px) */
@media (max-width: 768px) {
  .field input[type=email],
  .field input[type=text],
  .field input[type=number],
  .field input[type=date],
  .field input[type=password],
  .field textarea,
  .field select,
  .chat-input input { font-size: 16px !important; }
}

/* Recipient toggle host on /chat — keeps tabs centered + width-capped without
   forcing a full-height column (msg-wrap.client-view used to wrap them and
   stole the viewport, pushing chat-wrap behind bottom-tabs on mobile). */
.chat-recipient-host {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Use dvh where supported (iOS Safari collapsing bottom bar) */
.chat-wrap { height: calc(100dvh - var(--pf-header-h, 56px)); }

/* On mobile, the bottom-tabs nav (~78px + safe-area) is fixed over the
   viewport, AND the recipient tabs (~70px) sit above .chat-wrap in normal
   flow. Subtract both or the compose bar hides behind the bottom-tabs. */
@media (max-width: 768px) {
  .chat-wrap {
    height: calc(100dvh - var(--pf-header-h, 56px) - 70px - 78px - env(safe-area-inset-bottom, 0));
  }
  .chat-input { padding-bottom: 12px; }
}

/* Dashboard + tile grid stacks to 1 col on narrow phones; 2 cols on wider phones */
@media (max-width: 500px) {
  .grid { grid-template-columns: 1fr; }
}
@media (min-width: 501px) and (max-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tighten main padding + typography on phone */
@media (max-width: 600px) {
  main { padding: 20px 16px 100px; }
  h1 { font-size: 26px; }
  h2 { font-size: 17px; margin: 24px 0 10px; }
  .card { padding: 16px; margin: 10px 0; }
  .card .value { font-size: 26px; }
  .action-tile { padding: 16px; }
  .action-tile .tile-title { font-size: 15px; }
  .action-tile .tile-sub { font-size: 12px; }
  .action-tile .tile-icon { width: 30px; height: 30px; margin-bottom: 8px; }
  .btn { padding: 13px 24px; font-size: 15px; min-height: 44px; }
  .btn.block { padding: 14px 24px; }
  /* Bundle AA (2026-04-30) — must include env(safe-area-inset-top) so the
     iOS status bar (battery / time) doesn't clip the logo on mobile/PWA.
     Without this the previous `padding: 12px 16px` ate Bundle Z's safe-area
     fallback and caused AA-6 regression. */
  header.top {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
  }
  header.top .brand img { height: 22px; }
  .chat-wrap { padding: 0 12px; }

  /* Integration cards: Connect/Disconnect buttons were too imposing on phone.
     Smaller, denser tap targets (still ≥38px high — good for thumbs). */
  .integ-actions { gap: 10px; }
  .integ-actions .btn { padding: 9px 16px; font-size: 13px; min-height: 38px; }
  .integ-actions .btn.secondary { padding: 9px 14px; }
}

/* Very narrow screens (iPhone SE, etc.) */
@media (max-width: 380px) {
  main { padding: 16px 12px 100px; }
  h1 { font-size: 22px; }
  .card { padding: 14px; }
  .btn { padding: 12px 20px; font-size: 14px; }
}

/* Bigger bottom tabs on phone (tap targets 56px) */
@media (max-width: 768px) {
  .bottom-tabs { padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0)); }
  .bottom-tabs a { padding: 8px 0; font-size: 10px; letter-spacing: 0.06em; min-height: 48px; }
  .bottom-tabs a svg { width: 24px; height: 24px; }
  /* Leave room for bottom tabs */
  main { padding-bottom: 100px; }
}

/* Prevent horizontal scroll from wide content */
body { overflow-x: hidden; }
main { overflow-x: visible; }
img, video, iframe { max-width: 100%; height: auto; }

/* Push-notification prompt (shown above compose bar on messages screens) */
.push-prompt {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--gold);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
  animation: pfPromptIn 320ms cubic-bezier(.2,.8,.2,1);
}
@keyframes pfPromptIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.push-prompt-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.push-prompt-body strong {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500;
  font-size: 13px; color: var(--text);
}
.push-prompt-body span { color: var(--text-dim); font-size: 12px; }
.push-prompt-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.push-dismiss {
  background: transparent; border: none;
  color: var(--text-dim); cursor: pointer; padding: 6px 10px;
  font-size: 20px; line-height: 1;
}
.push-dismiss:hover { color: var(--text); }
@media (max-width: 600px) {
  .push-prompt { bottom: calc(150px + env(safe-area-inset-bottom, 0)); }
}

/* Message preview cards on dashboard (Trainerize-style) */
.msg-preview-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 24px; }
.msg-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--panel, #1b1815);
  border: 1px solid var(--border, #2a2622);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background 150ms, border-color 150ms;
}
.msg-preview-card:hover { background: #201c19; border-color: var(--accent, #b47e37); }
.msg-preview-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent, #b47e37);
  color: #030303;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
}
.msg-preview-avatar svg { color: #030303; stroke: #030303; }
.msg-preview-main { flex: 1; min-width: 0; }
.msg-preview-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.msg-preview-name { font-weight: 600; font-size: 15px; color: var(--text, #f4f0e8); }
.msg-preview-time { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.msg-preview-body {
  font-size: 14px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.msg-preview-badge {
  flex-shrink: 0;
  background: var(--accent, #b47e37);
  color: #030303;
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 520px) {
  .msg-preview-card { padding: 14px; gap: 12px; }
  .msg-preview-avatar { flex-basis: 40px; width: 40px; height: 40px; }
  .msg-preview-name { font-size: 14px; }
  .msg-preview-body { font-size: 13px; }
}

/* --- btn-link (text-style button, used in account / integrations) --- */
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}
.btn-link:hover { text-decoration: underline; }

/* --- Integrations page --- */
/* PWA install banner — fixed strip near the bottom of the viewport, above
   the bottom-tabs nav. Stays out of the way until the user is engaged. */
.pwa-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0));
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--warm);
  border: 1px solid rgba(180, 126, 55, 0.35);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  max-width: 480px;
  margin: 0 auto;
}
.pwa-install-banner[hidden] { display: none !important; }
.pwa-install-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-install-text strong { font-size: 14px; color: var(--text); }
.pwa-install-text span { font-size: 12px; color: var(--text-dim); }
.pwa-install-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
@media (max-width: 768px) {
  /* Bump banner above the bottom-tabs (~96px tabs+safe-area) */
  .pwa-install-banner { bottom: calc(96px + env(safe-area-inset-bottom, 0)); }
}

/* Universal avatar — used by base header, coach client list, message rows.
   Renders either an <img> (real upload) or a centered initial. */
.pf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--canvas);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.pf-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pf-avatar[data-initial="1"] {
  /* Slight gradient so the orange circle has more depth */
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hi, #d4a06a) 100%);
}

/* Account page — avatar uploader card */
.account-avatar-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  margin: 16px 0;
}
.account-avatar-card .av-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-avatar-card .av-flash { min-height: 18px; font-size: 13px; color: var(--text-dim); }
.account-avatar-card .av-flash.ok { color: #6cd49a; }
.account-avatar-card .av-flash.err { color: #f87171; }

/* Account page — on-brand toast (replaces native alert; aligns with
   feedback_no_native_popups + Pure Focus dark aesthetic). */
.acct-toast {
  position: sticky;
  top: calc(var(--pf-header-h, 56px) + 8px);
  z-index: 9;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: var(--warm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  transition: opacity 180ms ease;
}
.acct-toast.ok {
  border-color: rgba(180, 126, 55, 0.4);
  background: rgba(180, 126, 55, 0.08);
  color: var(--gold-hi);
}
.acct-toast.err {
  border-color: rgba(233, 61, 61, 0.4);
  background: rgba(233, 61, 61, 0.08);
  color: #f87171;
}
.acct-pending {
  padding: 12px 14px;
  border: 1px dashed rgba(180, 126, 55, 0.4);
  border-radius: var(--radius-card);
  background: rgba(180, 126, 55, 0.04);
  margin: 8px 0 4px;
}
/* Disabled-input style so the read-only "current email" looks intentional
   instead of broken. */
.field input[disabled] {
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.25);
  cursor: not-allowed;
}

.integ-block { margin-bottom: 16px; }
.integ-group-h {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 28px 0 10px;
  font-weight: 500;
}
.integ-group-h:first-of-type { margin-top: 8px; }
.integ-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}
.integ-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.integ-id {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}
.integ-id h3 { margin: 0 0 2px; font-size: 17px; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
.integ-id .meta { color: var(--text-dim); font-size: 13px; }
.integ-state { flex-shrink: 0; }
.integ-meta {
  color: var(--text-dim);
  font-size: 13px;
  margin: 4px 0 12px;
}
.integ-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.integ-guide {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}
.integ-guide ol { padding-left: 22px; margin: 4px 0; }
.integ-guide li { margin-bottom: 6px; }
.integ-guide .meta { color: var(--text-dim); font-size: 12px; margin-top: 8px; }

/* --- Paste-API-key form (Rize) --- */
.integ-key-form { margin-top: 12px; }
.integ-key-label {
  display: block; margin-bottom: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-dim);
}
.integ-key-row { display: flex; gap: 8px; align-items: center; }
.integ-key-input {
  flex: 1 1 auto;
  padding: 11px 12px;
  background: var(--warm-deep, #15120f);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  -webkit-appearance: none; appearance: none;
}
.integ-key-input:focus { outline: none; border-color: var(--gold); }
.integ-key-flash { min-height: 18px; margin-top: 6px; }
.integ-key-flash.ok { color: #6cd49a; }
.integ-key-flash.err { color: #f87171; }
@media (max-width: 480px) {
  .integ-key-row { flex-direction: column; align-items: stretch; }
  .integ-key-row .btn { width: 100%; }
}

.integ-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--canvas);
}
.integ-logo.oura     { background: linear-gradient(135deg, #d8b27a, #b47e37); color: var(--canvas); }
.integ-logo.apple    { background: #f5f5f7; }
.integ-logo.whoop    { background: #000; color: #fff; border: 1px solid #2a2a2a; }
.integ-logo.withings { background: linear-gradient(135deg, #00d4ff, #0086c2); color: #fff; }
.integ-logo.rize     { background: linear-gradient(135deg, #8a6dff, #5b3eff); color: #fff; }
.integ-logo.mfp      { background: linear-gradient(135deg, #1aa1ff, #0072ce); color: #fff; }
.integ-logo svg { display: block; }

.status-badge.soon {
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border-color: var(--hairline);
}

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 24px;
  max-width: 420px;
  width: 100%;
}
.modal h3 { margin: 0 0 8px; font-size: 18px; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
.modal p { color: var(--text-dim); margin: 0 0 18px; font-size: 14px; line-height: 1.5; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 520px) {
  .integ-card { padding: 16px; }
  .integ-id { gap: 12px; }
  .integ-id h3 { font-size: 16px; }
  .integ-head { flex-wrap: wrap; }
  .integ-state { margin-top: 4px; }
}

/* --- Food page --- */
.food-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.food-stat {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.food-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 500;
}
.food-stat-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.food-stat-value .unit { font-size: 12px; color: var(--text-dim); font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; margin-left: 2px; }
.food-stat-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.food-stat-bar .bar-fill {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 0.4s ease;
}
.food-stat-rem {
  font-size: 12px;
  color: var(--text-dim);
}

.food-capture {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.food-capture .capture-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.food-capture h2 { margin: 0; font-size: 18px; }
.food-capture .meta { color: var(--text-dim); font-size: 13px; margin: 0 0 12px; }
/* Coach's nudge — AI-generated next-meal advice. Sits between the day-totals
   and the meal list so the eye lands on it after seeing where the day stands. */
.food-insights {
  background: linear-gradient(180deg, rgba(180, 126, 55, 0.08), rgba(180, 126, 55, 0.02));
  border: 1px solid rgba(180, 126, 55, 0.25);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin: 16px 0;
}
.food-insights-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.food-insights-eyebrow {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.food-insights-body p {
  margin: 0 0 8px;
  line-height: 1.55;
  font-size: 14px;
  color: var(--text);
}
.food-insights-body p:last-child { margin-bottom: 0; }

/* Structured insight rendering (headline + bullets). Replaces the old wall
   of text. Goal: scannable, slightly editorial, easy on the eye. */
.food-insights-body .insight-headline {
  margin: 0 0 12px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
}
.food-insights-body .insight-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.food-insights-body .insight-bullets li {
  position: relative;
  padding: 10px 12px 10px 32px;
  background: rgba(180, 126, 55, 0.06);
  border-left: 2px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.food-insights-body .insight-bullets li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 17px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.capture-input { display: flex; flex-direction: column; gap: 10px; }
.capture-input textarea {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
  min-height: 60px;
}
.capture-input textarea:focus { outline: none; border-color: var(--gold); }
.capture-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#food-dict-btn,
#food-image-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
#food-dict-btn:hover,
#food-image-btn:hover { border-color: var(--gold); color: var(--gold); }
#food-dict-btn.dict-on {
  border-color: var(--red);
  color: var(--red);
  animation: dict-pulse 1.4s ease-in-out infinite;
}
#food-dict-btn.dict-unsupported { opacity: 0.55; }

.food-preview {
  background: var(--warm);
  border: 1px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.food-preview h3 { margin: 0 0 4px; font-size: 16px; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
#preview-confidence-line { color: var(--text-dim); font-size: 12px; margin: 0 0 8px; }
#preview-warnings .flash { margin: 6px 0; }
.preview-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.preview-item {
  display: grid;
  grid-template-columns: 2fr 60px 60px 50px 50px 50px 28px;
  gap: 6px;
  align-items: center;
}
.preview-item input {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.preview-item input:focus { outline: none; border-color: var(--gold); }
.preview-item .pi-del {
  background: none; border: 0; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 0;
}
.preview-item .pi-del:hover { color: var(--red); }
.preview-totals {
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
  margin-top: 8px;
}
.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.food-day h2 { margin-bottom: 12px; }
.entries-list { display: flex; flex-direction: column; gap: 10px; }
.entries-empty { padding: 16px 0; }
.entry-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.entry-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.entry-time {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.entry-totals {
  flex: 1;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
}
.entry-del { font-size: 12px; }
.btn-link.danger { color: var(--red); }
.entry-raw {
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
  margin: 4px 0 8px;
}
.entry-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--hairline);
  padding-top: 8px;
}
.entry-items li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.entry-items .item-name { color: var(--text); }
.entry-items .item-kcal { color: var(--text-dim); }

.targets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.targets-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-dim);
}
.targets-grid input {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.targets-grid input:focus { outline: none; border-color: var(--gold); }

@media (max-width: 640px) {
  .food-totals { grid-template-columns: 1fr 1fr; }
  .preview-item { grid-template-columns: 1.4fr 50px 48px 42px 42px 42px 24px; gap: 4px; }
  .preview-item input { font-size: 12px; padding: 5px 6px; }
  .targets-grid { grid-template-columns: 1fr; }
}

/* --- Workouts --- */
.program-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.program-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  transition: border-color 180ms;
  /* Bundle AD (2026-04-30) AD-1 — children were rendering edge-to-edge so the
     "Start workout" pill was almost falling off the bottom border on mobile.
     Inherit safe internal padding directly on the card so .program-card-foot
     respects the bottom border. */
  padding: 16px 18px;
}
.program-card:hover, a.program-card:hover { border-color: var(--gold); }
.program-card-body {
  display: block;
  padding: 16px 18px;
  color: var(--text);
  text-decoration: none;
}
.program-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.program-card h3 { margin: 0 0 4px; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 16px; }
.program-card .meta { font-size: 13px; color: var(--text-dim); margin: 0; }
.program-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  /* Bundle AD AD-1 — auto-push the foot to the bottom of the card on tall
     cards, with a guaranteed top spacer so the foot never crowds the body. */
  margin-top: auto;
  padding-top: 14px;
  gap: 12px;
}
/* Bundle AD AD-1 — pin the Start button visually inside the card padding. */
.program-card .start-program-btn { flex-shrink: 0; align-self: center; }
.program-card-actions {
  display: flex; justify-content: flex-end; gap: 16px;
  padding: 8px 18px 12px;
  border-top: 1px solid var(--hairline-dim);
}
.program-card-actions .btn-link { font-size: 13px; padding: 4px 8px; }
.program-card-actions .btn-link.danger { color: #f87171; }
.program-card-actions .btn-link.danger:hover { color: #fca5a5; }

.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--text);
}
.session-row:hover { border-color: var(--gold); }
.session-row-name { font-weight: 600; }
.session-row-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Live session */
.session-blocks { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.ex-block {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ex-head h3 { margin: 0; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 16px; }
.ex-target { color: var(--gold); font-size: 13px; }
.last-line { font-style: italic; }

.set-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.set-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.set-num { color: var(--text-dim); font-size: 12px; min-width: 32px; }
.set-info { flex: 1; }
.set-del { font-size: 18px; color: var(--text-dim); }
.set-del:hover { color: var(--red); }

.set-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.set-input-row input {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  min-width: 0;
}
.set-input-row input:focus { outline: none; border-color: var(--gold); }

.adhoc-row { display: flex; gap: 8px; }
.adhoc-row input {
  flex: 1;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.adhoc-row input:focus { outline: none; border-color: var(--gold); }

.session-notes { margin-top: 16px; }
.session-notes label { display: block; margin-bottom: 6px; }
.session-notes textarea {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.session-notes textarea:focus { outline: none; border-color: var(--gold); }
.notes-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }

.session-finish-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

/* History */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 12px 16px;
}
.history-card summary {
  display: flex; gap: 12px; align-items: baseline;
  cursor: pointer; list-style: none; font-size: 14px;
}
.history-card summary::-webkit-details-marker { display: none; }
.history-card .hc-date { color: var(--text-dim); min-width: 90px; }
.history-card .hc-name { font-weight: 600; flex: 1; }
.history-card .hc-meta { font-size: 12px; color: var(--text-dim); }
.history-card[open] summary { padding-bottom: 8px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.hc-body { display: flex; flex-direction: column; gap: 12px; }
.hc-ex { padding: 6px 0; }
.hc-ex-name { font-weight: 600; margin-bottom: 4px; }
.hc-sets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.hc-sets li { display: flex; gap: 12px; font-size: 13px; }
.hc-set-num { color: var(--text-dim); min-width: 32px; }
.hc-notes { font-size: 13px; color: var(--text-dim); padding: 8px 12px; background: rgba(0,0,0,0.2); border-radius: 4px; }

/* Coach program editor */
.prog-meta-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.prog-meta .form-row { margin-bottom: 12px; }
.prog-meta label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.prog-meta input,
.prog-meta textarea,
.prog-meta select {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.prog-meta input:focus,
.prog-meta textarea:focus,
.prog-meta select:focus { outline: none; border-color: var(--gold); }

.ex-editor { margin-top: 24px; }
#ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-edit-row {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: 6px;
}
.ex-edit-main {
  display: grid;
  grid-template-columns: 2fr 70px 90px auto auto auto;
  gap: 6px;
  align-items: center;
}
.ex-edit-row input,
.ex-edit-row textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.ex-edit-row input:focus,
.ex-edit-row textarea:focus { outline: none; border-color: var(--gold); }
.ex-edit-row .ex-flash { font-size: 11px; }

.ex-edit-extras {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 10px; padding: 10px 4px 4px;
  border-top: 1px dashed var(--hairline-dim);
}
.ex-edit-extras .ex-extra-field {
  display: flex; flex-direction: column;
  font-size: 11px; color: var(--text-dim);
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  border: 0; padding: 0; margin: 0;
}
.ex-edit-extras .ex-extra-field span,
.ex-edit-extras .ex-extra-field legend { margin-bottom: 6px; padding: 0; }
.ex-edit-extras .ex-extra-field em.muted {
  font-style: normal; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--text-dim); margin-left: 4px;
}
.ex-edit-extras input,
.ex-edit-extras textarea { font-size: 13px; padding: 8px 10px; }
.ex-edit-extras textarea { resize: vertical; min-height: 60px; line-height: 1.5; }

.ex-muscle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px 10px;
}
.ex-muscle-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  text-transform: capitalize; color: var(--text);
  padding: 3px 4px; border-radius: 4px;
  cursor: pointer; user-select: none;
}
.ex-muscle-opt:hover { background: rgba(255,255,255,0.04); }
.ex-muscle-opt input[type="checkbox"] {
  width: 14px; height: 14px; margin: 0;
  accent-color: var(--gold); cursor: pointer;
}
.ex-muscle-opt input[type="checkbox"]:checked + span { color: var(--gold); font-weight: 600; }

@media (max-width: 720px) {
  .program-list { grid-template-columns: 1fr; }
  .ex-edit-main {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .ex-edit-main .ex-name { grid-column: 1 / -1; }
  .ex-edit-main .save-ex,
  .ex-edit-main .del-ex,
  .ex-edit-main #add-ex { grid-column: span 1; }
  .ex-edit-main .ex-flash { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .set-input-row { grid-template-columns: 1fr 1fr 1fr; }
  .set-input-row .si-log { grid-column: 1 / -1; }
}

/* ============================================================
   Food page V2 — premium hierarchy
   ============================================================ */

.food-hero {
  display: flex;
  gap: 22px;
  align-items: center;
  background: linear-gradient(155deg, rgba(180, 126, 55, 0.10), rgba(180, 126, 55, 0.01));
  border: 1px solid rgba(180, 126, 55, 0.3);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.food-hero-ring {
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
}
.food-hero-ring-svg { width: 100%; height: 100%; }
#hero-ring-fg { transition: stroke-dashoffset 600ms cubic-bezier(.2,.8,.2,1); }
.food-hero-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.food-hero-num {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.food-hero-unit {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-top: 4px;
}
.food-hero-meta { flex: 1 1 auto; min-width: 0; }
.food-hero-eyebrow {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}
.food-hero-headline {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 30px;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
}
.food-hero-headline .dim { color: var(--text-dim); font-size: 18px; font-weight: 400; }
.food-hero-progress {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  margin-top: 14px;
  overflow: hidden;
}
.food-hero-progress .bar-fill {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: width 400ms ease;
}
.food-hero-context {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.food-hero-context.over { color: #f87171; }

.food-macro-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.food-macro-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.food-macro-card[data-macro="protein"] { --macro-accent: #c98563; }
.food-macro-card[data-macro="carbs"] { --macro-accent: #b48b3f; }
.food-macro-card[data-macro="fat"] { --macro-accent: #94b06f; }
.food-macro-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--macro-accent);
}
.food-macro-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.food-macro-name {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.food-macro-num {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.food-macro-num .unit { font-size: 12px; color: var(--text-dim); margin-left: 1px; }
.food-macro-target {
  font-size: 12px;
  color: var(--text-dim);
}
.food-macro-target .dim { color: var(--text-dim); }
.food-macro-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.food-macro-bar .bar-fill {
  display: block;
  height: 100%;
  background: var(--macro-accent);
  transition: width 400ms ease;
}
.food-macro-rem {
  font-size: 11px;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .food-hero { padding: 18px; gap: 14px; }
  .food-hero-ring { width: 96px; height: 96px; }
  .food-hero-num { font-size: 22px; }
  .food-hero-headline { font-size: 24px; }
  .food-macro-row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .food-macro-card { padding: 12px 10px; }
  .food-macro-num { font-size: 22px; }
}
@media (max-width: 420px) {
  .food-macro-row { gap: 6px; }
  .food-macro-card { padding: 10px 8px; gap: 4px; }
  .food-macro-num { font-size: 18px; }
  .food-macro-num .unit { font-size: 10px; }
  .food-macro-name { font-size: 10px; letter-spacing: 0.12em; }
  .food-macro-target, .food-macro-rem { font-size: 10px; }
  .food-macro-icon { width: 14px; height: 14px; }
}

/* --- Workout rest timer --- */
.rest-timer {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(180,126,55,0.06);
  border: 1px solid rgba(180,126,55,0.25);
  border-radius: 10px;
  transition: background 200ms, border-color 200ms;
}
.rest-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
}
.rest-timer .rest-icon { color: var(--gold); flex: 0 0 auto; }
.rest-timer .rest-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.rest-timer .rest-time {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--gold);
  margin-left: auto;
  margin-right: 12px;
  font-variant-numeric: tabular-nums;
}
.rest-timer .rest-actions { display: flex; gap: 6px; }
.rest-timer .btn-link { font-size: 12px; padding: 2px 8px; }
.rest-bar { height: 3px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.rest-bar-fill { display: block; height: 100%; background: var(--gold); transition: width 0.95s linear; }
.rest-timer.rest-warn { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.3); }
.rest-timer.rest-warn .rest-time { color: #f87171; }
.rest-timer.rest-warn .rest-bar-fill { background: #f87171; }
.rest-timer.rest-done .rest-time { color: #6cd49a; }
.rest-timer.rest-done { background: rgba(80,200,120,0.08); border-color: rgba(80,200,120,0.28); }

/* Per-exercise progress sparklines on workout history */
.progress-section { margin-top: 8px; margin-bottom: 24px; }
.progress-section h2 { margin-bottom: 4px; }
.progress-section > .meta { margin-bottom: 14px; }
.progress-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.progress-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.progress-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.progress-name {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 600; font-size: 14px;
  color: rgba(255,255,255,0.92);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%;
}
.progress-delta {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.progress-delta.up { color: #6cd49a; }
.progress-delta.down { color: #f87171; }
.progress-delta.flat { color: rgba(255,255,255,0.5); }
.progress-spark { display: block; width: 100%; height: 56px; }
.progress-spark .spark-line {
  fill: none; stroke: var(--gold); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.progress-spark .spark-dot { fill: rgba(255,255,255,0.35); }
.progress-spark .spark-dot.last { fill: var(--gold); }
.progress-foot {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: rgba(255,255,255,0.55);
  margin-top: 6px;
}
.progress-range { font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.7); }

/* --- Quick-log floating action button (clients) --- */
.quick-log-fab {
  position: fixed;
  right: 18px;
  bottom: calc(80px + env(safe-area-inset-bottom, 0));
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--gold);
  border: 0;
  color: var(--canvas);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(180,126,55,0.4);
  z-index: 30;
  transition: transform 160ms, background 160ms;
}
.quick-log-fab:hover { background: var(--gold-hi, #c78f45); transform: translateY(-1px); }
.quick-log-fab:active { transform: scale(0.95); }
.quick-log-fab svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
@media (min-width: 769px) {
  .quick-log-fab { bottom: 24px; }
}

/* --- Quick-log bottom sheet --- */
.quick-log-sheet {
  position: fixed; inset: 0;
  z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.quick-log-sheet[hidden] { display: none !important; }

/* --- Per-exercise demo block on workout session page --- */
.ex-muscles {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 6px 0 10px;
}
.ex-muscle-tag {
  display: inline-block;
  background: rgba(180,126,55,0.12);
  border: 1px solid rgba(180,126,55,0.28);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold);
}
.ex-demo {
  position: relative;
  margin: 8px 0 12px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.4);
  aspect-ratio: 16 / 9;
  max-width: 480px;
}
.ex-demo-thumb {
  position: relative;
  width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer;
  background: transparent;
  display: block;
}
.ex-demo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 200ms;
}
.ex-demo-thumb:hover img { filter: brightness(1.08); }
.ex-demo-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ex-demo-label {
  position: absolute; bottom: 8px; left: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
}
.ex-demo-iframe {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.ex-cues {
  list-style: none;
  padding: 0; margin: 8px 0 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.ex-cues li {
  position: relative;
  padding: 4px 4px 4px 18px;
  font-size: 13px; color: var(--text);
  line-height: 1.5;
}
.ex-cues li::before {
  content: "";
  position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
}
.quick-log-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0; transition: opacity 200ms;
}
.quick-log-sheet.open .quick-log-backdrop { opacity: 1; }
.quick-log-card {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 520px;
  padding: 12px 18px calc(20px + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.quick-log-sheet.open .quick-log-card { transform: translateY(0); }
.quick-log-handle {
  /* Visible bar is 40x4 but the touch target is the full strip, so swipe-down works anywhere on the top of the card. */
  position: relative;
  height: 22px;
  margin: -8px -18px 8px;
  cursor: grab;
  touch-action: none;
}
.quick-log-handle:active { cursor: grabbing; }
.quick-log-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px; height: 4px;
  margin: -2px 0 0 -20px;
  border-radius: 2px;
  background: rgba(255,255,255,0.22);
}
.quick-log-tabs {
  display: flex; gap: 8px; margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline-dim);
  padding-bottom: 10px;
}
.quick-log-tab {
  background: transparent; border: 0;
  color: var(--text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px;
  cursor: pointer; text-decoration: none;
}
.quick-log-tab.active { color: var(--gold); background: rgba(180,126,55,0.10); }
.quick-log-field {
  display: flex; flex-direction: column;
  margin-bottom: 14px;
  font-size: 13px; color: var(--text-dim);
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.quick-log-field span { margin-bottom: 6px; }
.quick-log-field em.muted { font-style: normal; color: var(--text-dim); text-transform: none; letter-spacing: 0; font-weight: 400; }
.quick-log-input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.quick-log-input-wrap input,
.quick-log-field-row input {
  width: 100%;
  padding: 14px 16px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none; appearance: none;
  text-transform: none; letter-spacing: 0;
}
.quick-log-input-wrap input:focus,
.quick-log-field-row input:focus { outline: none; border-color: var(--gold); }
.quick-log-unit {
  position: absolute; right: 18px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 14px; color: var(--text-dim);
  font-weight: 600; letter-spacing: 0.04em;
}
.quick-log-field-row {
  flex-direction: row; align-items: center; gap: 12px;
}
.quick-log-field-row span { margin-bottom: 0; flex: 1; }
.quick-log-field-row input { flex: 0 0 120px; font-size: 18px; padding: 11px 14px; }
.quick-log-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 14px; margin-top: 18px;
}
.quick-log-actions .btn { padding: 12px 22px; min-width: 100px; }
.quick-log-flash {
  margin-top: 10px; min-height: 18px;
  font-size: 13px; color: var(--text-dim);
}
.quick-log-flash.err { color: #f87171; }
.quick-log-flash.ok { color: #6cd49a; }

/* --- Progress photos (PFA-AUDIT-9) --- */
.quick-log-tab-link { margin-left: auto; }
.quick-log-hint {
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
  margin: 0 0 14px;
}
.qlf-photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 6px;
}
.qlf-photo-slot { position: relative; }
.qlf-photo-thumb {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  aspect-ratio: 3 / 4;
  background: var(--warm);
  border: 1px dashed var(--hairline);
  border-radius: 14px;
  cursor: pointer; overflow: hidden;
  position: relative;
}
.qlf-photo-thumb:hover { border-color: var(--gold); }
.qlf-photo-slot.is-sent .qlf-photo-thumb {
  border-color: #6cd49a; border-style: solid;
}
.qlf-photo-slot.is-failed .qlf-photo-thumb {
  border-color: #e08a8a; border-style: solid;
}
.qlf-photo-slot.is-processing .qlf-photo-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: qlf-shimmer 1.2s linear infinite;
  pointer-events: none;
}
@keyframes qlf-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.qlf-photo-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 12px;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.qlf-photo-empty svg { color: var(--text-dim); }
.qlf-photo-preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.qlf-photo-clear {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px;
  border-radius: 999px; border: 0;
  background: rgba(20, 20, 22, 0.78);
  color: #fff; font-size: 16px; line-height: 1; padding: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qlf-photo-clear:hover { background: rgba(20, 20, 22, 0.92); }

/* Coach client-profile progress-photos gallery */
.cp-progress-photos {
  margin: 18px 0 28px;
}
.cp-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.cp-photos-loading { color: var(--cp-ink-3, var(--text-dim)); font-size: 13px; padding: 12px 0; }
.cp-photos-empty {
  color: var(--cp-ink-3, var(--text-dim)); font-size: 13px;
  padding: 18px 14px; border: 1px dashed var(--hairline);
  border-radius: 14px; background: var(--warm);
}
.cp-photo-tile {
  position: relative; display: block;
  aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--warm);
  text-decoration: none;
}
.cp-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-photo-meta {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 11px;
  color: #fff; letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  text-transform: uppercase;
}
.cp-photo-pose { font-weight: 700; }
.cp-photo-date { opacity: 0.9; font-weight: 600; }

/* PFA-BS-1 (2026-05-15) — client-side photo history timeline on /body.
   Day-row layout: date label on top, 3 thumbnails (front/side/back) below.
   Empty pose shows a soft dash placeholder so each row stays the same shape. */
.ph-list {
  display: flex; flex-direction: column; gap: 14px;
}
.ph-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline-dim);
  border-radius: 14px;
  padding: 10px 12px;
}
.ph-row-date {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.ph-row-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.ph-cell {
  position: relative; display: block;
  aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--warm);
  text-decoration: none;
}
.ph-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-cell--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 18px;
  border-style: dashed;
}
.ph-cell-label {
  position: absolute; left: 6px; bottom: 6px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 10px;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.ph-cell--empty .ph-cell-label {
  color: var(--text-dim); text-shadow: none;
}

/* Coach client-profile multi-workout list (PFA-CP-1) */
.cp-workout-list {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.cp-workout-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--warm);
}
.cp-workout-row-meta { flex: 1 1 auto; min-width: 0; }
.cp-workout-row-name {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 700;
  font-size: 14px; line-height: 1.3; color: #f1ebe0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-workout-row-sub {
  font-size: 12px; line-height: 1.4; color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-cta-sm { padding: 6px 12px; font-size: 12px; }

/* --- Body stats page --- */
.body-hero {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
}
.body-hero-main { flex: 1 1 200px; min-width: 0; }
.body-hero-eyebrow {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.body-hero-num {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 44px; font-weight: 500;
  color: var(--gold);
  line-height: 1;
}
.body-hero-num .unit { font-size: 16px; color: var(--text-dim); margin-left: 4px; }
.body-hero-meta { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.body-hero-spark {
  flex: 1 1 240px;
  min-width: 0;
}
.body-hero-spark svg { width: 100%; height: 64px; display: block; }
.body-hero-spark .spark-line {
  fill: none; stroke: var(--gold); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.body-hero-spark .spark-dot { fill: rgba(255,255,255,0.35); }
.body-hero-spark .spark-dot.last { fill: var(--gold); }
.body-hero-delta {
  margin-top: 6px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 14px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.body-hero-delta.up { color: #6cd49a; }
.body-hero-delta.down { color: #c98563; }
.body-hero-delta.flat { color: var(--text-dim); }
.body-hero-delta .muted { color: var(--text-dim); font-weight: 400; font-size: 12px; margin-left: 4px; }

.body-add { padding: 18px 20px; margin: 18px 0; }
.body-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
/* BL-PERS-3B Bug 7 — `display: grid` above wins over `hidden`, so the
   `[hidden]` attribute on the extra-fields grid does nothing without an
   explicit override. Restore native semantics. */
.body-add-grid[hidden] { display: none; }
.body-add-grid label,
.body-add-notes {
  display: flex; flex-direction: column;
  font-size: 12px; color: var(--text-dim);
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  gap: 4px;
}
.body-add-grid input,
.body-add-notes textarea {
  background: var(--warm-deep, #15120f);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  /* BL-PERS-3B Bug 7 (2026-05-08) — iOS Safari auto-zooms any input with
     font-size < 16px on focus. Manou: "when I click on the weight (kg)
     field, it zooms in and makes the UI a little bit weird." Bumping to
     16px prevents the zoom; visual weight stays light via line-height +
     padding, not font-size. */
  font-size: 16px; font-weight: 400;
  text-transform: none; letter-spacing: 0;
}
/* BL-PERS-3B Bug 7 — collapsible "Count more metrics" toggle. Keeps the
   default form to weight + body-fat. Tapping the link expands the rest. */
.body-add-extra { display: grid; gap: 10px; grid-template-columns: 1fr; }
.body-add-extra-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 8px 0 12px;
  background: transparent; border: 0;
  color: var(--gold);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer; padding: 4px 0;
}
.body-add-extra-toggle:hover { opacity: 0.85; }
.body-add-extra-toggle .ba-extra-caret {
  transition: transform 200ms ease;
}
.body-add-extra-toggle[aria-expanded="true"] .ba-extra-caret {
  transform: rotate(180deg);
}
.body-add-grid input:focus,
.body-add-notes textarea:focus { outline: none; border-color: var(--gold); }
.body-add-notes { margin: 12px 0; }
.body-add-actions {
  display: flex; align-items: center; gap: 12px;
}

.body-stat-list { display: flex; flex-direction: column; gap: 10px; }
.body-stat-row {
  position: relative;
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  border-radius: 12px;
  padding: 12px 44px 12px 14px;
}
.bs-date {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 600; font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.bs-info { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-pill {
  display: inline-block;
  background: rgba(180,126,55,0.10);
  border: 1px solid rgba(180,126,55,0.22);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text);
}
.bs-pill strong { color: var(--gold); }
.bs-notes { color: var(--text-dim); font-size: 12px; margin-top: 6px; font-style: italic; }
.bs-del {
  position: absolute; right: 8px; top: 8px;
  background: transparent; border: 0;
  color: var(--text-dim); font-size: 18px; cursor: pointer;
  padding: 4px 8px;
}
.bs-del:hover { color: #f87171; }

/* ---- Weight history 90-day chart (body_stats.html) ---- */
.weight-chart-card { padding: 18px 20px; margin: 18px 0; }
.weight-chart-head { margin-bottom: 12px; }
.weight-chart-head h3 {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 16px; font-weight: 600;
}
.weight-chart-svg-wrap {
  width: 100%; overflow: hidden;
  background: rgba(180,126,55,0.04);
  border-radius: 10px;
  padding: 6px;
}
.weight-chart-svg-wrap svg { width: 100%; height: 180px; display: block; }
.weight-chart-line {
  fill: none; stroke: var(--gold); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.weight-chart-grid {
  stroke: rgba(255,255,255,0.06); stroke-width: 1; stroke-dasharray: 3 3;
}
.weight-chart-tick {
  fill: var(--text-dim); font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
}
.weight-chart-dot { stroke: rgba(0,0,0,0.4); stroke-width: 0.6; }
.weight-chart-dot--apple_health { fill: #ff3b30; }
.weight-chart-dot--withings { fill: #6cd4ff; }
.weight-chart-dot--oura { fill: #b47e37; }
.weight-chart-dot--manual { fill: rgba(255,255,255,0.55); }

.weight-chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 12px; font-size: 11px;
  color: var(--text-dim);
}
.wc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.wc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.wc-dot--apple_health { background: #ff3b30; }
.wc-dot--withings { background: #6cd4ff; }
.wc-dot--oura { background: #b47e37; }
.wc-dot--manual { background: rgba(255,255,255,0.55); }

/* Per-row source pill in the history list. Tiny capsule next to the date. */
.bs-source {
  display: inline-block; margin-left: 8px;
  padding: 2px 8px; border-radius: 999px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  vertical-align: 2px;
}
.bs-source--apple_health { background: rgba(255,59,48,0.16); color: #ff8a82; border: 1px solid rgba(255,59,48,0.3); }
.bs-source--withings    { background: rgba(108,212,255,0.14); color: #99e2ff; border: 1px solid rgba(108,212,255,0.3); }
.bs-source--oura        { background: rgba(180,126,55,0.18); color: var(--gold); border: 1px solid rgba(180,126,55,0.35); }
.bs-source--manual      { background: rgba(255,255,255,0.06); color: var(--text-dim); border: 1px solid rgba(255,255,255,0.12); }

/* Body-add collapse toggle */
.body-add-toggle-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.body-add-toggle-row h3 { margin: 0; }

/* Mobile: chart shrinks gracefully. */
@media (max-width: 600px) {
  .weight-chart-svg-wrap svg { height: 140px; }
  .weight-chart-legend { gap: 10px; font-size: 10px; }
  .bs-source { font-size: 9px; padding: 1px 6px; }
}

/* ---------------- Diet builder (coach + client) ---------------- */

/* Toolbar above lists (coach side) */
.diet-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Wider modal for the meal editor */
.modal-wide { max-width: 720px; }

/* --- Master meal library grid (coach) --- */
.meal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.meal-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.meal-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--warm-raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.meal-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.meal-img-empty {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.meal-card-body {
  padding: 14px 16px 4px;
  flex: 1;
}
.meal-card-body h3 {
  margin: 0 0 6px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
}
.meal-card-macros {
  color: var(--text-dim);
  font-size: 13px;
}
.meal-card-macros strong { color: var(--text); }
.meal-card-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meal-tag {
  background: var(--warm-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  color: var(--text-dim);
}
.meal-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--hairline-dim);
}
.meal-card-actions .btn-link.danger { color: #f87171; }
.meal-card-actions .btn-link.danger:hover { color: #fca5a5; }

/* --- Meal editor form (modal) --- */
.meal-form { display: flex; flex-direction: column; gap: 12px; }
.meal-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-dim); }
.meal-form input[type="text"],
.meal-form input[type="number"],
.meal-form textarea,
.meal-form select {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
}
.meal-form textarea { resize: vertical; min-height: 60px; }
.meal-form-image {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--warm-raised);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
}
.meal-form-image-preview {
  width: 96px;
  height: 96px;
  background: var(--canvas);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.meal-form-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.meal-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.meal-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* Bundle AC AC-5 — Macros↔kcal auto-recalc + lock toggle. Smoky-dark + gold. */
.dp-targets-grid label { position: relative; }
.dp-kcal-wrap .dp-kcal-label {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; line-height: 1.2;
}
.dp-kcal-lock-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(180, 126, 55, 0.35);
  background: rgba(180, 126, 55, 0.08);
  color: var(--gold-hi, #d8b58f);
  border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.dp-kcal-lock-btn:hover { background: rgba(180, 126, 55, 0.18); }
.dp-kcal-lock-btn .dp-lock-icon {
  width: 12px; height: 12px;
  stroke: currentColor;
}
.dp-kcal-lock-btn.is-unlocked {
  background: rgba(248, 113, 113, 0.10);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}
.dp-kcal-lock-btn.is-unlocked .dp-lock-shackle {
  /* unlocked shackle = open; tilt the path */
  transform: translate(-2px, -1px) rotate(-18deg);
  transform-origin: 12px 11px;
}
.dp-targets-grid input[readonly] {
  background: rgba(180, 126, 55, 0.06);
  color: var(--gold-hi, #d8b58f);
  cursor: not-allowed;
}
.dp-kcal-hint {
  margin: 6px 0 0; font-size: 12px; color: var(--meta, #a39d95);
}
.meal-section { padding-top: 4px; }
.meal-section h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.ing-row {
  display: grid;
  grid-template-columns: 1fr 110px 28px;
  gap: 8px;
  margin-bottom: 6px;
}
.ing-row input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 7px 9px;
  border-radius: var(--radius);
  font-size: 13px;
}
.ing-row .ing-del {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
}
.ing-row .ing-del:hover { color: #f87171; }

@media (max-width: 600px) {
  .meal-grid-3 { grid-template-columns: 1fr 1fr; }
  .meal-grid-4 { grid-template-columns: 1fr 1fr; }
  .ing-row { grid-template-columns: 1fr 90px 28px; }
}

/* --- Diet plan slots (coach) --- */
.diet-slots { margin-top: 28px; }
.diet-slots-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.diet-slots-head h2 {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
}
.slot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.slot-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 14px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 12px;
  align-items: flex-start;
}
.slot-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  background: var(--warm-raised);
  object-fit: cover;
  display: block;
}
.slot-thumb-empty {
  border: 1px dashed var(--hairline);
}
.slot-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.slot-main input,
.slot-main textarea {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 9px;
  font-family: inherit;
  font-size: 13px;
}
.slot-label {
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary) !important;
  max-width: 220px;
}
.slot-name { font-size: 14px !important; font-weight: 600; }
.slot-macros {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.slot-macros label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
}
.slot-macros input {
  width: 70px;
}
.slot-detail { font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; }
.slot-detail summary { cursor: pointer; color: var(--text-secondary); }
.slot-detail ul, .slot-detail ol { margin: 4px 0 0 18px; padding: 0; }
.slot-detail li { margin-bottom: 2px; }
.s-notes {
  font-size: 12px !important;
  color: var(--text) !important;
  font-style: italic;
}
.slot-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.slot-actions .btn-link.danger { color: #f87171; }
.slot-actions .btn-link.danger:hover { color: #fca5a5; }

@media (max-width: 720px) {
  .slot-row { grid-template-columns: 64px 1fr; grid-template-areas: "thumb main" "actions actions"; }
  .slot-thumb { width: 64px; height: 64px; grid-area: thumb; }
  .slot-main { grid-area: main; }
  .slot-actions { grid-area: actions; flex-direction: row; justify-content: flex-end; }
  .slot-macros input { width: 56px; }
}

/* "Add slot" picker row */
.diet-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--warm);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-card);
}
.diet-add-row select,
.diet-add-row input[type="text"] {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
}
.diet-add-row select { flex: 1; min-width: 200px; }
.diet-add-row input[type="text"] { width: 200px; }

/* --- Client-side meal plan view --- */
/* HARD RULE feedback_meal_macros_must_match_ingredients.md — totals row
   shows the active day's actual sum-of-ingredients macros. Coach-set
   targets live behind a toggle, never as the default display. */
.diet-totals-wrap { margin: 16px 0 8px; }
.diet-totals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.diet-totals-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.diet-totals-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 140ms, color 140ms;
}
.diet-totals-toggle:hover,
.diet-totals-toggle[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
}
.diet-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 0 0 20px;
}
.diet-targets[data-cd-mode="target"] .diet-target {
  border-style: dashed;
}
.diet-target {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.diet-target strong {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  color: var(--gold);
}
.diet-target span {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.client-meal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.client-meal-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 0;
}
.client-meal-head { display: block; }
.client-meal-img {
  display: block;
  width: 100%;
  height: 220px;
  border-radius: 0;
  object-fit: cover;
  background: var(--warm-raised);
}
.client-meal-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--hairline);
}
.client-meal-img-empty svg { width: 36px; height: 36px; }
.client-meal-meta {
  min-width: 0;
  padding: 14px 14px 0;
}
.client-meal-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 4px;
}
.client-meal-meta h3 {
  margin: 0 0 8px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
}
.client-meal-macros { font-size: 13px; color: var(--text-dim); }
.client-meal-macros strong { color: var(--text); }
.client-meal-notes {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  border-left: 2px solid var(--gold);
  padding: 4px 0 4px 10px;
}
/* Bundle BK-6 (2026-05-02) — back-to-Food link + Log-as-eaten button on
   client meal-plan view. Manou: clients had no back-nav from /diet and
   no way to record what they ate against today's macros. */
.cd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 16px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline-dim);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.cd-back-link:hover, .cd-back-link:focus-visible {
  color: var(--text);
  border-color: var(--gold);
  background: rgba(180,126,55,0.06);
}
.client-meal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--hairline-dim);
}
.cd-log-eaten {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: #1a1612;
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, opacity .15s ease;
}
.cd-log-eaten:hover, .cd-log-eaten:focus-visible {
  filter: brightness(1.08);
}
.cd-log-eaten:disabled { opacity: 0.7; cursor: progress; }
.cd-log-eaten.is-logged {
  background: rgba(74, 222, 128, 0.18);
  color: #4ade80;
  box-shadow: inset 0 0 0 1px rgba(74,222,128,0.4);
}
.cd-log-eaten-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.client-meal-section {
  margin: 0;
  border-top: 1px solid var(--hairline-dim);
  padding: 10px 14px 14px;
}
.client-meal-section summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.client-ing-list {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
}
.client-ing-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--hairline-dim);
  font-size: 13px;
}
.client-ing-list li:last-child { border-bottom: 0; }
.client-ing-list em {
  color: var(--text-dim);
  font-style: normal;
  font-size: 12px;
}
.client-step-list {
  margin: 8px 0 0 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.client-step-list li { margin-bottom: 6px; }

/* CHARLIE-MEALS-V2 (2026-05-20): multi-day variation pills. A plan with
   >1 variation (Chicken day / Beef day / Pasta day) renders a row of
   pills above the meal list; tapping one swaps which cards are visible.
   .is-hidden hard-removes cards from layout so the macro stack only
   reflects the active day. */
.cd-variations {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline-dim);
  border-radius: 999px;
  width: fit-content;
}
.cd-variation-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.cd-variation-pill:hover, .cd-variation-pill:focus-visible {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.cd-variation-pill.is-active {
  background: var(--gold);
  color: #1a1612;
}
.cd-variation-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.client-meal-card.is-hidden { display: none; }

@media (max-width: 520px) {
  .client-meal-img { height: 180px; }
  .client-meal-meta h3 { font-size: 14px; }
}

/* Food page header row (link to meal plan) */
.food-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.food-meal-plan-link { font-size: 13px; }

/* ---------------- Exercise library (coach) ---------------- */
.ex-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ex-editor-head h2 { margin: 0; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 18px; }

.ex-from-library {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px;
  background: var(--warm);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-card);
  flex-wrap: wrap;
}
.ex-from-library select {
  flex: 1;
  min-width: 220px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
}

.exlib-card-thumb { position: relative; }
.exlib-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.92);
  pointer-events: none;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}
.exlib-icon-empty {
  background: linear-gradient(140deg, rgba(180,126,55,0.10), rgba(180,126,55,0.02));
  color: var(--gold);
}
.exlib-icon-empty svg { display: block; }
/* Coach exercise-library card titles — uniformly left-aligned with
   consistent left padding so the column reads like a clean list. */
.exlib-card .meal-card-body { text-align: left; padding-left: 16px; padding-right: 16px; }
.exlib-card .meal-card-body h3 { text-align: left; }
.exlib-card .meal-card-macros { text-align: left; }
.exlib-card .meal-card-tags { justify-content: flex-start; }
.exlib-card .meal-card-actions { justify-content: flex-start; padding-left: 16px; }
@media (max-width: 600px) {
  .exlib-card .meal-card-body { padding-left: 12px; padding-right: 12px; }
  .exlib-card .meal-card-actions { padding-left: 12px; }
}

/* ---------------- Home dashboard hero (client) ---------------- */

.hero-cold-start {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--warm) 0%, rgba(180,126,55,0.04) 100%);
}
.cold-start-steps {
  list-style: none;
  counter-reset: hero-step;
  padding: 0;
  margin: 8px 0 0;
}
.cold-start-steps li {
  counter-increment: hero-step;
  position: relative;
  padding: 10px 8px 10px 44px;
  border-top: 1px solid var(--hairline-dim);
  font-size: 14px;
  line-height: 1.5;
}
.cold-start-steps li:first-child { border-top: 0; }
.cold-start-steps li::before {
  content: counter(hero-step);
  position: absolute; left: 8px; top: 8px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold);
  color: var(--canvas);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  border-radius: 50%;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 14px 0 18px;
}
.hero-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, var(--warm) 0%, rgba(20, 17, 13, 0.88) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 16px 16px 14px;
  min-height: 108px;
  position: relative;
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.hero-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 100% 0%, rgba(180, 126, 55, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.hero-tile-empty {
  opacity: 0.6;
  background: var(--warm);
}
.hero-tile-empty::before { display: none; }
.hero-tile-empty:hover { opacity: 0.85; }
.hero-tile-wide { grid-column: span 2; }
.hero-tile-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
}
.hero-tile-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  position: relative;
}
.hero-tile-value-text {
  font-size: 18px;
  color: var(--text);
  line-height: 1.25;
  /* Limit to 2 lines so a long program name doesn't bloat the tile */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-tile-unit {
  font-size: 14px;
  color: var(--text-dim);
  margin-left: 2px;
}
.hero-tile-meta {
  font-size: 12px;
  color: var(--text-dim);
}
.trend-up { color: #f59e0b; }
.trend-down { color: #4ade80; }

@media (min-width: 720px) {
  .hero-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-tile-wide { grid-column: span 2; }
}

/* Top 3 Today is the PRIMARY anchor on the dashboard. It needs more visual
   gravity than the data tiles above it — gold-accented header strip, richer
   surface, taller titles. Everything else recedes. */
.hero-actions {
  background: linear-gradient(180deg, rgba(180, 126, 55, 0.06) 0%, var(--warm) 35%);
  border: 1px solid rgba(180, 126, 55, 0.22);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 18px 20px 20px;
  margin: 6px 0 18px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  position: relative;
}
.hero-actions::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 126, 55, 0.4), transparent);
}
.hero-actions-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hero-actions-head h3 {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hero-actions-list {
  margin: 0;
  padding-left: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  list-style: none;
  counter-reset: action-num;
}
.hero-actions-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  counter-increment: action-num;
}
.hero-actions-list li:last-child { margin-bottom: 0; }
.hero-actions-list li::before {
  content: counter(action-num);
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(180, 126, 55, 0.18);
  color: var(--gold);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meal-plan-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 16px;
}
.meal-plan-banner:hover { border-color: var(--gold); }
.meal-plan-banner strong {
  display: block;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  margin-bottom: 2px;
}
.meal-plan-banner .meta { font-size: 12px; }
.meal-plan-banner-arrow {
  color: var(--gold);
  font-size: 22px;
  flex-shrink: 0;
}

/* ---------------- Daily System editor (coach) ---------------- */

.ds-gen-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ds-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.ds-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ds-editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ds-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--text-dim); }
.ds-field input,
.ds-field textarea {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
}
.ds-h4 {
  margin: 18px 0 8px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.ds-section-row {
  display: grid;
  grid-template-columns: 1fr 200px auto;
  grid-template-areas: "title time del" "body body body" "loom loom loom";
  gap: 8px;
  padding: 12px;
  background: var(--warm-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.ds-section-row .sec-title { grid-area: title; }
.ds-section-row .sec-time { grid-area: time; }
.ds-section-row .sec-del { grid-area: del; }
.ds-section-row .sec-body { grid-area: body; resize: vertical; }
.ds-section-row .sec-loom { grid-area: loom; }
.ds-section-row input,
.ds-section-row textarea {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 6px 9px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.ds-supp-row {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr 0.8fr 1.4fr 1fr 28px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.ds-supp-row input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: 13px;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
@media (max-width: 720px) {
  .ds-supp-row { grid-template-columns: 1fr 1fr; }
  .ds-section-row { grid-template-columns: 1fr 28px; grid-template-areas: "title del" "time time" "body body" "loom loom"; }
}

/* Coach editor — phase-based daily system */
.ds-edit-card { overflow: hidden; }
.ds-variant-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  margin-bottom: 14px;
}
.ds-vt-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.ds-vt-btn:hover { color: var(--text); }
.ds-vt-btn.active { background: var(--gold); color: #1c1a16; }
.ds-vt-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ds-edit-subhead {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin: 8px 0 6px;
}

.ds-item-row-edit {
  display: grid;
  grid-template-columns: 70px 1fr 1.2fr 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.ds-item-row-edit input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 6px 9px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ds-item-row-edit .it-time { text-align: center; font-variant-numeric: tabular-nums; }
.ds-item-row-edit .it-del,
.ds-detail-row-edit .dt-del {
  font-size: 18px;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}
.ds-item-row-edit .it-del:hover,
.ds-detail-row-edit .dt-del:hover { color: var(--red, #c4554d); }

.ds-detail-row-edit {
  display: grid;
  grid-template-columns: 1fr 0.7fr 28px;
  gap: 6px;
  align-items: start;
  margin-bottom: 6px;
}
.ds-detail-row-edit textarea,
.ds-detail-row-edit input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 6px 9px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

@media (max-width: 720px) {
  .ds-item-row-edit { grid-template-columns: 64px 1fr 28px; }
  .ds-item-row-edit .it-loom { grid-column: 1 / -1; }
  .ds-detail-row-edit { grid-template-columns: 1fr 28px; }
  .ds-detail-row-edit .dt-loom { grid-column: 1 / -1; }
}
.ds-edit-card .ds-field input,
.ds-edit-card .ds-field textarea { max-width: 100%; box-sizing: border-box; }
.ds-phase-edit {
  border: 1px solid var(--hairline);
  background: var(--warm-raised);
  border-radius: var(--radius-card);
  padding: 14px 14px 12px;
  margin-bottom: 14px;
  max-width: 100%;
  box-sizing: border-box;
}
.ds-phase-edit-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ds-phase-edit-head .ph-title {
  flex: 1;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ds-phase-edit .ph-subtitle {
  width: 100%;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 6px 9px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 10px;
  box-sizing: border-box;
}
.ds-phase-edit .ph-details {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  width: 100%;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
.ds-phase-edit .ph-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.ds-item-row {
  display: grid;
  grid-template-columns: 70px 1fr 1.2fr 28px;
  gap: 6px;
  align-items: center;
}
.ds-item-row input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--text);
  padding: 6px 9px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ds-item-row .it-time {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ds-item-row .it-del {
  font-size: 18px;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}
.ds-item-row .it-del:hover { color: var(--red, #c4554d); }
@media (max-width: 720px) {
  .ds-item-row { grid-template-columns: 64px 1fr 28px; }
  .ds-item-row .it-loom { grid-column: 1 / -1; }
}
.ds-history { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-dim); }

/* ---------------- Daily System: client document (Beast Mode brand) ---------------- */

/* BL-16b — Fraunces @import moved to base.html <head> (see top of file). */

.ds-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 22px 80px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
}
.ds-doc-header {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.ds-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}
.ds-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 38px;
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ds-intro {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}
.ds-doc-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ds-section {
  margin: 36px 0;
  padding-left: 16px;
  border-left: 2px solid var(--hairline);
}
.ds-section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}
.ds-section-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.ds-section-body p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.ds-section-body p:last-child { margin-bottom: 0; }
.ds-loom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.ds-loom:hover { color: var(--gold-hi); }

.ds-supplements {
  margin: 40px 0 24px;
  padding: 22px;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}
.ds-supp-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}
.ds-supp-table th {
  text-align: left;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 8px;
  border-bottom: 1px solid var(--hairline);
}
.ds-supp-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--hairline-dim);
  color: var(--text-secondary);
  vertical-align: top;
}
.ds-supp-table tr:last-child td { border-bottom: 0; }
.ds-supp-table td:first-child { color: var(--text); font-weight: 500; }
.ds-loom-inline {
  display: inline-block;
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ds-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.04em;
}

/* ---------------- Daily System: client beige-card design ---------------- */

/* Brand palette for the card itself. Matte cream paper, square corners,
   like the Maps detail card aesthetic. */
:root {
  --ds-paper: #f4ede0;        /* matte beige base */
  --ds-paper-2: #ece4d2;      /* slightly darker fold for phases */
  --ds-paper-3: #e3dac6;      /* bordered chip */
  --ds-paper-ink: #1c1a16;    /* near-black ink */
  --ds-paper-ink-2: #463f33;  /* secondary ink */
  --ds-paper-ink-dim: #6b6353;
  --ds-paper-rule: #d8cdb4;
  --ds-paper-gold: #b47e37;
}

.ds-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 14px 80px;
}

.ds-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* The main card. Square corners, off-white, lift only by shadow. */
.ds-card {
  background: var(--ds-paper);
  color: var(--ds-paper-ink);
  border: 1px solid var(--ds-paper-rule);
  border-radius: 4px;          /* square-ish per Manou */
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 24px 80px -40px rgba(0,0,0,0.55);
  overflow: hidden;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Header band — yellow brand strip + Daily System title */
.ds-card-head {
  background: linear-gradient(180deg, #f7e8b2 0%, #f0dc94 100%);
  border-bottom: 1px solid var(--ds-paper-rule);
  padding: 22px 22px 18px;
  text-align: center;
  position: relative;
}
.ds-card-head .ds-eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: #8a7140;
  font-weight: 700;
  margin-bottom: 4px;
}
.ds-card-head .ds-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 600;
  font-size: 38px;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ds-paper-ink);
}
.ds-card-name {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ds-paper-ink-2);
}

/* Variant toggle (Gym / Non-Gym) */
.ds-variant-toggle {
  display: inline-flex;
  margin-top: 14px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--ds-paper-rule);
  border-radius: 999px;
  padding: 3px;
}
.ds-variant-btn {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ds-paper-ink-2);
  transition: background .15s ease, color .15s ease;
}
.ds-variant-btn.active {
  background: var(--ds-paper-ink);
  color: var(--ds-paper);
}
.ds-variant-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.ds-variant-static {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ds-paper-ink-2);
}

.ds-card-intro {
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ds-paper-ink-2);
  margin: 0;
  padding: 18px 22px 4px;
  border-bottom: 0;
}

/* "Do This First" Loom CTA */
.ds-do-this-first {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 22px 4px;
  padding: 12px 16px;
  background: var(--ds-paper-ink);
  color: var(--ds-paper);
  border-radius: 4px;
  text-decoration: none;
  transition: transform .15s ease;
}
.ds-do-this-first:hover { transform: translateY(-1px); }
.ds-dtf-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ds-paper);
  opacity: 0.8;
}
.ds-dtf-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ds-paper);
}

/* Phase list — each phase shaded slightly differently for visual rhythm */
.ds-phase-list {
  padding: 6px 0 18px;
}
.ds-phase {
  padding: 22px 22px 18px;
  border-top: 1px solid var(--ds-paper-rule);
  background: var(--ds-paper);
}
.ds-phase-1 { background: var(--ds-paper); }
.ds-phase-2 { background: var(--ds-paper-2); }
.ds-phase-3 { background: var(--ds-paper); }
.ds-phase-4 { background: var(--ds-paper-2); }

.ds-phase-head { margin-bottom: 14px; }
.ds-phase-num {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ds-paper-gold);
  font-weight: 700;
}
.ds-phase-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-style: italic;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 4px 0 0;
  color: var(--ds-paper-ink);
}
.ds-phase-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ds-paper-ink-dim);
  font-style: italic;
}

/* Two-column layout per phase. Items left, Details right. Stack on mobile. */
.ds-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 22px;
  align-items: start;
}
.ds-col-items, .ds-col-details { min-width: 0; }

.ds-items {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ds-paper-rule);
  background: rgba(255,255,255,0.55);
  border-radius: 3px;
}
.ds-item {
  border-bottom: 1px dashed var(--ds-paper-rule);
}
.ds-item:last-child { border-bottom: 0; }
.ds-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  color: var(--ds-paper-ink);
  font: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  transition: background .12s ease;
  font-family: inherit;
}
.ds-item-row:disabled { cursor: default; }
.ds-item.has-loom .ds-item-row:hover { background: rgba(180,126,55,0.10); }
.ds-item.has-loom.playing .ds-item-row { background: rgba(180,126,55,0.16); }
.ds-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ds-paper-ink);
  letter-spacing: 0.01em;
}
.ds-sep { color: var(--ds-paper-ink-dim); font-weight: 400; }
.ds-activity {
  flex: 1;
  color: var(--ds-paper-ink);
  font-weight: 500;
  word-break: break-word;
}
.ds-item.has-loom .ds-activity {
  text-decoration: underline;
  text-decoration-color: rgba(180,126,55,0.45);
  text-underline-offset: 3px;
}
.ds-play {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ds-paper-gold);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ds-item.has-loom.playing .ds-play { transform: rotate(90deg); }

.ds-loom-frame {
  padding: 0 12px 12px;
  background: rgba(255,255,255,0.55);
}
.ds-loom-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  background: #000;
  display: block;
}
.ds-loom-open {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ds-paper-gold);
  text-decoration: none;
}
.ds-loom-open:hover { text-decoration: underline; }

/* Details column */
.ds-details-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ds-paper-gold);
  border-bottom: 1px solid var(--ds-paper-rule);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
ul.ds-details {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
ul.ds-details > li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ds-paper-ink-2);
  padding-left: 16px;
  position: relative;
  word-break: break-word;
}
ul.ds-details > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ds-paper-gold);
}
.ds-detail-loom {
  color: var(--ds-paper-gold);
  text-decoration: underline;
  font-style: italic;
  margin-left: 4px;
}

/* Supplements inside the same card */
.ds-card-sub {
  padding: 22px;
  border-top: 1px solid var(--ds-paper-rule);
  background: var(--ds-paper);
}
.ds-card-sub .ds-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ds-paper-gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.ds-card-sub .ds-section-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--ds-paper-ink);
}
.ds-supp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.ds-supp-card {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--ds-paper-rule);
  border-radius: 3px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-supp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ds-supp-name { color: var(--ds-paper-ink); font-weight: 600; font-size: 14px; }
.ds-supp-dose {
  color: var(--ds-paper-gold);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.ds-supp-when {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-paper-ink-dim);
}
.ds-supp-notes {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ds-paper-ink-2);
}

.ds-card-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--ds-paper-rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ds-paper-ink-dim);
  letter-spacing: 0.05em;
  background: var(--ds-paper);
}
.ds-card-footer a {
  color: var(--ds-paper-gold);
  text-decoration: none;
  font-weight: 600;
}
.ds-card-footer a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .ds-shell { padding: 14px 10px 80px; }
  .ds-card-head { padding: 18px 16px 14px; }
  .ds-card-head .ds-title { font-size: 30px; }
  .ds-card-intro { padding: 14px 16px 0; font-size: 13.5px; }
  .ds-do-this-first { margin: 12px 16px 0; padding: 10px 14px; }
  .ds-phase { padding: 18px 16px 14px; }
  .ds-phase-title { font-size: 22px; }
  .ds-cols { grid-template-columns: 1fr; gap: 14px; }
  .ds-card-sub { padding: 18px 16px; }
  .ds-card-footer { padding: 12px 16px 14px; }
}

/* 6-tab bottom nav: tighten label so System fits */
@media (max-width: 380px) {
  .bottom-tabs a { font-size: 10px; }
  .bottom-tabs a svg { width: 20px; height: 20px; }
}

/* Print mode: clean version when client saves as PDF */
.ds-print-mode { padding: 0; }
@media print {
  body { background: #fff !important; color: #1c1a16 !important; }
  .top, header.top, .bottom-tabs, .pwa-install-banner, footer,
  #quick-log-fab, #quick-log-sheet { display: none !important; }
  .ds-shell { padding: 0; }
  .ds-card { box-shadow: none; border: 1px solid #d8cdb4; border-radius: 0; }
  .ds-do-this-first, .ds-variant-toggle { display: none !important; }
  .ds-phase { page-break-inside: avoid; }
  .ds-loom-frame { display: none !important; }
  .ds-play { display: none; }
  .ds-item-row { cursor: default !important; }
  .ds-item.has-loom .ds-activity { text-decoration: none; }
  .ds-card-footer a { display: none; }
  .ds-title, .ds-phase-title { color: #1c1a16; }
  ul.ds-details > li { color: #2f2c28; }
  .ds-eyebrow, .ds-section-eyebrow, .ds-supp-dose,
  .ds-detail-loom, .ds-loom-open { color: #b47e37; }
  a { color: #b47e37; text-decoration: underline; }
}

/* ============================================================
   Muscle chip multi-select (program editor + exercise library)
   Replaces the old .ex-muscle-grid / .ex-muscle-opt checkboxes.
   Shared between client + coach surfaces; appended additively.
   ============================================================ */
.muscle-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}
.muscle-chip {
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: capitalize;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--hairline, rgba(255,255,255,0.12));
  border-radius: 999px;
  padding: 7px 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease,
              color 140ms ease, box-shadow 180ms ease, transform 80ms ease;
}
.muscle-chip:hover {
  border-color: rgba(180,126,55,0.55);
  color: var(--gold-hi, #d8b58f);
  background: rgba(180,126,55,0.05);
}
.muscle-chip:active { transform: translateY(1px); }
.muscle-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(180,126,55,0.45);
}
.muscle-chip.is-selected {
  background: var(--gold, #b47e37);
  border-color: var(--gold, #b47e37);
  color: #1c1a16;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(180,126,55,0.35),
              0 4px 14px -4px rgba(180,126,55,0.55);
}
.muscle-chip.is-selected:hover {
  background: var(--gold-hi, #d8b58f);
  border-color: var(--gold-hi, #d8b58f);
  color: #1c1a16;
}

/* Library filter strip (top of exercise_library page). */
.lib-filter {
  border: 1px solid var(--hairline, rgba(255,255,255,0.10));
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin: 12px 0 18px;
  background: rgba(255,255,255,0.015);
}
.lib-filter legend {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim, #9aa0a6);
  padding: 0 6px;
}
.lib-filter-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim, #9aa0a6);
  min-height: 1em;
}

@media (max-width: 520px) {
  .muscle-chip { font-size: 11px; padding: 6px 11px; }
}

/* ────────────────────────────────────────────────────────────────────
   Global in-app modal (pfaConfirm / pfaAlert).
   Mirrors coach_views.css .pf-modal but is loaded for client surfaces too.
   Brand: warm dark backdrop, gold primary, Poppins/Lato fonts,
   12-16px radius, subtle shadow, backdrop blur.
   ──────────────────────────────────────────────────────────────────── */
.pf-modal-back {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(3, 3, 3, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: pfaFadeIn 140ms ease-out;
}
.pf-modal {
  max-width: 420px; width: 100%;
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.22);
  border-radius: 16px;
  padding: 26px 24px 22px;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.6);
  animation: pfaPopIn 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.pf-modal .pf-modal-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--text, #fdfdff);
  margin: 0 0 10px;
  text-transform: none;
}
.pf-modal p {
  margin: 0 0 20px;
  color: var(--text, #fdfdff);
  line-height: 1.55;
  font-size: 15px;
}
.pf-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; align-items: center;
  flex-wrap: wrap;
}
.pf-modal .btn-link,
.pf-modal .btn-gold {
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 18px;
  transition: background 140ms, color 140ms, border-color 140ms;
}
.pf-modal .btn-link {
  color: var(--text-dim, #8a8785);
  background: transparent;
  border: 1px solid transparent;
}
.pf-modal .btn-link:hover { color: var(--text, #fdfdff); background: rgba(255,255,255,0.04); }
.pf-modal .btn-gold {
  background: var(--gold, #b47e37);
  color: #0a0908;
  border: 1px solid var(--gold, #b47e37);
}
.pf-modal .btn-gold:hover { background: var(--gold-hi, #d8b58f); border-color: var(--gold-hi, #d8b58f); }
.pf-modal .pfa-ok-danger {
  background: var(--red, #e93d3d);
  border-color: var(--red, #e93d3d);
  color: #fff;
}
.pf-modal .pfa-ok-danger:hover { background: #c43232; border-color: #c43232; }

@keyframes pfaFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfaPopIn {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .pf-modal-back { padding: 16px; align-items: flex-end; }
  .pf-modal {
    max-width: 100%;
    border-radius: 18px 18px 12px 12px;
    padding: 22px 20px 20px;
  }
  .pf-modal-actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .pf-modal-actions .btn-link,
  .pf-modal-actions .btn-gold {
    width: 100%;
    text-align: center;
    padding: 14px 18px;
  }
}

/* Locked-app billing surface: header logout + premium subscribe card */
.header-logout {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text-dim, #8a8785) !important;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--hairline-dim, #1f1c19);
  background: transparent;
  text-decoration: none !important;
  transition: color 140ms, border-color 140ms, background 140ms;
}
.header-logout:hover {
  color: var(--text, #fdfdff) !important;
  border-color: var(--hairline, #2b2520);
  background: rgba(255,255,255,0.03);
}

/* Subscribe-now card on /billing */
.billing-subscribe {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(180,126,55,0.10), transparent 55%),
    var(--warm, #1b1815);
  border: 1px solid rgba(180,126,55,0.25);
}
.billing-subscribe h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  text-transform: none; letter-spacing: -0.01em;
  color: var(--text, #fdfdff); margin: 6px 0 10px;
}
.billing-lock-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(180,126,55,0.12);
  border: 1px solid rgba(180,126,55,0.30);
  border-radius: 12px;
  color: var(--gold, #b47e37);
  margin-bottom: 4px;
}
.billing-lock-icon svg { width: 22px; height: 22px; }
.billing-perks { list-style: none; padding: 0; margin: 14px 0 18px; }
.billing-perks li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  color: var(--text, #fdfdff);
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.billing-perks li:last-child { border-bottom: 0; }
.billing-perks .check {
  flex-shrink: 0; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(180,126,55,0.15);
  border-radius: 50%;
  color: var(--gold, #b47e37);
  margin-top: 1px;
}
.billing-perks .check svg { width: 12px; height: 12px; }
.billing-subscribe .btn { min-height: 48px; padding: 12px 22px; font-size: 15px; }

.billing-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary, #c2bfbc);
}
.billing-status-pill.active   { background: rgba(180,126,55,0.12); border-color: rgba(180,126,55,0.35); color: var(--gold, #b47e37); }
.billing-status-pill.trialing { background: rgba(180,126,55,0.10); border-color: rgba(180,126,55,0.30); color: var(--gold-hi, #d8b58f); }
.billing-status-pill.in_grace { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.30); color: #f59e0b; }
.billing-status-pill.lapsed,
.billing-status-pill.none     { background: rgba(233,61,61,0.08); border-color: rgba(233,61,61,0.30); color: #f87171; }

/* Coach client-list: status pill colour variants */
.status-pill.client-active   { background: rgba(180,126,55,0.14); color: var(--gold, #b47e37); border: 1px solid rgba(180,126,55,0.35); }
.status-pill.client-pending  { background: rgba(245,158,11,0.10); color: #f59e0b; border: 1px solid rgba(245,158,11,0.30); }
.status-pill.client-onboarding { background: rgba(255,255,255,0.05); color: var(--text-secondary, #c2bfbc); border: 1px solid rgba(255,255,255,0.10); }
.status-pill.client-lapsed   { background: rgba(233,61,61,0.08); color: #f87171; border: 1px solid rgba(233,61,61,0.30); }

/* Quick-onboarding (mini funnel) styles */
.quick-onb-wrap { max-width: 540px; margin: 0 auto; padding: 32px 20px 80px; }
.quick-onb-progress {
  height: 4px; background: rgba(255,255,255,0.06); border-radius: 999px;
  overflow: hidden; margin-bottom: 18px;
}
.quick-onb-progress > span {
  display: block; height: 100%;
  background: var(--gold, #b47e37);
  transition: width 240ms cubic-bezier(0.2,0.8,0.2,1);
}
.quick-onb-step { display: none; }
.quick-onb-step.active { display: block; animation: pfaFadeIn 220ms ease-out; }
.quick-onb-step h2 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px; line-height: 1.3; margin: 4px 0 6px;
  color: var(--text, #fdfdff); font-weight: 500;
}
.quick-onb-step .qsub { color: var(--text-dim, #8a8785); font-size: 14px; margin: 0 0 22px; }
.quick-onb-options { display: flex; flex-direction: column; gap: 10px; }
.quick-onb-options label {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--warm, #1b1815);
  border: 1px solid var(--hairline, #2b2520);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 140ms, background 140ms;
  min-height: 56px;
  color: var(--text, #fdfdff);
  font-size: 15px;
}
.quick-onb-options label:hover { border-color: rgba(180,126,55,0.35); background: rgba(180,126,55,0.04); }
.quick-onb-options input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--text-dim, #8a8785);
  border-radius: 50%;
  margin: 0; flex-shrink: 0;
  position: relative; cursor: pointer;
}
.quick-onb-options input[type="radio"]:checked {
  border-color: var(--gold, #b47e37);
  background: radial-gradient(circle, var(--gold, #b47e37) 0 6px, transparent 7px);
}
.quick-onb-options label:has(input:checked) {
  border-color: var(--gold, #b47e37);
  background: rgba(180,126,55,0.06);
}
.quick-onb-actions {
  margin-top: 28px;
  display: flex; gap: 10px; justify-content: flex-end;
}
.quick-onb-actions .btn { min-height: 48px; padding: 12px 26px; }
.quick-onb-eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; color: var(--gold, #b47e37); font-weight: 600;
  margin-bottom: 6px;
}
@media (max-width: 480px) {
  .quick-onb-wrap { padding: 24px 16px 100px; }
  .quick-onb-step h2 { font-size: 19px; }
  .quick-onb-actions { flex-direction: column-reverse; align-items: stretch; }
  .quick-onb-actions .btn { width: 100%; }
}

/* ============================================================
   Workout Session V2 — premium redesign (2026-04-28)
   Inspired by Strong, Hevy, Fitbod for hierarchy + chrome reduction.
   Additive only — does not replace .session-blocks/.ex-block legacy rules
   used elsewhere; new namespace is .ws-*.
   ============================================================ */

.ws-page { padding-bottom: 100px; }

.ws-top {
  display: flex; align-items: center; gap: 12px;
  margin: -8px 0 8px;
  padding: 4px 0;
}
.ws-back {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  text-decoration: none;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.ws-back:hover { color: var(--gold); border-color: var(--gold); background: rgba(180,126,55,0.08); }
.ws-top-meta { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ws-eyebrow {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.ws-notes-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline); cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.ws-notes-toggle:hover { color: var(--gold); border-color: var(--gold); }

.ws-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500; font-size: 30px; line-height: 1.1;
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.ws-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 22px; }

.ws-blocks { display: flex; flex-direction: column; gap: 18px; }

/* Per-exercise card */
.ws-ex {
  background: linear-gradient(155deg, rgba(180,126,55,0.04), rgba(255,255,255,0.005));
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 18px 18px 20px;
  position: relative;
}
.ws-ex-head {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.ws-ex-titleblock {
  display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
  text-align: left;
}
.ws-ex-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(180,126,55,0.10);
  border: 1px solid rgba(180,126,55,0.24);
  border-radius: 10px;
  color: var(--gold);
}
.ws-ex-icon svg { display: block; }
.ws-ex-name {
  margin: 0;
  flex: 1 1 auto;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--text);
  text-transform: none;
  text-align: left;
}
.ws-ex-target {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ws-ex-target-num { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500; }
.ws-ex-target-x { color: var(--text-dim); margin: 0 1px; }
.ws-ex-target-meta { color: var(--text-dim); font-size: 12px; margin-left: 4px; }
.ws-ex-muscles {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0;
}
.ws-muscle-tag {
  display: inline-block;
  background: rgba(180,126,55,0.08);
  border: 1px solid rgba(180,126,55,0.2);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
}

/* Last-time banner (Strong-style) */
.ws-last {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ws-last-label {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.ws-last-value {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px;
}
.ws-last-rpe {
  background: rgba(180,126,55,0.12);
  border: 1px solid rgba(180,126,55,0.3);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--gold);
}
.ws-last-when { color: var(--text-dim); font-size: 12px; margin-left: auto; }
.ws-last-first {
  border-left-color: rgba(180,126,55,0.6);
}
.ws-last-first .ws-last-value { color: var(--text-secondary); font-style: italic; font-weight: 500; }

/* Form-demo (chrome-stripped) */
.ws-demo {
  position: relative;
  margin: 0 0 14px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.5);
  aspect-ratio: 16 / 9;
}
.ws-demo-thumb {
  position: relative;
  width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer;
  background: transparent;
  display: block;
}
.ws-demo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 200ms;
}
.ws-demo-thumb:hover img { filter: brightness(1.08); }
.ws-demo-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ws-demo-label {
  position: absolute; bottom: 10px; left: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 4px;
}
.ws-demo-iframe {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
/* Soft top scrim hides any title overlay YouTube renders despite modestbranding */
.ws-demo-scrim {
  position: absolute; top: 0; left: 0; right: 0;
  height: 60px;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.65) 0%,
    rgba(0,0,0,0.25) 60%,
    rgba(0,0,0,0) 100%);
}

.ws-cues {
  list-style: none;
  padding: 0; margin: 0 0 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.ws-cues li {
  position: relative;
  padding: 4px 4px 4px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ws-cues li::before {
  content: "";
  position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.ws-meta { color: var(--text-dim); font-size: 13px; margin: 0 0 10px; }

/* Completed sets — clean stack of cards */
.ws-set-stack {
  display: flex; flex-direction: column; gap: 8px;
  margin: 4px 0 14px;
}
.ws-set:empty { display: none; }
.ws-set-stack:empty { display: none; }
.ws-set {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  transition: background 160ms, border-color 160ms;
}
.ws-set:hover { background: rgba(255,255,255,0.035); }
.ws-set-num {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--gold);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ws-set-body { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.ws-set-line { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ws-set-big {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: 3px;
}
.ws-set-unit {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.ws-set-x {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 400; font-size: 14px;
  color: var(--text-dim);
}
.ws-rpe-pill {
  background: rgba(180,126,55,0.12);
  border: 1px solid rgba(180,126,55,0.3);
  border-radius: 999px;
  padding: 2px 9px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
}
/* Color RPE pill by intensity (high RPE = warmer red) */
.ws-rpe-pill[data-rpe="9"], .ws-rpe-pill[data-rpe="10"] {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.3);
  color: #f87171;
}
.ws-rpe-pill[data-rpe="1"], .ws-rpe-pill[data-rpe="2"], .ws-rpe-pill[data-rpe="3"] {
  background: rgba(108,212,154,0.10);
  border-color: rgba(108,212,154,0.25);
  color: #6cd49a;
}
.ws-set-del {
  width: 28px; height: 28px;
  border: 0; background: transparent;
  border-radius: 6px;
  color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color 160ms, background 160ms;
}
.ws-set-del:hover { color: #f87171; background: rgba(248,113,113,0.08); }

/* Input — weight + reps + RPE picker */
.ws-input {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.ws-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.ws-input-field {
  position: relative;
  display: flex; flex-direction: column;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 14px;
  transition: border-color 160ms;
}
.ws-input-field:focus-within { border-color: var(--gold); }
.ws-input-label {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  margin-bottom: 2px;
}
.ws-input-field input {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  outline: none;
  width: 100%;
  letter-spacing: -0.01em;
}
.ws-input-field input::placeholder { color: var(--text-dim); }
.ws-input-unit {
  position: absolute;
  right: 14px; bottom: 12px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  pointer-events: none;
}

/* RPE trigger pill (collapsed default — opens bottom sheet on tap) */
.ws-input-row { align-items: stretch; }
.ws-rpe-trigger {
  display: inline-flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  gap: 2px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: inherit;
  cursor: pointer;
  min-width: 90px;
  position: relative;
  transition: border-color 160ms, background 160ms, box-shadow 200ms;
  -webkit-tap-highlight-color: transparent;
}
.ws-rpe-trigger:hover { border-color: rgba(180,126,55,0.55); }
.ws-rpe-trigger:active { transform: scale(0.99); }
.ws-rpe-trigger[aria-expanded="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(180,126,55,0.18);
}
.ws-rpe-trigger-label {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.ws-rpe-trigger-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500; font-size: 18px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.ws-rpe-trigger.is-set .ws-rpe-trigger-value { color: var(--gold); }
.ws-rpe-trigger-caret {
  position: absolute;
  right: 10px; bottom: 10px;
  color: var(--text-dim);
  pointer-events: none;
}

/* Generic sheet (RPE + exercise picker share) */
.ws-sheet {
  position: fixed; inset: 0;
  z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
}
.ws-sheet[hidden] { display: none !important; }
.ws-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.ws-sheet.is-open .ws-sheet-backdrop { opacity: 1; }
.ws-sheet-card {
  position: relative;
  background: var(--warm-raised);
  border: 1px solid var(--hairline);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  width: 100%;
  max-width: 720px;
  padding: 8px 18px 22px;
  box-shadow: 0 -16px 40px rgba(0,0,0,0.55);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 200ms ease-out, opacity 200ms ease-out;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ws-sheet.is-open .ws-sheet-card { transform: translateY(0); opacity: 1; }
.ws-sheet-handle {
  width: 38px; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  margin: 6px auto 12px;
}
.ws-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.ws-sheet-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.ws-sheet-close {
  width: 32px; height: 32px;
  border: 0; background: transparent;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 160ms, background 160ms;
}
.ws-sheet-close:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.ws-sheet-foot {
  display: flex; justify-content: flex-end; padding-top: 10px;
  flex-shrink: 0;
}

/* Desktop: center the sheet as a popover instead of edge-pinning */
@media (min-width: 720px) {
  .ws-sheet { align-items: center; }
  .ws-sheet-card {
    border-radius: 18px;
    border: 1px solid var(--hairline);
    width: calc(100% - 64px);
  }
  .ws-sheet-handle { display: none; }
}

/* RPE speedometer — horizontal gradient track + halo + big readout (V8, drops V7 SVG arc) */
.ws-rpe-sheet { padding-bottom: 22px; }
.ws-rpe-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 6px 10px;
  width: 100%;
}

/* Big numeric readout above the track — replaces V7 SVG arc.
   Sits in its own row so it never overlaps the track or halo. */
.ws-rpe-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  margin: 0 auto 2px;
  pointer-events: none;
}
.ws-rpe-readout-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 200ms, transform 240ms cubic-bezier(0.22, 0.7, 0.3, 1);
}
.ws-rpe-readout-value.is-empty {
  color: var(--text-dim);
  font-size: 36px;
}

/* Linear gradient track — the source of truth */
.ws-rpe-track {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 56px;
  margin: 0 auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  outline: none;
}
.ws-rpe-track:focus-visible .ws-rpe-track-bar {
  box-shadow: 0 0 0 2px rgba(180,126,55,0.55);
}
.ws-rpe-track-bar {
  position: absolute;
  top: 18px;
  left: 0; right: 0;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #3aa86b 0%,
    #5fb260 18%,
    #b8a322 50%,
    #d4a017 60%,
    #c43d3d 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.35),
    0 4px 12px -6px rgba(0,0,0,0.6);
}
.ws-rpe-track-halo {
  position: absolute;
  top: 11px;
  left: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--warm-raised);
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 4px rgba(180,126,55,0.18),
    0 6px 14px -4px rgba(0,0,0,0.5);
  transform: translateX(-50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: left 240ms cubic-bezier(0.22, 0.7, 0.3, 1),
              opacity 200ms,
              transform 200ms;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.ws-rpe-track.has-value .ws-rpe-track-halo {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.ws-rpe-halo-num {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ws-rpe-ticks {
  position: absolute;
  top: 36px;
  left: 0; right: 0;
  height: 6px;
  pointer-events: none;
}
.ws-rpe-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 6px;
  background: rgba(255,255,255,0.32);
  transform: translateX(-50%);
}
.ws-rpe-tick.is-major { height: 10px; background: rgba(255,255,255,0.55); }
.ws-rpe-numbers {
  position: absolute;
  top: 44px;
  left: 0; right: 0;
  height: 14px;
  pointer-events: none;
}
.ws-rpe-num {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* Per-value descriptor under the track */
.ws-rpe-descriptor {
  margin: 4px 0 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.01em;
  min-height: 1.2em;
  transition: color 200ms;
}
.ws-rpe-track.has-value ~ .ws-rpe-descriptor,
.ws-rpe-gauge.has-value .ws-rpe-descriptor {
  color: var(--text);
}

@media (min-width: 720px) {
  .ws-rpe-track { max-width: 480px; height: 60px; cursor: grab; }
  .ws-rpe-track:active { cursor: grabbing; }
  .ws-rpe-descriptor { font-size: 14px; }
  .ws-rpe-readout-value { font-size: 64px; }
  .ws-rpe-readout-value.is-empty { font-size: 40px; }
}

/* Exercise picker (Strong-app style — full-bleed mobile, modal desktop) */
.ws-sheet-full .ws-sheet-card {
  height: 92vh;
  max-height: 92vh;
}
@media (min-width: 720px) {
  .ws-sheet-full .ws-sheet-card {
    height: 80vh;
    max-height: 720px;
    width: calc(100% - 64px);
    max-width: 720px;
  }
}
.ws-picker-card { padding: 8px 18px 0; }
.ws-picker-head {
  position: sticky; top: 0;
  background: var(--warm-raised);
  z-index: 2;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.ws-picker-head .ws-sheet-title { margin-right: auto; }
.ws-picker-head .ws-sheet-close { position: absolute; right: 0; top: 0; }
.ws-picker-search {
  position: relative;
  display: flex; align-items: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0 14px 0 38px;
  height: 42px;
  transition: border-color 160ms;
}
.ws-picker-search:focus-within { border-color: var(--gold); }
.ws-picker-search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim);
}
#ex-picker-search {
  background: transparent; border: 0; outline: none;
  color: var(--text);
  width: 100%; height: 100%;
  font: 500 14px/1 "Lato", sans-serif;
}
#ex-picker-search::placeholder { color: var(--text-dim); }
/* Filter trigger row — two big buttons that open modals (replaced
   horizontal-scroll chip rows that hid options below the fold). */
.ws-picker-filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ws-picker-filter-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.32);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms, background 160ms;
  min-height: 48px;
  min-width: 0;
}
.ws-picker-filter-btn-label { flex: 0 0 auto; }
.ws-picker-filter-btn:hover {
  border-color: rgba(180,126,55,0.45);
  background: rgba(180,126,55,0.04);
}
.ws-picker-filter-btn.is-active {
  border-color: rgba(180,126,55,0.55);
  background: rgba(180,126,55,0.08);
}
.ws-picker-filter-btn-label {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 10px; font-weight: 700;
  color: var(--text-dim);
}
.ws-picker-filter-btn-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--text);
  margin-left: auto;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-picker-filter-btn.is-active .ws-picker-filter-btn-value { color: var(--gold); }
.ws-picker-filter-btn-caret { color: var(--text-dim); flex-shrink: 0; }

/* Filter modal — full vertical scrollable list, single-select */
.ws-filter-modal-card {
  padding: 12px 8px 18px;
  max-height: 78vh;
}
.ws-filter-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.ws-filter-head .ws-sheet-close { position: static; }
.ws-filter-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 6px 4px;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  gap: 2px;
}
.ws-filter-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 14px 14px;
  color: var(--text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 140ms, border-color 140ms, color 140ms;
  min-height: 52px;
}
.ws-filter-row:hover {
  background: rgba(180,126,55,0.05);
}
.ws-filter-row.is-selected {
  background: rgba(180,126,55,0.12);
  border-color: rgba(180,126,55,0.4);
  color: var(--gold);
}
.ws-filter-row-label {
  text-transform: capitalize;
  letter-spacing: 0.005em;
}
.ws-filter-row-check {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  color: transparent;
  flex-shrink: 0;
  transition: all 140ms;
}
.ws-filter-row.is-selected .ws-filter-row-check {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--canvas, #1c1a16);
}

.ws-picker-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 0 8px;
  margin: 0 -2px;
  -webkit-overflow-scrolling: touch;
}
.ws-picker-empty {
  text-align: center;
  color: var(--text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  padding: 30px 12px;
}
.ws-picker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  margin: 6px 0;
  cursor: pointer;
  transition: all 160ms;
  -webkit-tap-highlight-color: transparent;
}
.ws-picker-row:hover { border-color: rgba(180,126,55,0.5); background: rgba(180,126,55,0.04); }
.ws-picker-row.is-selected {
  border-color: var(--gold);
  background: rgba(180,126,55,0.12);
  box-shadow: 0 0 0 1px rgba(180,126,55,0.4);
}
.ws-picker-icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(180,126,55,0.10);
  border: 1px solid rgba(180,126,55,0.22);
  border-radius: 10px;
  flex-shrink: 0;
  color: var(--gold);
}
.ws-picker-icon svg { display: block; }
.ws-picker-body {
  flex: 1 1 auto; min-width: 0;
  text-align: left;
}
.ws-picker-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500; font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  line-height: 1.2;
  text-align: left;
  /* Consistent left padding so titles align across rows even when icon
     widths or row paddings drift (Manou: "sometimes left, sometimes
     right — needs to be aesthetically lined up"). */
  padding-left: 0;
}
.ws-picker-row {
  text-align: left;
}
.ws-picker-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.ws-picker-tag {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px; font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline-dim);
  border-radius: 999px;
  padding: 2px 8px;
}
.ws-picker-tag.equipment {
  color: var(--gold);
  background: rgba(180,126,55,0.08);
  border-color: rgba(180,126,55,0.22);
}
.ws-picker-check {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  transition: all 160ms;
}
.ws-picker-row.is-selected .ws-picker-check {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--canvas);
}
.ws-picker-row .ws-picker-check svg { opacity: 0; transition: opacity 140ms; }
.ws-picker-row.is-selected .ws-picker-check svg { opacity: 1; }

.ws-picker-foot {
  position: sticky; bottom: 0;
  background: var(--warm-raised);
  padding: 12px 0 18px;
  border-top: 1px solid var(--hairline);
  z-index: 2;
  flex-shrink: 0;
}
.ws-picker-foot .ws-log-btn { margin-top: 0; }

.ws-picker-row.is-already {
  opacity: 0.55;
  pointer-events: none;
}
.ws-picker-row.is-already .ws-picker-tag.already {
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9px;
}

/* Custom-add fallback link under the big "Add exercise" CTA */
.ws-adhoc-secondary { margin-top: 10px; }
.ws-custom-link {
  background: transparent; border: 0;
  color: var(--text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 4px 0;
  transition: color 140ms;
}
.ws-custom-link:hover { color: var(--gold); }

.ws-log-btn {
  margin-top: 14px;
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gold);
  color: var(--canvas);
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms, transform 100ms;
  box-shadow: 0 4px 12px rgba(180,126,55,0.25);
}
.ws-log-btn:hover { background: var(--gold-hi); }
.ws-log-btn:active { transform: scale(0.98); }
.ws-log-btn:disabled { opacity: 0.6; cursor: wait; }

/* Rest timer (V2 — bigger, clearer) */
.ws-rest {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(180,126,55,0.10), rgba(180,126,55,0.03));
  border: 1px solid rgba(180,126,55,0.3);
  border-radius: 12px;
}
.ws-rest-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.ws-rest-label {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.ws-rest-time {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 28px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.ws-rest-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ws-rest-bar-fill {
  display: block; height: 100%;
  background: var(--gold);
  transition: width 0.95s linear, background 200ms;
  width: 100%;
}
.ws-rest-actions { display: flex; gap: 8px; }
.ws-rest-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: all 140ms;
}
.ws-rest-btn:hover { border-color: var(--gold); color: var(--gold); }
.ws-rest.ws-rest-warn { border-color: rgba(248,113,113,0.35); }
.ws-rest.ws-rest-warn .ws-rest-time { color: #f87171; }
.ws-rest.ws-rest-warn .ws-rest-bar-fill { background: #f87171; }
.ws-rest.ws-rest-done { border-color: rgba(108,212,154,0.35); background: linear-gradient(135deg, rgba(108,212,154,0.10), rgba(108,212,154,0.03)); }
.ws-rest.ws-rest-done .ws-rest-time { color: #6cd49a; }

/* Adhoc add */
.ws-adhoc { margin-top: 22px; }
.ws-adhoc-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px dashed var(--hairline);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-dim);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: border-color 160ms, color 160ms;
}
.ws-adhoc-toggle:hover { border-color: var(--gold); color: var(--gold); }
.ws-adhoc-toggle svg { color: currentColor; }
.ws-adhoc-body {
  display: flex; gap: 10px;
  margin-top: 10px;
}
.ws-adhoc-body[hidden] { display: none !important; }
.ws-adhoc-body input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
}
.ws-adhoc-body input:focus { outline: none; border-color: var(--gold); }

/* Notes panel (collapsible) */
.ws-notes {
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.ws-notes textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  margin-top: 8px;
}
.ws-notes textarea:focus { outline: none; border-color: var(--gold); }
.ws-notes-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; gap: 10px;
}

/* Sticky finish bar */
.ws-finish {
  position: sticky;
  bottom: env(safe-area-inset-bottom, 0);
  margin-top: 28px;
  padding: 14px 0 18px;
  background: linear-gradient(to top, var(--canvas) 70%, rgba(3,3,3,0.7) 100%, rgba(3,3,3,0));
  z-index: 20;
}
.ws-finish-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  background: var(--gold);
  color: var(--canvas);
  border: 0;
  border-radius: 14px;
  padding: 16px 20px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms;
  box-shadow: 0 4px 16px rgba(180,126,55,0.3);
}
.ws-finish-btn:hover { background: var(--gold-hi); color: var(--canvas); }

/* In-page confirm dialog */
.ws-confirm {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 80;
}
.ws-confirm[hidden] { display: none !important; }
.ws-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}
.ws-confirm-card {
  position: relative;
  background: var(--warm-raised);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 22px 22px 18px;
  max-width: 360px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.ws-confirm-msg {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.35;
}
.ws-confirm-actions { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.ws-confirm-actions .btn { padding: 9px 18px; }

/* Mobile — tighter spacing, full-width primary actions */
@media (max-width: 520px) {
  .ws-title { font-size: 24px; }
  .ws-ex { padding: 14px 14px 16px; border-radius: 14px; }
  .ws-ex-name { font-size: 19px; }
  .ws-input-field input { font-size: 19px; }
  .ws-rest-time { font-size: 24px; }
  .ws-input-row { grid-template-columns: 1fr 1fr auto; }
  .ws-rpe-trigger { min-width: 84px; }
  .ws-set { grid-template-columns: 28px 1fr 28px; gap: 8px; padding: 10px 12px; }
  .ws-set-big { font-size: 16px; }
  .ws-last-when { margin-left: 0; flex-basis: 100%; }
}

/* ============================================================
   Coach program editor V2 — exercise cards + drag handles
   Additive, on top of legacy .ex-edit-row.
   ============================================================ */

.ex-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.ex-toolbar .btn { padding: 9px 16px; }
.ex-empty {
  text-align: center;
  padding: 36px 24px;
  border: 1px dashed var(--hairline);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  margin: 16px 0 24px;
}
.ex-empty h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 6px;
}
.ex-empty p { color: var(--text-dim); margin: 0 0 16px; }
.ex-empty .btn { margin: 0 6px; }

/* Premium exercise card (replaces legacy ex-edit-row visually) */
.ex-edit-row.ex-card {
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, rgba(180,126,55,0.04), rgba(255,255,255,0.005));
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.ex-card .ex-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid var(--hairline);
}
.ex-card-drag {
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  cursor: grab;
  background: transparent;
  border: 0;
  flex: 0 0 auto;
  transition: color 160ms, background 160ms;
}
.ex-card-drag:hover { color: var(--gold); background: rgba(180,126,55,0.08); }
.ex-card-drag:active { cursor: grabbing; }
.ex-card-name {
  flex: 1;
  background: transparent;
  border: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--text);
  padding: 4px 6px;
  border-radius: 6px;
  outline: none;
  min-width: 0;
}
.ex-card-name:focus { background: rgba(255,255,255,0.04); }
.ex-card-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ex-icon-btn {
  width: 30px; height: 30px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  background: transparent;
  border: 0;
  transition: color 160ms, background 160ms;
}
.ex-icon-btn:hover { color: var(--gold); background: rgba(180,126,55,0.08); }
.ex-icon-btn.danger:hover { color: #f87171; background: rgba(248,113,113,0.08); }

.ex-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

/* sets × reps + rest grid */
.ex-card-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}
.ex-card-stat {
  display: flex; flex-direction: column;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color 160ms;
}
.ex-card-stat:focus-within { border-color: var(--gold); }
.ex-card-stat-label {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.ex-card-stat input,
.ex-card-stat .ex-rest-pill {
  background: transparent;
  border: 0; outline: none;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  width: 100%;
  margin-top: 2px;
  text-align: left;
  cursor: pointer;
}
.ex-rest-pill { cursor: pointer; }
.ex-rest-pill::after { content: " ▾"; color: var(--text-dim); font-size: 12px; }

/* BL-PERS-3a Bug 2: superset non-tail rows show a static hint instead of
   the editable rest pill. Tail (last) row keeps the editable pill. */
.ex-rest-ss-hint {
  display: block;
  margin-top: 4px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.ex-card-stat.is-superset-non-tail {
  background: rgba(180, 126, 55, 0.05);
  border-color: rgba(180, 126, 55, 0.22);
}

.ex-card-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ex-card-row .ex-card-flash { font-size: 11px; }
.ex-card-row .save-ex,
.ex-card-row .del-ex { padding: 6px 12px; }

/* Rest picker dropdown */
.ex-rest-menu {
  position: absolute;
  background: var(--warm-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 6px;
  z-index: 50;
  display: flex; flex-direction: column;
  min-width: 160px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.ex-rest-menu[hidden] { display: none !important; }
.ex-rest-menu button {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
}
.ex-rest-menu button:hover { background: rgba(180,126,55,0.12); color: var(--gold); }
.ex-rest-menu input[type="number"] {
  margin-top: 4px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font: inherit;
}

/* Templates list — extra info in card */
.program-card-templates-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.program-card-muscle {
  background: rgba(180,126,55,0.08);
  border: 1px solid rgba(180,126,55,0.2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold);
}

/* "Start from template" picker on /coach/programs/new */
.tpl-picker {
  background: rgba(180,126,55,0.05);
  border: 1px solid rgba(180,126,55,0.2);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.tpl-picker h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 8px;
}
.tpl-picker p { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; }
.tpl-picker-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tpl-picker select {
  flex: 1;
  min-width: 200px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
}
.tpl-picker select:focus { outline: none; border-color: var(--gold); }

/* Per-exercise card on coach side (mobile) */
@media (max-width: 720px) {
  .ex-card-grid { grid-template-columns: 1fr 1fr; }
  .ex-card-grid .ex-card-stat:nth-child(3) { grid-column: 1 / -1; }
}

/* =========================================================================
   Daily System v2 — premium $7K-deliverable polish (additive only)
   ========================================================================= */

/* --- Optional chip on items + cycle-aware sub-headers --- */
.ds-opt-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid rgba(28,26,22,0.18);
  border-radius: 999px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-paper-ink-dim, #6b6353);
  background: rgba(255,255,255,0.45);
  font-weight: 600;
  flex: 0 0 auto;
}
.ds-item.is-optional {
  opacity: 0.55;
}
.ds-item.is-optional .ds-activity {
  font-style: italic;
}

.ds-details-eyebrow.ds-cycle {
  margin-top: 18px;
  color: #8a7140;
}
.ds-details.ds-cycle-follicular,
.ds-details.ds-cycle-luteal {
  border-left: 2px solid var(--ds-paper-rule);
  padding-left: 12px;
}

/* --- Coach editor v2: two-column layout (canvas + live preview) --- */
.ds-coach-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}
.ds-coach-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.ds-coach-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 600;
  font-size: 32px;
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.ds-back-link { display: inline-block; margin-top: 4px; }
.ds-coach-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.ds-cycle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(180,126,55,0.32);
  border-radius: 999px;
  background: rgba(180,126,55,0.06);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.ds-cycle-switch input { accent-color: var(--gold); }
.ds-coach-sub { margin: 0 0 22px; }

.ds-coach-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .ds-coach-cols { grid-template-columns: 1fr; }
}

.ds-coach-canvas {
  padding: 22px 22px 26px;
  border-radius: 8px;
  background: var(--warm);
  border: 1px solid rgba(180,126,55,0.18);
}

/* Tabs — variant chips + add */
.ds-coach-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid rgba(180,126,55,0.18);
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.ds-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(180,126,55,0.30);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all .15s ease;
}
.ds-tab:hover { color: var(--text); border-color: var(--gold); }
.ds-tab.active {
  background: var(--gold);
  color: #1c1a16;
  border-color: var(--gold);
}
.ds-tab-add {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px dashed rgba(180,126,55,0.4);
  background: transparent;
  color: var(--gold-hi);
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
}
.ds-tab-add:hover { border-color: var(--gold); color: var(--gold); background: rgba(180,126,55,0.06); }

.ds-coach-empty {
  padding: 30px 0;
  text-align: center;
}
.ds-coach-empty p { margin-bottom: 16px; }
.ds-coach-empty .ds-gen-row { justify-content: center; flex-wrap: wrap; gap: 8px; }

.ds-editor-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ds-field-inline { flex: 1 1 280px; margin-bottom: 0; }
.ds-coach-hint { margin: -2px 0 14px; }

/* item row: include optional toggle + tighten on mobile */
.ds-item-row-edit {
  display: grid;
  grid-template-columns: 84px 1.2fr 1.4fr 110px 28px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.it-opt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  user-select: none;
  cursor: pointer;
}
.it-opt-toggle input { accent-color: var(--gold); }
@media (max-width: 720px) {
  .ds-item-row-edit {
    grid-template-columns: 80px 1fr 28px;
    grid-template-areas: "time activity del" "loom loom loom" "opt opt opt";
  }
  .ds-item-row-edit .it-time { grid-area: time; }
  .ds-item-row-edit .it-activity { grid-area: activity; }
  .ds-item-row-edit .it-del { grid-area: del; }
  .ds-item-row-edit .it-loom { grid-area: loom; }
  .ds-item-row-edit .it-opt-toggle { grid-area: opt; }
}

.ds-cycle-block {
  margin-top: 14px;
  border: 1px dashed rgba(180,126,55,0.32);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(180,126,55,0.04);
}
.ds-cycle-block summary {
  cursor: pointer;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-hi);
  font-weight: 600;
}

/* Live preview pane */
.ds-coach-preview {
  position: sticky;
  top: 86px;
  align-self: start;
}
@media (max-width: 1100px) {
  .ds-coach-preview { position: static; }
}
.ds-preview-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.ds-preview-frame {
  background: var(--canvas);
  border: 1px solid rgba(180,126,55,0.16);
  border-radius: 8px;
  padding: 16px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  box-shadow: 0 24px 80px -40px rgba(0,0,0,0.55);
}
.ds-preview-card {
  background: var(--ds-paper);
  color: var(--ds-paper-ink);
  border: 1px solid var(--ds-paper-rule);
  border-radius: 4px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}
/* Inside preview, scope card-head down so it fits */
.ds-preview-card .ds-card-head {
  padding: 18px 18px 14px;
}
.ds-preview-card .ds-card-head .ds-title {
  font-size: 28px;
}
.ds-preview-card .ds-phase {
  padding: 18px 18px 16px;
}
.ds-preview-card .ds-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}
@media (max-width: 1300px) {
  .ds-preview-card .ds-cols { grid-template-columns: 1fr; }
}
.ds-preview-empty {
  padding: 40px 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Preset grid in modal */
.ds-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 18px;
}
.ds-preset-btn {
  padding: 14px 12px;
  border: 1px solid rgba(180,126,55,0.30);
  border-radius: 8px;
  background: var(--warm-raised);
  color: var(--text);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.ds-preset-btn:hover { border-color: var(--gold); background: rgba(180,126,55,0.10); }

/* Mobile-first polish for client view: tighter card on phones */
@media (max-width: 480px) {
  .ds-shell { padding: 12px 8px 80px; }
  .ds-card-head { padding: 18px 16px 14px; }
  .ds-card-head .ds-title { font-size: 30px; }
  .ds-phase { padding: 18px 16px 16px; }
  .ds-cols { grid-template-columns: 1fr !important; gap: 14px; }
  .ds-time { font-size: 13px; }
  .ds-activity { font-size: 14px; }
  .ds-item-row { padding: 10px 0; min-height: 44px; align-items: center; }
  .ds-variant-toggle { flex-wrap: wrap; }
}

/* The danger button-link variant */
.btn-link.danger { color: #c4554d; }
.btn-link.danger:hover { color: #e36359; }

/* =========================================================================
   Daily System v3 (calendar) — premium $7K-deliverable, smoky-dark, time-axis
   ========================================================================= */
:root {
  --dsx-rail-w: 76px;
  --dsx-row-h: 64px;            /* px per 1h on the timeline */
  --dsx-start-h: 5;             /* axis starts at 05:00 */
  --dsx-end-h: 23;              /* axis ends at 23:00 (inclusive label) */
  --dsx-warm: #1b1815;
  --dsx-warm-2: #221d18;
  --dsx-warm-3: #2b2520;
  --dsx-line: rgba(180, 126, 55, 0.12);
  --dsx-line-strong: rgba(180, 126, 55, 0.28);
  --dsx-ink: #fdfdff;
  --dsx-ink-2: #c2bfbc;
  --dsx-ink-3: #8a8785;
}

.dsx-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 96px;
  color: var(--dsx-ink);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.dsx-shell.dsx-print { padding: 24px 24px 40px; }

.dsx-empty {
  text-align: center;
  padding: 56px 22px 64px;
  color: var(--dsx-ink-2);
  background: var(--dsx-warm);
  border: 1px solid var(--dsx-line);
  border-radius: 16px;
  margin: 24px auto 32px;
  max-width: 540px;
  position: relative;
  overflow: hidden;
}
.dsx-empty::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}
.dsx-empty h1 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  color: var(--dsx-ink);
  margin: 14px 0 12px;
  letter-spacing: -0.012em;
}
.dsx-empty p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--dsx-ink-2);
  margin: 0 auto 22px;
  max-width: 380px;
}
.dsx-empty-glyph {
  display: inline-flex;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(180, 126, 55, 0.10);
  border: 1px solid var(--dsx-line-strong);
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.dsx-empty-glyph svg { width: 26px; height: 26px; }
.dsx-empty-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--dsx-line);
  border-radius: 999px;
  background: rgba(180, 126, 55, 0.05);
  color: var(--dsx-ink-3);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.dsx-empty-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(180, 126, 55, 0.7);
  animation: dsx-pulse 2s ease-in-out infinite;
}
@keyframes dsx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Header strip ---------- */
.dsx-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--dsx-line);
  margin-bottom: 16px;
}
.dsx-head-l { min-width: 0; }
.dsx-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gold);
}
.dsx-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.012em;
  color: var(--dsx-ink);
  margin: 4px 0 0;
}
.dsx-name {
  color: var(--dsx-ink-3);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.dsx-stamp {
  color: var(--dsx-ink-3);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---------- Variant toggle (pills) ---------- */
.dsx-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 18px;
}
.dsx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--dsx-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--dsx-ink-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all .14s ease;
  text-decoration: none;
  font-family: inherit;
}
.dsx-pill:hover { color: var(--dsx-ink); border-color: var(--gold); background: rgba(180, 126, 55, 0.06); }
.dsx-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c1a16;
  font-weight: 600;
}
.dsx-pill.dim {
  border-color: var(--dsx-line);
  color: var(--dsx-ink-3);
  background: transparent;
}

/* ---------- Intro / Do this first banner ---------- */
.dsx-intro {
  background: var(--dsx-warm);
  border: 1px solid var(--dsx-line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--dsx-ink-2);
}
.dsx-intro em { color: var(--dsx-ink); font-style: italic; }
.dsx-do-first {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(180,126,55,0.10), rgba(180,126,55,0.04));
  border: 1px solid var(--dsx-line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  color: var(--dsx-ink);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}
.dsx-do-first:hover { background: rgba(180,126,55,0.14); border-color: var(--gold); color: var(--dsx-ink); }
.dsx-do-first svg { color: var(--gold); flex-shrink: 0; }

/* ---------- All-day row ---------- */
.dsx-allday {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 12px 12px 14px;
  border: 1px solid var(--dsx-line);
  border-radius: 12px;
  background: var(--dsx-warm);
  margin-bottom: 14px;
}
.dsx-allday-label {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dsx-ink-3);
  align-self: center;
  padding-right: 8px;
  border-right: 1px solid var(--dsx-line);
  margin-right: 4px;
}
.dsx-allday-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.dsx-allday-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--dsx-warm-3);
  border: 1px solid var(--dsx-line-strong);
  color: var(--dsx-ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s ease;
  font-family: inherit;
}
.dsx-allday-pill:hover { border-color: var(--gold); }
.dsx-allday-pill .dsx-mini-tag {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-hi);
  background: rgba(180,126,55,0.1);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--dsx-line-strong);
}

/* ---------- Calendar timeline ----------
   On desktop, let the calendar grow to its content (no inner scroll; the
   page scrolls). On mobile/tablet client view, the bottom tabbar eats
   ~80-100px of viewport, so we cap height (inside the @media block) and
   scroll INSIDE the calendar via --dsx-cal-max. */
.dsx-cal {
  position: relative;
  background: var(--dsx-warm);
  border: 1px solid var(--dsx-line);
  border-radius: 14px;
  padding: 8px 10px 14px 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: var(--dsx-cal-max, none);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 126, 55, 0.32) transparent;
}
.dsx-cal::-webkit-scrollbar { width: 8px; }
.dsx-cal::-webkit-scrollbar-track { background: transparent; }
.dsx-cal::-webkit-scrollbar-thumb {
  background: rgba(180, 126, 55, 0.28);
  border-radius: 999px;
}
.dsx-grid {
  position: relative;
  /* Server-side inline `height: <px>` is set per render based on
     max(block.end_minutes) + bottom buffer; this CSS default covers a normal
     05:00→23:00 day at 64px/h. */
  height: calc((var(--dsx-end-h) - var(--dsx-start-h)) * var(--dsx-row-h));
  margin-left: var(--dsx-rail-w);
  /* Reserve scroll buffer so the last block always has air beneath it,
     even if the inline height is smaller than the container. */
  padding-bottom: 24px;
  /* Hour grid lines via repeating-linear-gradient. */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--dsx-row-h) - 1px),
      var(--dsx-line) calc(var(--dsx-row-h) - 1px),
      var(--dsx-line) var(--dsx-row-h)
    );
}
.dsx-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--dsx-rail-w);
  height: 100%;
  pointer-events: none;
}
.dsx-rail-mark {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--dsx-ink-3);
  font-variant-numeric: tabular-nums;
  padding: 0 14px 0 14px;
  transform: translateY(-50%);
}
.dsx-rail-mark::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 8px; height: 1px;
  background: var(--dsx-line-strong);
}

/* The "now" indicator (only renders if current local time is within range).
   Cream/white so it reads distinct from gold block borders + gold hour lines.
   Was gold pre-2026-04-30 but Manou flagged the marker was the same colour
   as the blocks themselves and unreadable. */
.dsx-now {
  position: absolute;
  left: var(--dsx-rail-w);
  right: 8px;
  height: 2px;
  background: #f1ebe0;
  box-shadow: 0 0 12px rgba(241, 235, 224, 0.75),
              0 0 0 1px rgba(241, 235, 224, 0.18);
  z-index: 3;
  pointer-events: none;
}
.dsx-now::before {
  content: "";
  position: absolute;
  left: -5px; top: -3.5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f1ebe0;
  box-shadow: 0 0 6px rgba(241, 235, 224, 0.85);
}

/* Activity blocks.
   BL-INV-10 (2026-05-07) — SINGLE-COLUMN layout (memory rules
   feedback_daily_system_single_column_timeline.md +
   feedback_coach_daily_system_single_column_polish.md). NEVER side-by-side
   lanes. Every block spans the full timeline width. The server pre-computes
   rendered_top with vertical-displacement so overlapping blocks stack down
   the column. The "stacked" data attribute marks displaced blocks so the
   client can see the y-position no longer matches the actual scheduled time. */
.dsx-block {
  --dsx-block-gutter-l: 8px;
  --dsx-block-gutter-r: 10px;
  position: absolute;
  left: var(--dsx-block-gutter-l);
  right: var(--dsx-block-gutter-r);
  width: auto;
  min-height: 56px;
  background: var(--dsx-warm-2);
  border: 1px solid var(--dsx-line-strong);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 9px 12px 10px;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
  overflow: hidden;
  z-index: 1;
  text-align: left;
  font: inherit;
  color: inherit;
  display: block;
}
/* Stacked indicator: a small gold dot at the top-right of any block whose
   rendered position no longer matches its natural time. Lets the client
   understand "this is at 06:30 but visually below the 06:30 block above". */
.dsx-block[data-stacked="true"]::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(180, 126, 55, 0.18);
  pointer-events: none;
}
.dsx-block:hover {
  transform: translateY(-1px);
  border-color: rgba(180, 126, 55, 0.5);
  border-left-color: var(--gold);
  background: var(--dsx-warm-3);
  z-index: 2;
}
.dsx-block.is-optional {
  border-left-color: var(--dsx-line-strong);
  background: transparent;
  border-style: dashed;
}
.dsx-block.is-optional .dsx-b-title { color: var(--dsx-ink-2); font-style: italic; }
.dsx-block.is-now {
  border-color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(180,126,55,0.10);
}

/* Top row: time pill + meta pills */
.dsx-b-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.dsx-time-pill {
  font-size: 10px;
  letter-spacing: 0.10em;
  font-weight: 700;
  color: var(--gold-hi);
  background: rgba(180,126,55,0.10);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--dsx-line-strong);
  font-variant-numeric: tabular-nums;
}
.dsx-mini-tag {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dsx-ink-3);
  background: var(--dsx-warm-3);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--dsx-line);
  font-weight: 600;
}
.dsx-mini-tag.gold { color: var(--gold-hi); border-color: var(--dsx-line-strong); background: rgba(180,126,55,0.06); }
.dsx-mini-tag.fol { color: #d8b58f; border-color: rgba(216,181,143,0.32); background: rgba(216,181,143,0.08); }
.dsx-mini-tag.lut { color: #b9a3e1; border-color: rgba(185,163,225,0.28); background: rgba(185,163,225,0.08); }

.dsx-b-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 15.5px;
  line-height: 1.25;
  color: var(--dsx-ink);
  margin: 0;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsx-b-summary {
  font-size: 12px;
  color: var(--dsx-ink-2);
  line-height: 1.45;
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.dsx-b-tap {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
}

/* Expanded state: block grows to fit details, pushed onto the canvas. */
.dsx-block.is-open {
  z-index: 5;
  background: var(--dsx-warm-3);
  border-color: var(--gold);
  border-left-color: var(--gold);
  box-shadow: 0 14px 40px -22px rgba(0,0,0,0.85);
}
.dsx-block.is-open .dsx-b-summary { -webkit-line-clamp: unset; display: block; }
.dsx-b-expanded {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--dsx-line);
  display: none;
}
.dsx-block.is-open .dsx-b-expanded { display: block; }
.dsx-b-expanded ul { list-style: none; padding: 0; margin: 0 0 10px; }
.dsx-b-expanded li {
  position: relative;
  padding: 6px 0 6px 16px;
  color: var(--dsx-ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}
.dsx-b-expanded li::before {
  content: "";
  position: absolute;
  left: 4px; top: 13px;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
}
.dsx-b-expanded li.is-fol::before { background: #d8b58f; }
.dsx-b-expanded li.is-lut::before { background: #b9a3e1; }
.dsx-detail-loom {
  display: inline-block;
  margin-left: 6px;
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(180,126,55,0.35);
}
.dsx-loom-frame {
  margin-top: 8px;
  border: 1px solid var(--dsx-line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.dsx-loom-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
}
.dsx-loom-open {
  display: inline-block;
  padding: 8px 12px;
  background: rgba(180,126,55,0.08);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-top: 1px solid var(--dsx-line);
}

/* Cycle pills row inside expanded block */
.dsx-cycle-block {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--dsx-warm);
  border: 1px solid var(--dsx-line);
  border-radius: 8px;
}
.dsx-cycle-block .dsx-mini-tag { margin-bottom: 6px; }

/* ---------- Supplements dock ---------- */
.dsx-dock {
  margin-top: 26px;
}
.dsx-dock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0 4px;
}
.dsx-dock-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  color: var(--dsx-ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.dsx-supps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.dsx-supp {
  background: var(--dsx-warm);
  border: 1px solid var(--dsx-line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 12px 13px 13px;
}
.dsx-supp-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--dsx-ink);
}
.dsx-supp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}
.dsx-supp-notes {
  font-size: 12.5px;
  color: var(--dsx-ink-2);
  line-height: 1.5;
  margin: 0;
}

/* Bundle AA — supplement benefit icons + Buy link.
   Coach chooses up to 8 benefit categories per supplement; each renders as
   a small icon-pill so clients can scan their supplement-stack visually. */
.dsx-supp-benefits {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 6px 0 8px;
}
.dsx-supp-benefit {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  background: rgba(180, 126, 55, 0.10);
  border: 1px solid rgba(180, 126, 55, 0.28);
  color: var(--gold-hi, #d8b58f);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  font-weight: 500;
}
.dsx-supp-benefit svg { width: 14px; height: 14px; flex: 0 0 auto; }
.dsx-supp-benefit--sleep { background: rgba(124, 142, 220, 0.10); border-color: rgba(124, 142, 220, 0.32); color: #a8b6e2; }
.dsx-supp-benefit--recovery { background: rgba(81, 176, 138, 0.10); border-color: rgba(81, 176, 138, 0.32); color: #9ec9b3; }
.dsx-supp-benefit--focus { background: rgba(180, 126, 55, 0.12); border-color: rgba(180, 126, 55, 0.32); color: var(--gold-hi, #d8b58f); }
.dsx-supp-benefit--energy { background: rgba(220, 180, 80, 0.10); border-color: rgba(220, 180, 80, 0.32); color: #ddc079; }
.dsx-supp-benefit--immunity { background: rgba(140, 200, 220, 0.10); border-color: rgba(140, 200, 220, 0.32); color: #9fd2e0; }
.dsx-supp-benefit--mood { background: rgba(220, 160, 200, 0.10); border-color: rgba(220, 160, 200, 0.32); color: #e0b8d0; }
.dsx-supp-benefit--hormonal { background: rgba(180, 140, 220, 0.10); border-color: rgba(180, 140, 220, 0.32); color: #c8b3e2; }
.dsx-supp-benefit--gut { background: rgba(200, 160, 130, 0.10); border-color: rgba(200, 160, 130, 0.32); color: #d3b89c; }
/* Buy CTA — small gold pill, opens in new tab. */
.dsx-supp-buy {
  display: inline-block;
  margin-top: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--gold, #b47e37);
  color: #0E0E12;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .12s ease;
}
.dsx-supp-buy:hover { background: var(--gold-hi, #d8b58f); color: #0E0E12; }

/* Bundle AA — supplement editor: benefit chip toggles + buy URL field. */
.dsxc-supp-row--v2 {
  grid-template-columns: 1.2fr 0.7fr 0.9fr 1.5fr 28px;
  grid-template-areas:
    "name dose when notes del"
    "benefits benefits benefits benefits benefits"
    "buy buy buy buy buy";
}
.dsxc-supp-row--v2 .sup-name { grid-area: name; }
.dsxc-supp-row--v2 .sup-dose { grid-area: dose; }
.dsxc-supp-row--v2 .sup-when { grid-area: when; }
.dsxc-supp-row--v2 .sup-notes { grid-area: notes; }
.dsxc-supp-row--v2 .sup-del { grid-area: del; }
.dsxc-supp-row--v2 .sup-benefit-row { grid-area: benefits; display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.dsxc-supp-row--v2 .sup-buy-url { grid-area: buy; }
.sup-benefit-chip {
  background: transparent;
  border: 1px solid rgba(180, 126, 55, 0.20);
  color: var(--text-dim, #8a8785);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.sup-benefit-chip:hover { border-color: var(--gold); color: var(--gold-hi, #d8b58f); }
.sup-benefit-chip.is-on {
  background: rgba(180, 126, 55, 0.18);
  border-color: var(--gold);
  color: var(--gold-hi, #d8b58f);
}
@media (max-width: 720px) {
  .dsxc-supp-row--v2 {
    grid-template-columns: 1fr 1fr 28px;
    grid-template-areas:
      "name dose del"
      "when when when"
      "notes notes notes"
      "benefits benefits benefits"
      "buy buy buy";
  }
}

/* ---------- Footer ---------- */
.dsx-foot {
  margin-top: 26px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--dsx-line);
  font-size: 11px;
  color: var(--dsx-ink-3);
  letter-spacing: 0.04em;
}
.dsx-foot a { color: var(--gold-hi); text-decoration: none; }
.dsx-foot a:hover { color: var(--gold); }

/* ---------- Mobile ----------
   Bumped --dsx-row-h from 60→84 so blocks at 06:30/07:00/07:30 etc. don't
   visually crash into each other on small screens. Bigger tap target,
   matches Canva-deliverable density (4-6 items per phase). The calendar
   gets max-height ONLY on mobile so the bottom tabbar never crops the last
   block; the user scrolls inside the calendar. */
@media (max-width: 640px) {
  :root {
    --dsx-rail-w: 56px;
    --dsx-row-h: 84px;
    /* tabbar (~78) + safe-area + header strip + variant pills + intro card.
       Trim conservatively — better to leave 1-2 unused px than crop a block.
       vh is the fallback for Safari <15.4; dvh below overrides on newer. */
    --dsx-cal-max: calc(100vh - 280px);
  }
  .dsx-shell { padding: 14px 10px 24px; }
  .dsx-title { font-size: 26px; }
  .dsx-b-title { font-size: 14.5px; white-space: normal; }
  .dsx-block { padding: 10px 11px 10px; }
  .dsx-allday-label { display: block; border-right: 0; border-bottom: 1px solid var(--dsx-line); padding: 0 0 6px; margin: 0 0 6px; width: 100%; }
  /* Supplements dock — make it pop more on mobile so it's clearly the
     close-of-day artifact (matches Canva spec where it gets its own page). */
  .dsx-dock { margin-top: 18px; padding: 14px 14px 16px; background: var(--dsx-warm); border: 1px solid var(--dsx-line); border-radius: 14px; }
  .dsx-dock-head { padding: 0 0 10px; margin: 0 0 12px; border-bottom: 1px solid var(--dsx-line); }
  .dsx-supps { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 380px) {
  :root { --dsx-row-h: 76px; --dsx-rail-w: 50px; }
}

/* dvh override (Safari 15.4+, modern Chrome, modern Firefox). */
@supports (height: 100dvh) {
  @media (max-width: 640px) {
    :root { --dsx-cal-max: calc(100dvh - 280px); }
  }
}

/* iPad-class (and small desktops) — breathing room without going full-mobile.
   No calendar max-height here; tabbar isn't shown >768px on client. */
@media (min-width: 641px) and (max-width: 1024px) {
  :root { --dsx-row-h: 72px; }
}

/* ---------- Coach editor v3 (split view: calendar preview + side panel) ---------- */
.dsxc-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 24px 80px;
}
.dsxc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dsx-line);
}
.dsxc-head .dsxc-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  color: var(--dsx-ink);
  margin: 4px 0 2px;
  letter-spacing: -0.012em;
}
.dsxc-head .dsxc-back { color: var(--dsx-ink-3); font-size: 12px; text-decoration: none; }
.dsxc-head .dsxc-back:hover { color: var(--gold); }
.dsxc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.dsxc-cycle-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--dsx-line-strong);
  border-radius: 999px;
  background: rgba(180,126,55,0.05);
  color: var(--dsx-ink-2);
  font-size: 12px;
  cursor: pointer;
}
.dsxc-cycle-switch input { accent-color: var(--gold); }
.dsxc-flash { color: var(--gold); font-size: 11.5px; letter-spacing: 0.05em; }

.dsxc-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 1100px) {
  .dsxc-cols { grid-template-columns: 1fr; }
  .dsxc-side.dsxc-mobile-collapsed { display: none; }
  .dsxc-mobile-fab { display: flex; }
}

/* Left: live calendar preview (sticky on desktop) */
.dsxc-preview {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow: auto;
  padding-right: 4px;
}
@media (max-width: 1100px) {
  .dsxc-preview { position: static; max-height: none; overflow: visible; }
}

/* Right: edit panel */
.dsxc-side {
  background: var(--dsx-warm);
  border: 1px solid var(--dsx-line);
  border-radius: 14px;
  padding: 18px 18px 22px;
}
.dsxc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--dsx-line);
}
.dsxc-tab {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--dsx-line-strong);
  background: transparent;
  color: var(--dsx-ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.dsxc-tab:hover { color: var(--dsx-ink); border-color: var(--gold); }
.dsxc-tab.active { background: var(--gold); color: #1c1a16; border-color: var(--gold); }
.dsxc-tab-add {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px dashed var(--dsx-line-strong);
  background: transparent;
  color: var(--gold-hi);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.dsxc-tab-add:hover { border-color: var(--gold); color: var(--gold); }

.dsxc-empty {
  padding: 36px 6px;
  text-align: center;
  color: var(--dsx-ink-2);
  font-size: 13px;
}

.dsxc-field { display: block; margin: 0 0 10px; }
.dsxc-field > span {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dsx-ink-3);
  margin-bottom: 4px;
  font-weight: 600;
}
.dsxc-field input,
.dsxc-field textarea,
.dsxc-side input[type="text"],
.dsxc-side input[type="url"],
.dsxc-side textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--dsx-warm-3);
  border: 1px solid var(--dsx-line);
  border-radius: 8px;
  color: var(--dsx-ink);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .12s;
}
.dsxc-field input:focus,
.dsxc-field textarea:focus,
.dsxc-side input:focus,
.dsxc-side textarea:focus {
  border-color: var(--gold);
  background: var(--dsx-warm-2);
}
.dsxc-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dsxc-section {
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--dsx-line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.dsxc-section h4 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  color: var(--dsx-ink);
  margin: 0;
  letter-spacing: 0;
  text-transform: none;
}
.dsxc-section .meta {
  font-size: 10.5px;
  color: var(--dsx-ink-3);
  letter-spacing: 0.04em;
}

/* Item editor row */
.dsxc-item-row {
  display: grid;
  grid-template-columns: 76px 1fr 110px 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.dsxc-item-row .iti-time { text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.dsxc-item-row .iti-loom { grid-column: 2 / 4; }
.dsxc-item-row .iti-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--dsx-ink-3);
  user-select: none;
  cursor: pointer;
  padding: 0 6px;
}
.dsxc-item-row .iti-opt input { accent-color: var(--gold); }
.dsxc-item-row .iti-del {
  background: transparent;
  border: 0;
  color: #c4554d;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.dsxc-item-row .iti-del:hover { color: #e36359; }

@media (max-width: 720px) {
  .dsxc-item-row {
    grid-template-columns: 70px 1fr 28px;
    grid-template-areas:
      "time activity del"
      "loom loom loom"
      "opt opt opt";
  }
  .dsxc-item-row .iti-time { grid-area: time; }
  .dsxc-item-row .iti-activity { grid-area: activity; }
  .dsxc-item-row .iti-del { grid-area: del; }
  .dsxc-item-row .iti-loom { grid-area: loom; grid-column: auto; }
  .dsxc-item-row .iti-opt { grid-area: opt; }
}

.dsxc-detail-row {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 6px;
  margin-bottom: 6px;
}
.dsxc-detail-row textarea { resize: vertical; min-height: 36px; }
.dsxc-detail-row .iti-del { align-self: start; padding-top: 6px; }

.dsxc-add-btn {
  background: transparent;
  border: 1px dashed var(--dsx-line-strong);
  color: var(--gold-hi);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.dsxc-add-btn:hover { border-color: var(--gold); color: var(--gold); }

.dsxc-phase-card {
  background: var(--dsx-warm-2);
  border: 1px solid var(--dsx-line);
  border-radius: 10px;
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}
.dsxc-phase-card .dsxc-phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dsxc-phase-card .dsxc-phase-head .dsxc-phase-name {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dsx-ink-3);
  font-weight: 700;
}
.dsxc-phase-card .iti-del { font-size: 12px; padding: 4px 8px; border: 1px solid var(--dsx-line); border-radius: 999px; }

.dsxc-supp-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.9fr 1.5fr 28px;
  gap: 6px;
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .dsxc-supp-row { grid-template-columns: 1fr 1fr 28px; grid-template-areas: "name dose del" "when when when" "notes notes notes"; }
  .dsxc-supp-row .sup-name { grid-area: name; }
  .dsxc-supp-row .sup-dose { grid-area: dose; }
  .dsxc-supp-row .sup-del { grid-area: del; }
  .dsxc-supp-row .sup-when { grid-area: when; }
  .dsxc-supp-row .sup-notes { grid-area: notes; }
}

.dsxc-mobile-fab {
  display: none;
  position: fixed;
  right: 14px; bottom: 88px;
  z-index: 20;
  background: var(--gold);
  color: #1c1a16;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,0.6);
  cursor: pointer;
  font-family: inherit;
}

/* Print mode: keep the calendar but trim chrome */
@media print {
  body { background: #fff !important; }
  .dsx-shell { color: #111; padding: 16px; }
  .dsx-title, .dsx-b-title, .dsx-supp-name, .dsx-dock-title { color: #111 !important; font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important; }
  .dsx-cal, .dsx-supp, .dsx-allday, .dsx-intro { background: #faf8f3 !important; border-color: #d8c8a0 !important; color: #111 !important; }
  .dsx-block { background: #fff !important; color: #111 !important; box-shadow: none !important; }
  .dsx-block .dsx-b-summary, .dsx-block .dsx-b-expanded li { color: #333 !important; }
  .dsx-rail-mark { color: #555 !important; }
  .dsx-time-pill, .dsx-mini-tag { color: #6b4a14 !important; background: #f3e7c8 !important; border-color: #d8c8a0 !important; }
  .dsx-allday-pill { background: #fff !important; color: #111 !important; border-color: #d8c8a0 !important; }
  .dsx-allday-label { color: #555 !important; }
  .dsx-foot, .bottom-tabs, header.top, .pwa-install-banner, .quick-log-fab { display: none !important; }
}

/* --- Barcode scanner modal (Bundle D / 2026-04-28) --- */
.barcode-stage {
  position: relative;
  margin: 12px 0 16px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
  max-height: 320px;
}
.barcode-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.barcode-frame {
  position: absolute;
  inset: 16% 8%;
  border: 2px solid var(--gold, #b47e37);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
  pointer-events: none;
}
.barcode-manual {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 8px;
}
.barcode-manual label {
  font-size: 13px;
  color: var(--text-dim);
}
.barcode-manual input {
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  letter-spacing: 1px;
}
.barcode-manual input:focus {
  outline: none;
  border-color: var(--gold);
}
.barcode-product {
  background: rgba(180,126,55,0.06);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0 14px;
}
.barcode-product-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
}
.barcode-product-brand {
  font-size: 13px;
  margin-bottom: 6px;
}
.barcode-product-macros {
  font-size: 13px;
  color: var(--text);
}
.barcode-grams {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.barcode-grams label {
  font-size: 13px;
  color: var(--text-dim);
}
.barcode-grams input {
  background: rgba(0,0,0,0.35);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
}
.barcode-grams input:focus {
  outline: none;
  border-color: var(--gold);
}
.barcode-grams-preview {
  font-size: 13px;
  margin-top: 4px;
}

/* Brand badges in the parse preview */
.brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.brand-badge.branded {
  background: rgba(180,126,55,0.18);
  color: var(--gold, #b47e37);
  border: 1px solid rgba(180,126,55,0.4);
}
.brand-badge.generic {
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  border: 1px solid var(--hairline);
}
.preview-item-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: -4px;
  padding-left: 2px;
}

/* =====================================================================
   Supersets — coach-grouped exercise pairs/triples on the client view.
   See feedback_supersets_first_class.md.
===================================================================== */
.ws-superset {
  position: relative;
  border: 1px solid rgba(180,126,55,0.35);
  border-left: 3px solid var(--gold, #b47e37);
  border-radius: 16px;
  padding: 14px 14px 18px 18px;
  background: linear-gradient(160deg, rgba(180,126,55,0.06), rgba(180,126,55,0.015));
  display: flex; flex-direction: column; gap: 12px;
}
.ws-superset-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(180,126,55,0.18);
}
.ws-superset-title {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--gold, #b47e37);
}
.ws-superset-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-left: auto;
}
.ws-superset-instruction {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-dim);
  font-style: italic;
}
.ws-superset-body {
  display: flex; flex-direction: column; gap: 12px;
}
.ws-superset-body .ws-ex.ws-ex-superset-member {
  border-radius: 12px;
  background: rgba(20,20,20,0.45);
  border: 1px solid var(--hairline);
  padding: 14px 14px 16px;
}
.ws-ex-superset-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: rgba(180,126,55,0.18);
  color: var(--gold, #b47e37);
  border: 1px solid rgba(180,126,55,0.4);
  border-radius: 6px;
  vertical-align: middle;
}
@media (max-width: 600px) {
  .ws-superset { padding: 12px 12px 16px 14px; border-radius: 14px; }
  .ws-superset-title { font-size: 16px; }
  .ws-superset-instruction { font-size: 12px; }
  .ws-ex-superset-tag { font-size: 10px; padding: 1px 6px; }
}

/* =====================================================================
   Coach program editor — superset grouping mode + indicators.
===================================================================== */
.ex-superset-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.ex-superset-toolbar.is-active {
  border-color: rgba(180,126,55,0.4);
  background: rgba(180,126,55,0.06);
}
.ex-superset-toolbar .pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ex-superset-toolbar .pill-btn:hover:not([disabled]) {
  border-color: var(--gold, #b47e37);
  color: var(--gold, #b47e37);
}
.ex-superset-toolbar .pill-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.ex-superset-toolbar .pill-btn.primary {
  background: var(--gold, #b47e37);
  color: #1a1a1a;
  border-color: var(--gold, #b47e37);
}
.ex-superset-toolbar .pill-btn.primary[disabled] {
  background: rgba(180,126,55,0.2);
  color: var(--text-dim);
  border-color: var(--hairline);
}
.ex-superset-toolbar .ex-ss-status {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}
.ex-card .ex-ss-checkbox {
  display: none;
  margin-right: 8px;
  width: 18px; height: 18px;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--gold, #b47e37);
}
.ex-list-grouping-mode .ex-card .ex-ss-checkbox {
  display: inline-block;
}
.ex-card.ex-ss-selected {
  border-color: var(--gold, #b47e37);
  box-shadow: 0 0 0 1px rgba(180,126,55,0.45) inset;
}
.ex-card .ex-ss-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: rgba(180,126,55,0.18);
  color: var(--gold, #b47e37);
  border: 1px solid rgba(180,126,55,0.4);
  border-radius: 5px;
  vertical-align: middle;
}
.ex-card[data-superset-group] {
  border-left: 3px solid var(--gold, #b47e37);
}
.ex-superset-divider {
  height: 1px;
  margin: 6px 4px 4px;
  background: linear-gradient(90deg, transparent, rgba(180,126,55,0.5), transparent);
}
.ex-superset-divider-label {
  display: inline-block;
  margin: 8px 4px 6px;
  padding: 2px 10px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: rgba(180,126,55,0.12);
  color: var(--gold, #b47e37);
  border: 1px solid rgba(180,126,55,0.35);
  border-radius: 6px;
}

/* ============================================================================
   Bundle G — Daily System CTA card on Home dashboard.
   The single hero entry point to /daily. Smoky dark surface, gold accents,
   pill-row preview ("Next: 06:30 — Wake-up Time"). Mobile = stacked. Desktop
   = side-by-side. Always tappable.
   ============================================================================ */
.ds-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(180, 126, 55, 0.10) 0%, var(--warm) 55%);
  border: 1px solid rgba(180, 126, 55, 0.34);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin: 14px 0 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ds-cta-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 100% 0%, rgba(180, 126, 55, 0.10) 0%, transparent 60%);
  pointer-events: none;
}
.ds-cta-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}
.ds-cta-l {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
}
.ds-cta-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.ds-cta-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.ds-cta-pill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ds-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(180, 126, 55, 0.08);
  border: 1px solid rgba(180, 126, 55, 0.32);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 100%;
}
.ds-cta-pill-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.ds-cta-pill-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--gold);
}
.ds-cta-pill-activity {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-cta-pill-meta {
  background: transparent;
  border-color: var(--hairline);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10.5px;
}
.ds-cta-pill-empty {
  background: transparent;
  border-color: var(--hairline);
  color: var(--text-dim);
  font-style: italic;
}
.ds-cta-r {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}
.ds-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--gold);
  color: var(--canvas);
  border-radius: 999px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ds-cta-card:hover .ds-cta-btn {
  background: var(--gold-hi, #d3a05c);
}
@media (max-width: 640px) {
  .ds-cta-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 16px 18px;
    gap: 14px;
  }
  .ds-cta-r { width: 100%; }
  .ds-cta-btn {
    width: 100%;
    justify-content: center;
    padding: 13px 16px;
    font-size: 14px;
  }
  .ds-cta-title { font-size: 19px; }
  .ds-cta-pill { font-size: 12px; padding: 5px 10px; }
  .ds-cta-pill-activity {
    /* On the smallest phones, allow the activity to wrap into the pill row
       so we don't ellipsize the only piece of useful content. */
    white-space: normal;
  }
  .ds-cta-pill {
    white-space: normal;
    max-width: calc(100% - 4px);
  }
}

/* ============================================================================
   Bundle G — Daily System mobile fixes: scroll containment + lane cap +
   bottom-sheet detail expand.
   ============================================================================ */

/* Scroll containment: tell the browser the calendar is its own scroll
   surface. When user reaches the calendar's top/bottom, scrolling does
   NOT chain to the page (which on mobile Safari was Manou's main
   complaint — "sometimes it scrolls the entire page"). */
.dsx-cal {
  overscroll-behavior: contain;
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* BL-INV-10 — single-column rule supersedes all prior lane-cap rules.
   No more multi-lane CSS, no "+N more" pill. Blocks are pre-displaced
   server-side and span the full timeline width on every viewport. */
@media (max-width: 640px) {
  .dsx-block { padding: 8px 10px 9px; min-height: 64px; }
  .dsx-block .dsx-b-title {
    font-size: 14px;
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Legacy "+N more" cluster overflow pill: kept hidden so any stale DOM
   doesn't show. JS no longer emits this. */
.dsx-cluster-more { display: none !important; }

/* ----- Block detail bottom-sheet (mobile) / centered modal (desktop).
   Replaces the in-place "is-open" expand which was cramped on mobile.
   The "is-open" state is kept for desktop; mobile clicks open the sheet
   instead via JS. The sheet is its own DOM node injected by the page
   script when first needed. */
/* Bundle X (2026-04-30) — block-detail bottom-sheet z-index FIX.
   Was 1500/1501 which sits BEHIND the .pf-daily-modal-overlay (z 1600).
   On Manou's real iPhone the sheet was rendering INVISIBLE because
   the daily modal overlay covered it. Now the sheet stacks above the
   daily modal overlay (1600) so taps on a block from inside the modal
   open the sheet correctly above. The sheet is always appended to
   `document.body` (not nested inside .pf-daily-modal) so it gets a
   fresh stacking context at body level — no parent stacking traps.
   See feedback_real_device_qa_required.md (block-detail-behind-modal).
*/
.dsx-detail-sheet-back {
  position: fixed;
  inset: 0;
  /* Softer, slightly warmer dim with a heavier blur so the rounded sheet reads
     as floating above the dimmed day rather than snapping over flat black. */
  background: rgba(8, 6, 4, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.dsx-detail-sheet-back.open {
  opacity: 1;
  pointer-events: auto;
}
.dsx-detail-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1701;
  background: var(--warm, #1b1815);
  /* Softer, rounder lip: bigger top radius, no hairline gold edge line, a
     layered diffuse shadow instead of one hard drop. */
  border-radius: 24px 24px 0 0;
  padding: 14px 22px calc(30px + env(safe-area-inset-bottom, 0));
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow:
    0 -1px 0 rgba(180, 126, 55, 0.18),
    0 -24px 64px -16px rgba(0, 0, 0, 0.55),
    0 -8px 24px -12px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.dsx-detail-sheet.open { transform: translateY(0); }
.dsx-detail-handle {
  width: 48px;
  height: 6px;
  background: rgba(241, 235, 224, 0.28);
  border-radius: 999px;
  margin: 6px auto 16px;
}
.dsx-detail-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dsx-detail-sheet-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 23px;
  /* Drop the negative tracking so it doesn't read tight/sharp. */
  letter-spacing: 0;
  color: var(--text);
  margin: 2px 0 6px;
  line-height: 1.25;
}
.dsx-detail-sheet-time {
  display: inline-flex;
  align-items: center;
  /* Soft warm time tag: fill instead of hairline, no wide tracking, lighter
     weight. Reads as a chip, not a system label. */
  padding: 5px 13px;
  background: rgba(180, 126, 55, 0.16);
  color: var(--gold);
  border: 0;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.dsx-detail-sheet-close {
  margin-left: auto;
  /* Soft resting surface so it's a proper rounded button on touch, not a bare
     floating glyph. */
  background: rgba(255, 255, 255, 0.05);
  border: 0;
  color: var(--text-dim);
  font-size: 19px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
}
.dsx-detail-sheet-close:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.dsx-detail-sheet-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}
.dsx-detail-sheet-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.dsx-detail-sheet-body li {
  position: relative;
  /* Roomier cue rows so it reads as a breathable cue card, not a dense list. */
  padding: 9px 0 9px 24px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}
.dsx-detail-sheet-body li::before {
  content: "";
  position: absolute;
  left: 4px; top: 18px;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  /* Gentle gold halo so the cue dot reads soft, not a hard pin-prick. */
  box-shadow: 0 0 0 3px rgba(180, 126, 55, 0.12);
}
.dsx-detail-sheet-loom {
  margin-top: 14px;
  /* Let .pf-video own the soft ring; no duplicate hairline border here. */
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  max-width: 100%;
}
.dsx-detail-sheet-loom iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
.dsx-detail-sheet-cycle {
  margin-top: 14px;
  /* Rounder, roomier info panel with a soft inset ring instead of a hairline. */
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}
@media (min-width: 720px) {
  /* Desktop: centred modal, not bottom-sheet. Soft floating panel: no hairline
     frame, a diffuse shadow with a faint gold ring, more breathing room. */
  .dsx-detail-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, calc(-50% + 24px));
    width: min(680px, calc(100vw - 48px));
    max-height: min(82vh, 760px);
    border-radius: 24px;
    border: 0;
    box-shadow:
      0 24px 80px -24px rgba(0, 0, 0, 0.6),
      0 0 0 1px rgba(180, 126, 55, 0.12);
    padding: 22px 26px 26px;
  }
  .dsx-detail-sheet.open {
    transform: translate(-50%, -50%);
  }
  .dsx-detail-handle { display: none; }
}

/* ============================================================
   Cardio session blocks (Bundle E — 2026-04-30)
   Smoky dark + gold. Mobile-first, falls into ws-blocks grid.
   ============================================================ */

.ws-cardio {
  background: var(--warm);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 18px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.ws-cardio--vo2 {
  border-color: rgba(180, 126, 55, 0.45);
  box-shadow: inset 0 0 0 1px rgba(180, 126, 55, 0.12);
}

.ws-cardio-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ws-cardio-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(180,126,55,0.18), rgba(180,126,55,0.04));
  border: 1px solid rgba(180, 126, 55, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.ws-cardio-icon svg { display: block; }
.ws-cardio-titleblock { display: flex; flex-direction: column; gap: 2px; }
.ws-cardio-eyebrow {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}
.ws-cardio-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 19px;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ws-cardio-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.ws-cardio-card {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 14px;
  padding: 14px 14px 16px;
}

/* Teaching card */
.ws-teaching-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ws-teaching-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-teaching-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(180, 126, 55, 0.18);
}
.ws-teaching-title {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.ws-teaching-sep { color: var(--text-dim); margin: 0 2px; }
.ws-teaching-label-text { color: var(--gold); font-style: italic; }

.ws-teaching-target {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(180, 126, 55, 0.07);
  border: 1px solid rgba(180, 126, 55, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
}
.ws-teaching-target-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
}
.ws-teaching-target-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.ws-teaching-target-pct {
  font-size: 12px;
  color: var(--text-dim);
}
.ws-teaching-target--noage .ws-teaching-target-value { font-size: 18px; }

.ws-zone-bar {
  display: flex;
  gap: 4px;
  border-radius: 10px;
  overflow: hidden;
}
.ws-zone-seg {
  flex: 1;
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ws-zone-seg--zone_1 { background: linear-gradient(135deg, #76c893, #57b67c); }
.ws-zone-seg--zone_2 { background: linear-gradient(135deg, #a3d977, #87c64b); }
.ws-zone-seg--zone_3 { background: linear-gradient(135deg, #f5c451, #e3a432); }
.ws-zone-seg--zone_4 { background: linear-gradient(135deg, #e8884a, #d56a25); }
.ws-zone-seg--zone_5 { background: linear-gradient(135deg, #d8534a, #b3392f); color: rgba(255,255,255,0.85); }
.ws-zone-seg.is-current {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(180, 126, 55, 0.25);
}
.ws-zone-seg-num { line-height: 1; }

.ws-teaching-why {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.ws-teaching-callout {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(180, 126, 55, 0.05);
  border: 1px dashed rgba(180, 126, 55, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}
.ws-teaching-callout svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--gold);
}

/* VO2 max card */
.ws-vo2-card { padding: 0; overflow: hidden; }
.ws-vo2-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px;
  background: linear-gradient(140deg, rgba(180,126,55,0.18), rgba(180,126,55,0.05));
  border-bottom: 1px solid rgba(180, 126, 55, 0.16);
}
.ws-vo2-summary::-webkit-details-marker { display: none; }
.ws-vo2-summary-label {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  color: var(--text);
  font-size: 15px;
  flex: 1;
}
.ws-vo2-summary-meta {
  font-family: "JetBrains Mono", monospace;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ws-vo2-caret { color: var(--gold); transition: transform 0.2s ease; flex: 0 0 auto; }
.ws-vo2-card[open] .ws-vo2-caret { transform: rotate(180deg); }
.ws-vo2-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.ws-vo2-section-title {
  margin: 6px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.ws-vo2-equip-list { display: flex; flex-direction: column; gap: 8px; }
.ws-vo2-equip {
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(180,126,55,0.14);
  border-radius: 12px;
  padding: 10px 12px;
}
.ws-vo2-equip--rec {
  border-color: rgba(180, 126, 55, 0.4);
  background: rgba(180, 126, 55, 0.08);
}
.ws-vo2-equip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ws-vo2-equip-name { font-weight: 600; color: var(--text); font-size: 14px; }
.ws-vo2-equip-tag {
  background: var(--gold);
  color: #1a1410;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.ws-vo2-equip-safety { color: var(--gold); font-size: 12px; margin: 0 0 2px; font-weight: 600; }
.ws-vo2-equip-note { color: var(--text-dim); font-size: 13px; margin: 0; line-height: 1.45; }
.ws-vo2-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-vo2-steps li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; line-height: 1.4; }
.ws-vo2-step-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1410;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-vo2-empty { color: var(--text-dim); font-size: 13px; margin: 0; font-style: italic; }
.ws-vo2-prog-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0,0,0,0.18);
  border-radius: 10px;
  padding: 4px;
}
.ws-vo2-prog-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 8px 8px;
  border-radius: 8px;
}
.ws-vo2-prog-row.is-current {
  background: rgba(180, 126, 55, 0.12);
  outline: 1px solid rgba(180, 126, 55, 0.4);
}
.ws-vo2-prog-week {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: center;
}
.ws-vo2-prog-cell { display: flex; flex-direction: column; gap: 2px; }
.ws-vo2-prog-level {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ws-vo2-prog-narr {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
}
.ws-vo2-frequency {
  margin: 0;
  font-size: 13px;
  color: var(--gold);
  font-style: italic;
}
.ws-vo2-why { color: var(--text); font-size: 13px; }
.ws-vo2-why summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.ws-vo2-why p { margin: 6px 0 0; line-height: 1.5; color: var(--text-dim); }

/* Cardio actions + timer */
.ws-cardio-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-cardio-start {
  background: var(--gold);
  color: #1a1410;
}
.ws-log-btn--alt {
  background: transparent;
  border: 1px solid rgba(180, 126, 55, 0.45);
  color: var(--gold);
}
.ws-log-btn--alt:hover { background: rgba(180,126,55,0.1); color: var(--gold); }

.ws-cardio-timer {
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(180,126,55,0.3);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-cardio-timer-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ws-cardio-timer-phase {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.ws-cardio-timer-time {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.ws-cardio-timer-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(180,126,55,0.12);
  overflow: hidden;
}
.ws-cardio-timer-bar-fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  transition: inset 0.4s linear;
}
.ws-cardio-timer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-cardio-notes-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ws-cardio-notes-input {
  width: 100%;
  resize: vertical;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(180,126,55,0.18);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.ws-cardio-notes-input:focus {
  outline: none;
  border-color: var(--gold);
}
.ws-cardio-notes { color: var(--text-dim); font-size: 13px; }

/* ============================================================
   Coach builder — kind toggle + cardio fields
   ============================================================ */
.ex-kind-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(180,126,55,0.18);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 6px;
}
.ex-kind-pill {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ex-kind-pill.is-active {
  background: var(--gold);
  color: #1a1410;
}
.ex-cardio-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.ex-cardio-fields > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.ex-cardio-fields select,
.ex-cardio-fields input {
  background: var(--warm);
  border: 1px solid rgba(180,126,55,0.18);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.ex-cardio-fields select:focus,
.ex-cardio-fields input:focus {
  outline: none;
  border-color: var(--gold);
}
.ex-cardio-modality-other { display: none; }
.ex-cardio-modality-other.is-shown { display: flex; }
.ex-vo2-helper {
  margin-top: 8px;
  background: rgba(180,126,55,0.06);
  border: 1px dashed rgba(180,126,55,0.32);
  border-radius: 12px;
  padding: 10px 12px;
  display: none;
}
.ex-vo2-helper.is-shown { display: block; }
.ex-vo2-helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ex-vo2-helper-row label { font-size: 12px; font-weight: 600; color: var(--gold); }
.ex-vo2-helper-row select {
  background: var(--warm);
  border: 1px solid rgba(180,126,55,0.18);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
}
.ex-vo2-helper-narr {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
}

/* ============================================================================
   Bundle M (2026-04-30) — Single-column flow timeline (mobile).
   Bundle Y (2026-04-30) — Single-column flow timeline as DEFAULT for ALL
   viewports (desktop + tablet + mobile), per BUG 5 in bundle-y brief. The
   absolute-positioned multi-lane grid is hidden everywhere; same hour blocks
   stack vertically with a small gap. Manou's verbatim ask:
     "Apply mobile aesthetic logic: smoky-dark + gold + Fraunces + Inter,
      single-column timeline ... click an element → shows FULL content
      (video, details, notes), not just title+time."
   ============================================================================ */

/* Hide absolute-positioned grid + rail on every viewport. We keep the DOM
   (so JS that walks .dsx-block keeps finding both copies — `dsx-flow-block`
   is also a `.dsx-block`). Hidden grid blocks cannot collide with visible
   flow blocks visually or via tap. */
.dsx-grid { display: none !important; }

/* Show flow timeline by default. */
.dsx-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 8px 16px;
  position: relative;
}
.dsx-flow-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: stretch;
  column-gap: 10px;
  border-top: 1px solid var(--dsx-line);
  padding: 8px 0 8px 0;
  min-height: 36px;
}
.dsx-flow-row:first-child { border-top: 0; }
.dsx-flow-hour {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--dsx-ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  text-align: right;
  padding-right: 4px;
}
.dsx-flow-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
/* Flow blocks: full-width, static-flow, no lane math, title wraps. */
.dsx-flow-block {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  min-height: 0;
  --dsx-lane-i: 0;
  --dsx-lane-n: 1;
  padding: 10px 12px 11px;
}
.dsx-flow-block .dsx-b-title {
  font-size: 14.5px;
  line-height: 1.3;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  display: block !important;
}
.dsx-flow-block .dsx-b-meta { margin-bottom: 4px; }
.dsx-flow-block .dsx-time-pill {
  font-size: 10px;
  padding: 2px 8px;
}
.dsx-flow-block .dsx-mini-tag {
  font-size: 9.5px;
  padding: 2px 7px;
  letter-spacing: 0.14em;
  display: inline-flex;
}

/* Disable the Bundle-G lane-cap rules (they only target absolute grid blocks
   with data-lane-count, which our flow blocks don't carry — but be safe). */
.dsx-flow-block.dsx-block[data-lane-count] {
  width: 100% !important;
  left: auto !important;
}

/* Hide the "+N more" cluster pill — relic of the absolute grid layout. */
.dsx-cluster-more { display: none !important; }

/* Now-marker on the flow timeline. Anchored absolutely to the flow track
   (which is position:relative). JS computes top from current local time,
   mapped to the rendered flow rows by data-hour. Cream colour to read
   distinct from gold block borders + gold hour lines.
   Bundle Z (2026-04-30): bumped to 2px height + stronger glow so it's
   actually visible against the smoky panel — Manou flagged "still not
   visible" on real iPhone after Bundle Y. */
.dsx-flow .dsx-now-flow {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #f1ebe0;
  box-shadow: 0 0 12px rgba(241, 235, 224, 0.75),
              0 0 0 1px rgba(241, 235, 224, 0.18);
  z-index: 3;
  pointer-events: none;
}
.dsx-flow .dsx-now-flow::before {
  content: "";
  position: absolute;
  left: -2px; top: -3.5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f1ebe0;
  box-shadow: 0 0 6px rgba(241, 235, 224, 0.85);
}
.dsx-flow .dsx-now-flow::after {
  /* Bundle X (2026-04-30) — fix "no" clipping. */
  content: "Now";
  position: absolute;
  right: 6px; top: -10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #0f0e0c;
  background: #f1ebe0;
  border: 1px solid rgba(241, 235, 224, 0.55);
  border-radius: 999px;
  padding: 2px 9px 2px;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.6);
  line-height: 1;
  white-space: nowrap;
}

/* Bundle Y (2026-04-30) — Desktop refinements for the now-mobile-default flow.
   Centre the timeline in a max-width column so it doesn't sprawl on wide
   monitors. Beef up the hour-label column and block sizing so it reads as a
   premium calendar, not a phone view that grew up. */
@media (min-width: 720px) {
  .dsx-flow {
    max-width: 760px;
    margin: 0 auto;
    padding: 8px 16px 28px;
  }
  .dsx-flow-row {
    grid-template-columns: 72px 1fr;
    column-gap: 14px;
    padding: 10px 0;
  }
  .dsx-flow-hour {
    font-size: 12px;
    padding-top: 4px;
    padding-right: 8px;
  }
  .dsx-flow-block {
    padding: 14px 18px 16px;
  }
  .dsx-flow-block .dsx-b-title {
    font-size: 16px;
    line-height: 1.35;
  }
  .dsx-flow-block .dsx-b-summary {
    font-size: 13.5px;
    line-height: 1.55;
    margin-top: 6px;
  }
  .dsx-flow-block .dsx-time-pill {
    font-size: 11px;
    padding: 3px 10px;
  }
  .dsx-flow-block .dsx-mini-tag {
    font-size: 10.5px;
  }
}

/* ===========================================================
   B2/B3 (2026-05-30): Daily System day-overlay SECTIONS +
   coach-picked block/section ICONS (mobile flow).
   A section is a translucent colored band over a time range
   with a thin labelled tab at its start hour. Blocks render
   ABOVE the band untouched: the band sits at z-index -1 inside
   a stacking-context row, so non-positioned blocks + tabs paint
   over it with zero change to the load-bearing block CSS.
   =========================================================== */
.dsx-flow-row {
  --dsx-slot-x: 66px;   /* hour col 56 + column-gap 10 */
}
/* Only rows that actually carry a section band become a positioned stacking
   context, so the band's z-index:-1 stays scoped to its own row. Zero-section
   rows are left untouched, so the section feature has no blast radius onto
   normal days (and the now-badge's transform-anchored positioning is never
   given a new row-level containing-block candidate). The server stamps
   .dsx-flow-row--sec on every row a band loops over. */
.dsx-flow-row--sec {
  position: relative;
  z-index: 0;
}
@media (min-width: 720px) {
  .dsx-flow-row { --dsx-slot-x: 86px; }  /* hour col 72 + gap 14 */
}
.dsx-flow-band {
  position: absolute;
  /* Bleed left past the slot, over the hour-number column, so a section reads
     as a WIDE wrapper bracketing the whole stretch (not just another block).
     z-index -1 keeps it behind the hour numbers, which have no background and
     stay readable on top. Continuous (no radius) so stacked row-segments form
     one seamless stripe. */
  left: 3px;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  border-left: 3px solid var(--dsx-sec-edge, rgba(201, 162, 75, 0.7));
  background: var(--dsx-sec-fill, rgba(201, 162, 75, 0.09));
  border-radius: 0;
}
.dsx-section-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  /* Pull the header tab left over the hour column too; the column-flex slot
     stretches it back out so it spans the full row width, lined up with the
     band edge. */
  margin-left: calc(4px - var(--dsx-slot-x));
  padding: 6px 11px;
  margin-bottom: 4px;
  border-radius: 0 9px 9px 0;
  border-left: 3px solid var(--dsx-sec-edge, rgba(201, 162, 75, 0.85));
  /* Solid dark base UNDER the colour tint so the start-hour number the tab
     overlaps does not ghost through a translucent header. */
  background-color: #17130e;
  background-image: linear-gradient(var(--dsx-sec-tab, rgba(201, 162, 75, 0.16)),
                                    var(--dsx-sec-tab, rgba(201, 162, 75, 0.16)));
}
.dsx-section-tab-ic {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-flex;
  color: var(--dsx-sec-ink, #e7d3a0);
}
.dsx-section-tab-ic svg { width: 100%; height: 100%; display: block; }
.dsx-section-tab-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dsx-sec-ink, #e7d3a0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsx-section-tab-time {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--dsx-ink-3);
}
@media (min-width: 720px) {
  .dsx-section-tab-title { font-size: 13.5px; }
  .dsx-section-tab-time { font-size: 11px; }
  .dsx-section-tab-ic { width: 16px; height: 16px; }
}

/* Per-color theming. Section colors mirror the coercer allowlist
   (gold / sky / mint / violet / rose / slate). */
.dsx-flow-band--gold   { --dsx-sec-edge: rgba(201, 162, 75, 0.55);  --dsx-sec-fill: rgba(201, 162, 75, 0.09); }
.dsx-flow-band--sky    { --dsx-sec-edge: rgba(90, 169, 214, 0.55);  --dsx-sec-fill: rgba(90, 169, 214, 0.10); }
.dsx-flow-band--mint   { --dsx-sec-edge: rgba(79, 178, 134, 0.55);  --dsx-sec-fill: rgba(79, 178, 134, 0.10); }
.dsx-flow-band--violet { --dsx-sec-edge: rgba(155, 127, 209, 0.55); --dsx-sec-fill: rgba(155, 127, 209, 0.11); }
.dsx-flow-band--rose   { --dsx-sec-edge: rgba(209, 120, 143, 0.55); --dsx-sec-fill: rgba(209, 120, 143, 0.11); }
.dsx-flow-band--slate  { --dsx-sec-edge: rgba(133, 147, 168, 0.55); --dsx-sec-fill: rgba(133, 147, 168, 0.10); }

.dsx-section-tab--gold   { --dsx-sec-edge: rgba(201, 162, 75, 0.7);  --dsx-sec-tab: rgba(201, 162, 75, 0.16);  --dsx-sec-ink: #e7d3a0; }
.dsx-section-tab--sky    { --dsx-sec-edge: rgba(90, 169, 214, 0.7);  --dsx-sec-tab: rgba(90, 169, 214, 0.16);  --dsx-sec-ink: #bfe0f3; }
.dsx-section-tab--mint   { --dsx-sec-edge: rgba(79, 178, 134, 0.7);  --dsx-sec-tab: rgba(79, 178, 134, 0.16);  --dsx-sec-ink: #bfe6d3; }
.dsx-section-tab--violet { --dsx-sec-edge: rgba(155, 127, 209, 0.7); --dsx-sec-tab: rgba(155, 127, 209, 0.18); --dsx-sec-ink: #d8c9f0; }
.dsx-section-tab--rose   { --dsx-sec-edge: rgba(209, 120, 143, 0.7); --dsx-sec-tab: rgba(209, 120, 143, 0.18); --dsx-sec-ink: #f0c6d2; }
.dsx-section-tab--slate  { --dsx-sec-edge: rgba(133, 147, 168, 0.7); --dsx-sec-tab: rgba(133, 147, 168, 0.16); --dsx-sec-ink: #cdd6e2; }

/* Coach-picked block icon: inline sprite <use>, replacing the masked
   category glyph. Neutralize the base .dsx-cat-icon mask + background. */
.dsx-cat-icon--svg {
  background: none !important;
  -webkit-mask-image: none !important;
          mask-image: none !important;
  color: var(--dsx-ink-2, #cbb98e);
  width: 14px;
  height: 14px;
}
.dsx-cat-icon--svg svg { width: 100%; height: 100%; display: block; }

/* ---------- Branding-stripped video player ----------
   Pure Focus dark-canvas wrapper for embedded coaching videos. Pre-play =
   dark poster + gold play button only. Post-play = iframe with masking
   strips over residual YouTube chrome (logo bottom-right, share top-right). */
.pf-video {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  /* Softer media card: rounder corners, a soft inset gold ring + diffuse
     shadow instead of a hard 1px hairline around a near-black rectangle. */
  border-radius: 16px;
  overflow: hidden;
  background: #030303;
  border: 0;
  box-shadow:
    inset 0 0 0 1px rgba(180, 126, 55, 0.14),
    0 8px 24px -12px rgba(0, 0, 0, 0.5);
  isolation: isolate;
}
.pf-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(180, 126, 55, 0.18) 0%, rgba(180, 126, 55, 0.04) 38%, transparent 70%),
    linear-gradient(140deg, #030303 0%, #1b1815 100%);
  border: 0;
  cursor: pointer;
  transition: transform .18s ease;
  z-index: 2;
  padding: 0;
}
.pf-video-poster:hover { transform: none; }
.pf-video-poster:hover .pf-video-play { transform: scale(1.06); }
.pf-video-poster:active .pf-video-play { transform: scale(0.96); }
.pf-video-play {
  width: 80px;
  height: 80px;
  display: block;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.55));
  transition: transform .18s ease;
}
@media (min-width: 720px) {
  .pf-video-play { width: 96px; height: 96px; }
}
.pf-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  z-index: 1;
}
/* Branding masks. pointer-events:none so users can still hit pause/play and
   scrub the timeline through the masks. Background colour = same dark canvas
   as the wrapper, so the masks visually merge with the player chrome. */
.pf-video-mask {
  position: absolute;
  pointer-events: none;
  background: #030303;
  z-index: 4;
}
/* Top-right strip masks share button + more-options overlay if it shows. */
.pf-video-mask.tr {
  top: 0;
  right: 0;
  width: 110px;
  height: 52px;
}
/* Bottom-right strip masks the YouTube wordmark on the controls bar. */
.pf-video-mask.br {
  bottom: 0;
  right: 0;
  width: 92px;
  height: 30px;
}
/* While paused / before play the masks are hidden so the dark poster reads
   clean. After play they appear over the iframe. The "loading" state (iframe
   created + autoplaying behind the still-visible poster, before its first
   frame paints) ALSO hides the masks so no black corner strips flash over the
   poster image, and gently pulses the play button so the tap reads as "loading"
   rather than frozen. */
.pf-video[data-state="ready"] .pf-video-mask,
.pf-video[data-state="loading"] .pf-video-mask { display: none; }
.pf-video[data-state="playing"] .pf-video-poster { display: none; }
.pf-video[data-state="loading"] .pf-video-poster { cursor: progress; }
.pf-video[data-state="loading"] .pf-video-play {
  animation: pf-video-loading-pulse 1.1s ease-in-out infinite;
}
@keyframes pf-video-loading-pulse {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}


/* ============================================================================
   Bundle N (2026-04-30) — Home as immersive day-dashboard.
   Big day/date header → ±7 day pill strip → cards (workout / daily system /
   food / coach note). Replaces Bundle G's static CTA layout.
   See feedback_home_immersive_day_dashboard.md.
   ============================================================================ */

.home-day { padding-bottom: 96px; }

/* ---- Header ---- */
.hd-header {
  margin: 4px 0 14px;
}
.hd-date-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.hd-date-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 4px;
}
.hd-greet {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 18px;
}

/* ---- Date strip (pill row + arrows) ---- */
.hd-strip {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 6px;
}
.hd-strip-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  background: var(--warm);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}
.hd-strip-arrow:hover {
  border-color: var(--gold);
  color: var(--gold-hi);
  background: var(--warm-raised);
}
.hd-strip-pills {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  min-width: 0;
}
.hd-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  background: var(--warm);
  border: 1px solid rgba(180, 126, 55, 0.12);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  position: relative;
  min-height: 56px;
}
.hd-pill:hover {
  border-color: rgba(180, 126, 55, 0.45);
  color: var(--text);
}
.hd-pill-dow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  line-height: 1;
}
.hd-pill-num {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.hd-pill-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  height: 6px;
  margin-top: 3px;
}
.hd-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.hd-dot-workout { background: var(--gold); }
.hd-dot-food { background: var(--text-secondary); }
.hd-pill-today {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(180, 126, 55, 0.10), var(--warm) 70%);
}
.hd-pill-today .hd-pill-dow { color: var(--gold); }
.hd-pill-selected {
  background: var(--warm-raised);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset;
  transform: scale(1.04);
}
.hd-pill-selected .hd-pill-dow { color: var(--gold); }
.hd-pill-selected .hd-pill-num { color: var(--gold-hi); }

.hd-strip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 22px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hd-strip-fullcal {
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.10em;
  font-weight: 500;
}
.hd-strip-fullcal:hover { color: var(--gold); }

/* ---- Cards ---- */
.hd-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 768px) {
  .hd-cards {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}
.hd-card {
  background: var(--warm);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 18px;
  padding: 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.hd-card-workout {
  border-left: 3px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(180, 126, 55, 0.08) 0%, var(--warm) 60%);
}
.hd-card-rest {
  border-style: dashed;
  border-color: rgba(180, 126, 55, 0.22);
  background: transparent;
}
.hd-card-coach {
  border-left: 3px solid var(--gold-hi);
}
.hd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.hd-card-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.hd-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(180, 126, 55, 0.08);
  border: 1px solid rgba(180, 126, 55, 0.18);
  padding: 3px 8px;
  border-radius: 999px;
}
.hd-tag-pulse {
  color: var(--gold);
  border-color: rgba(180, 126, 55, 0.45);
  background: rgba(180, 126, 55, 0.14);
}
.hd-card-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.hd-card-title-rest, .hd-card-title-empty { color: var(--text-secondary); }
.hd-card-rest-copy {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 4px;
  line-height: 1.45;
}
.hd-card-note {
  /* Premium subline: a small uppercase eyebrow + gold dot + clean tabular
     value. Replaces the italic "Last night (2026-06-19)" line that read like a
     backend audit log. */
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
  margin: 0;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.hd-card-note-lead {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hd-card-note-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 8px;
  flex: none;
  opacity: 0.9;
}
.hd-rest-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.hd-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.hd-meta-pill {
  display: inline-flex;
  flex-direction: column;
  padding: 6px 12px;
  background: rgba(180, 126, 55, 0.06);
  border: 1px solid rgba(180, 126, 55, 0.20);
  border-radius: 999px;
  line-height: 1.05;
}
.hd-meta-pill-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.hd-meta-pill-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.hd-exercise-preview {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hd-exercise-preview li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
}
.hd-exercise-preview li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--gold);
  font-weight: 700;
}

/* ---- CTAs (cards) ---- */
.hd-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: 999px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin-top: auto;
  transition: all 0.15s ease;
  align-self: flex-start;
}
@media (max-width: 640px) {
  .hd-card-cta {
    align-self: stretch;
    padding: 12px 18px;
    font-size: 14px;
  }
}
.hd-card-cta-primary {
  background: var(--gold);
  color: var(--canvas);
}
.hd-card-cta-primary:hover { background: var(--gold-hi); color: var(--canvas); }
.hd-card-cta-secondary {
  background: rgba(180, 126, 55, 0.10);
  color: var(--gold-hi);
  border: 1px solid rgba(180, 126, 55, 0.32);
}
.hd-card-cta-secondary:hover {
  background: rgba(180, 126, 55, 0.18);
  border-color: var(--gold);
  color: var(--gold-hi);
}
.hd-card-cta-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(180, 126, 55, 0.18);
  padding: 9px 14px;
  font-size: 12.5px;
}
.hd-card-cta-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-hi);
}
.hd-card-cta-disabled {
  background: transparent;
  color: var(--text-dim);
  border: 1px dashed rgba(180, 126, 55, 0.18);
  cursor: not-allowed;
}

/* ---- Food card: kcal ring + macro bars ---- */
.hd-food-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
}
@media (max-width: 380px) {
  .hd-food-row { grid-template-columns: 80px 1fr; gap: 12px; }
}
.hd-kcal-ring {
  --hd-kcal-pct: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    conic-gradient(
      var(--gold) calc(var(--hd-kcal-pct) * 1%),
      rgba(180, 126, 55, 0.12) 0
    );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
@media (max-width: 380px) {
  .hd-kcal-ring { width: 80px; height: 80px; }
}
.hd-kcal-ring-inner {
  width: 78px;
  height: 78px;
  background: var(--warm);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.05;
}
@media (max-width: 380px) {
  .hd-kcal-ring-inner { width: 64px; height: 64px; }
}
.hd-kcal-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hd-kcal-target {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.hd-kcal-unit {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-top: 2px;
}
.hd-macro-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hd-macro-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
}
.hd-macro-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
}
.hd-macro-bar {
  height: 6px;
  background: rgba(180, 126, 55, 0.10);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.hd-macro-bar-fill {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.hd-macro-val {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}
.hd-macro-val .muted { color: var(--text-dim); }

/* ---- Coach note ---- */
.hd-coach-preview {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Mobile fine-tunes ---- */
@media (max-width: 640px) {
  .hd-date-title { font-size: 26px; }
  .hd-pill-num { font-size: 16px; }
  .hd-pill { min-height: 50px; padding: 6px 2px 4px; }
  .hd-strip-arrow { width: 32px; }
  .hd-strip-pills { gap: 4px; }
  .hd-card { padding: 16px 16px 18px; border-radius: 16px; }
  .hd-card-title { font-size: 19px; }
}


/* ============================================================================
   Bundle P (2026-04-30) — Daily System polish round 2.
   Drives:
     SHIP 1 — Now-block visual emphasis (size, glow, NOW badge, pulse)
     SHIP 2 — Past/Now/Future temporal state + per-category accent stripe + icon
     SHIP 3 — Home click-to-focus modal (scale-in, backdrop, sandboxed scroll)
     SHIP 4 — Functional drag handle on bottom-sheet (drag-down dismiss / drag-up fullscreen)
     SHIP 5 — YouTube static thumbnail visible inside .pf-video poster
   See:
     feedback_daily_system_now_block_emphasis.md
     feedback_daily_system_block_state_styling.md
     feedback_daily_system_expand_collapse_scroll.md
     feedback_daily_system_video_branding_strip.md (UPDATED 2026-04-30, lines 11+18)
   ============================================================================ */

/* ---------- Category palette (CSS variables) ---------- */
:root {
  --pf-cat-wake: #ffcc66;        /* sunrise gold */
  --pf-cat-hydration: #aee0e8;   /* pale aqua-cream */
  --pf-cat-movement: #d18b3a;    /* bronze-gold */
  --pf-cat-meal: #c19056;        /* warm tan */
  --pf-cat-focus: #b47e37;       /* deep gold */
  --pf-cat-break: #a8c19a;       /* sage-gold */
  --pf-cat-sleep: #6e7ba0;       /* muted indigo */
  --pf-cat-mindfulness: #e8dcc4; /* pale cream */
  --pf-cat-other: #b47e37;       /* default gold */
  --pf-cat-gym: #d18b3a;         /* bronze-gold (training) */
  --pf-cat-deep_work: #b47e37;   /* deep gold (focus) */
  --pf-cat-hygiene: #aee0e8;     /* pale aqua */
  --pf-cat-nsdr: #6e7ba0;        /* muted indigo (rest) */
  --pf-cat-supplement: #c19056;  /* warm tan */
}

/* ---------- SHIP 2A — Temporal state (past / now / future) ---------- */
.dsx-block--past {
  opacity: 0.55;
  border-color: rgba(180, 126, 55, 0.40);
  border-left-width: 2px;
  /* Slight font/padding scale-down so past blocks visually recede. */
  font-size: 0.94em;
}
.dsx-block--past .dsx-b-title { font-size: 14.6px; }
.dsx-block--past:hover { opacity: 0.85; }

.dsx-block--future {
  opacity: 0.95;
}

/* SHIP 1 — Now-block visual emphasis. Bigger padding, gold border + glow,
   pulsing glow, prominent floating NOW badge. Layered above past/future.
   Bundle X (2026-04-30): override `.dsx-block { overflow:hidden }` so the
   NOW badge (top:-11px) is no longer CLIPPED on the top-left of the
   active block. Manou flagged this on his real iPhone — the active block
   was visibly cut at the top-left because the badge bled outside the
   parent's box, hit `overflow:hidden`, and got clipped. Allow visible
   overflow on the now-block only — past/future blocks keep `hidden` so
   long titles still ellipsize correctly.
   See feedback_real_device_qa_required.md (active-block clip). */
.dsx-block.dsx-block--now {
  /* Override is-now's gentle gold-wash with a stronger emphasis. */
  border: 3px solid var(--gold) !important;
  border-left: 3px solid var(--gold) !important;
  background: rgba(180, 126, 55, 0.14) !important;
  box-shadow: 0 0 24px rgba(180, 126, 55, 0.35);
  /* Bumped top padding so the badge floats just outside the border but the
     content below has air. Was 14px → 16px so the now-badge sits slightly
     above the content row. */
  padding: 16px 16px 15px;
  z-index: 4;
  animation: pf-now-pulse 2.4s ease-in-out infinite;
  opacity: 1;
  /* Critical: allow the NOW badge to render outside the block box. */
  overflow: visible !important;
}
/* Ensure the cluster/flow track gives the NOW badge breathing room — the
   first row in dsx-flow has `border-top: 0` so the badge can extend
   slightly above without touching another row's border. */
.dsx-flow-row:has(.dsx-block--now) {
  padding-top: 16px;
}
@keyframes pf-now-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(180, 126, 55, 0.30); }
  50%      { box-shadow: 0 0 34px rgba(180, 126, 55, 0.55); }
}
/* Floating NOW badge — Fraunces, all-caps, larger than the prior tiny pill.
   Hidden by default for past/future blocks, revealed on `--now`. */
.dsx-now-badge {
  display: none;
  position: absolute;
  top: -11px;
  left: 12px;
  padding: 3px 10px 3px;
  background: #f1ebe0;
  color: #0f0e0c;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 4px;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6);
  z-index: 5;
  pointer-events: none;
}
.dsx-block.dsx-block--now .dsx-now-badge { display: inline-block; }
@media (min-width: 720px) {
  .dsx-now-badge { font-size: 12px; padding: 4px 11px 4px; }
}
/* Coexists with past category-stripe: NOW badge sits above-left of the block. */

/* ---------- SHIP 2B/2C — Per-category accent stripe + icon ---------- */
/* The left-edge gold border on .dsx-block already exists (3px). We override
   it with the category color so each block's left edge reads the day's shape
   at a glance. Standard blocks: solid color. Now block keeps the gold pop. */
.dsx-block--cat-wake        { border-left-color: var(--pf-cat-wake) !important; }
.dsx-block--cat-hydration   { border-left-color: var(--pf-cat-hydration) !important; }
.dsx-block--cat-movement    { border-left-color: var(--pf-cat-movement) !important; }
.dsx-block--cat-meal        { border-left-color: var(--pf-cat-meal) !important; }
.dsx-block--cat-focus       { border-left-color: var(--pf-cat-focus) !important; }
.dsx-block--cat-break       { border-left-color: var(--pf-cat-break) !important; }
.dsx-block--cat-sleep       { border-left-color: var(--pf-cat-sleep) !important; }
.dsx-block--cat-mindfulness { border-left-color: var(--pf-cat-mindfulness) !important; }
.dsx-block--cat-other       { border-left-color: var(--pf-cat-other) !important; }
/* Past blocks: dim the category color to match the muted state. */
.dsx-block--past.dsx-block--cat-wake        { border-left-color: rgba(255, 204, 102, 0.45) !important; }
.dsx-block--past.dsx-block--cat-hydration   { border-left-color: rgba(174, 224, 232, 0.45) !important; }
.dsx-block--past.dsx-block--cat-movement    { border-left-color: rgba(209, 139, 58, 0.45) !important; }
.dsx-block--past.dsx-block--cat-meal        { border-left-color: rgba(193, 144, 86, 0.45) !important; }
.dsx-block--past.dsx-block--cat-focus       { border-left-color: rgba(180, 126, 55, 0.45) !important; }
.dsx-block--past.dsx-block--cat-break       { border-left-color: rgba(168, 193, 154, 0.45) !important; }
.dsx-block--past.dsx-block--cat-sleep       { border-left-color: rgba(110, 123, 160, 0.45) !important; }
.dsx-block--past.dsx-block--cat-mindfulness { border-left-color: rgba(232, 220, 196, 0.45) !important; }
.dsx-block--past.dsx-block--cat-other       { border-left-color: rgba(180, 126, 55, 0.45) !important; }
/* Now block keeps the gold border for emphasis; the icon + (optional) tint
   still communicate the category. */

/* Subtle category background tint — 6-10% wash of the category hue, fading
   to transparent ~80px to keep titles legible against the smoky panel. */
.dsx-block.dsx-block--cat-wake        { background: linear-gradient(90deg, rgba(255, 204, 102, 0.06) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-hydration   { background: linear-gradient(90deg, rgba(174, 224, 232, 0.06) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-movement    { background: linear-gradient(90deg, rgba(209, 139, 58, 0.07) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-meal        { background: linear-gradient(90deg, rgba(193, 144, 86, 0.07) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-focus       { background: linear-gradient(90deg, rgba(180, 126, 55, 0.07) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-break       { background: linear-gradient(90deg, rgba(168, 193, 154, 0.06) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-sleep       { background: linear-gradient(90deg, rgba(110, 123, 160, 0.08) 0%, transparent 70%), var(--dsx-warm-2); }
.dsx-block.dsx-block--cat-mindfulness { background: linear-gradient(90deg, rgba(232, 220, 196, 0.06) 0%, transparent 70%), var(--dsx-warm-2); }
/* Now wins. */
.dsx-block.dsx-block--now { background: rgba(180, 126, 55, 0.14) !important; }

/* The .dsx-cat-stripe element is reserved for future expansion (e.g. an
   inner-stripe gradient overlay). For now it's invisible/no-op so we don't
   double-paint over the border-left. Kept in markup to avoid future churn. */
.dsx-cat-stripe { display: none; }

/* Per-category icon — small inline glyph rendered before the time-pill. CSS
   masks an SVG path so we can recolor with the category hue. Falls back to
   a colored dot if mask-image isn't supported (Safari ≤14). */
.dsx-cat-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  /* Self-healing fallback: a category with no mask rule (or an empty category)
     renders as a neutral dot, never a filled square. The 9+5 mapped categories
     below cut their own glyph via mask-image, so this radius is masked away for
     them and only shows for unmapped/empty categories. */
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  flex-shrink: 0;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
}
.dsx-cat-icon[data-cat="wake"]        { color: var(--pf-cat-wake); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><circle cx='12' cy='12' r='4'/><path d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><circle cx='12' cy='12' r='4'/><path d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/></svg>"); }
.dsx-cat-icon[data-cat="hydration"]   { color: var(--pf-cat-hydration); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 2C9 6 6 10 6 14a6 6 0 0012 0c0-4-3-8-6-12z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 2C9 6 6 10 6 14a6 6 0 0012 0c0-4-3-8-6-12z'/></svg>"); }
.dsx-cat-icon[data-cat="movement"]    { color: var(--pf-cat-movement); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><circle cx='12' cy='4' r='2'/><path d='M12 8v6M9 14l-3 6M15 14l3 6M9 11l-3-1M15 11l3-1'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><circle cx='12' cy='4' r='2'/><path d='M12 8v6M9 14l-3 6M15 14l3 6M9 11l-3-1M15 11l3-1'/></svg>"); }
.dsx-cat-icon[data-cat="meal"]        { color: var(--pf-cat-meal); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M6 2v9M6 11a3 3 0 003-3V2M6 11v11M18 2c-2 0-4 2-4 5s2 5 4 5v9'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M6 2v9M6 11a3 3 0 003-3V2M6 11v11M18 2c-2 0-4 2-4 5s2 5 4 5v9'/></svg>"); }
.dsx-cat-icon[data-cat="focus"]       { color: var(--pf-cat-focus); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/><circle cx='12' cy='12' r='1.5' fill='black'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/><circle cx='12' cy='12' r='1.5' fill='black'/></svg>"); }
.dsx-cat-icon[data-cat="break"]       { color: var(--pf-cat-break); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><rect x='6' y='5' width='4' height='14' rx='1'/><rect x='14' y='5' width='4' height='14' rx='1'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><rect x='6' y='5' width='4' height='14' rx='1'/><rect x='14' y='5' width='4' height='14' rx='1'/></svg>"); }
.dsx-cat-icon[data-cat="sleep"]       { color: var(--pf-cat-sleep); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M21 13a9 9 0 11-10-10 7 7 0 0010 10z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M21 13a9 9 0 11-10-10 7 7 0 0010 10z'/></svg>"); }
.dsx-cat-icon[data-cat="mindfulness"] { color: var(--pf-cat-mindfulness); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M12 4a8 8 0 008 8 8 8 0 00-8 8 8 8 0 00-8-8 8 8 0 008-8z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M12 4a8 8 0 008 8 8 8 0 00-8 8 8 8 0 00-8-8 8 8 0 008-8z'/></svg>"); }
.dsx-cat-icon[data-cat="other"]       { color: var(--pf-cat-other); border-radius: 50%; }
/* BUG-WHITEBOX-ICON (2026-06-02): these 5 valid categories had no mask rule, so
   the base rule painted a filled box. Glyphs copied from _daily_system_icon_sprite.html. */
.dsx-cat-icon[data-cat="gym"]         { color: var(--pf-cat-gym); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 6v12M3 9v6M18 6v12M21 9v6M6 12h12'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 6v12M3 9v6M18 6v12M21 9v6M6 12h12'/></svg>"); }
.dsx-cat-icon[data-cat="deep_work"]   { color: var(--pf-cat-deep_work); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/><circle cx='12' cy='12' r='1.5' fill='black'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/><circle cx='12' cy='12' r='1.5' fill='black'/></svg>"); }
.dsx-cat-icon[data-cat="hygiene"]     { color: var(--pf-cat-hygiene); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v6M9 8h6M8 8l-2 14h12L16 8'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v6M9 8h6M8 8l-2 14h12L16 8'/></svg>"); }
.dsx-cat-icon[data-cat="nsdr"]        { color: var(--pf-cat-nsdr); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12c2-3 6-5 9-5s7 2 9 5'/><path d='M3 12c2 3 6 5 9 5s7-2 9-5'/><path d='M9 12h.01M15 12h.01'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12c2-3 6-5 9-5s7 2 9 5'/><path d='M3 12c2 3 6 5 9 5s7-2 9-5'/><path d='M9 12h.01M15 12h.01'/></svg>"); }
.dsx-cat-icon[data-cat="supplement"]  { color: var(--pf-cat-supplement); -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='9' width='18' height='6' rx='3'/><path d='M12 9v6'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='9' width='18' height='6' rx='3'/><path d='M12 9v6'/></svg>"); }

/* ---------- SHIP 3 — Home click-to-focus daily-system modal ---------- */
.pf-daily-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 12, 0.62);
  backdrop-filter: blur(3px);
  z-index: 1600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-daily-modal-overlay.pf-daily-modal--open {
  opacity: 1;
  pointer-events: auto;
}
.pf-daily-modal {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  max-width: 100%;
  height: auto;
  /* Bundle X (2026-04-30): use dvh to track iOS browser-bar auto-hide AND
     keep the modal off the install prompt. vh on iOS = layout vh, which is
     NOT the visible area. dvh = dynamic visible area. */
  max-height: calc(100dvh - 32px);
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.34);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.94);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 32px 80px -16px rgba(0, 0, 0, 0.7);
}
.pf-daily-modal--open .pf-daily-modal { transform: scale(1); }
.pf-daily-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(180, 126, 55, 0.32);
  color: #f1ebe0;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pf-daily-modal-close:hover { background: rgba(0, 0, 0, 0.6); }
.pf-daily-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 22px 18px 28px;
  /* Bundle Z (2026-04-30): explicit min-height:0 so the flex child
     actually shrinks below its content size — without this, on desktop
     Chrome the body's intrinsic content height (the full Daily System)
     forces the modal-body to expand, defeating overflow-y:auto. The
     bug Manou flagged: "CANNOT scroll inside Daily System modal."
     See Bundle Z Bug 5. */
  min-height: 0;
}
/* Bundle Z (2026-04-30): inside the modal, .dsx-cal must NOT establish
   its own scroll container — that double-scroll is what blocks the
   outer .pf-daily-modal-body scroll on desktop. Let the calendar grow
   to its natural height; the modal body scrolls. */
.pf-daily-modal-body .dsx-cal {
  max-height: none !important;
  overflow: visible !important;
}
.pf-daily-modal-loading {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-dim, #9a9a96);
  font-size: 14px;
}
@media (max-width: 640px) {
  .pf-daily-modal {
    width: 100vw;
    /* Bundle X — dvh handles iOS browser-bar collapse + Chrome install
       prompt without a layout gap or content cutoff. */
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  /* Bundle X — bump bottom padding so the LAST block isn't crushed against
     the install-prompt area when one is showing. The vv-offset CSS var (set
     by base.html) is the install-prompt height.
     Bundle Z (2026-04-30) — bump TOP padding so the modal content (and X
     button) sit BELOW iOS status bar (battery / time). env(safe-area-inset-top)
     resolves to ~47px on iPhone 14+ in standalone/black-translucent mode,
     0 outside iOS standalone. See Bundle Z Bug 3. */
  .pf-daily-modal-body {
    padding:
      calc(14px + env(safe-area-inset-top, 0px)) 14px
      calc(28px + var(--pf-vv-offset, 0px));
  }
  .pf-daily-modal-close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
  }
}

/* Home Daily System card — visual cue that the whole card is tappable. */
.hd-card-daily-trigger {
  cursor: pointer;
  position: relative;
  transition: transform .14s ease, border-color .14s ease;
}
.hd-card-daily-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(180, 126, 55, 0.5);
}
.hd-card-daily-trigger:focus-visible {
  outline: 2px solid var(--gold, #b47e37);
  outline-offset: 3px;
}
.hd-card-tap-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(180, 126, 55, 0.7);
  font-weight: 600;
}
.hd-card-cta-trigger { pointer-events: none; }

/* ---------- SHIP 4 — Drag handle on bottom-sheet ---------- */
.dsx-detail-handle--draggable {
  cursor: grab;
  touch-action: none;
  padding: 10px 0 6px;
  margin: -6px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.dsx-detail-handle--draggable .dsx-detail-handle-bar {
  display: block;
  /* Friendlier, rounder grip in a softer warm-white. */
  width: 48px;
  height: 6px;
  background: rgba(241, 235, 224, 0.28);
  border-radius: 999px;
  transition: background .14s ease, width .14s ease;
}
.dsx-detail-handle--draggable:hover .dsx-detail-handle-bar,
.dsx-detail-handle--draggable:active .dsx-detail-handle-bar {
  background: rgba(241, 235, 224, 0.5);
  width: 56px;
}
.dsx-sheet--fullscreen.dsx-detail-sheet {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  /* Bundle X — dvh tracks iOS visible viewport, never overflows under the
     install prompt or the home-indicator.
     Bundle Z — top padding respects safe-area-inset-top so the drag handle
     + close button don't crash into iOS status bar (battery / time) when
     the sheet is dragged up to fullscreen. See Bundle Z Bug 4. */
  height: 100dvh !important;
  max-height: 100dvh !important;
  padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
  border-radius: 0 !important;
  transform: translateY(0) !important;
}

/* Bundle Y (2026-04-30) — empty-state copy inside the bottom-sheet for blocks
   without coach-authored details/loom. Keeps the sheet from looking broken. */
.dsx-detail-empty {
  margin: 4px 0 8px;
  /* Soft solid note card, not a dashed technical placeholder. Reads
     reassuring rather than broken/empty. */
  padding: 16px 18px;
  background: rgba(180, 126, 55, 0.06);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(180, 126, 55, 0.10);
  border-radius: 16px;
}

/* Bundle Y — sheet head doubles as a drag-grip (broader hitbox).
   touch-action:none lets the gesture handler take ownership of the swipe
   instead of the page scrolling. Cursor:grab signals draggability on desktop. */
.dsx-detail-sheet-head {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.dsx-detail-sheet-head:active { cursor: grabbing; }
.dsx-detail-sheet-head .dsx-detail-sheet-close { cursor: pointer; }
/* The handle bar itself: prevent text selection while dragging. */
.dsx-detail-handle--draggable { touch-action: none; user-select: none; }
@media (min-width: 720px) {
  /* Desktop: drag handle hidden; the centred modal already has dedicated
     close button + escape. Keep handle DOM for fallback bind, but invisible. */
  .dsx-detail-handle--draggable { display: none; }
}

/* ---------- SHIP 5 — YouTube static thumbnail in poster ---------- */
.pf-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
  border: 0;
  pointer-events: none;
}
.pf-video-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 14, 12, 0.25) 0%, rgba(15, 14, 12, 0.55) 100%);
  z-index: 2;
  pointer-events: none;
}
/* Play button must sit above thumb + scrim. */
.pf-video-poster .pf-video-play { position: relative; z-index: 3; }
/* Reset poster's gradient backdrop so the actual image shows through. */
.pf-video .pf-video-poster {
  background: #030303; /* fallback if no thumb (Loom) */
}

/* ========================================================================
   In-place video preview (VSL-style "live thumbnail")
   The .pf-video-stage holds the iframe: a muted, looping, chrome-less preview
   that plays on its own, or the full player after a tap. The poster becomes a
   translucent tap layer over the moving video. Tapping swaps the preview for
   the full player (sound + controls, restarted from 0) and the poster hides.
   ======================================================================== */
.pf-video-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(180,126,55,0.16) 0%, rgba(180,126,55,0.03) 40%, transparent 72%),
    linear-gradient(140deg, #050403 0%, #16120d 100%);
}
.pf-video-stage iframe,
.pf-video-preview-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* The muted preview is nudged just past the frame edges so the provider has no
   room to flash edge chrome or letterbox bars, and ignores pointer events so a
   tap always lands on the poster (which swaps in the full, audible player). */
.pf-video-preview-frame {
  pointer-events: none;
  transform: scale(1.03);
  transform-origin: center;
}
/* Auto-preview poster: a soft veil + centred play cue over the live video. */
.pf-video--auto .pf-video-poster {
  background: linear-gradient(180deg, rgba(4,3,2,0.30) 0%, rgba(4,3,2,0.08) 36%, rgba(4,3,2,0.16) 70%, rgba(4,3,2,0.46) 100%);
  flex-direction: column;
}
.pf-video--auto .pf-video-scrim { display: none; }
.pf-video-cue {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  pointer-events: none;
}
.pf-video--auto .pf-video-play {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.58));
}
@media (min-width: 720px) {
  .pf-video--auto .pf-video-play { width: 72px; height: 72px; }
}
.pf-video-cue-label {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f3ead9;
  background: rgba(8,7,5,0.50);
  border: 1px solid rgba(216,181,143,0.34);
  border-radius: 999px;
  padding: 5px 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* During the silent preview, hide the corner branding masks so the moving
   image reads clean; they return once the full (chrome-bearing) player mounts. */
.pf-video--auto[data-state="preview"] .pf-video-mask { display: none; }

/* YouTube cover: the real video thumbnail sits ABOVE the muted preview iframe
   and only fades away once the embed reports it is actually playing. So a
   blocked autoplay degrades to a premium still, never YouTube chrome. */
.pf-video-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  display: block;
  border: 0;
  pointer-events: none;
  background: #050403;
  transition: opacity .6s ease;
}
.pf-video--auto .pf-video-poster { z-index: 3; }
.pf-video--auto.is-live .pf-video-poster-img { opacity: 0; }
.pf-video[data-state="playing"] .pf-video-poster-img { display: none; }
/* Zoom the YouTube preview a touch so its title bar / logo are cropped out of
   frame once revealed. Loom + Vimeo keep the gentler default scale. */
.pf-video[data-video-kind="youtube"] .pf-video-preview-frame {
  transform: scale(1.34);
}
/* Mini empty-state for the embed route when client has no system. */
.dsx-empty-mini {
  padding: 50px 20px;
  text-align: center;
  color: var(--text-dim, #9a9a96);
  font-size: 14px;
}

/* End Bundle P (2026-04-30) */

/* ========================================================================
   BL-7 (2026-05-04) — Loom poster thumbnail.
   Loom share/embed URLs don't expose a static thumbnail, so /api/loom/thumb
   returns the oEmbed `thumbnail_url` which gets injected as a sibling of
   `.pf-video-thumb` (YouTube). Same positioning + scrim layering — the gold
   play button + dark scrim overlay sit on top, so the smoky-dark + gold
   aesthetic stays intact.
   ======================================================================== */
.dsx-loom-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
  border: 0;
  pointer-events: none;
  background: #030303;
}
/* End BL-7 */

/* ========================================================================
   Bundle Q (2026-04-30) — Home depth cards, workout nav guard banner,
   leave-warning modal, swipe-to-delete, Daily System hero treatment,
   "tasks" rename. See:
   - feedback_home_data_richness.md
   - feedback_workout_session_state_lifecycle.md
   - feedback_user_facing_copy_no_dev_jargon.md
   - feedback_home_daily_system_card_priority.md
   ======================================================================== */

/* ---- Active workout banner (persistent across nav while session live) ---- */
.pf-active-workout-banner {
  position: fixed;
  top: var(--pf-header-h, 56px);
  left: 0;
  right: 0;
  z-index: 200;
  padding: 0;
  background: linear-gradient(180deg, rgba(180,126,55,0.12), rgba(180,126,55,0.04));
  border-top: 1px solid rgba(180,126,55,0.22);
  border-bottom: 1px solid rgba(180,126,55,0.22);
  animation: pf-awb-fade 240ms cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes pf-awb-fade {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.pf-active-workout-banner .pf-awb-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}
.pf-awb-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.pf-awb-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: rgba(180,126,55,0.16);
  color: var(--gold);
  flex-shrink: 0;
}
.pf-awb-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; min-width: 0; }
.pf-awb-eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold);
}
.pf-awb-title {
  font-size: 14px; font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-awb-cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}

/* Push the page content down on pages with the banner — body[data-active-workout]
   adds top padding so content doesn't get hidden under the fixed banner. */
body[data-active-workout] {
  padding-top: 48px;
}

/* ---- Leave-warning modal (4-action) ---- */
.pf-leave-back {
  position: fixed; inset: 0;
  background: rgba(3,3,3,0.7);
  z-index: 4000;
  opacity: 0;
  transition: opacity 180ms ease-out;
}
.pf-leave-back.open { opacity: 1; }
.pf-leave-card {
  position: fixed;
  z-index: 4001;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  width: min(420px, calc(100vw - 32px));
  background: var(--warm);
  border: 1px solid rgba(180,126,55,0.22);
  border-radius: 12px;
  padding: 22px 22px 18px;
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.2,0.8,0.2,1), opacity 220ms;
}
@media (min-width: 768px) {
  .pf-leave-card {
    top: 50%; bottom: auto;
    transform: translate(-50%, -45%);
  }
  .pf-leave-card.open {
    transform: translate(-50%, -50%);
  }
}
.pf-leave-card.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.pf-leave-eyebrow {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
  margin-bottom: 8px;
}
.pf-leave-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 19px;
  margin: 0 0 6px;
  color: var(--text);
}
.pf-leave-body {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-secondary);
}
.pf-leave-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-leave-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--warm-raised);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.pf-leave-btn:hover { border-color: rgba(180,126,55,0.3); }
.pf-leave-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c130a;
}
.pf-leave-primary:hover {
  background: var(--gold-hi);
  border-color: var(--gold-hi);
}
.pf-leave-secondary { background: var(--warm-raised); }
.pf-leave-tertiary { background: transparent; }
.pf-leave-destructive {
  color: var(--red);
  border-color: rgba(233,61,61,0.3);
}
.pf-leave-destructive:hover {
  background: rgba(233,61,61,0.08);
}

/* ---- Swipe-to-delete on recent sessions ---- */
.pf-swipe-row {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  border-radius: 8px;
}
.pf-swipe-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: linear-gradient(90deg, transparent, #4a1a1a 30%, #6e2727 100%);
  pointer-events: none;
}
.pf-swipe-row[data-revealed="1"] .pf-swipe-back {
  pointer-events: auto;
}
.pf-swipe-delete-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 92px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pf-swipe-front {
  position: relative;
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2,0.8,0.2,1);
  display: flex;
  align-items: stretch;
}
.pf-swipe-front .session-row {
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.pf-row-x {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  align-self: center;
  margin-right: 4px;
  border-radius: 50%;
  transition: background 120ms, color 120ms;
}
.pf-row-x:hover {
  background: rgba(233,61,61,0.12);
  color: var(--red);
}
@media (min-width: 768px) {
  .pf-swipe-row:hover .pf-row-x { display: inline-flex; }
}

/* ---- Home depth cards: weight, week-workouts, sleep, steps, insights ---- */
.hd-tag-up { color: var(--gold); border-color: rgba(180,126,55,0.3); }
.hd-tag-down { color: #e0a87a; border-color: rgba(224,168,122,0.3); }
.hd-tag-flat { color: var(--text-dim); }
.hd-tag-gold { color: var(--gold); border-color: rgba(180,126,55,0.4); }

/* Sparkline */
.hd-spark {
  width: 110px;
  height: 32px;
  margin-left: auto;
}

/* Weight */
.hd-card-weight .hd-weight-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px;
}
.hd-weight-num { display: inline-flex; align-items: baseline; gap: 4px; }
.hd-weight-big {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 32px;
  color: var(--text);
  font-weight: 500;
}
.hd-weight-unit {
  font-size: 14px;
  color: var(--text-secondary);
}

/* This-week workouts */
.hd-card-week-workouts .hd-weekring {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto 12px;
}
.hd-progress-ring { width: 100%; height: 100%; }
.hd-weekring-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none;
}
.hd-weekring-pct {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px; color: var(--text); font-weight: 500;
}
.hd-weekring-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim);
}
.hd-weekdays {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: flex; justify-content: space-between; gap: 4px;
}
.hd-weekday {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1;
  padding: 8px 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline-dim);
}
.hd-weekday-dow {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
}
.hd-weekday-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--warm-raised);
  color: var(--text);
}
.hd-weekday-done .hd-weekday-dot {
  background: var(--gold);
  color: #1c130a;
}
.hd-weekday-missed .hd-weekday-dot {
  background: rgba(233,61,61,0.18);
  color: var(--red);
}
.hd-weekday-today {
  border-color: var(--gold);
  background: rgba(180,126,55,0.08);
}
.hd-weekday-in_progress .hd-weekday-dot {
  background: rgba(180,126,55,0.4);
}

/* Sleep */
.hd-card-sleep .hd-sleep-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 8px;
}
.hd-sleep-num { display: inline-flex; align-items: baseline; gap: 2px; }
.hd-sleep-big {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 32px;
  color: var(--text);
  font-weight: 500;
}
.hd-sleep-unit {
  font-size: 16px; color: var(--text-secondary);
}
.hd-sleep-breakdown {
  list-style: none; margin: 0 0 8px; padding: 0;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.hd-sleep-breakdown li {
  display: inline-flex; gap: 4px; align-items: baseline;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  font-size: 12px;
}
.hd-sleep-key {
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.hd-sleep-val {
  color: var(--text);
  font-weight: 600;
}

/* Steps */
.hd-card-steps .hd-steps-row {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 12px;
}
.hd-steps-num { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.hd-steps-big {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 28px;
  color: var(--text);
  font-weight: 500;
}
.hd-steps-unit {
  font-size: 14px;
  color: var(--text-secondary);
}
.hd-steps-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.hd-steps-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 320ms cubic-bezier(0.2,0.8,0.2,1);
}

/* Insights */
.hd-card-insights .hd-insights {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.hd-insight {
  display: flex; gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--gold);
}
.hd-insight-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 6px;
  flex-shrink: 0;
}
.hd-insight-red { border-left-color: var(--red); }
.hd-insight-red .hd-insight-dot { background: var(--red); }
.hd-insight-amber { border-left-color: #e0a87a; }
.hd-insight-amber .hd-insight-dot { background: #e0a87a; }
.hd-insight-gold { border-left-color: var(--gold); }
.hd-insight-info { border-left-color: var(--text-dim); }
.hd-insight-info .hd-insight-dot { background: var(--text-dim); }
.hd-insight-text { flex: 1 1 auto; min-width: 0; }
.hd-insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.hd-insight-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ---- Daily System hero (Bundle Q) ---- */
.hd-daily-hero {
  border: 2px solid var(--gold) !important;
  box-shadow: 0 0 32px rgba(180,126,55,0.30);
  background: linear-gradient(180deg,
    rgba(180,126,55,0.08) 0%,
    var(--warm) 60%,
    var(--warm) 100%);
  padding: 22px;
  position: relative;
}
@media (min-width: 768px) {
  .hd-daily-hero {
    grid-column: 1 / -1;
    padding: 28px 32px;
  }
}
.hd-daily-hero .hd-daily-hero-now {
  margin-bottom: 12px;
}
.hd-daily-hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.hd-daily-hero-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .hd-daily-hero-title { font-size: 28px; }
}
.hd-daily-hero-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 8px;
}
.hd-daily-hero-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 320ms cubic-bezier(0.2,0.8,0.2,1);
}
.hd-daily-hero-next {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.hd-daily-hero-next em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
  margin-right: 4px;
}
.hd-meta-pill-time .hd-meta-pill-val {
  color: var(--gold);
  font-weight: 600;
}

/* ========================================================================
   End Bundle Q (2026-04-30)
   ======================================================================== */


/* ========================================================================
   Bundle R (2026-04-30) — coach polish
   - Coach desktop typography bump (data-role="coach")
   - MRR pill scale (active/paused/one_time/trial/prospect/archived)
   - Modality picker (weights/cardio/hybrid)
   - Cardio interval rounds builder (Zone 2 / VO2 max)
   - Card-list assignee picker (replaces multi-select)
   - Coach common scope helpers (cs-* classes used in coach views only)
   ======================================================================== */

[data-role="coach"] {
  --pf-body-size: 15px;
  --pf-body-size-lg: 16px;
  --pf-name-weight: 500;
  --pf-name-weight-strong: 600;
}

@media (min-width: 720px) {
  [data-role="coach"] body,
  [data-role="coach"] main,
  [data-role="coach"] .coach-narrow,
  [data-role="coach"] p,
  [data-role="coach"] .meta,
  [data-role="coach"] td,
  [data-role="coach"] .cs-body,
  [data-role="coach"] .cs-card-body {
    font-size: var(--pf-body-size);
    line-height: 1.55;
  }

  [data-role="coach"] .coach-table tbody td {
    font-size: var(--pf-body-size);
  }

  [data-role="coach"] .coach-table thead th {
    font-size: 12.5px;
  }

  [data-role="coach"] .client-cell strong,
  [data-role="coach"] .cs-client-name,
  [data-role="coach"] .cs-programme-name,
  [data-role="coach"] .cs-assignee-name,
  [data-role="coach"] .client-identity strong {
    font-weight: var(--pf-name-weight);
    font-size: var(--pf-body-size-lg);
  }

  [data-role="coach"] h1 { font-size: 30px; }
  [data-role="coach"] h2 { font-size: 22px; font-weight: 500; }
  [data-role="coach"] .cs-section-heading {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  [data-role="coach"] .cs-card-heading {
    font-size: 20px;
    font-weight: var(--pf-name-weight-strong);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  }

  [data-role="coach"] .client-email,
  [data-role="coach"] .sub,
  [data-role="coach"] .muted {
    font-size: 13.5px;
  }
}

/* ----- MRR pill ----- */
.cs-mrr-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
  border: 1px solid transparent;
}
/* Bundle V (2026-04-30) — 4-state taxonomy. Gold = MRR active, bronze = Main,
   cream = MRR paused, muted-grey = Archived. Old active/one_time/trial/
   prospect modifiers retained as aliases below for transitional safety. */
.cs-mrr-pill--mrr-active {
  background: rgba(180, 126, 55, 0.18);
  color: #d8b58f;
  border-color: rgba(180, 126, 55, 0.5);
}
.cs-mrr-pill--main {
  background: rgba(140, 90, 40, 0.18);
  color: #c69767;
  border-color: rgba(140, 90, 40, 0.45);
}
.cs-mrr-pill--paused {
  background: rgba(241, 235, 224, 0.06);
  color: #f1ebe0;
  border-color: rgba(241, 235, 224, 0.18);
}
.cs-mrr-pill--archived {
  background: rgba(0, 0, 0, 0.18);
  color: rgba(241, 235, 224, 0.4);
  border-color: rgba(241, 235, 224, 0.08);
}

/* Coach upgrade-to-main dropdown menu (Bundle V). Smoky-dark + gold. */
.cs-mrr-menu {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}
.cs-mrr-menu-trigger {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  color: inherit;
}
.cs-mrr-menu-trigger:focus { outline: 2px solid #b47e37; outline-offset: 2px; border-radius: 999px; }
.cs-mrr-menu-trigger:hover .cs-mrr-pill { filter: brightness(1.18); }
.cs-mrr-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 90;
  min-width: 220px;
  background: #1b1815;
  border: 1px solid rgba(180, 126, 55, 0.32);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: none;
  list-style: none;
  margin: 0;
}
.cs-mrr-menu.is-open .cs-mrr-menu-list { display: block; }
.cs-mrr-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #f1ebe0;
  font: inherit;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.cs-mrr-menu-list button:hover { background: rgba(180, 126, 55, 0.16); color: #d8b58f; }
.cs-mrr-menu-list button.is-danger:hover { background: rgba(248, 113, 113, 0.16); color: #f87171; }
.cs-mrr-menu-list .cs-mrr-menu-divider {
  border-top: 1px solid rgba(180, 126, 55, 0.18);
  margin: 6px 4px;
}

/* Notifications card on client profile (Bundle V) */
.cp-notif-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(180, 126, 55, 0.12);
}
.cp-notif-row:last-child { border-bottom: 0; }
.cp-notif-label { color: #f1ebe0; font-size: 14px; line-height: 1.3; }
.cp-notif-sub { color: #8a8785; font-size: 12px; line-height: 1.4; margin-top: 2px; }
.cp-notif-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(180, 126, 55, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms;
  flex-shrink: 0;
}
.cp-notif-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #c2bfbc;
  border-radius: 50%;
  transition: transform 120ms, background 120ms;
}
.cp-notif-toggle.is-on { background: rgba(180, 126, 55, 0.55); border-color: #b47e37; }
.cp-notif-toggle.is-on::after { transform: translateX(20px); background: #f1ebe0; }
.cp-notif-banner {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid rgba(180, 126, 55, 0.35);
  background: rgba(180, 126, 55, 0.08);
  color: #d8b58f;
  display: none;
}
.cp-notif-banner.is-visible { display: block; }
.cp-notif-banner.is-error { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.1); color: #f87171; }

/* Legacy modifier aliases — preserve any older rendering paths until full
   page sweep complete. New code emits cs-mrr-pill--mrr-active /
   cs-mrr-pill--main only. */
.cs-mrr-pill--active { background: rgba(180, 126, 55, 0.18); color: #d8b58f; border-color: rgba(180, 126, 55, 0.5); }
.cs-mrr-pill--one-time { background: rgba(140, 90, 40, 0.18); color: #c69767; border-color: rgba(140, 90, 40, 0.45); }
.cs-mrr-pill--trial { background: rgba(180, 126, 55, 0.06); color: rgba(216, 181, 143, 0.6); border-color: rgba(180, 126, 55, 0.18); }
.cs-mrr-pill--prospect { background: rgba(255, 255, 255, 0.03); color: rgba(216, 181, 143, 0.6); border-color: rgba(180, 126, 55, 0.14); }

/* ----- Status filter chips on clients_list ----- */
.cs-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.cs-filter-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(180, 126, 55, 0.18);
  color: var(--text-dim, #8a8785);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.cs-filter-chip:hover {
  border-color: var(--gold, #b47e37);
  color: var(--text, #f1ebe0);
}
.cs-filter-chip.is-active {
  background: rgba(180, 126, 55, 0.18);
  border-color: var(--gold, #b47e37);
  color: var(--gold-hi, #d8b58f);
}
.cs-filter-chip-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  margin-left: 6px;
  opacity: 0.7;
}
tr.coach-row.is-mrr-hidden { display: none !important; }

/* ----- Modality picker (Step 1 of programme builder) ----- */
.cs-modality-picker {
  margin: 18px 0 24px;
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 14px;
  padding: 22px;
}
.cs-modality-picker .cs-section-heading {
  margin: 0 0 14px;
  color: var(--text, #f1ebe0);
}
.cs-modality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cs-modality-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text, #f1ebe0);
  transition: border-color 140ms, background 140ms, transform 140ms;
}
.cs-modality-card:hover {
  border-color: var(--gold, #b47e37);
  background: rgba(180, 126, 55, 0.05);
  transform: translateY(-1px);
}
.cs-modality-card.is-active {
  border-color: var(--gold, #b47e37);
  background: rgba(180, 126, 55, 0.10);
  box-shadow: 0 0 0 2px rgba(180, 126, 55, 0.18);
}
.cs-modality-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(180, 126, 55, 0.12);
  color: var(--gold-hi, #d8b58f);
}
.cs-modality-icon svg { width: 22px; height: 22px; }
.cs-modality-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
}
.cs-modality-desc {
  color: var(--text-dim, #8a8785);
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .cs-modality-grid { grid-template-columns: 1fr; }
}

/* ----- Card-list assignee picker (replaces <select multiple>) ----- */
.cs-assignee-picker {
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
}
.cs-assignee-search {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 126, 55, 0.22);
  border-radius: 10px;
  color: var(--text, #f1ebe0);
  font: inherit;
  font-size: 14px;
  margin-bottom: 12px;
}
.cs-assignee-search:focus { outline: none; border-color: var(--gold, #b47e37); }
.cs-assignee-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.cs-assignee-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(180, 126, 55, 0.14);
  border-radius: 10px;
  text-align: left;
  font-family: inherit;
  color: var(--text, #f1ebe0);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.cs-assignee-row:hover {
  border-color: var(--gold, #b47e37);
  background: rgba(180, 126, 55, 0.04);
}
.cs-assignee-row.is-selected {
  border-color: var(--gold, #b47e37);
  background: rgba(180, 126, 55, 0.10);
  box-shadow: inset 0 0 0 1px rgba(180, 126, 55, 0.4);
}
.cs-assignee-row.is-hidden { display: none; }
.cs-assignee-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(180, 126, 55, 0.18);
  color: var(--gold-hi, #d8b58f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
}
.cs-assignee-meta { min-width: 0; }
.cs-assignee-name {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text, #f1ebe0);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-assignee-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cs-status-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim, #8a8785);
}
.cs-status-pill--active { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.cs-status-pill--pending { background: rgba(251, 191, 36, 0.14); color: #fbbf24; }
.cs-status-pill--lapsed { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.cs-status-pill--onboarding { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }

.cs-assignee-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(180, 126, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 14px;
  font-weight: 700;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.cs-assignee-row.is-selected .cs-assignee-check {
  background: var(--gold, #b47e37);
  color: #0E0E12;
  border-color: var(--gold, #b47e37);
}
.cs-assignee-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.cs-btn-primary {
  background: var(--gold, #b47e37);
  color: #0E0E12;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
}
.cs-btn-primary:hover { background: var(--gold-hi, #d8b58f); }
.cs-btn-primary:disabled {
  background: rgba(180, 126, 55, 0.3);
  color: rgba(14, 14, 18, 0.5);
  cursor: not-allowed;
}
.cs-btn-cream {
  background: transparent;
  color: var(--text-dim, #8a8785);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.cs-btn-cream:hover { color: var(--text, #f1ebe0); border-color: var(--gold, #b47e37); }
.cs-count {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
}

@media (max-width: 720px) {
  .cs-assignee-row { grid-template-columns: 36px 1fr auto; gap: 10px; }
  .cs-assignee-avatar { width: 36px; height: 36px; font-size: 14px; }
}

/* ========================================================================
   End Bundle R (2026-04-30)
   ======================================================================== */

/* ========================================================================
   Bundle S (2026-04-30) — Daily/Workout polish round 2 + 3-tier Home
   hierarchy. Per:
   - feedback_daily_workout_polish_bugs_round2.md  (6 bugs)
   - feedback_home_visual_hierarchy.md             (TIER 1/2/3 + insights)
   Six ships:
     SHIP 1 — modal first-tap re-bind (JS only, no CSS)
     SHIP 2 — banner overlap with Pure Focus logo
     SHIP 3 — nudge fires from session page (JS only, no CSS)
     SHIP 4 — cancel-session leaves popup (JS only, no CSS)
     SHIP 5 — stale Leg Day (Bundle Q SHIP 1 verified — no code change)
     SHIP 6 — modal pop-out cue on touch
     SHIP 7 — 3-tier Home hierarchy + insights bucketing
     SHIP 8 — perf wins applied (mostly small)
   ======================================================================== */

/* ---- SHIP 2 — Active workout banner overlap fix.
   Earlier Bundle Q sat the banner UNDER the sticky header by setting
   top: var(--pf-header-h). On mobile, the header's actual rendered
   height drifted from the variable (52px vs ~62px with brand), so the
   banner sometimes overlapped the logo. Fix: pin banner to top: 0
   ABOVE the header, then push the header DOWN by --pf-banner-h via
   padding-top — header is sticky so it stays below the banner cleanly.
   --pf-banner-h is 0 by default and 44px when body.data-active-workout
   is present. ---- */
:root {
  --pf-banner-h: 0px;
}
body[data-active-workout] {
  --pf-banner-h: 44px;
}
.pf-active-workout-banner {
  /* Override Bundle Q's top: var(--pf-header-h) — banner now sits at the
     very top of the viewport with the header pushed underneath it. */
  top: 0 !important;
  z-index: 250 !important;
}
body[data-active-workout] header.top {
  /* The sticky header's stick-point shifts down by the banner height so
     it never collides with the banner. The brand + nav rows still get
     their original padding (14px 20px). */
  top: var(--pf-banner-h);
}
/* Body padding-top from Bundle Q (48px) was layered on top of the sticky
   header — drop the implicit 48px in favour of letting the page header
   itself stick at the new offset, removing the bottom-of-banner gap. */
body[data-active-workout] {
  padding-top: 0;
}
/* The banner's own height is enforced so --pf-banner-h is reliable. */
.pf-active-workout-banner .pf-awb-inner {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.pf-awb-link {
  padding: 6px 4px;
}

/* ---- SHIP 6 — Daily System modal pop-out cue on first touch ---- */
.pf-daily-modal {
  /* Smooth transitions for the touch-cue scale + glow. Doesn't fight
     Bundle P's existing scale(0.94 → 1) opening animation because that
     is on .pf-daily-modal--open's .pf-daily-modal selector. */
  transition: transform .22s ease-out, box-shadow .22s ease-out,
              border-color .22s ease-out;
}
.pf-daily-modal--touched {
  transform: scale(1.005);
  border-color: rgba(180, 126, 55, 0.65);
  box-shadow:
    0 0 0 2px rgba(180, 126, 55, 0.55),
    0 0 36px rgba(180, 126, 55, 0.40),
    0 32px 80px -16px rgba(0, 0, 0, 0.7);
}
/* Re-affirm overscroll-behavior:contain (Bundle P set this; keep it
   redundant here so any later cascade override doesn't break gesture
   sandboxing). */
.pf-daily-modal-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ========================================================================
   SHIP 7 — 3-tier Home hierarchy.
   Per feedback_home_visual_hierarchy.md the eye must travel:
     date strip → TIER 1 hero (where am I now) → TIER 3 insights (what to
     watch) → TIER 2 actions (today) → TIER 3 status grid.
   Implementation:
     - Mobile (<768px): single column, DOM order. Hero is biggest, insights
       second, then primary actions, then status.
     - Tablet/Desktop (≥768px): 12-col CSS grid. Hero spans 7 (left), Insights
       spans 5 (top-right). TIER 2 cards span 4 each in a row beneath. TIER 3
       status cards span 6 each (2-up).
   Each tier has an explicit visual weight: TIER 1 = 2-3px gold border + glow
   + larger padding. TIER 2 = 1.5px gold border + slight gradient. TIER 3 =
   1px subtle border + ~88% font scale.
   ======================================================================== */
.hd-cards--tiered {
  /* Mobile default: single column. */
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: dense;  /* let later items fill earlier gaps */
  gap: 14px;
}
@media (min-width: 768px) {
  .hd-cards--tiered {
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
  }
}

/* ---- TIER 1 — Hero: Daily System dominates ---- */
.hd-card--tier-1 {
  /* Override Bundle Q's earlier border + glow with a slightly stronger
     hero weight so it reads as the primary surface. */
  border: 2.5px solid var(--gold) !important;
  box-shadow:
    0 0 0 1px rgba(180, 126, 55, 0.18),
    0 0 36px rgba(180, 126, 55, 0.32),
    0 16px 60px -16px rgba(0, 0, 0, 0.55) !important;
  padding: 22px 22px 22px;
}
@media (min-width: 768px) {
  .hd-card--tier-1 {
    grid-column: 1 / span 7;
    grid-row: 1;
    padding: 30px 34px 28px;
  }
  .hd-card--tier-1 .hd-daily-hero-title {
    font-size: 30px;
  }
}
@media (min-width: 1100px) {
  .hd-card--tier-1 {
    grid-column: 1 / span 8;
  }
}

/* ---- TIER 2 — Primary action cards (workout / food / coach) ---- */
.hd-card--tier-2 {
  border-width: 1.5px;
  border-color: rgba(180, 126, 55, 0.30);
}
@media (min-width: 768px) {
  .hd-card--tier-2 {
    grid-column: span 4;
  }
  /* Coach note can collapse — when present, slot into the row alongside
     workout + food. When absent (most days), workout + food split 6/6. */
  .hd-card--tier-2.hd-card-workout,
  .hd-card--tier-2.hd-card-rest {
    grid-column: span 6;
  }
  .hd-card--tier-2.hd-card-food {
    grid-column: span 6;
  }
  /* If a coach card is present in DOM, the auto-fit will fill it in the
     next row. Manual override forces a clean 4/4/4 split when all three
     coexist. */
  .hd-cards--tiered:has(.hd-card-coach) .hd-card--tier-2.hd-card-workout,
  .hd-cards--tiered:has(.hd-card-coach) .hd-card--tier-2.hd-card-rest,
  .hd-cards--tiered:has(.hd-card-coach) .hd-card--tier-2.hd-card-food,
  .hd-cards--tiered:has(.hd-card-coach) .hd-card--tier-2.hd-card-coach {
    grid-column: span 4;
  }
}

/* ---- TIER 3 — Status / data cards ---- */
.hd-card--tier-3 {
  /* Subtler weight: thinner border, slightly muted padding + font, no
     glow, no gradient. Reads as data-strip rather than primary CTA. */
  border-width: 1px;
  border-color: rgba(180, 126, 55, 0.14);
  padding: 14px 16px 16px;
}
.hd-card--tier-3 .hd-card-title,
.hd-card--tier-3 .hd-card-title-empty {
  font-size: 18px;
}
.hd-card--tier-3 .hd-card-eyebrow {
  font-size: 9.5px;
}
.hd-card--tier-3 .hd-weight-big,
.hd-card--tier-3 .hd-sleep-big,
.hd-card--tier-3 .hd-steps-big,
.hd-card--tier-3 .hd-weekring-pct {
  /* Number readouts stay big — that's what carries the value. */
  font-size: 26px;
}
@media (min-width: 768px) {
  .hd-card--tier-3 {
    grid-column: span 6;
  }
}
@media (min-width: 1100px) {
  /* On wide desktops, status cards drop to 1/4 each below the hero+insights
     row so we don't end up with cavernous half-row cards. */
  .hd-card--tier-3:not(.hd-card--insights-pos) {
    grid-column: span 3;
  }
}

/* ---- Insights — TOP-RIGHT pin ---- */
.hd-card--insights-pos {
  /* Insights gets a bit more visual weight than the rest of TIER 3 so
     the categorized buckets register as scannable, not dense. */
  border-color: rgba(180, 126, 55, 0.26);
  background: linear-gradient(180deg,
    rgba(180, 126, 55, 0.05) 0%,
    var(--warm) 70%);
}
@media (min-width: 768px) {
  .hd-card--insights-pos {
    grid-column: 8 / span 5;
    grid-row: 1;
    align-self: stretch;
  }
}
@media (min-width: 1100px) {
  .hd-card--insights-pos {
    grid-column: 9 / span 4;
  }
}

/* ---- Insights bucketed sub-sections ---- */
.hd-insights-bucketed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-insights-bucket {
  border-top: 1px solid var(--hairline-dim);
  padding-top: 10px;
}
.hd-insights-bucket:first-child {
  border-top: 0;
  padding-top: 4px;
}
.hd-insights-bucket-head {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-secondary);
}
.hd-insights-bucket-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}
.hd-insights-bucket-red .hd-insights-bucket-dot   { background: var(--red); }
.hd-insights-bucket-red .hd-insights-bucket-head  { color: #f1baba; }
.hd-insights-bucket-amber .hd-insights-bucket-dot { background: #e0a87a; }
.hd-insights-bucket-amber .hd-insights-bucket-head{ color: #e8c79f; }
.hd-insights-bucket-gold .hd-insights-bucket-dot  { background: var(--gold); }
.hd-insights-bucket-gold .hd-insights-bucket-head { color: var(--gold-hi); }
.hd-insights-bucket-info .hd-insights-bucket-dot  { background: #e8dcc4; }
.hd-insights-bucket-info .hd-insights-bucket-head { color: var(--text-dim); }

/* Tappable insights — wrap in <a class="hd-insight-link"> to route. */
.hd-insight-link {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  flex: 1 1 auto;
}
.hd-insight-link:hover { color: inherit; }
.hd-insight-link:hover .hd-insight-title { color: var(--gold-hi); }
.hd-insight-chev {
  margin-left: auto;
  align-self: center;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ---- Mobile compaction (< 768px) ---- */
@media (max-width: 767px) {
  .hd-card--tier-1 {
    padding: 18px 18px 18px;
  }
  .hd-card--insights-pos {
    /* Pin Insights to row 2 so it sits directly under the hero in DOM
       order — already guaranteed because of how the include lands in
       dashboard.html's render path. */
  }
  .hd-card--tier-3 {
    padding: 14px 14px 14px;
  }
  /* Slightly larger gold-glow on hero for mobile so it carries weight at
     small sizes; on a small screen the hero IS the page. */
  .hd-card--tier-1 {
    box-shadow:
      0 0 0 1px rgba(180, 126, 55, 0.22),
      0 0 28px rgba(180, 126, 55, 0.30);
  }
}

/* ---- prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  .pf-daily-modal,
  .pf-daily-modal--touched,
  .hd-card--tier-1 {
    transition: none !important;
    animation: none !important;
  }
  .pf-daily-modal--touched {
    transform: none;
  }
  .pf-active-workout-banner {
    animation: none !important;
  }
}

/* ========================================================================
   End Bundle S (2026-04-30)
   ======================================================================== */

/* ========================================================================
   Bundle U (2026-04-30) — Programme/Workout terminology + cardio cleanup
   + clean exercise picker modal.

   3 sections:
   1. Programme detail page (.pd-*) — programme-meta + workouts list grid.
   2. New programme page (.pn-*) — minimal name+desc+assignees form.
   3. Cardio-only workout fields (.cs-cardio-workout *) — minimal modality+
      zone+duration+intervals UI, NEVER the exercise grid.
   4. Exercise picker modal (.cs-ex-picker-*) — smoky-dark + gold cards
      replacing the white-markdown <select> Frankenstein.
   ======================================================================== */

/* --- 1. Programme detail page --- */
.pd-shell { padding-bottom: 60px; }
.pd-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.pd-workouts { margin-top: 28px; }
.pd-workouts-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(180, 126, 55, 0.16);
  margin-bottom: 12px;
}
.pd-workouts-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500;
  font-size: 22px; margin: 0;
  color: var(--text, #f1ebe0);
}
.pd-workouts-sub { color: var(--text-dim, #8a8785); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.pd-cta-gold {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold, #b47e37); color: #0E0E12;
  border-radius: 999px; padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 0; font-family: inherit;
  transition: background 120ms;
}
.pd-cta-gold:hover { background: var(--gold-hi, #d8b58f); }

.pd-workout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.pd-workout-card {
  position: relative;
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 120ms, transform 80ms;
}
.pd-workout-card:hover { border-color: var(--gold, #b47e37); }
.pd-workout-head-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.pd-workout-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500;
  font-size: 17px; line-height: 1.2; margin: 0;
  color: var(--text, #f1ebe0);
}
.pd-workout-kind {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.pd-workout-kind--weights { background: rgba(180,126,55,0.18); color: #d8b58f; }
.pd-workout-kind--cardio { background: rgba(81,176,138,0.18); color: #9ec9b3; }
.pd-workout-kind--hybrid { background: rgba(140,124,209,0.18); color: #c2b9e8; }
.pd-workout-kind--mobility { background: rgba(220,180,80,0.16); color: #ddc079; }
.pd-workout-desc { color: var(--text-dim, #8a8785); font-size: 13px; margin: 0; line-height: 1.4; }
.pd-workout-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.pd-workout-stat {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim, #8a8785);
  letter-spacing: 0.04em;
}
.pd-workout-del {
  position: absolute;
  top: 6px; right: 8px;
  background: transparent;
  border: 0;
  color: rgba(248, 113, 113, 0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.pd-workout-del:hover { background: rgba(248,113,113,0.1); color: #fca5a5; }

.pd-empty {
  padding: 36px 18px;
  text-align: center;
  background: var(--warm, #1b1815);
  border: 1px dashed rgba(180,126,55,0.16);
  border-radius: 14px;
}
.pd-empty h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500;
  font-size: 18px; margin: 0 0 6px; color: var(--text);
}
.pd-empty p { color: var(--text-dim); font-size: 13px; margin: 0 0 12px; }
/* Bundle AA — arrow pointing to the toolbar +New Workout button. */
.pd-empty-arrow {
  display: flex; justify-content: center; margin-top: 10px;
  color: var(--gold, #b47e37);
  animation: pdArrowBob 1.6s ease-in-out infinite;
}
.pd-empty-arrow svg { width: 28px; height: 28px; }
@keyframes pdArrowBob {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* Bundle AA — programme_detail metadata form (.pd-meta).
   Mirrors the .prog-meta treatment so inputs render smoky-dark + gold focus,
   never the bare native white box. */
.pd-meta { margin-bottom: 18px; }
.pd-meta .form-row { margin-bottom: 12px; }
.pd-meta label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 6px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 13px;
}
.pd-meta input[type="text"],
.pd-meta input[type="number"],
.pd-meta input[type="search"],
.pd-meta input[type="time"],
.pd-meta input[type="date"],
.pd-meta input[type="url"],
.pd-meta textarea,
.pd-meta select {
  width: 100%;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(180, 126, 55, 0.20);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  transition: border-color .14s ease, background .14s ease;
}
.pd-meta input:focus,
.pd-meta textarea:focus,
.pd-meta select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
}

/* Bundle AA — programme schedule modal (.prog-sched-*) form fields.
   Was rendering native white because no styles existed. */
.prog-sched-section {
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 14px;
  padding: 18px;
  margin: 22px 0;
}
.prog-sched-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.prog-sched-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}
/* AA-3: redesigned link — smoky pill + gold border on hover, NOT raw text. */
.prog-sched-link {
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(180, 126, 55, 0.26);
  background: rgba(180, 126, 55, 0.05);
  letter-spacing: 0.02em;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.prog-sched-link:hover {
  border-color: var(--gold);
  color: var(--gold-hi, #d8b58f);
  background: rgba(180, 126, 55, 0.12);
}
.prog-sched-meta {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.prog-sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.prog-sched-loading { color: var(--text-dim); font-size: 12px; grid-column: 1 / -1; padding: 14px 0; text-align: center; }
.prog-sched-tip { color: var(--text-dim); font-size: 11px; line-height: 1.4; margin: 0; font-style: italic; }
.prog-sched-modal-back {
  position: fixed; inset: 0;
  background: rgba(2, 2, 2, 0.62);
  z-index: 1700;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.prog-sched-modal-back[hidden] { display: none !important; }
.prog-sched-modal {
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.32);
  border-radius: 14px;
  padding: 22px;
  max-width: 420px;
  width: 100%;
  color: var(--text);
}
.prog-sched-modal-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 19px; font-weight: 500;
  margin: 0 0 6px;
}
.prog-sched-modal-meta { color: var(--text-dim); font-size: 12.5px; margin: 0 0 14px; }
.prog-sched-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.prog-sched-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.prog-sched-field input,
.prog-sched-field select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.30);
  color: var(--text);
  border: 1px solid rgba(180, 126, 55, 0.20);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
}
.prog-sched-field input:focus,
.prog-sched-field select:focus { outline: none; border-color: var(--gold); }
.prog-sched-modal-actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px;
}
.prog-sched-cta-gold, .prog-sched-cta-ghost {
  border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; border: 0; transition: background .12s ease, color .12s ease;
}
.prog-sched-cta-gold { background: var(--gold); color: #0E0E12; }
.prog-sched-cta-gold:hover { background: var(--gold-hi, #d8b58f); }
.prog-sched-cta-ghost { background: transparent; color: var(--text-dim); border: 1px solid rgba(180,126,55,0.20); }
.prog-sched-cta-ghost:hover { border-color: var(--gold); color: var(--gold-hi, #d8b58f); }

@media (max-width: 720px) {
  .pd-workout-grid { grid-template-columns: 1fr; }
}

/* --- 2. New programme page --- */
.pn-shell { padding-bottom: 60px; }
.pn-help {
  color: var(--text-dim, #8a8785);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(180,126,55,0.06);
  border-left: 3px solid var(--gold, #b47e37);
  border-radius: 0 10px 10px 0;
}

/* --- 3. Cardio-only workout fields --- */
.cs-cardio-workout {
  margin-top: 20px;
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 14px;
  padding: 18px 20px;
}
.cs-cardio-workout[hidden] { display: none !important; }
.cs-cardio-help {
  color: var(--text-dim, #8a8785);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.5;
}
.cs-cardio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.cs-cardio-field {
  display: flex; flex-direction: column; gap: 5px;
}
.cs-cardio-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim, #8a8785);
}
.cs-cardio-input {
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text, #f1ebe0);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-family: inherit;
}
.cs-cardio-input:focus { outline: none; border-color: var(--gold, #b47e37); }
.cs-cardio-intervals {
  margin: 14px 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(180,126,55,0.12);
  border-radius: 10px;
}
.cs-cardio-intervals-summary {
  cursor: pointer;
  color: var(--gold, #b47e37);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cs-cardio-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(180,126,55,0.12);
}
.cs-cardio-preview {
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim, #8a8785);
}

/* --- 4. Exercise picker modal (Bundle U SHIP 3) --- */
.cs-ex-picker-modal-back {
  position: fixed; inset: 0;
  background: rgba(3,3,3,0.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.cs-ex-picker-modal-back[hidden] { display: none !important; }
.cs-ex-picker-modal {
  background: #0f0e0c;
  border: 1px solid rgba(180,126,55,0.36);
  border-radius: 16px;
  padding: 22px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cs-ex-picker-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cs-ex-picker-head h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 500;
  font-size: 20px; margin: 0;
  color: var(--text, #f1ebe0);
}
.cs-ex-picker-close {
  background: transparent; border: 0;
  color: var(--text-dim);
  font-size: 26px; line-height: 1;
  cursor: pointer; padding: 4px 10px;
  border-radius: 6px;
}
.cs-ex-picker-close:hover { background: rgba(248,113,113,0.1); color: #fca5a5; }
.cs-ex-picker-search {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text, #f1ebe0);
  border: 1px solid rgba(180,126,55,0.16);
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
}
.cs-ex-picker-search:focus { outline: none; border-color: var(--gold, #b47e37); }
.cs-ex-picker-filters {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
.cs-ex-picker-filter-group {
  display: flex; flex-direction: column; gap: 5px;
}
.cs-ex-picker-filter-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim, #8a8785);
}
.cs-ex-picker-filter-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.cs-ex-picker-chip {
  background: transparent;
  color: var(--text-dim, #8a8785);
  border: 1px solid rgba(180,126,55,0.16);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.cs-ex-picker-chip:hover { color: var(--text); border-color: rgba(180,126,55,0.36); }
.cs-ex-picker-chip.is-active {
  background: var(--gold, #b47e37);
  color: #0E0E12;
  border-color: var(--gold, #b47e37);
}
.cs-ex-picker-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 6px 4px 12px;
  /* Gold scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(180,126,55,0.4) transparent;
}
.cs-ex-picker-list::-webkit-scrollbar { width: 8px; }
.cs-ex-picker-list::-webkit-scrollbar-thumb {
  background: rgba(180,126,55,0.4);
  border-radius: 4px;
}
.cs-ex-picker-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--warm, #1b1815);
  color: inherit;
  border: 1px solid rgba(180,126,55,0.12);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 120ms, transform 80ms, background 120ms;
}
.cs-ex-picker-card:hover {
  border-color: var(--gold, #b47e37);
  background: rgba(180,126,55,0.06);
}
.cs-ex-picker-card.is-loading { opacity: 0.5; pointer-events: none; }
.cs-ex-picker-card-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(180,126,55,0.1);
  border-radius: 10px;
  color: var(--gold-hi, #d8b58f);
}
.cs-ex-picker-card-icon svg { width: 22px; height: 22px; }
.cs-ex-picker-card-body {
  min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.cs-ex-picker-card-name {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text, #f1ebe0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-ex-picker-card-meta {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.cs-ex-picker-tag {
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  background: rgba(180,126,55,0.1);
  color: var(--text-dim, #8a8785);
  padding: 2px 6px;
  border-radius: 4px;
}
.cs-ex-picker-tag--muscle {
  background: rgba(120, 160, 120, 0.12);
  color: #9ec9b3;
}
.cs-ex-picker-card-video { padding: 0 4px; }
.cs-ex-picker-video-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(180,126,55,0.2);
}
.cs-ex-picker-video-dot.is-on {
  background: var(--gold, #b47e37);
  box-shadow: 0 0 6px rgba(180,126,55,0.6);
}
.cs-ex-picker-empty {
  text-align: center;
  padding: 30px 14px;
  color: var(--text-dim);
}
/* BL-16 — client-workout group heading inside Copy-from-Client picker. */
.cs-ex-picker-group-head {
  grid-column: 1 / -1;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold, #b47e37);
  padding: 12px 4px 4px;
  border-bottom: 1px solid rgba(180,126,55,0.18);
  margin-bottom: 4px;
}
.cs-ex-picker-group-head:first-child { padding-top: 4px; }
.cs-ex-picker-foot {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(180,126,55,0.12);
  text-align: right;
}

@media (max-width: 720px) {
  .cs-ex-picker-modal { padding: 16px; max-height: 92vh; }
  .cs-ex-picker-list { grid-template-columns: 1fr; }
  .cs-cardio-grid { grid-template-columns: 1fr; }
  .cs-cardio-actions { flex-direction: column; align-items: stretch; }
}

/* End Bundle U */

/* ========================================================================
   Bundle T (2026-04-30) — Workout session UI polish + Bundle S residual.

   SHIP 1: bottom-nav (.bottom-tabs) must persist during a live workout
           session — clients need Food/Messages/Home reachable mid-rest.
           No CSS rule was hiding it; it was visually obscured by the
           sticky `.ws-finish` button. Define `--bottom-nav-h` so the
           Finish button can offset itself above the nav.
   SHIP 2: Finish Workout button sits ABOVE the bottom-nav (Option A from
           the spec). Was sticking to viewport bottom and overlapping nav.
   SHIP 3: kill the static `.ws-top` header that put a centered "Session"
           pill block above the title (Manou: "static header... not
           beautiful at all"). New `.ws-titlebar` keeps the notes toggle
           inline next to the title without competing chrome.
   SHIP 4–6: handled in JS (workout_nav_guard.js v3 + base.html modal
           delegation). No CSS shape changes needed beyond the existing
           rules in Bundle S.

   See: feedback_workout_session_ui_polish.md +
        feedback_daily_workout_polish_bugs_round2.md.
   ======================================================================== */

/* Bottom-nav height token. Mobile shows the bar; desktop ≥768px doesn't,
   so `--bottom-nav-h` collapses to 0 there. The variable is consumed by
   `.ws-finish` (workout session) and any other sticky-bottom surface that
   needs to clear the nav. */
:root {
  --bottom-nav-h: 0px;
}
@media (max-width: 768px) {
  :root {
    /* 8px top-pad + ~46px icon+label height + 8px bottom-pad + safe-area.
       Matches `.bottom-tabs` padding + child sizing. */
    --bottom-nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* SHIP 2 — Finish workout button sits above the bottom-nav.
   The base rule (line 5266) leaves it `position: sticky` with
   `bottom: env(safe-area-inset-bottom, 0)`. Override `bottom` to clear
   the bottom-nav AND the safe-area in one calc. On desktop this resolves
   to 0 because --bottom-nav-h collapses to 0 and there's no nav. */
.ws-finish {
  bottom: var(--bottom-nav-h, 0px);
}
/* Page bottom padding bumps so the last exercise card isn't sandwiched
   between the sticky finish bar AND the bottom-nav. Was 100px (pre-T).
   New: 100px + nav clearance. */
.ws-page {
  padding-bottom: calc(100px + var(--bottom-nav-h, 0px));
}

/* SHIP 3 — Session title bar.
   Replaces the dropped `.ws-top` static header. Title + inline notes
   toggle sit on one line, no centered logo block. The notes toggle keeps
   the Bundle S styling but loses the round 36px circle treatment so it
   doesn't fight with the title. */
.ws-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
}
.ws-titlebar .ws-title {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}
.ws-notes-toggle--inline {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.ws-notes-toggle--inline:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(180, 126, 55, 0.06);
}
.ws-notes-toggle--inline[aria-expanded="true"] {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(180, 126, 55, 0.10);
}

/* End Bundle T */

/* ========================================================================
   Bundle Z (2026-04-30) — Desktop real-estate use + safe-area + scroll +
   PWA service-worker invalidation. Companion to bundle-z-2026-04-30 brief.

   Manou's verbatim feedback (Bundle Y phase-2 audit was lazy):
   - "Home + Food + Daily System are CRAMMED on desktop despite real estate"
   - "Logo top-left overlaps iOS status bar (battery / time)"
   - "Pull-to-refresh sucks bottom-nav UP when user drags page down"
   - "Drag handle glitch on drag-up overlaps battery / time area"
   - "CANNOT scroll inside Daily System modal — totally stuck"
   - "now-line marker IS STILL NOT VISIBLE — Bundle Y claimed shipped, isn't"
   ======================================================================== */

/* --- Desktop: Home + Food expand the main column ---
   At ≥1024px the screen has plenty of room; Bundle N's 760px cap was
   correct for mobile but reads as "phone view stretched into a desktop
   frame" on actual desktops. Expand the main column to 1100px so the
   12-col tier grid + insights sidebar can breathe. */
@media (min-width: 1024px) {
  main.home-day,
  main.food-shell,
  body[data-role="client"] main:not(.legacy-narrow) {
    max-width: 1180px;
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* --- Desktop Home dashboard: visual hierarchy density bump ---
   Bigger hero typography, more whitespace, the 12-col grid actually
   uses the column count. */
@media (min-width: 1024px) {
  .hd-date-title { font-size: 38px; }
  .hd-greet { font-size: 17px; margin-bottom: 22px; }
  .hd-cards--tiered { gap: 22px; }
  .hd-card--tier-1 { padding: 36px 40px 32px; }
  .hd-card--tier-1 .hd-daily-hero-title { font-size: 36px; }
  .hd-card--tier-2 { padding: 22px 24px; }
  .hd-card--tier-3 { padding: 18px 20px; }
}

/* --- Desktop Food: 2-column layout (entries left, totals + macros right) ---
   Default mobile stays single column; ≥1024px the hero + macro row pin
   to the right column while meals list dominates the left. */
@media (min-width: 1024px) {
  main.food-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
    column-gap: 32px;
    align-items: start;
  }
  /* Header row spans both columns. */
  main.food-shell > .food-header-row,
  main.food-shell > .ob-eyebrow,
  main.food-shell > p.sub,
  main.food-shell > #food-date-pretty {
    grid-column: 1 / -1;
  }
  /* Meals + library land in the left column (everything that isn't the
     hero / macro row / supplements panel). */
  main.food-shell > .food-meals,
  main.food-shell > .food-library,
  main.food-shell > #food-meals,
  main.food-shell > #food-library {
    grid-column: 1;
  }
  /* Hero + macros + supplements stack in the right rail. */
  main.food-shell > .food-hero,
  main.food-shell > .food-macro-row,
  main.food-shell > .food-supplements,
  main.food-shell > #food-hero,
  main.food-shell > #food-supplements {
    grid-column: 2;
    position: sticky;
    top: 80px;
  }
}

/* --- Desktop Daily System modal: wider + 2-col internal (timeline left,
   selected block detail right). When no block is selected, the right
   column shows a subtle "tap a block" placeholder. ---
   We don't change the underlying timeline DOM; we widen the modal +
   allow the dsx-cal to span its natural width. The block-detail sheet
   already opens above the modal (per Bundle X) so we don't need a real
   2-col here yet — but the modal MUST be wider so the timeline is
   readable. */
@media (min-width: 1024px) {
  .pf-daily-modal {
    width: min(1100px, calc(100vw - 48px)) !important;
    max-width: min(1100px, calc(100vw - 48px)) !important;
    max-height: calc(100dvh - 48px);
  }
  .pf-daily-modal-body {
    padding: 28px 36px 36px;
  }
}

/* --- Coach desktop: bigger typography (Bundle R rule) ---
   Bumped previously; reinforce here so coach surfaces don't regress
   when desktop columns expand. */
@media (min-width: 1024px) {
  body.coach-body {
    font-size: 16px;
  }
  body.coach-body .coach-card-name,
  body.coach-body .clients-name,
  body.coach-body .pd-title {
    font-weight: 600;
  }
}

/* --- Daily System header expanded copy ---
   Bundle Z Bug 9: "your training, your work, and your recovery" is
   too minimal. Explained in 2 short sentences (still no fabrication
   of specifics). */
.dsx-intro {
  /* Inherit existing styling; copy expansion happens in the seed +
     fallback default via dsx-intro-default sub-class. */
}
.dsx-intro--default em::before {
  content: "";
}

/* --- Block-detail sheet desktop scroll fix ---
   When opened from the daily modal on desktop, the sheet was scrolling
   internally. Make sure it does. */
@media (min-width: 720px) {
  .dsx-detail-sheet {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* End Bundle Z */

/* ===============================================================
   Bundle AB-1 (2026-04-30) — Coach DS editor card redesign +
   native-form-box purge inside daily_system_edit + supplements_edit.
   - Each DS item is a self-contained card (.ds-card)
   - Time/title/category/desc/video preview/Loom URL all in one card
   - Drag handle + drop targets
   - Smoky-dark + gold + Fraunces titles + Inter body
   - ZERO native white inputs/selects/buttons inside the editor scope
   =============================================================== */

.dsxc-cols--full { grid-template-columns: 1fr; }

.dsxc-shell .ds-pill-btn,
.dsxc-shell .ds-pill-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--dsx-warm-2, #221d18);
  color: var(--dsx-ink-2, #c2bfbc);
  border: 1px solid var(--dsx-line-strong, rgba(180, 126, 55, 0.28));
  border-radius: 999px;
  font: 600 12px/1 "Lato", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.dsxc-shell .ds-pill-btn:hover {
  border-color: var(--gold, #b47e37);
  color: var(--gold-hi, #d8b58f);
}
.dsxc-shell .ds-pill-btn--gold {
  background: var(--gold, #b47e37);
  color: #1c1a16;
  border-color: var(--gold, #b47e37);
}
.dsxc-shell .ds-pill-btn--gold:hover { filter: brightness(1.08); color: #1c1a16; }
.dsxc-shell .ds-pill-btn--danger { color: #e36359; border-color: rgba(196, 85, 77, 0.4); }
.dsxc-shell .ds-pill-btn--danger:hover { color: #e36359; border-color: #c4554d; background: rgba(196, 85, 77, 0.08); }
.dsxc-shell .ds-pill-btn--ghost { background: transparent; }

.dsxc-shell .ds-pill-switch input { accent-color: var(--gold, #b47e37); margin: 0; }

.dsxc-shell .ds-pill-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 6px 0 12px;
}
.dsxc-shell .ds-pill {
  background: var(--dsx-warm-2, #221d18);
  color: var(--dsx-ink-2, #c2bfbc);
  border: 1px solid var(--dsx-line-strong, rgba(180, 126, 55, 0.28));
  border-radius: 999px;
  padding: 6px 12px;
  font: 600 12px/1 "Lato", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.dsxc-shell .ds-pill:hover { border-color: var(--gold, #b47e37); color: var(--gold-hi, #d8b58f); }

/* Native-form-box purge: every input/select/textarea/button inside the
   editor scope is restyled by default. .dsxc-shell + .dsxc-side wrap the
   whole editor (DS + supplements). */
.dsxc-shell input[type="text"],
.dsxc-shell input[type="url"],
.dsxc-shell input[type="email"],
.dsxc-shell input[type="number"],
.dsxc-shell input[type="search"],
.dsxc-shell input[type="time"],
.dsxc-shell input[type="date"],
.dsxc-shell input[type="tel"],
.dsxc-shell input:not([type]),
.dsxc-shell textarea,
.dsxc-shell select {
  width: 100%;
  padding: 8px 10px;
  background: var(--dsx-warm-3, #2b2520);
  border: 1px solid var(--dsx-line, rgba(180, 126, 55, 0.12));
  border-radius: 8px;
  color: var(--dsx-ink, #fdfdff);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color .12s, background .12s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.dsxc-shell select {
  background-image: linear-gradient(45deg, transparent 50%, var(--dsx-ink-3, #8a8785) 50%),
                    linear-gradient(-45deg, transparent 50%, var(--dsx-ink-3, #8a8785) 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
.dsxc-shell input[type="text"]:focus,
.dsxc-shell input[type="url"]:focus,
.dsxc-shell input[type="email"]:focus,
.dsxc-shell input[type="number"]:focus,
.dsxc-shell input[type="search"]:focus,
.dsxc-shell input[type="time"]:focus,
.dsxc-shell input[type="date"]:focus,
.dsxc-shell textarea:focus,
.dsxc-shell select:focus {
  border-color: var(--gold, #b47e37);
  background: var(--dsx-warm-2, #221d18);
}
.dsxc-shell input[type="checkbox"] { accent-color: var(--gold, #b47e37); }

/* Kill Chrome's pale-yellow autofill highlight on EVERY input across the app
   (not just editor scope). Autofill ignores normal background-color so we use
   inset box-shadow + text-fill-color overrides. Applies app-wide: inputs
   should never look cream/yellow on a smoky-dark surface. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--dsx-ink, #fdfdff) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--dsx-warm-3, #2b2520) inset !important;
  box-shadow: 0 0 0 1000px var(--dsx-warm-3, #2b2520) inset !important;
  caret-color: var(--dsx-ink, #fdfdff) !important;
  transition: background-color 9999s ease-in-out 0s !important;
}

/* Button reset inside the DS editor: any unstyled <button> becomes a pill. */
.dsxc-shell button:not(.ds-pill-btn):not(.ds-pill):not(.dsxc-tab):not(.dsxc-tab-add):not(.dsxc-add-btn):not(.dsxc-mobile-fab):not(.iti-del):not(.ds-card-del):not(.ds-card-drag):not(.ds-card-video-play):not(.sup-benefit-chip):not(.sup-del):not(.btn-link):not(.btn-gold) {
  background: var(--dsx-warm-2, #221d18);
  color: var(--dsx-ink-2, #c2bfbc);
  border: 1px solid var(--dsx-line-strong, rgba(180, 126, 55, 0.28));
  border-radius: 999px;
  padding: 7px 14px;
  font: 600 12px/1 "Lato", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

/* Modal action buttons — kill any leftover native white. */
.dsxc-shell .pf-modal .btn-link,
.pf-modal-back .pf-modal .btn-link {
  background: var(--dsx-warm-2, #221d18) !important;
  color: var(--dsx-ink-2, #c2bfbc) !important;
  border: 1px solid var(--dsx-line-strong, rgba(180, 126, 55, 0.28)) !important;
  border-radius: 999px !important;
  padding: 7px 14px !important;
  font: 600 12px/1 "Lato", sans-serif !important;
}

/* ---------- ds-card (the heart of AB-1) ---------- */
.ds-card {
  background: var(--dsx-warm-2, #221d18);
  border: 1px solid var(--dsx-line, rgba(180, 126, 55, 0.18));
  border-left: 3px solid var(--dsx-line-strong, rgba(180, 126, 55, 0.28));
  border-radius: 12px;
  padding: 10px 12px 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 8px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.ds-card:hover { border-color: var(--gold, #b47e37); box-shadow: 0 1px 0 rgba(180, 126, 55, 0.15); }
.ds-card.is-dragging { opacity: 0.5; }
.ds-card.is-drop { box-shadow: 0 -2px 0 var(--gold, #b47e37); }

.ds-card[data-cat="wake"]        { border-left-color: #f0b35a; }
.ds-card[data-cat="hydration"]   { border-left-color: #5fb1d6; }
.ds-card[data-cat="movement"]    { border-left-color: #b47e37; }
.ds-card[data-cat="meal"]        { border-left-color: #d68b3e; }
.ds-card[data-cat="focus"]       { border-left-color: #c4a064; }
.ds-card[data-cat="break"]       { border-left-color: #a39d93; }
.ds-card[data-cat="sleep"]       { border-left-color: #6f7fb5; }
.ds-card[data-cat="mindfulness"] { border-left-color: #8a9b6f; }

.ds-card-head {
  display: grid;
  grid-template-columns: 28px 78px 1fr 130px auto 28px;
  gap: 6px;
  align-items: center;
  background: var(--dsx-warm-2, #221d18);
}
.ds-card-drag {
  background: transparent;
  border: 0;
  color: var(--dsx-ink-3, #8a8785);
  cursor: grab;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ds-card-drag:active { cursor: grabbing; }
.ds-card-time { text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.ds-card-title { font-weight: 500; }
.ds-card-cat { font-size: 12px; }
.ds-card-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--dsx-ink-3, #8a8785);
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
}
.ds-card-opt input { width: auto; }
.ds-card-del {
  background: transparent;
  border: 0;
  color: #c4554d;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.ds-card-del:hover { color: #e36359; }

.ds-card-body { display: grid; gap: 8px; }
.ds-card-field { display: grid; gap: 4px; }
.ds-card-flabel {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dsx-ink-3, #8a8785);
  font-weight: 600;
}
.ds-card-desc { resize: vertical; min-height: 60px; line-height: 1.5; }
.ds-card-link {
  color: var(--gold-hi, #d8b58f);
  text-decoration: underline;
  word-break: break-all;
}

/* Video preview inside ds-card */
.ds-card-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid var(--dsx-line, rgba(180, 126, 55, 0.18));
}
.ds-card-video-poster {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.ds-card-video-loom {
  background:
    radial-gradient(circle at center, rgba(180, 126, 55, 0.18) 0%, transparent 60%),
    var(--dsx-warm-3, #2b2520);
}
.ds-card-video-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 14, 12, 0.25) 0%, rgba(15, 14, 12, 0.55) 100%);
}
.ds-card-video-play {
  position: relative;
  z-index: 1;
  background: var(--gold, #b47e37);
  color: #1c1a16;
  border: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  padding-left: 4px;
}
.ds-card-video-play:hover { filter: brightness(1.08); }
.ds-card-video-iframe {
  position: absolute; inset: 0;
}
.ds-card-video-iframe iframe {
  width: 100%; height: 100%; border: 0;
}
.ds-card-video-mask-tr {
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 50px;
  pointer-events: none;
  background: transparent;
}
.ds-card-video-mask-br {
  position: absolute;
  bottom: 0; right: 0;
  width: 90px; height: 28px;
  pointer-events: none;
  background: transparent;
}

@media (max-width: 720px) {
  .ds-card-head {
    grid-template-columns: 28px 1fr 28px;
    grid-template-areas:
      "drag time del"
      "title title title"
      "cat cat opt";
    gap: 6px;
  }
  .ds-card-drag { grid-area: drag; }
  .ds-card-time { grid-area: time; }
  .ds-card-title { grid-area: title; }
  .ds-card-cat { grid-area: cat; }
  .ds-card-opt { grid-area: opt; justify-self: end; }
  .ds-card-del { grid-area: del; }
}

/* Desktop 2-col on wide viewports for the cards host. */
@media (min-width: 1024px) {
  #ds-cards-host {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  #ds-cards-host .ds-phase-head,
  #ds-cards-host .ds-phase-extra,
  #ds-cards-host .ds-phase-sentinel {
    grid-column: 1 / -1;
  }
}

/* Phase header row */
.ds-phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--dsx-line, rgba(180, 126, 55, 0.18));
}
.ds-phase-head-l {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.ds-phase-pill {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-hi, #d8b58f);
  font-weight: 700;
  background: var(--dsx-warm-3, #2b2520);
  border: 1px solid var(--dsx-line-strong, rgba(180, 126, 55, 0.28));
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.ds-phase-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--dsx-ink, #fdfdff);
  background: transparent !important;
  border: 0 !important;
  padding: 4px 0 !important;
}
.ds-phase-title:focus {
  outline: 1px dashed rgba(180, 126, 55, 0.4);
  outline-offset: 2px;
}

.ds-phase-extra {
  background: rgba(15, 14, 12, 0.4);
  border: 1px dashed var(--dsx-line, rgba(180, 126, 55, 0.18));
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0 18px;
}
.ds-phase-extra > summary {
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dsx-ink-3, #8a8785);
  font-weight: 600;
  padding: 2px 0;
}
.ds-phase-extra-section { margin-top: 10px; }
.ds-phase-extra-section h5 {
  font: 600 11px/1 "Lato", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dsx-ink-3, #8a8785);
  margin: 0 0 6px;
}

.ds-detail-row {
  display: grid;
  grid-template-columns: 1fr 28px;
  grid-template-areas: "text del" "loom loom";
  gap: 6px;
  margin-bottom: 6px;
}
.ds-detail-row .dt-text { grid-area: text; resize: vertical; min-height: 36px; }
.ds-detail-row .dt-loom { grid-area: loom; }
.ds-detail-row .ds-card-del { grid-area: del; align-self: start; padding-top: 6px; }

/* Supplements page card */
.sup-card .ds-card-head {
  grid-template-columns: 1.5fr 0.7fr 1fr 28px;
}
@media (max-width: 720px) {
  .sup-card .ds-card-head {
    grid-template-columns: 1fr 1fr 28px;
    grid-template-areas:
      "name name del"
      "dose when when";
  }
  .sup-card .sup-name { grid-area: name; }
  .sup-card .sup-dose { grid-area: dose; }
  .sup-card .sup-when { grid-area: when; }
  .sup-card .sup-del  { grid-area: del; }
}
.sup-benefit-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* Progress bar for PDF import modal */
.ds-progress-bar {
  width: 100%; height: 4px;
  background: var(--dsx-warm-3, #2b2520);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.ds-progress-bar > span {
  display: block;
  width: 35%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, var(--gold, #b47e37) 50%, transparent 100%);
  animation: ds-progress-slide 1.2s linear infinite;
}
@keyframes ds-progress-slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(300%); }
}

/* End Bundle AB-1 */

/* ========================================================================
   Bundle AD (2026-04-30) — workout-list polish + workout-session header +
   supplements accordion + cardio quick-session UI. Companion to bundle-ad
   brief. See feedback ledger 2026-04-30 § Bundle AD scope.
   ======================================================================== */

/* AD-2 — kill the sticky brand header inside a workout session so it scrolls
   with content. Manou: "I see a static header... the logo, in the middle, and
   it stays there, and it's not beautiful at all." The base layout's
   `header.top` is `position: sticky` (line ~91); on the workout session page
   we want it to behave like an in-flow block so the page chrome doesn't hover.
   `body:has(main.ws-page)` matches only when the session page is rendered. */
body:has(main.ws-page) header.top {
  position: static;
  /* Drop the z-index lift too — no overlap means no need to rise. */
  z-index: auto;
}

/* AD-5 — supplements accordion on /food. Group 46 supplements by timing
   bucket (Fasted / Breakfast / Pre-Workout / Lunch / Dinner / Pre-Sleep /
   Other). Each section is collapsible <details> with smoky-dark + gold accent
   on header. Closed by default. */
.dsx-supps-acc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.acc-section {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 180ms;
}
.acc-section[open] { border-color: rgba(180, 126, 55, 0.45); }
.acc-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  transition: background 160ms, color 160ms;
}
.acc-section > summary::-webkit-details-marker { display: none; }
.acc-section > summary:hover { background: rgba(180, 126, 55, 0.06); }
.acc-section[open] > summary { color: var(--gold); }
.acc-section-head-left {
  display: inline-flex; align-items: center; gap: 10px;
}
.acc-section-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(180, 126, 55, 0.14);
  border: 1px solid rgba(180, 126, 55, 0.32);
  color: var(--gold-hi, #d8b58f);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.acc-section-chevron {
  flex-shrink: 0;
  transition: transform 220ms ease;
  color: var(--text-dim);
}
.acc-section[open] .acc-section-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}
.acc-section-body {
  padding: 8px 14px 14px;
  border-top: 1px solid var(--hairline-dim);
}
.acc-section-body .dsx-supps {
  /* Tighten grid inside the accordion body — same supplement-card look,
     just nested. */
  margin-top: 4px;
}

/* AD-4 — quick session modality picker modal. Two big tappable cards inside
   pf-modal so the picker feels distinct from a generic confirm. */
.pf-modality-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 16px;
}
.pf-modality-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 22px 14px;
  background: rgba(255,255,255,0.02);
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 160ms, border-color 160ms, transform 160ms;
  font-family: inherit;
}
.pf-modality-card:hover, .pf-modality-card:focus-visible {
  background: rgba(180, 126, 55, 0.08);
  border-color: var(--gold);
  transform: translateY(-1px);
  outline: none;
}
.pf-modality-card svg { color: var(--gold-hi, #d8b58f); }
.pf-modality-card-label {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 17px;
}
.pf-modality-card-sub {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* AD-4 — cardio quick-input section on the workout session page. Replaces
   the strength `.ws-adhoc` exercise picker entirely when kind=cardio. */
.ws-cardio-quick {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 6px 0 18px;
}
.ws-cardio-quick h2 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 6px;
}
.ws-cardio-quick .ws-cardio-quick-help {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 14px;
}
.ws-cardio-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 540px) {
  .ws-cardio-quick-grid { grid-template-columns: 1fr; }
}
.ws-cardio-quick-field { display: flex; flex-direction: column; gap: 6px; }
.ws-cardio-quick-field > span {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}
.ws-cardio-quick-field select,
.ws-cardio-quick-field input {
  padding: 11px 13px;
  background: rgba(0,0,0,0.30);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
}
.ws-cardio-quick-field select:focus,
.ws-cardio-quick-field input:focus {
  border-color: var(--gold);
  outline: none;
}
.ws-cardio-quick-rounds {
  margin: 6px 0 12px;
  padding: 12px;
  background: rgba(0,0,0,0.18);
  border: 1px dashed var(--hairline);
  border-radius: 10px;
}
.ws-cardio-quick-rounds h3 {
  margin: 0 0 8px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.ws-cardio-quick-rounds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
@media (max-width: 540px) {
  .ws-cardio-quick-rounds-grid { grid-template-columns: 1fr; }
}
.ws-cardio-quick-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 4px;
}
.ws-cardio-quick-flash {
  font-size: 13px; color: var(--text-dim);
}

/* End Bundle AD */

/* ========================================================================
   === Bundle AE-2 === (2026-04-30) Resume-banner polish + leave-warning fix.
   See feedback_workout_session_state_lifecycle.md +
       feedback_pwa_logo_branding.md +
       feedback_real_device_qa_required.md.

   Pre-AE-2 the resume banner sat at top:0 with NO safe-area-inset-top
   padding — on iPhone notch + black-translucent status bar the eyebrow +
   title were rendered behind the battery/time strip and were "barely
   visible" (Manou, 2026-04-30). The banner ALSO pushed `header.top`
   down by `--pf-banner-h: 44px`, but the actual rendered header is
   `56px + safe-area-inset-top` — so the logo overlapped the banner's
   bottom border ("the border on the phone is messed up").

   Fix: banner gets its OWN safe-area-inset-top padding. `--pf-banner-h`
   becomes the banner's INTRINSIC content height (44px) and we expose
   `--pf-banner-total-h` = 44px + safe-area-inset-top, which is what the
   sticky header uses to position itself below.
   ======================================================================== */
:root {
  --pf-banner-content-h: 44px;
  --pf-banner-total-h: 0px;
}
body[data-active-workout] {
  --pf-banner-total-h: calc(var(--pf-banner-content-h) + env(safe-area-inset-top, 0px));
}
.pf-active-workout-banner {
  /* Banner sits FIXED at the very top of the viewport. Internal padding
     equals safe-area-inset-top so the eyebrow text never hides under
     the iOS status bar. Background extends edge-to-edge. */
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1500 !important;
  padding-top: env(safe-area-inset-top, 0px) !important;
  /* Bundle AE-2: gold band, no fade-into-transparency from the old
     gradient (the gradient made the eyebrow vanish on smoke-dark canvas
     under bright iPhone status-bar pixels).
     Bundle AE-4 (2026-05-01): paint a SOLID canvas base underneath the
     gold tint so scrolling page content can't show through. The gold
     gradient is now layered ON TOP of the canvas color, not standalone.
     Manou: "when I'm scrolling, I can see the things moving behind the
     workout in session card that is on top." */
  background-color: var(--canvas) !important;
  background-image: linear-gradient(180deg,
                              rgba(180, 126, 55, 0.22),
                              rgba(180, 126, 55, 0.08)) !important;
  border-top: 1px solid rgba(180, 126, 55, 0.55) !important;
  border-bottom: 1px solid rgba(180, 126, 55, 0.55) !important;
  /* Subtle gold glow under the band so it reads as a discrete bar. */
  box-shadow: 0 6px 18px -10px rgba(180, 126, 55, 0.55) !important;
}
.pf-active-workout-banner .pf-awb-inner {
  /* Lock content height regardless of safe-area. min-height keeps tap
     target generous on small screens. */
  min-height: var(--pf-banner-content-h) !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 16px !important;
}
.pf-awb-link {
  /* Bigger, bolder so "barely visible" never returns. */
  padding: 8px 4px !important;
}
.pf-awb-eyebrow {
  /* Bump from 10px → 11px and add light shadow so it pops on the gold band. */
  font-size: 11px !important;
  color: var(--gold-hi, #d6a05e) !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25) !important;
}
.pf-awb-title {
  font-size: 14.5px !important;
  font-weight: 600 !important;
}
/* The sticky page header now starts BELOW the banner's full painted
   height (content + safe-area). Pre-AE-2 used `--pf-banner-h: 44px`
   which left the banner overlapping the logo on notch phones. */
body[data-active-workout] header.top {
  top: var(--pf-banner-total-h) !important;
}
/* Body padding-top: push page content past the banner. Header is
   sticky at --pf-banner-total-h so we only need to clear the banner
   itself, not the header (header is part of the document flow until it
   sticks). */
body[data-active-workout] {
  padding-top: var(--pf-banner-total-h) !important;
}

/* On the workout-session page itself, the banner is suppressed (no
   point pointing back at the page you're on). But base.html still
   sets `data-active-workout` on body so other CSS hooks fire. Ensure
   we don't push content down on that page. */
body[data-active-workout].in-workout-session header.top { top: 0 !important; }
body[data-active-workout].in-workout-session { padding-top: 0 !important; }

/* End Bundle AE-2 */

/* ========================================================================
   === Bundle AE-6 === (2026-05-01) Workout-session real-device UX polish.

   Three connected fixes from real-iPhone testing of AE-5:
   (1) RPE picker had no Done/Submit button — user had to hit X/back which
       felt like cancelling. Added a primary "Done" button next to Clear.
   (2) Undo flash overlapped content; reduced 5s → 2.5s in JS, repositioned
       to bottom-pinned ABOVE the bottom-nav with safe-area + glow so it
       reads as a transient toast, not a persistent bar.
   (3) Bottom-nav animated up/down with --pf-vv-offset transition every
       time the iOS keyboard opened on weight/reps/RPE inputs — looked
       glitchy. New rule: when body has .is-keyboard-open, hide the nav
       entirely. JS in workouts.js sets/clears the class on focusin/out
       within .ws-page.
   ======================================================================== */
.ws-rpe-foot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0)) !important;
}
.ws-rpe-foot .btn-link {
  /* Clear stays as a quiet text link — the heavy CTA is Done. */
  font-size: 14px;
  color: var(--text-mute, rgba(255, 255, 255, 0.6));
}
.ws-rpe-done {
  /* Match the existing primary .btn but with a tighter footprint that
     fits the sheet footer. Gold-fill so it's unmistakably the "commit"
     action — the X/backdrop become escape hatches, not the primary path. */
  min-width: 96px;
  padding: 10px 22px !important;
  font-weight: 600;
}
/* Bundle AE-6 — Undo flash repositioned + sized so it can't overlap the
   user's next action. Floats above bottom-nav, slides in from below. */
.ws-undo-flash {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  /* Float above bottom-nav (height ~60px) + safe-area + visualViewport
     offset. When .is-keyboard-open the nav is hidden so the toast can
     drop closer to the page edge. */
  bottom: calc(80px + env(safe-area-inset-bottom, 0) + var(--pf-vv-offset, 0px)) !important;
  z-index: 1450 !important;
  max-width: min(92vw, 360px) !important;
  padding: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: var(--canvas) !important;
  border: 1px solid rgba(180, 126, 55, 0.55) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.85),
              0 6px 16px -10px rgba(180, 126, 55, 0.35) !important;
  animation: pf-undo-flash-in 180ms ease-out;
}
.ws-undo-flash.is-leaving { animation: pf-undo-flash-out 200ms ease-in forwards; }
@keyframes pf-undo-flash-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes pf-undo-flash-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 12px); }
}
body.is-keyboard-open .ws-undo-flash {
  /* If toast happens to be visible while typing, drop it closer to the
     keyboard edge so it doesn't sit oddly far above. */
  bottom: calc(12px + env(safe-area-inset-bottom, 0) + var(--pf-vv-offset, 0px)) !important;
}
/* Bottom-nav: hide entirely while iOS keyboard is open inside the
   workout-session page. The transition: bottom .14s caused the visible
   jitter Manou reported ("the bottom menu goes up and down. It becomes
   a little bit unsettling"). Hide-on-focus is the standard iOS web pattern. */
body.is-keyboard-open .bottom-tabs {
  display: none !important;
}
/* Reclaim the page-bottom padding while nav is hidden so the focused
   input has room above the keyboard without the nav's scroll-padding
   reservation pushing content awkwardly. */
body.is-keyboard-open:has(.bottom-tabs.visible) main,
body.is-keyboard-open main {
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0) + var(--pf-vv-offset, 0px)) !important;
}
/* End Bundle AE-6 */

/* === Bundle AE-5 (2026-05-01) — Workout block state machine =================
   Three states per .ws-ex / .ws-cardio:
     .is-active    -> bigger padding, gold border + glow, NOW pill
     .is-pending   -> standard styling, slightly muted
     .is-completed -> smaller, dimmed, inputs hidden, "✓ Done" pill
   Plus .ws-superset.is-active wraps the whole pair in one gold panel.
   Memory rules: feedback_daily_system_block_state_styling.md +
   feedback_home_visual_hierarchy.md.
   =========================================================================== */

.ws-ex,
.ws-cardio {
  transition: padding 220ms ease,
              transform 220ms ease,
              opacity 220ms ease,
              border-color 220ms ease,
              box-shadow 220ms ease,
              background 220ms ease;
  transform-origin: top center;
}

/* --- Pending state (default for not-started, not-active) -------------------- */
.ws-ex.is-pending,
.ws-cardio.is-pending {
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 0.92;
}

/* --- Active state (the one the user is doing right now) -------------------- */
.ws-ex.is-active,
.ws-cardio.is-active {
  padding: 34px 26px 36px;
  border: 2px solid var(--gold-hi, #d6a05e);
  background: linear-gradient(155deg, rgba(214, 160, 94, 0.10),
                                       rgba(214, 160, 94, 0.025) 60%,
                                       rgba(255, 255, 255, 0.01));
  box-shadow: 0 0 0 1px rgba(214, 160, 94, 0.18),
              0 22px 44px -22px rgba(214, 160, 94, 0.45),
              0 0 28px -6px rgba(214, 160, 94, 0.24);
  opacity: 1;
  margin: 6px 0;
}
.ws-ex.is-active .ws-ex-name,
.ws-cardio.is-active .ws-cardio-name {
  font-size: 24px;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .ws-ex.is-active .ws-ex-name { font-size: 26px; }
}

/* --- Completed state (block done — small, dim, collapsed) ------------------ */
.ws-ex.is-completed,
.ws-cardio.is-completed {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.012);
  opacity: 0.55;
  transform: scale(0.965);
  cursor: pointer;
}
.ws-ex.is-completed:hover,
.ws-cardio.is-completed:hover {
  opacity: 0.78;
}
.ws-ex.is-completed .ws-ex-name,
.ws-cardio.is-completed .ws-cardio-name {
  font-size: 16px;
  margin: 0;
}
@media (max-width: 480px) {
  .ws-ex.is-completed .ws-ex-name,
  .ws-cardio.is-completed .ws-cardio-name {
    font-size: 14.5px;
  }
}

/* In completed state: hide every input/control + collapse the body so the
   card shrinks visually. The user can tap the card to re-expand (see
   .is-reopened below). */
.ws-ex.is-completed .ws-ex-target,
.ws-ex.is-completed .ws-ex-muscles,
.ws-ex.is-completed .ws-last,
.ws-ex.is-completed .ws-demo,
.ws-ex.is-completed .ws-cues,
.ws-ex.is-completed .ws-input,
.ws-ex.is-completed .ws-rest,
.ws-ex.is-completed .ws-set-stack,
.ws-ex.is-completed .ws-meta,
.ws-cardio.is-completed .ws-cardio-card,
.ws-cardio.is-completed .ws-cardio-actions,
.ws-cardio.is-completed .ws-cardio-notes-block,
.ws-cardio.is-completed .ws-cardio-timer,
.ws-cardio.is-completed .ws-cardio-sub,
.ws-cardio.is-completed .ws-set-stack {
  display: none !important;
}
.ws-ex.is-completed .ws-ex-icon,
.ws-cardio.is-completed .ws-cardio-icon {
  width: 28px; height: 28px;
}
.ws-ex.is-completed .ws-ex-icon svg,
.ws-cardio.is-completed .ws-cardio-icon svg {
  width: 18px; height: 18px;
}
.ws-ex.is-completed .ws-ex-head,
.ws-cardio.is-completed .ws-cardio-head {
  margin-bottom: 0;
}

/* --- Re-expand a completed card on tap (manual override) ------------------- */
.ws-ex.is-completed.is-reopened {
  padding: 18px 18px 20px;
  opacity: 0.95;
  transform: scale(1);
  cursor: default;
}
.ws-ex.is-completed.is-reopened .ws-ex-target,
.ws-ex.is-completed.is-reopened .ws-ex-muscles,
.ws-ex.is-completed.is-reopened .ws-last,
.ws-ex.is-completed.is-reopened .ws-cues,
.ws-ex.is-completed.is-reopened .ws-input,
.ws-ex.is-completed.is-reopened .ws-set-stack,
.ws-ex.is-completed.is-reopened .ws-meta {
  display: block !important;
}
.ws-ex.is-completed.is-reopened .ws-input { display: block !important; }
.ws-ex.is-completed.is-reopened .ws-ex-name {
  font-size: 22px;
}
.ws-ex.is-completed.is-reopened .ws-ex-icon { width: 40px; height: 40px; }
.ws-ex.is-completed.is-reopened .ws-ex-icon svg { width: 28px; height: 28px; }

/* --- State pill (NOW + Done corner badge) ---------------------------------- */
.ws-ex-state-pill {
  position: absolute;
  top: 12px; right: 12px;
  display: none;
  align-items: center; gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}
.ws-ex-state-pill-now,
.ws-ex-state-pill-done {
  display: inline-flex; align-items: center; gap: 4px;
}
.ws-ex.is-active > .ws-ex-state-pill {
  display: inline-flex;
  background: rgba(214, 160, 94, 0.18);
  border: 1px solid rgba(214, 160, 94, 0.55);
  color: var(--gold-hi, #d6a05e);
  box-shadow: 0 0 12px -2px rgba(214, 160, 94, 0.35);
}
.ws-ex.is-active > .ws-ex-state-pill .ws-ex-state-pill-done { display: none; }
.ws-ex.is-completed > .ws-ex-state-pill {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  top: 8px; right: 10px;
  padding: 2px 8px;
  font-size: 10px;
}
.ws-ex.is-completed > .ws-ex-state-pill .ws-ex-state-pill-now { display: none; }

/* --- Log row (Log set + Complete exercise side-by-side) -------------------- */
.ws-log-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 10px;
}
.ws-log-row .ws-log-btn {
  flex: 1 1 auto;
  min-width: 0;
}
.ws-log-row .ws-ex-complete {
  flex: 0 1 auto;
}
.ws-log-btn--ghost {
  background: transparent !important;
  border: 1px solid rgba(214, 160, 94, 0.45) !important;
  color: var(--gold-hi, #d6a05e) !important;
  box-shadow: none !important;
}
.ws-log-btn--ghost:hover { background: rgba(214, 160, 94, 0.08) !important; }
.ws-log-btn--ghost:disabled { opacity: 0.5; }
@media (max-width: 480px) {
  .ws-log-row { flex-direction: column; }
  .ws-log-row .ws-log-btn { width: 100%; }
}

/* --- Superset wrap state --------------------------------------------------- */
.ws-superset {
  transition: border-color 220ms ease, box-shadow 220ms ease,
              background 220ms ease, opacity 220ms ease;
}
.ws-superset.is-active {
  border-color: rgba(214, 160, 94, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(214, 160, 94, 0.18),
              0 18px 40px -22px rgba(214, 160, 94, 0.42),
              0 0 22px -6px rgba(214, 160, 94, 0.22);
  background: linear-gradient(155deg, rgba(214, 160, 94, 0.07),
                                       rgba(214, 160, 94, 0.015));
}
/* Inside a "group is active" superset, the inner members get a flatter look
   so the gold ring on the WRAPPER does the heavy lifting (one panel feel). */
.ws-superset.is-active .ws-ex.is-active {
  box-shadow: none;
  border-color: rgba(214, 160, 94, 0.30);
  background: rgba(214, 160, 94, 0.04);
  padding: 22px 20px 24px;
}
.ws-superset.is-completed {
  opacity: 0.6;
  transform: scale(0.97);
}
.ws-superset.is-completed .ws-superset-instruction { display: none; }

/* --- Undo flash banner (after Complete exercise) --------------------------- */
.ws-undo-flash {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 18px;
  background: rgba(20, 22, 26, 0.96);
  border: 1px solid rgba(214, 160, 94, 0.45);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45),
              0 0 18px -4px rgba(214, 160, 94, 0.4);
  color: var(--text, #f4f1ea);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  z-index: 9000;
  animation: pf-undo-flash-in 220ms ease-out;
}
.ws-undo-flash.is-leaving {
  animation: pf-undo-flash-out 220ms ease-in forwards;
}
.ws-undo-flash-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.ws-undo-flash-btn {
  background: transparent;
  border: 0;
  color: var(--gold-hi, #d6a05e);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  cursor: pointer;
}
.ws-undo-flash-btn:hover { color: #fff; }
@keyframes pf-undo-flash-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes pf-undo-flash-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, 12px); }
}

/* --- Mobile guards: never crush text below 14px ---------------------------- */
@media (max-width: 480px) {
  /* On mobile pending blocks get 14/14/16 (30px vertical) per the older
     mobile rule. Active blocks must visually pop ~24-30px taller minimum
     so the user's eye locks on. 28/22/30 = 58px vertical = +28px delta. */
  .ws-ex.is-active,
  .ws-cardio.is-active { padding: 28px 22px 30px; }
  .ws-ex.is-active .ws-ex-name { font-size: 21px; }
  .ws-ex.is-completed,
  .ws-cardio.is-completed {
    padding: 8px 12px;
  }
  .ws-undo-flash { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================================
   BL-2 (2026-05-03) — DESKTOP POLISH
   ============================================================================
   Manou: client desktop is "Frankenstein" — cards overlap on scroll, sticky
   panels pile up, /food top-left/right structure is awkward, meal images stretch
   weirdly at desktop widths.

   HARD RULE: this entire block is additive and ONLY targets >=769px (or >=1024px
   for tighter polish). Mobile rules above are untouched. Every selector here is
   inside a `@media (min-width: …)` query so phones are guaranteed unchanged.

   Surfaces touched:
   - /food   — kill broken sticky 2-col grid, swap for clean centered single-
               column layout; meal-plan hero spans full width; macro row stays
               horizontal; capture/preview/day/insights/supplements all flow
               normally with no overlap.
   - /diet   — meal cards flow as a 2-col grid at >=1024px, with capped image
               aspect-ratio so they no longer stretch.
   - /home   — gentle gap + spacing tweak; existing 12-col tier grid kept.
   - /workouts — programme + recent-session cards become a 2-col grid at
               >=1024px so the page doesn't feel like one tall column.
   - /messages — already capped at 760px, no change needed beyond breathing
               room around the wrap.
   - /daily  — already capped at 980px, fine; small polish only.
   - /account — capped at 760px; fine.
   ============================================================================ */

/* ---------- /food page: kill broken sticky-col-2 grid, single-column wide
   layout instead. The OLD rule at L11987 declared a `1.4fr 1fr` grid where
   only food-hero / food-macro-row / food-supplements were assigned to col 2
   with `position: sticky; top: 80px` — and the rest of the children fell into
   auto-flow, ALL pinning at the same top:80px so they piled up on scroll.
   We override at higher specificity (`body[data-role="client"] main.food-shell`)
   AND at >=769px so the original rule's >=1024px @media query is fully
   superseded for the broken cases. */
@media (min-width: 769px) {
  body[data-role="client"] main.food-shell {
    display: block;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
  }
  body[data-role="client"] main.food-shell > .food-mealplan-hero,
  body[data-role="client"] main.food-shell > .food-header-row,
  body[data-role="client"] main.food-shell > .food-hero,
  body[data-role="client"] main.food-shell > .food-macro-row,
  body[data-role="client"] main.food-shell > .food-capture,
  body[data-role="client"] main.food-shell > .food-preview,
  body[data-role="client"] main.food-shell > .food-day,
  body[data-role="client"] main.food-shell > .food-insights,
  body[data-role="client"] main.food-shell > .food-supplements,
  body[data-role="client"] main.food-shell > .ob-eyebrow,
  body[data-role="client"] main.food-shell > p.sub,
  body[data-role="client"] main.food-shell > #food-date-pretty,
  body[data-role="client"] main.food-shell > #food-hero,
  body[data-role="client"] main.food-shell > #food-supplements,
  body[data-role="client"] main.food-shell > #food-preview,
  body[data-role="client"] main.food-shell > #food-insights {
    grid-column: auto;
    position: static;
    top: auto;
  }
  /* Section-to-section breathing room. Mobile keeps its tighter spacing. */
  body[data-role="client"] main.food-shell > .food-hero,
  body[data-role="client"] main.food-shell > .food-macro-row,
  body[data-role="client"] main.food-shell > .food-capture,
  body[data-role="client"] main.food-shell > .food-day,
  body[data-role="client"] main.food-shell > .food-insights,
  body[data-role="client"] main.food-shell > .food-supplements {
    margin-bottom: 22px;
  }
  /* Macro row already has grid-template-columns: repeat(3,1fr) baseline.
     At desktop give it a touch more breathing space. */
  body[data-role="client"] main.food-shell > .food-macro-row {
    gap: 16px;
  }
}
@media (min-width: 1024px) {
  body[data-role="client"] main.food-shell {
    max-width: 960px;
  }
}

/* ---------- /diet page: 2-col meal-card grid at desktop, image aspect-ratio
   fix so it never stretches across the full row. Mobile keeps the existing
   single-column flex stack + 220px / 180px image height. */
@media (min-width: 769px) {
  body[data-role="client"] main > .client-meal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }
  body[data-role="client"] main .client-meal-card {
    margin: 0;
  }
  body[data-role="client"] main .client-meal-img:not(.client-meal-img-empty) {
    /* Override the base 220px height — at desktop the card is narrower so
       a fixed pixel height looks awkward. Use aspect-ratio instead. */
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 240px;
  }
  body[data-role="client"] main .client-meal-img-empty {
    height: 160px;
    aspect-ratio: auto;
  }
}
@media (min-width: 1024px) {
  body[data-role="client"] main > .client-meal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  body[data-role="client"] main .client-meal-img:not(.client-meal-img-empty) {
    aspect-ratio: 16 / 9;
    max-height: 260px;
  }
}

/* ---------- /workouts page: programme cards + recent sessions as a 2-col
   grid at desktop. Mobile stack stays as-is. The existing `.program-list`
   has no base layout in app.css beyond the inherited `.card` rules, so
   this is purely additive. */
@media (min-width: 769px) {
  body[data-role="client"] main .program-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  body[data-role="client"] main .session-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* ---------- /home dashboard: existing 12-col tier grid is correct; just
   a touch more horizontal breathing room. The `.hd-cards--tiered` baseline
   already handles the column placement — we don't override it. */
@media (min-width: 1024px) {
  body[data-role="client"] main.home-day {
    max-width: 1200px;
  }
}

/* ---------- /daily page: timeline stays centered, never stretches edge-to-
   edge on huge displays. .dsx-shell already caps at 980px (line ~6217), so
   this is just a defensive cap on the surrounding main element when the
   page renders inside the standard main wrapper. */
@media (min-width: 1024px) {
  body[data-role="client"] main:has(> .dsx-shell) {
    max-width: 1024px;
  }
}

/* ---------- /messages: chat surface. .msg-wrap already caps at 760px (see
   messages.css line 8). At very wide desktop, give it just a hair more
   breathing room — but never wider than 820px since chat readability tanks
   beyond that. Mobile chat sizing is governed by messages.css's
   max-width: 768 / 520 rules and is untouched. */
@media (min-width: 1100px) {
  body[data-role="client"] .msg-wrap.client-view {
    max-width: 820px;
  }
}

/* ---------- /account: base main is 760px-capped; that's correct desktop
   width for a settings page. No change needed. ---------- */

/* ---------- top-nav (desktop): already visible per the
   `body:not(.coach-body) header.top nav a.nav-item` mobile-hide rule
   inverting at >=769px. Add a subtle active-state pill so the current tab
   reads more like a sidebar/topbar item. */
@media (min-width: 769px) {
  body[data-role="client"] header.top nav a.nav-item.active {
    background: rgba(180, 126, 55, 0.10);
    color: var(--gold);
  }
}

/* ---------- BL-2 end ---------- */

/* End Bundle AE-5 */

/* ---------- BL-6 — pending coach approval (publish gate) ----------
   Smoky-dark + gold + Fraunces+Inter aesthetic. Used by:
   - templates/_pending_approval_card.html  (full-page card on /diet, /daily,
     /workouts, supplements panel when publish_state='pending')
   - templates/_pending_approval_inline.html  (inline strip inside Home cards)
   - coach edit pages: .pf-publish-btn primary CTA + .pf-published-pill state
   See feedback_pure_focus_vs_autonomous_bets.md / Pure Focus design system.
*/

@keyframes pf-pending-shimmer {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

.pf-shimmer-line {
  display: block;
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: rgba(180, 126, 55, 0.12);
  overflow: hidden;
}
.pf-shimmer-line + .pf-shimmer-line { margin-top: 10px; }
.pf-shimmer-line::after {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 60%; height: 100%;
  background: linear-gradient(90deg,
    rgba(180, 126, 55, 0) 0%,
    rgba(216, 181, 143, 0.28) 50%,
    rgba(180, 126, 55, 0) 100%);
  animation: pf-pending-shimmer 1.6s linear infinite;
}
.pf-shimmer-line-lg { width: 92%; height: 14px; }
.pf-shimmer-line-md { width: 70%; height: 12px; }
.pf-shimmer-line-sm { width: 50%; height: 10px; }

.pf-pending-card {
  background: var(--warm);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 28px 24px 32px;
  min-height: 220px;
  max-width: 720px;
  margin: 16px auto;
}
.pf-pending-card-eyebrow {
  display: inline-block;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.pf-pending-card-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 10px;
  font-weight: 500;
}
.pf-pending-card-sub {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 20px;
}
.pf-pending-card-skeleton { display: block; margin-top: 14px; }

.pf-pending-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 4px 4px;
  min-height: 80px;
}
.pf-pending-inline-text {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.pf-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  background: var(--gold);
  color: #0a0807;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.pf-publish-btn:hover { background: var(--gold-hi); border-color: var(--gold-hi); }
.pf-publish-btn[disabled] {
  background: var(--warm-raised);
  border-color: var(--hairline);
  color: var(--text-dim);
  cursor: wait;
}

.pf-published-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(72, 138, 88, 0.15);
  color: #84c79a;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(72, 138, 88, 0.35);
  animation: pf-pill-fadein 240ms ease both;
}
@keyframes pf-pill-fadein {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* BL-PERS-3a Bug 4: coach Unpublish control on the meal-plan editor was
   un-styled (default white square). Match the publish-button geometry but
   use a gold-outlined / transparent-fill ghost variant so it reads as a
   secondary destructive action and is visually distinct from the solid
   publish CTA, preventing accidental re-clicks. */
.btn-link-muted {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(180, 126, 55, 0.55);
  border-radius: var(--radius);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  text-decoration: none;
}
.btn-link-muted:hover {
  background: rgba(180, 126, 55, 0.10);
  border-color: var(--gold);
  color: var(--gold-hi, var(--gold));
}
.btn-link-muted:active {
  background: rgba(180, 126, 55, 0.18);
}
.btn-link-muted[disabled] {
  opacity: 0.55;
  cursor: progress;
}
/* ---------- BL-6 end ---------- */

/* ---------- BL-7: Coach lab uploads + retailor card ---------- */
.cp-labs-card .pf-labs-dropzone {
  border: 1px dashed rgba(212, 175, 55, 0.42);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  margin-top: 4px;
}
.cp-labs-card .pf-labs-dropzone:hover,
.cp-labs-card .pf-labs-dropzone.is-dragover {
  border-color: rgba(212, 175, 55, 0.85);
  background: rgba(212, 175, 55, 0.04);
}
.cp-labs-card .pf-labs-pick {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.6);
  color: #d4af37;
  padding: 9px 18px;
  border-radius: 999px;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.cp-labs-card .pf-labs-pick:hover { border-color: rgba(212, 175, 55, 0.95); color: #e7c878; }
.cp-labs-card .pf-labs-hint {
  margin: 10px 0 0;
  color: #9a9692;
  font-size: 12.5px;
}
.cp-labs-card .pf-labs-files {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.cp-labs-card .pf-labs-file {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.cp-labs-card .pf-labs-file-name { flex: 1; color: #f1ebe0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-labs-card .pf-labs-file-meta { color: #9a9692; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cp-labs-card .pf-labs-file-x {
  background: transparent; border: 0; color: #c2bfbc; font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.cp-labs-card .pf-labs-file-x:hover { color: #e57373; background: rgba(244, 67, 54, 0.08); }
.cp-labs-card .pf-labs-status {
  margin-top: 12px; min-height: 18px; font-size: 12.5px; color: #9a9692;
}
.cp-labs-card .pf-labs-status.is-ok  { color: #6fc77a; }
.cp-labs-card .pf-labs-status.is-err { color: #e57373; }
.cp-labs-card .pf-labs-results { margin-top: 18px; }
.cp-labs-card .pf-labs-results h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500; font-size: 16px; margin: 0 0 10px;
  color: #f1ebe0;
}
.cp-labs-card .pf-labs-deltas { list-style: none; margin: 0; padding: 0; }
.cp-labs-card .pf-delta-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.025);
  transition: opacity 200ms, transform 200ms;
}
.cp-labs-card .pf-delta-row.is-removing { opacity: 0; transform: translateX(8px); }
.cp-labs-card .pf-delta-icon { font-size: 18px; line-height: 1; padding-top: 2px; }
.cp-labs-card .pf-delta-body { flex: 1; min-width: 0; }
.cp-labs-card .pf-delta-head {
  display: flex; gap: 8px; align-items: baseline;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 13px;
  color: #d4af37; text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.cp-labs-card .pf-delta-action { color: #c2bfbc; font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 11.5px; }
.cp-labs-card .pf-delta-target { font-size: 14px; color: #f1ebe0; margin-bottom: 4px; }
.cp-labs-card .pf-delta-rationale { font-size: 12.5px; color: #9a9692; margin-bottom: 6px; line-height: 1.45; }
.cp-labs-card .pf-delta-meta { display: flex; gap: 6px; align-items: center; }
.cp-labs-card .pf-delta-confidence { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.cp-labs-card .pf-delta-confidence.high { background: rgba(76, 175, 80, 0.15); color: #6fc77a; }
.cp-labs-card .pf-delta-confidence.med  { background: rgba(255, 193, 7, 0.15);  color: #e0b945; }
.cp-labs-card .pf-delta-confidence.low  { background: rgba(244, 67, 54, 0.15);  color: #e57373; }
.cp-labs-card .pf-delta-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cp-labs-card .pf-delta-actions .cp-cta-gold,
.cp-labs-card .pf-delta-actions .cp-cta-ghost { padding: 6px 12px; font-size: 12px; }
.cp-labs-card .pf-delta-empty {
  padding: 12px 14px; color: #9a9692; font-size: 13px; font-style: italic;
}
.cp-labs-card .pf-spin {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(14, 14, 18, 0.25);
  border-top-color: rgba(14, 14, 18, 0.85);
  border-radius: 50%;
  animation: pf-labs-spin 700ms linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
@keyframes pf-labs-spin { to { transform: rotate(360deg); } }

/* BL-15D — Recently applied receipts panel */
.cp-labs-card .pf-labs-applied {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed rgba(180, 126, 55, 0.25);
}
.cp-labs-card .pf-labs-applied h3 {
  font-family: inherit; font-size: 13px; letter-spacing: 0.6px;
  text-transform: uppercase; color: #b47e37; margin: 0 0 10px;
  font-weight: 600;
}
.cp-labs-card .pf-applied-hint {
  color: #6f6a64; font-size: 11px; font-weight: 400; text-transform: none;
  letter-spacing: 0; margin-left: 6px;
}
.cp-labs-card .pf-applied-list { list-style: none; margin: 0; padding: 0; }
.cp-labs-card .pf-applied-row {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: 6px; margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid rgba(180, 126, 55, 0.45);
}
.cp-labs-card .pf-applied-row.pf-applied-dismissed {
  border-left-color: rgba(120, 120, 120, 0.45); opacity: 0.7;
}
.cp-labs-card .pf-applied-icon {
  font-size: 16px; line-height: 1; opacity: 0.85; padding-top: 1px;
  flex-shrink: 0;
}
.cp-labs-card .pf-applied-body { flex: 1; min-width: 0; }
.cp-labs-card .pf-applied-head {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 3px;
}
.cp-labs-card .pf-applied-status {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  padding: 2px 7px; border-radius: 3px;
}
.cp-labs-card .pf-applied-status.pf-status-approved {
  background: rgba(76, 175, 80, 0.18); color: #6fc77a;
}
.cp-labs-card .pf-applied-status.pf-status-dismissed {
  background: rgba(120, 120, 120, 0.18); color: #c0c0c0;
}
.cp-labs-card .pf-applied-resource {
  font-size: 13px; font-weight: 600; color: #e8e3d6;
}
.cp-labs-card .pf-applied-action {
  font-size: 12px; color: #9a9692;
}
.cp-labs-card .pf-applied-target {
  font-size: 12.5px; color: #d6d2c8; line-height: 1.3;
  margin-bottom: 3px;
}
.cp-labs-card .pf-applied-meta {
  font-size: 10.5px; color: #6f6a64; letter-spacing: 0.3px;
}
/* ---------- BL-7 / BL-15 end ---------- */

/* ---------- BL-12.2 (Connector 2) — diet-plan meal meta on DS blocks ----
   Render-time join from DietPlan → DS meal blocks. Only renders inside
   the expanded sub-view (.dsx-b-expanded), never on the day-grid header.
   Two states: 'ready' (image + name + macros) and 'finalising' (placeholder). */
.dsx-meal-meta {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--dsx-line);
  border-radius: 10px;
  background: rgba(180, 126, 55, 0.06);
}
.dsx-meal-meta--finalising {
  background: rgba(180, 126, 55, 0.04);
  border-style: dashed;
  border-color: rgba(180, 126, 55, 0.3);
  font-style: italic;
}
.dsx-meal-placeholder {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.5;
}
.dsx-meal-img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.dsx-meal-body {
  flex: 1 1 auto;
  min-width: 0;
}
.dsx-meal-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: var(--dsx-ink, #ece8e0);
  margin: 0 0 4px;
}
.dsx-meal-macros {
  font-size: 12.5px;
  color: var(--gold);
  letter-spacing: 0.2px;
}
.dsx-meal-prep {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
/* ---------- BL-12.2 end ---------- */

/* ============================================================================
   BL-INV-14 (2026-05-08) — DESKTOP WAVE 2: kill empty rails, restore 2-col food,
   add side-rails on /messages + /daily, top-nav polish, card padding bumps,
   hide PWA install banner on desktop.

   HARD RULES:
   - All rules are inside @media (min-width: 769px) or higher.
   - Mobile (<769px) is untouched. Verified on 390×844.
   - /daily timeline column NEVER splits into lanes. Right helper panel sits
     OUTSIDE the timeline column.
   ============================================================================ */

/* ---------- THEME-1: Hide PWA install banner on desktop ----------
   Banner overlapped 6 of 8 desktop surfaces because it's `position: fixed`
   centered at the bottom. Desktop users install PWAs via the URL-bar menu
   anyway; the banner is mobile-only UX. Mobile keeps it intact. */
@media (min-width: 769px) {
  .pwa-install-banner { display: none !important; }
}

/* ---------- THEME-4: Cap settings-form inputs on desktop ----------
   Display name / email / password inputs were stretching to ~1100px.
   Mobile inputs stay full-width. */
@media (min-width: 1024px) {
  body[data-role="client"] main input[type="text"],
  body[data-role="client"] main input[type="email"],
  body[data-role="client"] main input[type="password"],
  body[data-role="client"] main input[type="tel"],
  body[data-role="client"] main input[type="number"],
  body[data-role="client"] main input[type="search"],
  body[data-role="client"] main textarea {
    max-width: 480px;
  }
  /* Food capture textarea + meal log input are exempt — they need the wider
     authoring area. */
  body[data-role="client"] main.food-shell textarea,
  body[data-role="client"] main.food-shell input[type="text"],
  body[data-role="client"] main.food-shell input[type="number"] {
    max-width: none;
  }
  /* Message compose textarea also exempt — chat needs full bubble width. */
  body[data-role="client"] .msg-compose textarea {
    max-width: none;
  }
  /* Quick-log floating sheet inputs also exempt — fixed-card layout. */
  body[data-role="client"] .quick-log-card input {
    max-width: none;
  }
}

/* ---------- /account: cap whole page at 760px on desktop, polish toggle row ---- */
@media (min-width: 1024px) {
  body[data-role="client"] main.account-shell,
  body[data-role="client"] main.acct-main,
  body.acct-page main {
    max-width: 760px;
  }
  /* Reminder toggle rows + similar pill rows. Caps the row at 540px so the
     toggle pill sits right next to the label, not adrift across 1100px. */
  body[data-role="client"] main .reminder-row,
  body[data-role="client"] main .pf-toggle-row,
  body[data-role="client"] main .acct-toggle-row {
    max-width: 540px;
  }
}

/* ---------- /messages: left rail (thread list) at >=1024px ----------
   Pattern: Slack/iMessage. The chat column stays 760-820px capped (readability)
   and sits inside a wrapper that hosts the rail on the left. No rail on mobile
   (the back button + recipient toggle on mobile already handle navigation). */
@media (min-width: 1024px) {
  body[data-role="client"] main.bl14-msg-shell {
    max-width: 1180px;
    padding: 28px 20px 80px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail {
    display: flex;
    flex-direction: column;
    background: var(--warm);
    border: 1px solid var(--hairline-dim);
    border-radius: var(--radius-card);
    overflow: hidden;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    min-height: 400px;
    position: sticky;
    top: 80px;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--hairline-dim);
    background: var(--warm);
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-head h2 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.005em;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-head p {
    font-size: 11px;
    color: var(--text-dim);
    margin: 4px 0 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hairline-dim);
    text-decoration: none;
    color: var(--text);
    transition: background 150ms;
    cursor: pointer;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-item:hover {
    background: var(--warm-raised);
    text-decoration: none;
    color: var(--text);
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-item.active {
    background: var(--warm-raised);
    border-left: 2px solid var(--gold);
    padding-left: 16px;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-avatar.manou {
    background: var(--gold);
    color: var(--canvas);
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-avatar.ai {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-meta {
    flex: 1;
    min-width: 0;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-name {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 2px;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-sub {
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-rail-badge {
    flex-shrink: 0;
    background: var(--gold);
    color: var(--canvas);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
  }
  body[data-role="client"] main.bl14-msg-shell .bl14-msg-col {
    min-width: 0;
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
  }
  body[data-role="client"] main.bl14-msg-shell .msg-wrap.client-view {
    max-width: 820px;
    margin: 0;
    padding: 0;
  }
}
/* Mobile: hide the rail completely. Below 1024px, the existing stacked
   layout (recipient tabs + chat) reads cleanly. */
@media (max-width: 1023px) {
  .bl14-msg-rail { display: none !important; }
  body[data-role="client"] main.bl14-msg-shell {
    display: block;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 80px;
  }
}

/* ---------- /food: 2-col grid at >=1024px (no sticky) ----------
   Override the BL-2 max-width 920/960 caps. Use CSS Grid with explicit
   grid-template-areas so we never use sticky positioning. The previous BL-2
   block (above) forces position:static + display:block — we need to override
   BOTH at higher specificity, with min-width: 1024px so the BL-2 769-1023
   range remains single-column. */
@media (min-width: 1024px) {
  body[data-role="client"] main.food-shell {
    /* Override BL-2 max-width: 960 + 920. */
    max-width: 1200px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 24px;
    column-gap: 28px;
    align-items: start;
  }
  /* Hero blocks span both columns at top: eyebrow, mealplan-hero, qm-hero. */
  body[data-role="client"] main.food-shell > .ob-eyebrow,
  body[data-role="client"] main.food-shell > .food-mealplan-hero,
  body[data-role="client"] main.food-shell > .qm-hero {
    grid-column: 1 / -1;
  }
  /* Right column items: hero ring + macro row + insights. */
  body[data-role="client"] main.food-shell > .food-hero {
    grid-column: 2;
  }
  body[data-role="client"] main.food-shell > .food-macro-row {
    grid-column: 2;
  }
  body[data-role="client"] main.food-shell > .food-insights {
    grid-column: 2;
  }
  body[data-role="client"] main.food-shell > .food-preview {
    /* Preview/confirm should sit by the capture block since it modifies it. */
    grid-column: 1;
  }
  /* Left column items: capture + today's meals + supplements. */
  body[data-role="client"] main.food-shell > .food-header-row,
  body[data-role="client"] main.food-shell > #food-date-pretty,
  body[data-role="client"] main.food-shell > p.sub {
    grid-column: 1;
  }
  body[data-role="client"] main.food-shell > .food-capture {
    grid-column: 1;
  }
  body[data-role="client"] main.food-shell > .food-day {
    grid-column: 1;
  }
  body[data-role="client"] main.food-shell > .food-supplements {
    grid-column: 1;
  }
  /* Reset any leftover position:static rules — already static, no override
     needed. Keep margin-bottom from BL-2 for breathing room. */
}

/* ---------- /workouts: 3-col programme grid at >=1280px ---------- */
@media (min-width: 1280px) {
  body[data-role="client"] main .program-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  /* If exactly one card on the last row, span full width so the lone card
     doesn't sit awkwardly aligned to the left. */
  body[data-role="client"] main .program-list > .card:last-child:nth-child(3n+1) {
    grid-column: 1 / -1;
    max-width: calc((100% - 32px) / 3 * 2 + 16px);
    margin: 0 auto;
  }
}

/* ---------- /home: bigger max-width on ultra-wide ---------- */
@media (min-width: 1600px) {
  body[data-role="client"] main.home-day {
    max-width: 1440px;
  }
}

/* Tier-3 cards: ensure they don't get TOO narrow at mid-desktop where 4-up
   was forced (1100px+ rule above forces span 3, =4 cards across). At <1500px
   we want 3 across (span 4) so each card has more breathing room. */
@media (min-width: 1100px) and (max-width: 1499px) {
  body[data-role="client"] .hd-card--tier-3:not(.hd-card--insights-pos) {
    grid-column: span 4;
  }
}

/* ---------- THEME-3: Top-nav polish at desktop ----------
   Bigger logo, slightly larger 16px tab font, more padding, badge dots for
   unread messages / pending coach approval. Don't switch to sidebar. */
@media (min-width: 769px) {
  body[data-role="client"] header.top {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  body[data-role="client"] header.top a.brand img {
    height: 30px;
  }
  body[data-role="client"] header.top nav {
    gap: 4px;
  }
  body[data-role="client"] header.top nav a.nav-item {
    font-size: 15px;
    padding: 10px 16px;
    font-weight: 500;
    letter-spacing: 0.005em;
    position: relative;
  }
  body[data-role="client"] header.top nav a.nav-item.active {
    color: var(--gold);
    background: rgba(180, 126, 55, 0.10);
    border-radius: var(--radius);
  }
  /* Unread badge dot: rendered as a small gold dot in the top-right of the
     nav item. Triggered by [data-unread="1"] (set by client JS that polls
     /api/messages/unread-count). Hidden by default. */
  body[data-role="client"] header.top nav a.nav-item[data-unread="1"]::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 2px var(--canvas);
  }
}
@media (min-width: 1100px) {
  body[data-role="client"] header.top nav a.nav-item {
    font-size: 16px;
    padding: 11px 18px;
  }
}

/* ---------- THEME-2: Card padding bumps on desktop ---------- */
@media (min-width: 1280px) {
  body[data-role="client"] .hd-card--tier-2 {
    padding: 28px 30px;
  }
  body[data-role="client"] .hd-card--tier-3 {
    padding: 22px 24px 22px;
  }
}

/* ---------- /onboarding: bigger stage at >=1280px ---------- */
@media (min-width: 1280px) {
  .ob-stage,
  .ob-progress-wrap {
    max-width: 1140px;
  }
  .ob-card {
    max-width: 760px;
    margin: 0 auto;
  }
}

/* ---------- /daily: 2-col layout at >=1280px (TIMELINE STAYS SINGLE COL) ----
   The timeline column itself is NEVER split. The right-side helper panel
   sits OUTSIDE the timeline as a sibling 2nd column. Hard rule from
   feedback_coach_daily_system_single_column_polish.md +
   feedback_daily_system_single_column_timeline.md.
   Below 1280px, the right panel falls back to a stacked block under the
   timeline (or hidden — see below). */
@media (min-width: 1280px) {
  body[data-role="client"] main.dsx-shell {
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(280px, 320px);
    grid-auto-flow: row dense;
    gap: 32px;
    align-items: start;
  }
  /* Header + variants pills + footer span both columns. */
  body[data-role="client"] main.dsx-shell > .dsx-head,
  body[data-role="client"] main.dsx-shell > .dsx-variants,
  body[data-role="client"] main.dsx-shell > .dsx-empty,
  body[data-role="client"] main.dsx-shell > .dsx-foot {
    grid-column: 1 / -1;
  }
  /* Timeline body in column 1 — stays single-column inside. */
  body[data-role="client"] main.dsx-shell > #ds-body {
    grid-column: 1;
    min-width: 0;
  }
  /* Right-side helper panel in column 2.
     Anchor it to the same row as #ds-body so they sit side-by-side. The
     timeline column itself NEVER splits — this aside is OUTSIDE the timeline. */
  body[data-role="client"] main.dsx-shell > .bl14-daily-aside {
    grid-column: 2;
    align-self: start;
    position: sticky;
    top: 88px;
  }
}
@media (max-width: 1279px) {
  /* Hide the helper panel below 1280px — the timeline takes priority and we
     don't want the panel jammed underneath on mid-desktop. */
  .bl14-daily-aside { display: none !important; }
}

.bl14-daily-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bl14-daily-aside-card {
  background: var(--warm);
  border: 1px solid var(--hairline-dim);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}
.bl14-daily-aside-card h3 {
  margin: 0 0 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.bl14-daily-aside-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline-dim);
}
.bl14-daily-aside-stat:last-child { border-bottom: 0; }
.bl14-daily-aside-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
.bl14-daily-aside-stat-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bl14-daily-aside-stat-value.muted { color: var(--text-dim); font-weight: 400; }

/* Header date strip on /daily (desktop only). */
@media (min-width: 1024px) {
  .bl14-daily-datestrip {
    display: block;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 6px 0 0;
    font-weight: 600;
  }
}
@media (max-width: 1023px) {
  .bl14-daily-datestrip { display: none; }
}

/* ---------- /calendar: below-week stats panel at >=1024px ----------
   Fills the 440px dead space below the week-row. The panel is part of
   normal page flow on desktop. On mobile it stays visible too (helpful
   summary), capped at narrower width and stacked. */
.bl14-cal-stats {
  margin: 22px 0 0;
}
.bl14-cal-stats-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bl14-cal-stats-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.bl14-cal-stats-meta {
  font-size: 12px;
  color: var(--text-dim);
}
.bl14-cal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) {
  .bl14-cal-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}
.bl14-cal-stat-card {
  background: var(--warm);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
}
.bl14-cal-stat-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.bl14-cal-stat-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.bl14-cal-stat-unit {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  margin-left: 2px;
}
.bl14-cal-stat-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.3;
}

/* ---------- BL-INV-14 end ---------- */

/* ============================================================================
   DT-POLISH (2026-06-16). DESKTOP COHERENCE PASS (client app only)
   ============================================================================
   Goal: the wide-screen client view should look intentional and premium, not
   mobile-stretched. Every rule here is ADDITIVE and gated behind
   `@media (min-width: 1024px)` (a couple at 1280px), scoped to
   body[data-role="client"]. Mobile (and coach) render is byte-identical.

   Builds on the existing BL-2 / THEME-3 / BL-INV-14 desktop layers above.
   The shared client container is already 1180px (rule ~L12173). This pass:
     1. aligns the sticky top-nav to that same 1180px content column so the
        brand + tabs stop hugging the raw screen edges while content centers.
     2. /account. settings sections flow as a balanced 2-column masonry
        (was one narrow stack down the left, half the page empty).
     3. /account/integrations. integration cards flow as a 2-col grid
        (were full-width rows with a huge empty right side).
     4. /body. weigh-in history flows as a 2-col grid, plus the manual-entry
        form lays out left/right instead of one tall stack.
     5. /workouts/session (.ws-page). centered at a focused readable width
        so the single-column training flow isn't stranded against the left.
     6. /messages. thread column fills the available width cleanly.
   ============================================================================ */

/* ----- 1. Top-nav: align brand + tabs to the 1180px content column ----- */
@media (min-width: 1024px) {
  body[data-role="client"] header.top {
    /* Center the header bar's inner content on the same 1180px column the
       page content uses. The sticky bar background still spans full width;
       only its children are constrained + centered, so brand lines up with
       the content's left edge and the nav lines up with its right edge. */
    padding-left: max(32px, calc((100% - 1180px) / 2));
    padding-right: max(32px, calc((100% - 1180px) / 2));
  }
}

/* ----- 2. /account: 2-column settings masonry -----
   Hooked off main.acct-shell (class added to account.html's <main>). The page
   is a flat run of <h2> headers + .card / panel siblings directly under
   <main>. CSS multi-column flows them into two balanced columns.
   break-inside:avoid keeps each card intact; break-after:avoid on the headers
   keeps every <h2> glued to the card that follows it, so a header never sits
   alone at the foot of a column. */
@media (min-width: 1024px) {
  body[data-role="client"] main.acct-shell {
    max-width: 1080px;
    column-count: 2;
    column-gap: 34px;
  }
  body[data-role="client"] main.acct-shell > h2 {
    break-after: avoid;
    -webkit-column-break-after: avoid;
    margin-top: 6px;
  }
  body[data-role="client"] main.acct-shell > h2:first-of-type {
    margin-top: 0;
  }
  body[data-role="client"] main.acct-shell > .card,
  body[data-role="client"] main.acct-shell > .account-avatar-card,
  body[data-role="client"] main.acct-shell > p,
  body[data-role="client"] main.acct-shell > div[class] {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
  }
  /* The page title + toast span both columns. */
  body[data-role="client"] main.acct-shell > h1,
  body[data-role="client"] main.acct-shell > .acct-toast {
    column-span: all;
    -webkit-column-span: all;
  }
}

/* ----- 3. /account/integrations: 2-column card grid -----
   Hooked off main.integ-shell. Each group's cards are wrapped in
   <div.integ-grid>. On MOBILE that wrapper is display:contents (it vanishes
   from layout, so the .integ-block cards flow exactly as before, mobile
   byte-identical). On DESKTOP it becomes a 2-col grid so each group keeps its
   own header above a tidy pair of columns, group cohesion intact. */
.integ-grid { display: contents; }
@media (min-width: 1024px) {
  body[data-role="client"] main.integ-shell {
    max-width: 1100px;
  }
  body[data-role="client"] main.integ-shell .integ-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
    align-items: start;
    margin-bottom: 8px;
  }
  body[data-role="client"] main.integ-shell .integ-grid > .integ-block {
    margin: 0;
  }
}

/* ----- 4. /body: history grid + form layout -----
   Hooked off main.body-shell. */
@media (min-width: 1024px) {
  /* Cap the body page a touch narrower than the full 1180 so the weight chart
     and hero don't stretch uncomfortably wide, but still use the space. */
  body[data-role="client"] main.body-shell {
    max-width: 1080px;
  }
  /* Weigh-in history: 2-column grid of rows. */
  body[data-role="client"] main.body-shell .body-stat-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    align-items: start;
  }
  /* Manual-entry "Log full measurements" form: give the inner add-grids more
     column room so the fields aren't pinned to the left half. */
  body[data-role="client"] main.body-shell .body-add-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ----- 5. /workouts/session: focused, centered training column -----
   The live session is an intentionally single-column flow (you scroll
   exercise by exercise during a workout), so we do NOT grid it. We just cap
   it to a comfortable reading width and center it so it isn't stranded
   against the left edge of a 1180px main with empty space to the right. */
@media (min-width: 1024px) {
  body[data-role="client"] main.ws-page {
    max-width: 860px;
  }
  /* The sticky finish / start-for-real bar should track the same width. */
  body[data-role="client"] main.ws-page .ws-finish {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ----- 6. /messages: let the thread column own the freed width -----
   The shell is already a `320px minmax(0,1fr)` grid (rule ~L14059). The
   inner .msg-wrap was capped to 820px which left a gap on the right of the
   thread column. Release that cap inside the desktop grid so the active
   conversation fills its column; readability stays fine because the column
   itself is bounded by the 320px sidebar + 1180px shell. */
@media (min-width: 1024px) {
  body[data-role="client"] main.bl14-msg-shell .msg-wrap.client-view {
    max-width: 100%;
  }
}

/* ---------- DT-POLISH end ---------- */

/* ======================================================================
   VO2-AB (2026-06-01) - Cardio interval builder (coach) + rounds (client)
   ====================================================================== */

/* ----- Coach builder (.cib-*), shares the smoky-gold editor look ----- */
.cib {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cib-levelbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(180, 126, 55, 0.05);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 12px;
}
.cib-levelbar-lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #b47e37);
}
.cib-level-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.cib-level-pill {
  flex: 1 1 110px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(180, 126, 55, 0.2);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #fdfdff);
  cursor: pointer;
  text-align: center;
  transition: border-color 120ms, background 120ms, color 120ms;
}
.cib-level-pill:hover { border-color: var(--gold, #b47e37); }
.cib-level-pill.is-active {
  background: rgba(180, 126, 55, 0.2);
  border-color: var(--gold, #b47e37);
  color: var(--gold-hi, #d8b58f);
}
.cib-level-hint {
  font-size: 12px;
  color: var(--text-secondary, #c2bfbc);
}
.cib-warmup {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-secondary, #c2bfbc);
  cursor: pointer;
}
.cib-warmup input { width: 16px; height: 16px; accent-color: var(--gold, #b47e37); }
.cib-quickfill {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cib-quickfill-lbl {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #8a8785);
}
.cib-quickfill-select,
.cib-round-grid select,
.cib-round-grid input[type="number"] {
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 126, 55, 0.22);
  border-radius: 8px;
  color: var(--text, #fdfdff);
  font: inherit;
  font-size: 14px;
}
.cib-rounds { display: flex; flex-direction: column; gap: 10px; }
.cib-empty {
  font-size: 13px;
  color: var(--text-dim, #8a8785);
  padding: 6px 2px;
}
.cib-round {
  padding: 12px 14px;
  background: rgba(180, 126, 55, 0.045);
  border: 1px solid rgba(180, 126, 55, 0.16);
  border-radius: 12px;
}
.cib-round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cib-round-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-hi, #d8b58f);
  font-weight: 600;
}
.cib-round-del {
  background: transparent;
  color: rgba(233, 61, 61, 0.7);
  border: 1px solid rgba(233, 61, 61, 0.3);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  width: 30px;
  height: 28px;
  cursor: pointer;
}
.cib-round-del:hover { background: rgba(233, 61, 61, 0.12); color: var(--red, #e93d3d); }
.cib-round-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.cib-field { display: flex; flex-direction: column; gap: 4px; }
.cib-field-lbl {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #8a8785);
}
.cib-round-hr {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--gold-hi, #d8b58f);
}
.cib-add {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed rgba(180, 126, 55, 0.34);
  color: var(--gold-hi, #d8b58f);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms, border-style 120ms;
}
.cib-add:hover { border-color: var(--gold, #b47e37); border-style: solid; }
.cib-preview {
  padding: 12px 14px;
  background: rgba(180, 126, 55, 0.06);
  border-left: 3px solid var(--gold, #b47e37);
  border-radius: 8px;
}
.cib-preview-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, #b47e37);
  margin-bottom: 5px;
}
.cib-preview-line { font-size: 13px; color: var(--text, #fdfdff); line-height: 1.5; }
.cib-preview-num {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--gold-hi, #d8b58f);
}
.cib-preview-note {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-dim, #8a8785);
  line-height: 1.45;
}

/* ----- Client rounds card (.ws-rounds-*), matches the cardio session look - */
.ws-rounds-card {
  margin-top: 14px;
  padding: 18px;
  background: var(--warm, #1b1815);
  border: 1px solid rgba(180, 126, 55, 0.18);
  border-radius: 16px;
}
.ws-rounds-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text, #fdfdff);
  margin: 0 0 4px;
}
.ws-rounds-sub {
  font-size: 12.5px;
  color: var(--text-dim, #8a8785);
  margin: 0 0 14px;
}
.ws-rounds-warmup {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(118, 200, 147, 0.08);
  border: 1px solid rgba(118, 200, 147, 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary, #c2bfbc);
}
.ws-rounds-warmup-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #76c893; flex-shrink: 0;
}
.ws-round {
  padding: 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(180, 126, 55, 0.14);
  border-radius: 12px;
}
.ws-round:last-child { margin-bottom: 0; }
.ws-round-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ws-round-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-hi, #d8b58f);
}
.ws-round-reps {
  font-size: 12px;
  color: var(--text-dim, #8a8785);
}
.ws-round-reps strong {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--gold, #b47e37);
}
.ws-phase {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
}
.ws-phase + .ws-phase { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.ws-phase-dot { width: 11px; height: 11px; border-radius: 50%; }
.ws-phase-dot--work { background: #e8884a; }
.ws-phase-dot--rest { background: #76c893; }
.ws-phase-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-phase-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #fdfdff);
}
.ws-phase-name .ws-phase-time {
  font-weight: 400;
  color: var(--text-secondary, #c2bfbc);
}
.ws-phase-effort {
  font-size: 11.5px;
  color: var(--text-dim, #8a8785);
}
.ws-phase-hr {
  text-align: right;
  white-space: nowrap;
}
.ws-phase-hr-bpm {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--gold-hi, #d8b58f);
}
.ws-phase-hr-bpm small {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 10px;
  color: var(--text-dim, #8a8785);
}
.ws-phase-hr-pct {
  font-size: 11px;
  color: var(--text-dim, #8a8785);
}
.ws-rounds-noage {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-dim, #8a8785);
  line-height: 1.45;
}

/* VO2-AB - narrow-screen guards. The coach round grid (5 fields) would overflow
   a sub-480px viewport at minmax(120px); stack it. The client BPM cell is
   white-space:nowrap; let it drop to its own line so "166-175 bpm" never clips. */
@media (max-width: 480px) {
  .cib-round-grid { grid-template-columns: 1fr; }
  .ws-phase { grid-template-columns: 18px 1fr; }
  .ws-phase-hr {
    grid-column: 2;
    text-align: left;
    white-space: normal;
    margin-top: 2px;
  }
}

/* =====================================================================
   FOOD-2COL (2026-06-16): single authoritative desktop layout for /food.
   Supersedes the 3 competing shell-grid blocks (BL-2 single-col + the
   1024 "2-col grid" block) which made main.food-shell ITSELF a grid, so
   the two columns shared row heights and the left column stranded with
   big empty gaps (Manou: "food section did not change at all").
   The cluster is now wrapped in .tfood-grid > (.tfood-rail + .tfood-main)
   in food.html. Wrappers are display:contents below 1024px, so mobile +
   tablet render byte-identical (DOM order intact). At >=1024px each column
   stacks INDEPENDENTLY (two flex columns in one grid), no shared rows.
   ===================================================================== */
.tfood-grid, .tfood-rail, .tfood-main { display: contents; }

@media (min-width: 1024px) {
  /* Neutralise the old shell-as-grid. Shell is a plain centered block;
     the meal-plan hero / quick-ideas / "Today's food" header stay full
     width above the two columns. */
  body[data-role="client"] main.food-shell {
    display: block;
    max-width: 1180px;
  }
  /* The cluster is the only grid: main (log + meals + nudge + supplements)
     wide on the left, rail (calories ring + macros) sticky on the right. */
  body[data-role="client"] main.food-shell .tfood-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
    column-gap: 30px;
    align-items: start;
    margin-top: 4px;
  }
  body[data-role="client"] main.food-shell .tfood-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    grid-column: 1;
    /* Pin to row 1 so the left column starts at the top. Without this, the
       rail (DOM-first, column 2) advances the auto-flow cursor and the main
       (column 1) gets pushed to row 2, stranding the top-left. */
    grid-row: 1;
    min-width: 0;
  }
  body[data-role="client"] main.food-shell .tfood-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 88px;
  }
  /* The flex gap owns vertical spacing now; zero the sections' own
     vertical margins so we don't double up. */
  body[data-role="client"] main.food-shell .tfood-main > section,
  body[data-role="client"] main.food-shell .tfood-rail > section {
    margin-top: 0;
    margin-bottom: 0;
  }
}
