/* Same dark theme palette as the desktop app's mobile exports, so the web
   app feels like the same product rather than a different tool. Light
   mode (below) is the newer addition — every one of its color values was
   picked by calculating actual WCAG contrast ratios against its typical
   background, the same discipline already applied to the link-color rule
   further down, not eyeballed. */
:root {
  --bg:#1a1d2e; --panel:#242740; --panel2:#2e3150; --accent:#4fc3f7;
  --accent2:#7c83fd; --green:#43d6a0; --red:#ff6b6b; --orange:#ffa552;
  --text:#e8ecf8; --text2:#9ba3c9; --border:#373d5e; --entry-bg:#1e2138;
  /* Dark text for anything sitting ON TOP of the bright accent color
     itself (buttons, active pills, checkmarks) — was five repeated
     literal #0c1120/#0a0c14 values scattered through this file, now one
     named variable. Flips to white in light mode below, since --accent
     itself flips from a pale blue (needs dark text) to a deeper,
     saturated one (needs light text) — confirmed by calculating both
     options' actual contrast against light mode's own --accent value,
     not assumed to carry over unchanged. */
  --on-accent:#0c1120;
  --on-accent-muted:rgba(10,12,20,0.65);
  --green-tint:rgba(67,214,160,0.18); --orange-tint:rgba(255,165,82,0.16); --accent-glow:rgba(79,195,247,0.4); --accent-glow-hover:rgba(79,195,247,0.5);
  /* These four were the only genuinely theme-dependent hardcoded
     backgrounds found in this file — everything else already flowed
     through the variables above. The QR modal's own white background
     and dark text further down are deliberately NOT included here: a
     QR code needs real white behind real black to scan reliably,
     regardless of which theme the rest of the app is in. */
  --topbar-bg:#141625; --flash-error-bg:#3a1e22; --flash-success-bg:#1e3a2c; --deload-bg:#3a2c1e;
  /* Purely decorative section-accent colors, for visually breaking up long
     scrolling pages — deliberately distinct from red/orange/green above,
     which already mean something specific (errors, warnings, success)
     elsewhere in the UI. A section header being teal or rose carries no
     meaning beyond "a different section than the one above it". */
  --sc1:#4fc3f7; --sc2:#a5a9fe; --sc3:#2dd4bf; --sc4:#f78fb3;
  --sc5:#e8c468; --sc6:#b18cf5; --sc7:#43d6a0; --sc8:#6ec6ff;
  /* Superset/Circuit group colors — deliberately chosen from the two
     hue ranges (yellow-green ~60-140deg, violet-magenta ~260-340deg)
     the 8 category colors above never touch, so a grouped exercise's
     color is never confusable with its own training-category color. */
  --superset1:#cf89e6; --superset2:#4ebe37;
  --circuit1:#b3dd5f; --circuit2:#ed8294;
}

/* Light mode — toggled by adding data-theme="light" to <html> (see the
   toggle script in base.html). Every category/group color below keeps
   its dark-mode hue exactly, just darkened in HSL space until it clears
   4.5:1 against the new light --bg — done programmatically, not by eye,
   so the same 12 colors stay as visually distinct from each other as
   they were in dark mode, just legible on a light background instead of
   a dark one. */
html[data-theme="light"] {
  --bg:#f5f6fb; --panel:#ffffff; --panel2:#eef0f8; --accent:#0678a3;
  --accent2:#4f58fc; --green:#0e7d55; --red:#c93650; --orange:#96540d;
  --text:#1a1d2e; --text2:#565d80; --border:#d9dceb; --entry-bg:#eef0f8;
  --on-accent:#ffffff;
  --on-accent-muted:rgba(255,255,255,0.95);
  --green-tint:rgba(14,125,85,0.12); --orange-tint:rgba(150,84,13,0.14); --accent-glow:rgba(6,120,163,0.3); --accent-glow-hover:rgba(6,120,163,0.4);
  --topbar-bg:#ffffff; --flash-error-bg:#fdf0f1; --flash-success-bg:#e2f5ec; --deload-bg:#f7e9d8;
  --sc1:#0878aa; --sc2:#4f57fd; --sc3:#197c70; --sc4:#dd1057;
  --sc5:#8d6b15; --sc6:#844aef; --sc7:#1b7e5a; --sc8:#0074c0;
  --superset1:#ad35d4; --superset2:#347f25;
  --circuit1:#5a7a1a; --circuit2:#da1f3f;
}

/* Without this, every plain link (every "← Back to..." link, every
   inline link in a hint note, anywhere a more specific class doesn't
   already set its own color) fell back to the BROWSER's default link
   colors — designed for light backgrounds, and confirmed by direct
   contrast-ratio calculation to score as low as ~1.5:1 against this
   dark theme (WCAG AA needs 4.5:1 for normal text), with visited links
   in particular rendering as a barely-visible dark purple. This single
   rule is an author-stylesheet rule, so it correctly overrides the
   browser's default even for :visited, without needing a separate
   override for that specific state. More specific classes elsewhere
   (.cell-name-link, .msg-body a, etc.) still win where they exist. */
a { color: var(--accent); text-decoration-color: currentColor; }
a:hover { color: var(--text); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Top bar ── */
.topbar {
  background: var(--topbar-bg); padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.brand-row { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; color: var(--accent); font-size: 16px; text-decoration: none; }
.theme-toggle-btn {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  width: 30px; height: 30px; border-radius: 50%; font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.theme-toggle-btn:hover { border-color: var(--accent); }
.nav-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; row-gap: 8px; }
.who { font-size: 13px; color: var(--text2); white-space: nowrap; }
.role-tag {
  background: var(--panel2); color: var(--accent2); font-size: 10px; font-weight: 700;
  text-transform: uppercase; padding: 2px 7px; border-radius: 8px; margin-left: 6px;
}
.logout-link { color: var(--text2); font-size: 13px; text-decoration: none; }
.logout-link:hover { color: var(--red); }
.nav-link { color: var(--text2); font-size: 13px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.nav-link:hover { color: var(--accent); }
.bell-link { position: relative; font-size: 16px; padding: 0 4px; }
.badge-link { position: relative; padding-right: 14px; }
.bell-badge {
  position: absolute; top: -7px; right: -8px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

@media (max-width: 480px) {
  .topbar { padding: 10px 14px; }
  .brand { font-size: 14px; }
  .nav-row { gap: 10px; }
  .nav-link, .who, .logout-link { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* ── Layout ── */
.content { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.page-title { font-size: 22px; color: var(--accent); margin: 0 0 4px; }
.program-logo { max-height: 64px; max-width: 220px; display: block; margin: 0 auto 10px auto; border-radius: 6px; }
.page-sub { font-size: 13px; color: var(--text2); margin: 0 0 20px; }

/* ── Flash messages ── */
.flash-wrap { margin-bottom: 16px; }
.flash {
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 8px;
}
.flash-error { background: var(--flash-error-bg); color: var(--red); }
.flash-success { background: var(--flash-success-bg); color: var(--green); }

/* ── Login page ── */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 90vh; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 32px; width: 100%; max-width: 360px;
}
.login-title { font-size: 17px; color: var(--accent); text-align: center; margin: 0 0 4px; }
.login-sub { font-size: 12px; color: var(--text2); text-align: center; margin: 0 0 24px; }

/* ── Form fields ── */
.f { margin-bottom: 14px; }
.f label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 5px; font-weight: 600; }
.help-link {
  color: var(--accent); text-decoration: none; font-weight: 600; margin-left: 8px;
  font-size: 11px;
}
.help-link:hover { text-decoration: underline; }
.f input {
  width: 100%; padding: 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--entry-bg); color: var(--text); font-size: 14px; font-family: inherit;
}
.f input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.f textarea {
  width: 100%; padding: 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--entry-bg); color: var(--text); font-size: 14px; font-family: inherit;
  resize: vertical;
}
.f textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.f select {
  width: 100%; padding: 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--entry-bg); color: var(--text); font-size: 14px; font-family: inherit;
}
.f select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
/* The dropdown POPUP (the list of options when a select is open) is
   rendered by the browser using each <option>'s own color, not inherited
   from the closed <select> — without this, options render as light text
   on the browser's default white popup background and become unreadable. */
.f select option, .slot-cell select option, .multi-select option, .modcfg-warmup option {
  background: var(--entry-bg); color: var(--text);
}

.btn-primary {
  background: var(--accent); color: var(--on-accent); border: none; padding: 12px 18px;
  border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-secondary {
  background: var(--panel2); color: var(--accent2); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-secondary:hover { filter: brightness(1.15); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.calc-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--entry-bg); border: 1px dashed var(--border); border-radius: 9px;
  padding: 10px; margin: 0 0 14px;
}
.calc-label { font-size: 11px; font-weight: 700; color: var(--accent2); text-transform: uppercase; }
.calc-box input {
  width: 130px; padding: 8px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 13px; font-family: inherit;
}
.btn-calc { padding: 8px 12px; font-size: 12px; }
.calc-result { font-size: 12px; color: var(--green); flex-basis: 100%; }

.modcfg-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.modcfg-row:last-of-type { border-bottom: none; }
.modcfg-cat { font-size: 13px; font-weight: 700; color: var(--text); min-width: 130px; }
.modcfg-warmup {
  background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px; font-size: 12px; font-family: inherit; min-width: 140px;
}
.modcfg-note {
  flex: 1; min-width: 200px; padding: 7px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--entry-bg); color: var(--text); font-size: 12px; font-family: inherit;
}
.lead-status-select {
  background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 8px; font-size: 12px; font-family: inherit;
}
.lead-status-select option { background: var(--entry-bg); color: var(--text); }

.screen-ex-row {
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.screen-ex-row:last-of-type { border-bottom: none; }
.screen-ex-name { font-size: 14px; font-weight: 700; margin-right: 8px; }
.screen-trainer-note {
  background: var(--panel2); border-left: 3px solid var(--accent2); border-radius: 6px;
  padding: 8px 10px; margin-top: 8px; font-size: 13px; color: var(--text); line-height: 1.5;
}
.screen-ex-fields { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ── Cards / tables (admin dashboard) ── */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px; margin-bottom: 16px;
}
.empty-card { padding: 24px; color: var(--text2); font-size: 14px; }
.table-card { padding: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.session-break-form { display: flex; gap: 6px; align-items: center; padding: 6px 0 2px; }
.session-break-input {
  flex: 1; font-size: 11px; padding: 5px 8px; border-radius: 6px; border: 1px dashed var(--border);
  background: transparent; color: var(--text2);
}
.session-break-input:focus { border-style: solid; color: var(--text); }
.data-table th {
  text-align: left; background: var(--panel2); color: var(--accent);
  padding: 10px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.data-table td { padding: 10px 14px; border-top: 1px solid var(--border); white-space: nowrap; }
.cell-name { font-weight: 600; }
.cell-name-link { color: var(--text); text-decoration: none; }
.cell-name-link:hover { color: var(--accent); text-decoration: underline; }
.cell-muted { color: var(--text2); }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 7px;
  border-radius: 8px; background: var(--panel2); color: var(--accent2); white-space: nowrap;
  font-family: inherit; text-decoration: none;
}
.badge-muted { color: var(--text2); }

/* ── Client program view ── */
.week-banner {
  margin: 18px 0 8px; padding: 8px 12px; border-radius: 8px; font-weight: 700;
  font-size: 13px; letter-spacing: .5px; background: var(--panel2); color: var(--accent2);
  display: flex; align-items: center; justify-content: space-between;
}
.week-banner.deload { background: var(--deload-bg); color: var(--orange); }
.week-tag { font-size: 10px; opacity: .85; font-weight: 600; }

.week-selector {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; padding: 10px;
  background: var(--panel2); border-radius: 10px;
}
.week-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px;
  height: 30px; padding: 0 6px; border-radius: 8px; font-size: 13px; font-weight: 700;
  color: var(--text2); text-decoration: none; background: var(--panel);
  border: 1px solid var(--border);
}
.week-pill:hover { border-color: var(--accent); color: var(--accent); }
.week-pill-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.week-pill-deload:not(.week-pill-active) { color: var(--orange); border-color: var(--orange); }

.day-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden;
}
.day-card summary {
  list-style: none; cursor: pointer; padding: 14px 16px; display: flex;
  align-items: center; gap: 10px; font-size: 15px;
}
.day-card summary::-webkit-details-marker { display: none; }
.day-name { font-weight: 700; color: var(--text); min-width: 90px; }
.day-mods { color: var(--text2); font-size: 12px; flex: 1; }
.day-progress {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--panel2); padding: 3px 8px; border-radius: 10px; white-space: nowrap;
}
.day-body { padding: 0 16px 16px; border-top: 1px solid var(--border); }

.periodisation-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden;
}
.periodisation-card[class*="section-c"] { border-left-width: 4px; }
.periodisation-card summary {
  list-style: none; cursor: pointer; padding: 16px 18px; display: flex;
  flex-direction: column; gap: 4px;
}
.periodisation-card summary::-webkit-details-marker { display: none; }
.periodisation-name { font-weight: 700; color: var(--accent); font-size: 16px; }
.periodisation-tagline { color: var(--text2); font-size: 13px; }
.periodisation-body { padding: 4px 18px 20px; border-top: 1px solid var(--border); }
.periodisation-heading {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent2); margin: 18px 0 6px;
}
.periodisation-text {
  font-size: 14px; color: var(--text); line-height: 1.6; white-space: pre-line;
}
.periodisation-text:first-of-type { margin-top: 14px; }

.msg-thread { padding: 18px; display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; }
.msg-row { display: flex; }
.msg-row.msg-mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 72%; background: var(--panel2); border-radius: 14px; padding: 10px 14px;
}
.msg-row.msg-mine .msg-bubble { background: var(--accent); color: var(--on-accent); }
.msg-meta { font-size: 10.5px; color: var(--text2); margin-bottom: 4px; font-weight: 600; }
.msg-row.msg-mine .msg-meta { color: var(--on-accent-muted); }
.msg-body { font-size: 14px; line-height: 1.5; white-space: pre-line; }
.msg-body a { color: inherit; text-decoration: underline; }
.msg-body a:hover { opacity: 0.8; }
.msg-delete-btn {
  background: none; border: none; padding: 0; margin-top: 4px; font-size: 10.5px;
  color: var(--text2); text-decoration: underline; cursor: pointer; opacity: 0.7;
}
.msg-delete-btn:hover { opacity: 1; }
.msg-row.msg-mine .msg-delete-btn { color: var(--on-accent-muted); }

.pinned-notice {
  display: flex; gap: 12px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--orange); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.pinned-notice-icon { font-size: 18px; flex: 0 0 auto; }
.pinned-notice-body { flex: 1; min-width: 0; }
.pinned-notice-text { font-size: 14px; line-height: 1.5; white-space: pre-line; color: var(--text); }
.pinned-notice-text a { color: var(--accent); text-decoration: underline; }
.pinned-notice-text a:hover { color: var(--text); }
.pinned-notice-meta { font-size: 11px; color: var(--text2); margin-top: 6px; }

.transfer-list {
  display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 4px;
}
.transfer-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px;
}
.transfer-row:hover { background: var(--panel2); }
.transfer-row input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; }

.lib-filter-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.lib-filter-text, .lib-filter-cat {
  background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 10px; font-size: 13px; font-family: inherit;
}
.lib-filter-text { flex: 1; min-width: 160px; }
.lib-filter-cat { min-width: 150px; }
.lib-filter-cat option { background: var(--entry-bg); color: var(--text); }

.sess-title { font-size: 12px; font-weight: 700; color: var(--accent2); margin: 14px 0 6px; }
.warmup, .note {
  font-size: 12px; color: var(--text2); font-style: italic; margin: 6px 0; line-height: 1.4;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.warmup .watch-demo { font-style: normal; }

.ex-list { margin-top: 8px; }
.superset-row {
  display: flex; flex-wrap: wrap; gap: 0 14px; align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.superset-row:last-child { border-bottom: none; }
.superset-row .ex-row { flex: 1 1 140px; min-width: 0; border-bottom: none; }
.ex-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.ex-row:last-child { border-bottom: none; }

.ex-row-grouped {
  position: relative; padding-left: 14px; margin-left: -4px;
  border-left: 3px solid var(--accent2);
}
.superset-label {
  flex-basis: 100%; font-size: 10px; font-weight: 700; margin: 4px 0 2px 10px;
  text-transform: uppercase; letter-spacing: .5px; color: var(--accent2);
}
.superset-partners { font-size: 11px; color: var(--text2); margin: 2px 0 4px; }

.ex-row-grouped.group-color-superset-0 { border-left-color: var(--superset1); }
.ex-row-grouped.group-color-superset-1 { border-left-color: var(--superset2); }
.ex-row-grouped.group-color-circuit-0 { border-left-color: var(--circuit1); }
.ex-row-grouped.group-color-circuit-1 { border-left-color: var(--circuit2); }
.superset-label.group-color-superset-0, .ex-name.group-color-superset-0 { color: var(--superset1); }
.superset-label.group-color-superset-1, .ex-name.group-color-superset-1 { color: var(--superset2); }
.superset-label.group-color-circuit-0, .ex-name.group-color-circuit-0 { color: var(--circuit1); }
.superset-label.group-color-circuit-1, .ex-name.group-color-circuit-1 { color: var(--circuit2); }

.ex-check-label { display: flex; align-items: center; cursor: pointer; }
.ex-check { position: absolute; opacity: 0; width: 0; height: 0; }
.ex-box {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--text2);
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.ex-check:checked + .ex-box { background: var(--green); border-color: var(--green); }
.ex-check:checked + .ex-box::after { content: "✓"; color: var(--on-accent); font-weight: 900; font-size: 15px; }
.ex-check:disabled + .ex-box { opacity: .6; }
.ex-check-label:has(.ex-check:disabled) { cursor: default; }
.ex-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ex-name { font-size: 14px; font-weight: 700; }
.ex-cat-label {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  margin-left: 6px; opacity: 0.85;
}
.ex-check:checked ~ .ex-body .ex-name { color: var(--text2); text-decoration: line-through; }
.ex-presc { font-size: 13px; color: var(--text2); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; }
.badge.tempo { color: var(--accent2); }
.badge.rest { color: var(--orange); }
.badge.rpe-badge { color: var(--green); }
.watch-demo {
  flex: 0 0 auto; align-self: center; text-decoration: none; font-size: 11px; font-weight: 700;
  color: var(--bg); background: var(--red); padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}

.yt-search-row { display: flex; gap: 8px; align-items: center; }
.yt-search-row input { flex: 1; }
.btn-yt-search {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer;
  color: var(--text); background: var(--panel2); border: 1px solid var(--border);
  padding: 0 12px; border-radius: 8px; height: 100%;
}
.btn-yt-search:hover { border-color: var(--accent); color: var(--accent); }

.progress-wrap { margin-top: 10px; background: var(--panel2); border-radius: 20px; height: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); width: 0%; transition: width .3s; }
.progress-label { font-size: 11px; color: var(--text2); margin-top: 4px; }

.unit-toggle-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.unit-toggle-btn {
  background: var(--panel2); color: var(--text2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.unit-toggle-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.hint-note { font-size: 12px; color: var(--text2); font-style: italic; margin-top: 20px; text-align: center; }

.rpe-tempo-note {
  background: var(--panel2); border: 1px solid var(--accent2); border-radius: 10px;
  padding: 10px 14px; margin: 20px 0 16px; font-size: 13px; color: var(--text2);
}
.rpe-tempo-note summary { color: var(--accent); font-weight: 600; cursor: pointer; }
.rpe-tempo-note p { margin: 8px 0 0; line-height: 1.5; }
.rpe-tempo-note strong { color: var(--text); }

.vol-chart-card { padding: 18px 16px 14px; }
.vol-chart {
  display: flex; align-items: flex-end; gap: 6px; height: 190px;
  overflow-x: auto; padding-bottom: 4px;
}
.vol-bar-col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  flex: 1 0 28px; min-width: 28px; height: 100%;
}
.vol-bar-track {
  width: 100%; height: 140px; display: flex; align-items: flex-end;
  background: var(--panel2); border-radius: 4px; overflow: hidden;
}
.vol-bar { width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; transition: height .3s; }
.vol-bar.load { background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.vol-bar.deload { background: var(--orange); }
.vol-bar-label { font-size: 10px; font-weight: 700; color: var(--text2); margin-top: 6px; }
.vol-legend-swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle;
}
.vol-legend-swatch.load { background: var(--accent); }
.vol-legend-swatch.deload { background: var(--orange); }
.vol-legend-swatch.current { background: none; border: 2px solid var(--green); }

.vol-bar-col-current .vol-bar-track { background: var(--green-tint); box-shadow: inset 0 0 0 2px var(--green); }
.vol-bar-col-current .vol-bar-label { color: var(--green); }

.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }

.client-tab-row { display: flex; gap: 6px; margin: 14px 0 22px; flex-wrap: wrap; }
.client-tab {
  padding: 8px 16px; border-radius: 9px; border: 1px solid var(--border); background: var(--entry-bg);
  color: var(--text2); font-size: 13px; font-weight: 700; text-decoration: none;
}
.client-tab:hover { color: var(--text); border-color: var(--accent); }
.client-tab-active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.client-tab-badge {
  display: inline-block; min-width: 16px; padding: 1px 5px; margin-left: 6px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800; text-align: center;
}

.hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }

.stat-row { display: flex; gap: 32px; flex-wrap: wrap; }

.wiz-progress { display: flex; gap: 8px; margin: 14px 0 20px; flex-wrap: wrap; }
.wiz-dot {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; text-decoration: none;
  background: var(--entry-bg); color: var(--text2); border: 1px solid var(--border);
}
.wiz-dot:hover { border-color: var(--accent); color: var(--text); }
.wiz-dot-active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.wiz-dot-done { background: var(--panel2); color: var(--green); border-color: var(--green); }
.wiz-instruct {
  font-size: 14px; line-height: 1.6; color: var(--text2); margin: 0 0 16px;
  padding: 12px 14px; background: var(--panel2); border-radius: 10px;
  border-left: 3px solid var(--accent);
}
.wiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; }

.autofill-wrap { position: relative; display: inline-block; }
.autofill-badge {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; text-align: center; line-height: 1.15; padding: 2px;
  background: var(--orange-tint); border: 1px dashed var(--orange); border-radius: 6px;
  color: var(--orange); pointer-events: none; box-sizing: border-box;
}
.autofill-wrap.autofill-active .autofill-badge { display: flex; }
.autofill-wrap.autofill-active .autofill-input { border-color: var(--orange); }
.autofill-inline-badge {
  display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 7px; margin-left: 6px;
  background: var(--orange-tint); border: 1px dashed var(--orange); border-radius: 10px;
  color: var(--orange); vertical-align: middle; text-transform: none; letter-spacing: normal;
}

.scroll-hint-note {
  font-size: 12px; color: var(--accent); text-align: center; margin: 0 0 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.landscape-hint {
  display: none; font-size: 12.5px; color: var(--accent); background: var(--panel2);
  border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; text-align: left;
}
@media (max-width: 700px) and (orientation: portrait) {
  .landscape-hint { display: block; }
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--text2); }

.share-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.share-row:last-child { border-bottom: none; }
.share-row-label { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.share-row-url { font-size: 11.5px; color: var(--text3); margin: 0 0 10px; word-break: break-all; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.share-btn {
  background: var(--entry-bg); color: var(--text2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.share-btn:hover { color: var(--text); border-color: var(--accent); }
.share-btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.send-screen-btn {
  display: block; width: 100%; text-align: center; box-sizing: border-box;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--on-accent); border: none; padding: 13px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 800; letter-spacing: .2px; cursor: pointer;
  box-shadow: 0 3px 12px var(--accent-glow);
}
.send-screen-btn:hover { filter: brightness(1.08); box-shadow: 0 4px 16px var(--accent-glow-hover); }

.qr-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.qr-modal-overlay.qr-modal-open { display: flex; }
.qr-modal-box {
  background: #fff; border-radius: 14px; padding: 24px; max-width: 320px; width: 100%;
  text-align: center; position: relative;
}
.qr-modal-img { width: 100%; height: auto; display: block; }
.qr-modal-close {
  position: absolute; top: 8px; right: 10px; background: none; border: none;
  font-size: 22px; line-height: 1; color: #333; cursor: pointer; padding: 4px;
}
.qr-modal-caption { font-size: 12px; color: #555; margin-top: 12px; word-break: break-all; }

.timer-clickable {
  font-family: inherit; text-align: left; cursor: pointer;
}
button.badge.timer-clickable {
  border: none; padding: 7px 10px; -webkit-tap-highlight-color: transparent;
}
button.ex-presc.timer-clickable {
  background: none; border: none; padding: 6px 4px; margin: -6px -4px; font-size: 13px;
  color: var(--text2); -webkit-tap-highlight-color: transparent;
}
.timer-clickable:hover, .timer-clickable:active { filter: brightness(1.3); }
.timer-trigger-icon { margin-left: 5px; opacity: .85; }
.timer-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.timer-modal-overlay.timer-modal-open { display: flex; }
.timer-modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px;
  max-width: 300px; width: 100%; text-align: center; position: relative;
}
.timer-modal-close {
  position: absolute; top: 8px; right: 10px; background: none; border: none;
  font-size: 22px; line-height: 1; color: var(--text2); cursor: pointer; padding: 4px;
}
.timer-modal-label { font-size: 13px; color: var(--text2); margin: 0 0 8px; text-transform: capitalize; }
.timer-display { font-size: 48px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin: 0 0 8px; }
.timer-modal-hint { font-size: 11px; color: var(--text2); margin: 0 0 16px; }
.timer-controls { display: flex; gap: 10px; justify-content: center; }
.hub-card {
  display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 10px; text-decoration: none; text-align: center; position: relative;
}
.hub-card:hover { border-color: var(--accent); }
.hub-card-icon { font-size: 22px; margin-bottom: 6px; }
.hub-card-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 4px; line-height: 1.25; }
.hub-card-desc { font-size: 11px; color: var(--text2); line-height: 1.35; margin: 0; }
@media (max-width: 720px) {
  .hub-card { padding: 12px 6px; }
  .hub-card-icon { font-size: 20px; margin-bottom: 4px; }
  .hub-card-desc { display: none; }
}
.section-hdr {
  font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--accent2); margin: 26px 0 8px;
}
.section-hdr[class*="section-c"] {
  border-left: 3px solid; padding-left: 10px; margin-left: -13px;
}

.collapsible-section { margin: 26px 0 8px; }
.collapsible-section > summary.section-hdr {
  margin: 0; cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 7px;
}
.collapsible-section > summary.section-hdr::-webkit-details-marker { display: none; }
.collapsible-section > summary.section-hdr::before {
  content: '\25B8'; display: inline-block; font-size: 10px; transition: transform .15s ease;
}
.collapsible-section[open] > summary.section-hdr::before { transform: rotate(90deg); }
.collapsible-section > summary.section-hdr:hover { filter: brightness(1.3); }
.collapsible-section > summary.section-hdr ~ * { margin-top: 10px; }
.card-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
/* Generic color-only utilities — .section-hdr and .periodisation-card
   each define their own border/padding layout above/below; these just
   supply which of the 8 decorative hues to use. Purely visual, no
   semantic meaning (unlike red/orange/green elsewhere in this file). */
.section-c1 { border-left-color: var(--sc1) !important; color: var(--sc1) !important; }
.section-c2 { border-left-color: var(--sc2) !important; color: var(--sc2) !important; }
.section-c3 { border-left-color: var(--sc3) !important; color: var(--sc3) !important; }
.section-c4 { border-left-color: var(--sc4) !important; color: var(--sc4) !important; }
.section-c5 { border-left-color: var(--sc5) !important; color: var(--sc5) !important; }
.section-c6 { border-left-color: var(--sc6) !important; color: var(--sc6) !important; }
.section-c7 { border-left-color: var(--sc7) !important; color: var(--sc7) !important; }
.section-c8 { border-left-color: var(--sc8) !important; color: var(--sc8) !important; }

/* A select's border wraps the whole box, not just a left accent edge
   like a section header — these add a full border-color on top of the
   rules just above (which already set the text color), specifically
   when one of those classes ends up on a <select>. Doesn't change how
   the classes behave anywhere else they're already used. */
select.section-c1 { border-color: var(--sc1) !important; }
select.section-c2 { border-color: var(--sc2) !important; }
select.section-c3 { border-color: var(--sc3) !important; }
select.section-c4 { border-color: var(--sc4) !important; }
select.section-c5 { border-color: var(--sc5) !important; }
select.section-c6 { border-color: var(--sc6) !important; }
select.section-c7 { border-color: var(--sc7) !important; }
select.section-c8 { border-color: var(--sc8) !important; }
.form-card { padding: 18px; }
.row2 { display: flex; gap: 14px; }
.row2 .f { flex: 1; min-width: 0; }
.multi-select {
  width: 100%; background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px; font-size: 13px; font-family: inherit;
}
.multi-select option { padding: 4px 6px; }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-cell {
  display: flex; align-items: center; gap: 6px; background: var(--entry-bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 4px 8px;
}
.slot-num { font-size: 10px; font-weight: 700; color: var(--accent2); min-width: 16px; }
.slot-cell select {
  background: transparent; color: var(--text); border: none; font-size: 12px;
  font-family: inherit; max-width: 140px; padding: 3px 0; line-height: normal;
}
.btn-generate { font-size: 15px; padding: 14px 24px; }
.btn-danger-small {
  background: transparent; color: var(--red); border: 1px solid var(--red); border-radius: 7px;
  padding: 5px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.btn-danger-small:hover { background: var(--red); color: var(--bg); }

.admin-banner {
  background: var(--panel2); border: 1px solid var(--accent2); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px;
}
.admin-banner a { color: var(--accent); text-decoration: none; font-weight: 700; }
.admin-banner a:hover { text-decoration: underline; }
.admin-banner span { color: var(--text2); }
.draft-banner { border-color: var(--orange); }
.draft-banner span { color: var(--orange); font-weight: 700; }

/* ── Plan tiers (account page) ── */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.plan-option {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
}
.plan-option.plan-current { border-color: var(--accent); }
.plan-name { font-weight: 700; font-size: 14px; color: var(--accent); }
.plan-price { font-size: 18px; font-weight: 700; }
.plan-desc { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.plan-select {
  background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 6px; font-size: 12px;
}
.plan-select option { background: var(--entry-bg); color: var(--text); }

/* ── Performance log (client program page) ── */
.log-details { margin-top: 7px; }
.log-summary {
  list-style: none; cursor: pointer; font-size: 11.5px; color: var(--accent);
  font-weight: 600;
}
.log-summary::-webkit-details-marker { display: none; }
.log-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.log-value { width: 110px; }
.log-note { flex: 1; min-width: 140px; }
.log-value, .log-note {
  background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 9px; font-size: 13px;
}
.log-saved { font-size: 12px; color: var(--green, #43d6a0); font-weight: 700; }

.inline-edit-input, .inline-edit-select {
  background: var(--entry-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 4px; font-size: 13px;
}
.inline-edit-input:focus, .inline-edit-select:focus { border-color: var(--accent); outline: none; }
.inline-edit-select option { background: var(--entry-bg); color: var(--text); }
.group-inline-input, .rpe-inline-input { width: 52px; text-align: center; }
.sets-inline-input, .value-inline-input { width: 66px; text-align: center; }
.inline-edit-saved {
  display: none; color: var(--green, #43d6a0); font-weight: 700; font-size: 12px; margin-left: 6px;
}

/* ── Help page ── */
.help-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 13px; }
.help-steps li { font-size: 14px; line-height: 1.6; }
.help-map { margin: 0; }
.help-map dt { font-weight: 700; color: var(--accent); font-size: 14px; margin-top: 13px; }
.help-map dt:first-child { margin-top: 0; }
.help-map dd { margin: 3px 0 0 0; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.help-tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.help-tips li { font-size: 14px; line-height: 1.6; }
