/* © Pybox 2026 — All rights reserved */

/* Self-hosted Poppins 700 (latin subset). Was loaded from fonts.googleapis.com
   which leaked visitor IP+UA to Google on every page; Google isn't on our
   subprocessor list. */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/poppins-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --blue:        #5AB4E5;
  --blue-dark:   #3a9fd4;
  --black:       #1c1c1c;
  --grey-dark:   #333333;
  --grey-mid:    #888888;
  --grey-light:  #e8e8e8;
  --white:       #ffffff;
  --bg:          #f5f5f5;
  --issue-open:   #1a7f37;
  --issue-closed: #8250df;

  --font: system-ui, -apple-system, sans-serif;
  --radius: 6px;
}

[data-theme="dark"] {
  --blue:        #E8533A;
  --blue-dark:   #c94430;
  --black:       #e8e8e8;
  --grey-dark:   #bbbbbb;
  --grey-mid:    #777777;
  --grey-light:  #2a2a2a;
  --white:       #1e1e1e;
  --bg:          #111111;
  --issue-open:   #4caf72;
  --issue-closed: #a78bfa;
}
[data-theme="dark"] .level--beginner,
[data-theme="dark"] .level--fundamental  { background: #0d2a40; color: #7db8e0; }
[data-theme="dark"] .level--intermediate { background: #2e1f00; color: #c89040; }
[data-theme="dark"] .level--advanced     { background: #2e0a0a; color: #d06060; }
[data-theme="dark"] .level--random       { background: #1e0a30; color: #a06ad0; }
[data-theme="dark"] .issue-badge--closed { background: #2a1a50; color: #b09afa; }
[data-theme="dark"] .program-sidebar-status--session { background: #0d2a1a; color: #5cb87c; }
[data-theme="dark"] .program-sidebar-status--rest    { background: #2e2000; color: #c8a040; }
[data-theme="dark"] .program-sidebar-status--custom  { background: #0d1e30; color: #6ea8d8; }
[data-theme="dark"] .cal-slot--done   { background: #196127; }
[data-theme="dark"] .cal-slot--rest   { background: #2e2000; color: #c8a040; }
[data-theme="dark"] .cal-slot--custom { background: #0d1e30; color: #6ea8d8; }

/* ── Dark mode toggle ───────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--grey-light);
  background: var(--white);
  color: var(--black);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: border-color 0.15s;
  z-index: 100;
}
.theme-toggle:hover { border-color: var(--blue); }

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Theme toggle is now instant — the previous universal 1s transition
   made every colour/background change perceptibly slow, including the
   partner-instruction Boxer A/B labels recolouring on dark-mode flip. */

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
}
.header-left { display: flex; align-items: center; gap: 1.5rem; }
.logo-link { display: flex; align-items: center; gap: 0.1rem; text-decoration: none; }
.logo { height: 80px; width: auto; }
.logo-wordmark {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--black);
  letter-spacing: -0.01em;
}
.version-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--grey-mid);
  margin-left: 0.5rem;
  letter-spacing: 0.03em;
}
.about-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--grey-mid);
  text-decoration: none;
  transition: color 0.15s;
}
.about-link:hover { color: var(--blue); }

.site-nav { display: flex; gap: 1.5rem; }
.nav-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--black);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.nav-link:hover { color: var(--blue); border-color: var(--blue); }
.nav-link--disabled { color: var(--grey-mid); pointer-events: none; }
.nav-link--suspended { color: var(--grey-mid); opacity: 0.5; cursor: not-allowed; }
.nav-link--suspended:hover { color: var(--grey-mid); }
.nav-link--locked {
  color: var(--grey-mid);
  cursor: default;
  position: relative;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0;
}
.nav-link--locked:hover { color: var(--grey-mid); border-color: transparent; }
.nav-gym-badge {
  font-weight: 700;
  color: #b8860b;
  text-decoration: none;
  margin-right: 1rem;
  padding-right: 1rem;
  border-right: 1px solid var(--grey-light);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.nav-gym-badge:hover { color: #daa520; }
[data-theme="dark"] .nav-gym-badge { color: #daa520; }
[data-theme="dark"] .nav-gym-badge:hover { color: #ffd700; }
.nav-link--logout {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  font-size: inherit;
  cursor: pointer;
  color: var(--grey-mid);
  padding: 0.25rem 0;
  transition: border-color 0.15s, color 0.15s;
}
.nav-link--logout:hover { color: #d32f2f; border-color: #d32f2f; }
.footer-user { font-size: 0.75rem; color: var(--grey-mid); margin-top: 0.25rem; }

/* ── Main ───────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--grey-mid);
  border-top: 1px solid var(--grey-light);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}
.btn--primary  { background: var(--blue); color: var(--white); }
.btn--primary:hover  { background: var(--blue-dark); }
.btn--secondary { background: var(--grey-light); color: var(--black); }
.btn--secondary:hover { background: #d8d8d8; }
.btn--disabled { opacity: 0.45; pointer-events: none; }

/* ── Hero (home page) ───────────────────────────────────────── */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 860px;
  margin: 3rem auto;
  padding: 0 1rem;
}
@media (max-width: 640px) { .dashboard { grid-template-columns: 1fr; } }
.dashboard-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--black);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dashboard-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.dashboard-card-badge { display: inline-block; background: #dc3545; color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; margin-left: 0.25rem; vertical-align: middle; }
.dashboard-card--soon { opacity: 0.5; cursor: pointer; }
.dashboard-card--soon:hover { opacity: 0.65; }
.dashboard-card--locked {
  opacity: 0.5;
  cursor: pointer;
  position: relative;
}
.dashboard-card--locked:hover { opacity: 0.65; }
.dashboard-card--gym { border-left: 4px solid var(--gym-color, #b8860b); }
.dashboard-card--gym:hover { border-color: var(--gym-color, #b8860b); box-shadow: 0 2px 12px color-mix(in srgb, var(--gym-color, #b8860b) 20%, transparent); }
.dashboard-card--faded { opacity: 0.45; }
.dashboard-card--faded:hover { opacity: 0.75; }
.dashboard-card-icon { font-size: 1.75rem; }
.dashboard-card h2 { font-size: 1.1rem; margin: 0; }
.dashboard-card p { font-size: 0.85rem; color: var(--grey-mid); line-height: 1.5; margin: 0; }

/* ── Page header ────────────────────────────────────────────── */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.page-header p  { color: var(--grey-dark); }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Session form ───────────────────────────────────────────── */
.session-form { display: flex; flex-direction: column; gap: 2rem; max-width: 640px; }

.form-step { display: flex; flex-direction: column; gap: 1rem; }
.step-title { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-mid); }

/* Session type cards */
.session-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.session-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--grey-light);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.session-card:hover { border-color: var(--blue); }
.session-card.selected,
.session-card:has(input:checked) { border-color: var(--blue); background: var(--grey-light); }
.session-card input[type="radio"] { display: none; }
.card-key { font-size: 1.2rem; font-weight: 700; color: var(--blue); min-width: 1.5rem; }
.card-name { font-weight: 600; flex: 1; }
.card-info { font-size: 0.8rem; color: var(--grey-mid); }

/* Partner drill summary panel */
.partner-selected { padding: 0.85rem 1rem; border: 1px solid var(--blue); border-left: 4px solid var(--blue); border-radius: var(--radius); background: var(--white); }
[data-theme="dark"] .partner-selected { background: var(--card-bg, #1e1e1e); }
.partner-selected-name { font-weight: 700; font-size: 1rem; }
.partner-selected-meta { font-size: 0.82rem; color: var(--grey-mid); margin-top: 0.2rem; }

/* Round count buttons */
.round-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.round-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--grey-light);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s;
  min-width: 90px;
}
.round-btn:hover { border-color: var(--blue); }
.round-btn.active { border-color: var(--blue); background: var(--grey-light); }
.round-btn-count { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.round-btn-label { font-size: 0.75rem; color: var(--grey-mid); margin-top: 0.2rem; }

/* Timer step */
.timer-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.timer-group { display: flex; flex-direction: column; gap: 0.5rem; }
.timer-label { font-weight: 600; font-size: 0.9rem; }
.timer-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.timer-btn {
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--grey-light);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.timer-btn:hover { border-color: var(--blue); }
.timer-btn.active { border-color: var(--blue); background: var(--grey-light); }

.btn-text {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  align-self: flex-start;
}
.btn-text:hover { color: var(--blue-dark); }

.advanced-timer { display: flex; flex-direction: column; gap: 0.75rem; }
.advanced-timer-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.advanced-timer-row .form-group { flex: 1; min-width: 140px; }
#advanced-error { color: #c0392b; }

/* Difficulty selects */
.difficulty-rows { display: flex; flex-direction: column; gap: 1rem; }
.difficulty-row { display: flex; flex-direction: column; gap: 0.3rem; }
.difficulty-row label { font-weight: 600; font-size: 0.9rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  transition: border-color 0.15s;
}
.form-control:focus    { outline: none; border-color: var(--blue); }
.form-control:disabled { opacity: 0.4; cursor: not-allowed; background: var(--grey-light); }

.field-hint       { font-size: 0.8rem; color: var(--grey-mid); }
.field-hint--error { color: #d32f2f; font-weight: 600; }

/* ── Session output ─────────────────────────────────────────── */
.session-meta { color: var(--grey-dark); font-size: 0.9rem; margin-top: 0.3rem; }

.sub-structure { margin-bottom: 2.5rem; }

.sub-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.sub-index { font-weight: 700; font-size: 1rem; }
.sub-level {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--grey-light);
  color: var(--grey-dark);
}
.level--beginner     { background: #e8f5ff; color: #2a7ab5; }
.level--fundamental  { background: #e8f5ff; color: #2a7ab5; }
.level--intermediate { background: #fff4e0; color: #a06010; }
.level--advanced     { background: #fff0f0; color: #a02020; }
.level--random       { background: #f0e8ff; color: #6020a0; }

.passive-focus-badge {
  font-size: 0.82rem;
  color: #b03000;
  font-style: italic;
}

.round-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.round-table th {
  background: var(--black);
  color: var(--white);
  padding: 0.5rem 0.9rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.round-table td {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--grey-light);
  vertical-align: middle;
}
.round-table tbody tr:last-child td { border-bottom: none; }
.round-table tbody tr:hover { background: var(--grey-light); }

.col-round { color: var(--grey-mid); font-size: 0.85rem; width: 3rem; }
.col-entry strong { font-weight: 700; }
.col-focus { color: #b03000; font-style: italic; }
.row--active td { background: var(--grey-light) !important; }
.row--active .col-entry strong { color: var(--blue); }

.btn--sm  { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
.btn--full { width: 100%; text-align: center; }

/* ── Save dialog ────────────────────────────────────────────── */
.save-dialog {
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 2rem;
  min-width: 340px;
  max-width: 520px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  margin: auto;
  background: var(--white);
}
.save-dialog::backdrop { background: rgba(0,0,0,0.4); }
[data-theme="dark"] .save-dialog { background: var(--card-bg, #1e1e1e); border-color: #333; }
.dialog-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.2rem; }
.dialog-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

/* ── Saved sessions table ───────────────────────────────────── */
.empty-state { color: var(--grey-mid); font-style: italic; margin-top: 1rem; }

.saved-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.saved-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--white);
}
.saved-table th {
  background: var(--black);
  color: var(--white);
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.saved-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--grey-light);
  vertical-align: middle;
  white-space: nowrap;
}
.saved-name { white-space: normal; min-width: 140px; }
.saved-table tbody tr:last-child td { border-bottom: none; }
.saved-table tbody tr:hover { background: var(--grey-light); }

.saved-name a { font-weight: 600; color: var(--black); text-decoration: none; }
.saved-name a:hover { color: var(--blue); }
.row--timer { background: var(--grey-light); }
.row--timer:hover { background: var(--grey-light) !important; }
.kind-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.kind-badge--session { background: #1c1c1c; color: #fff; }
.kind-badge--timer   { background: #5AB4E5; color: #fff; }
.saved-subtype { font-size: 0.85rem; vertical-align: middle; }
.saved-date  { font-size: 0.82rem; color: var(--grey-mid); white-space: nowrap; }
.saved-timer { font-size: 0.82rem; color: var(--grey-mid); }
.saved-record-meta { font-size: 0.82rem; color: var(--grey-mid); margin-top: 0.2rem; }

.saved-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: nowrap; }

.rating-form  { display: flex; align-items: center; gap: 0.35rem; }
.rating-input {
  width: 3.2rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  text-align: center;
}
.rating-input:focus { outline: none; border-color: var(--blue); }
.btn-icon {
  background: none;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--grey-dark);
  transition: border-color 0.15s, color 0.15s;
}
.btn-icon:hover { border-color: var(--blue); color: var(--blue); }

.btn--danger { background: #e74c3c; color: var(--white); }
.btn--danger:hover { background: #c0392b; }
.btn--gold   { background: #d4a017; color: var(--white); }
.btn--gold:hover { background: #b8860b; }

/* ── Session split layout ───────────────────────────────────── */
.body--session {
  height: 100vh;      /* lock to viewport — makes the flex chain bounded */
  overflow: hidden;   /* prevent document-level scroll */
}

.main-content--wide { max-width: 1600px; }
.main-content--full {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.session-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* Panel visibility modes */
.layout--both   .panel-overview,
.layout--both   .panel-timer   { flex: 1; display: flex; }
.layout--timer  .panel-overview { display: none !important; }
.layout--timer  .panel-timer    { flex: 1; }
.layout--session .panel-timer   { display: none !important; }
.layout--session .panel-overview { flex: 1; }

/* Timer-only: instructions left, circle right */
.layout--timer .panel-timer {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4rem;
}
.layout--timer .timer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.layout--timer .round-instructions {
  align-items: flex-start;
  text-align: left;
  max-width: 340px;
}
.layout--timer .instr-steps       { justify-content: flex-start; font-size: 1.4rem; }
.layout--timer .instr-step        { padding: 0.35rem 0.8rem; }
.layout--timer .timer-circle-wrap { width: 520px; height: 520px; }
.layout--timer .timer-time        { font-size: 8rem; }
.layout--timer .timer-state       { font-size: 2rem; }
.layout--timer .timer-round-label { font-size: 1.6rem; }

/* Session-only: centre with breathing room */
.layout--session .panel-overview { max-width: 960px; margin: 0 auto; padding: 2rem 3rem; }

.panel {
  overflow-y: auto;
  min-width: 0;
  min-height: 0;
}

.panel-overview {
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--grey-light);
  gap: 0;
}

.panel-timer {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 1rem;
  background: var(--white);
}

/* Overview header */
.overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.overview-title { font-size: 1.4rem; font-weight: 700; }
.overview-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Circular timer ─────────────────────────────────────────── */
.timer-round-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--grey-mid);
  letter-spacing: 0.05em;
}

.timer-circle-wrap {
  position: relative;
  width: 420px;
  height: 420px;
  flex-shrink: 0;
}

.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring-bg {
  fill: none;
  stroke: var(--grey-light);
  stroke-width: 12;
}
.timer-ring-fill {
  fill: transparent;
  transition: fill 0.8s ease;
}
.timer-ring-fg {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 753.98;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s;
}
.timer-ring-round  { stroke: var(--blue); }
.timer-ring-rest   { stroke: #e8a020; }
.timer-ring-done   { stroke: #2ecc71; }
.timer-ring-idle   { stroke: var(--grey-light); }
.timer-ring-warmup   { stroke: var(--blue-dark); }
.timer-ring-cooldown { stroke: var(--blue-dark); }

.timer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

/* Mobile-only mirror of the round counter (rendered inside the circle).
   Default: hidden on desktop — the existing .timer-round-label above the
   circle stays in place. Shown by the mobile media query below. */
.timer-overlay-round { display: none; }

/* Mobile-only session-name banner injected into the timer block. Default
   hidden on desktop where .overview-title / .page-header h1 carry the name. */
.timer-block-title { display: none; }
.timer-time {
  font-size: 6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer-time--warn { color: #d32f2f; }
.timer-state {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--grey-mid);
}

/* ── Timer main group (label + circle + controls) ───────────── */
.timer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
/* In both-panel mode keep instructions below the circle */
.layout--both .round-instructions { order: 1; }

/* ── Round instructions ─────────────────────────────────────── */
.round-instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-height: 3.5rem;
  text-align: center;
  max-width: 380px;
}
.instr-focus {
  font-size: 0.82rem;
  color: #b03000;
  font-style: italic;
  min-height: 1em;
}
.instr-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  font-size: 1rem;
}
.instr-step {
  font-weight: 700;
  background: var(--grey-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
}
.instr-sep   { color: var(--grey-mid); font-size: 0.8rem; }
.instr-rest   { color: #e8a020; font-weight: 700; font-size: 1.1rem; letter-spacing: 0.05em; }
.instr-warmup { color: var(--blue-dark); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.05em; }
.instr-done  { color: #2ecc71; font-weight: 700; font-size: 1.1rem; letter-spacing: 0.05em; }

/* ── Timer controls ─────────────────────────────────────────── */
.timer-controls { display: flex; gap: 0.75rem; }

/* ── Panel toggle bar ───────────────────────────────────────── */
.panel-toggle-bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--grey-light);
  background: var(--white);
}
.toggle-btn {
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--grey-light);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--grey-dark);
}
.toggle-btn:hover  { border-color: var(--blue); color: var(--blue); }
.toggle-btn.active { background: var(--blue); border-color: var(--blue); color: var(--white); font-weight: 600; }

/* ── Timer presets ──────────────────────────────────────────── */
.presets-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-mid);
  margin-bottom: 0.4rem;
}
.presets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.presets-table th {
  background: var(--black);
  color: var(--white);
  padding: 0.4rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.presets-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--grey-light);
  vertical-align: middle;
}
.presets-table tbody tr:last-child td { border-bottom: none; }
.presets-table tbody tr:hover { background: var(--grey-light); }
.preset-actions { display: flex; gap: 0.4rem; }
.preset-save-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}
.preset-save-row .form-control { flex: 1; }

/* ── Course session panel (above timer) ────────────────────── */
.course-session-panel { max-width: 720px; margin: 0 auto 1rem; padding: 1rem 1.25rem; background: var(--white); border: 1px solid var(--grey-light); border-radius: var(--radius); border-left: 4px solid var(--blue); }
.course-session-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.course-session-course { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); }
.course-session-title { font-weight: 700; font-size: 1.05rem; color: var(--black); margin-top: 0.15rem; }
.course-session-description { font-size: 0.88rem; line-height: 1.45; color: var(--grey-dark); margin: 0 0 0.75rem; }
.course-session-focus { background: var(--grey-light); border-radius: 6px; padding: 0.6rem 0.85rem; }
.course-session-focus-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); display: block; margin-bottom: 0.3rem; }
.course-session-focus ul { margin: 0; padding-left: 1.2rem; }
.course-session-focus li { font-size: 0.85rem; line-height: 1.5; color: var(--grey-dark); }
.course-session-back { display: inline-block; margin-top: 0.75rem; font-size: 0.78rem; color: var(--blue); text-decoration: none; }
.course-session-back:hover { text-decoration: underline; }
[data-theme="dark"] .course-session-panel { background: var(--card-bg, #1e1e1e); }
[data-theme="dark"] .course-session-focus { background: rgba(255,255,255,0.05); }

/* ── Standalone timer page ──────────────────────────────────── */
.standalone-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 2rem;
}
.timer-area {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}
.timer-area .timer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.timer-settings-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  width: 100%;
  max-width: 680px;
}
.timer-settings-row .form-group { flex: 1; min-width: 140px; }
.timer-options-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 520px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] { cursor: pointer; }

/* ── Warmup ─────────────────────────────────────────────────── */
.warmup-row { display: flex; align-items: center; gap: 1.5rem; margin: 1rem 0 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; }
.warmup-options { margin: 0; }
.warmup-note { font-size: 0.875rem; color: var(--grey-mid); margin-top: 0.4rem; }

/* ── Up next ────────────────────────────────────────────────── */
.up-next {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--grey-light);
  opacity: 0.7;
}
.up-next-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--grey-mid);
  margin-bottom: 0.35rem;
}

/* ── About ──────────────────────────────────────────────────── */
.about-hero { max-width: 680px; margin-bottom: 2.5rem; }
.about-hero h1 { font-size: 2rem; margin-bottom: 1rem; }
.about-intro { color: var(--grey-dark); line-height: 1.7; margin-bottom: 0.75rem; }
.about-divider { border: none; border-top: 1px solid var(--grey-light); margin: 2rem 0; }
.about-section h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }
.disclaimer-block { max-width: 720px; margin-bottom: 1.5rem; }
.disclaimer-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--black); }
.disclaimer-text { font-size: 0.82rem; color: var(--grey-mid); line-height: 1.7; }

/* ── Boxers ─────────────────────────────────────────────────── */
.boxer-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.boxer-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.boxer-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--grey-light);
}
.boxer-info { flex: 1; }
.boxer-name-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.2rem; }
.boxer-name-row h3 { font-size: 1rem; margin: 0; }
.verified-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  background: var(--blue);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
  letter-spacing: 0.02em;
}
.boxer-meta { font-size: 0.8rem; color: var(--grey-mid); margin-bottom: 0.2rem; }
.boxer-record { font-size: 0.82rem; font-weight: 600; color: var(--black); margin-bottom: 0.5rem; }
.boxer-bio { font-size: 0.875rem; color: var(--grey-dark); line-height: 1.6; margin-bottom: 0.75rem; }
.boxer-testimonial {
  margin: 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--blue);
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--grey-dark);
  line-height: 1.6;
}

.research-section { max-width: 720px; margin-bottom: 0.5rem; }
.research-section h2 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.research-body { color: var(--grey-dark); line-height: 1.7; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.team-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--grey-light);
  margin-bottom: 1rem;
}
.team-card h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.team-role { font-size: 0.8rem; color: var(--blue); font-weight: 600; margin-bottom: 0.6rem; }
.team-bio { font-size: 0.875rem; color: var(--grey-dark); line-height: 1.6; }

/* ── Login ──────────────────────────────────────────────────── */
.login-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  margin: 4rem auto 0;
}
.login-card h1 { margin-bottom: 1.25rem; font-size: 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.btn--full { width: 100%; text-align: center; }

/* ── Pricing ─────────────────────────────────────────────────── */
.pricing-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  margin: 4rem auto 0;
  text-align: center;
}
.pricing-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.pricing-sub { font-size: 0.85rem; color: var(--grey-mid); margin-bottom: 1.75rem; }
.pricing-amount { margin-bottom: 1.75rem; line-height: 1; }
.pricing-currency { font-size: 1.5rem; vertical-align: super; color: var(--grey-dark); }
.pricing-price { font-size: 3.5rem; font-weight: 700; color: var(--black); }
.pricing-period { font-size: 1rem; color: var(--grey-mid); }
.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pricing-features li { font-size: 0.9rem; color: var(--grey-dark); }
.pricing-features li::before { content: "✓ "; color: var(--blue); font-weight: 700; }
.pricing-full { color: var(--grey-mid); font-size: 0.9rem; margin-bottom: 1rem; }
.pricing-login { font-size: 0.8rem; color: var(--grey-mid); margin-top: 1rem; }
.pricing-login a { color: var(--blue); }
.pricing-disclaimer {
  max-width: 420px;
  margin: 1.5rem auto 2rem;
  text-align: center;
}

/* ── Subscribe result ───────────────────────────────────────── */
.subscribe-result {
  max-width: 480px;
  margin: 5rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.subscribe-result h1 { font-size: 2rem; }
.subscribe-result p { color: var(--grey-mid); }

/* ── Pricing grid (three tiers) ─────────────────────────────── */
.pricing-page { max-width: 960px; margin: 3rem auto; padding: 0 1rem; }
.pricing-heading { text-align: center; font-size: 2rem; margin-bottom: 0.25rem; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0 2rem;
}
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-grid--two { grid-template-columns: repeat(2, 1fr); max-width: 640px; margin-left: auto; margin-right: auto; }
@media (max-width: 720px) { .pricing-grid--two { grid-template-columns: 1fr; } }
.pricing-grid--three { grid-template-columns: repeat(3, 1fr); max-width: 960px; margin-left: auto; margin-right: auto; }
@media (max-width: 720px) { .pricing-grid--three { grid-template-columns: 1fr; } }
.pricing-grid .pricing-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: none;
  margin: 0;
  min-width: 0;
}
.pricing-card h2 { font-size: 1.25rem; margin: 0; }
.pricing-card--featured {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue);
  position: relative;
}
.pricing-card--soon { opacity: 0.6; }
.pricing-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pricing-price--soon { font-size: 1.1rem; color: var(--grey-mid); }
.pricing-setup-fee { font-size: 0.78rem; color: var(--grey-mid); margin: -0.25rem 0 0.75rem; font-style: italic; }

/* ── Admin panel ────────────────────────────────────────────── */
.admin-page { margin: 0 auto; }
.admin-page h1 { margin-bottom: 1.5rem; }
.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--grey-mid); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 2px solid var(--grey-light); color: var(--grey-mid); font-weight: 600; }
.admin-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--grey-light); vertical-align: middle; }
.admin-table tr.row--inactive td { color: var(--grey-mid); }
.admin-select { font-size: 0.8rem; border: 1px solid var(--grey-light); border-radius: var(--radius); padding: 0.2rem 0.4rem; background: var(--white); cursor: pointer; }
.admin-actions { white-space: nowrap; }
.admin-actions form { display: inline-block; }

/* Small inline status pills (admin promotions, etc.) */
.badge { display: inline-block; padding: 0.1rem 0.5rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 3px; }
.badge--success { background: #dafbe1; color: #1a7f37; }
.badge--muted { background: var(--grey-light); color: var(--grey-mid); }
[data-theme="dark"] .badge--success { background: rgba(46, 160, 67, 0.18); color: #4ac26b; }
[data-theme="dark"] .badge--muted { background: rgba(255,255,255,0.06); color: #aaa; }

/* Admin sub-nav */
.admin-subnav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--grey-light);
}
.admin-subnav-link {
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: var(--grey-mid);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.12s;
}
.admin-subnav-link:hover { color: var(--text); }
.admin-subnav-link--active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Admin dashboard stat cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat-card {
  display: block;
  padding: 1.25rem;
  background: var(--card-bg, #fff);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s, box-shadow 0.12s;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--blue);
}
.admin-stat-label {
  font-size: 0.75rem;
  color: var(--grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.admin-stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.3rem 0;
}
.signup-tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 960px; }
@media (max-width: 820px) { .signup-tier-grid { grid-template-columns: 1fr; } }
.signup-tier-card { padding: 1rem; border: 1px solid var(--grey-light); border-radius: var(--radius); background: var(--white); display: flex; flex-direction: column; gap: 0.5rem; }
.signup-tier-card--open   { border-left: 4px solid #2ea043; }
.signup-tier-card--closed { border-left: 4px solid #dc3545; }
.signup-tier-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.signup-tier-name { font-weight: 700; font-size: 1rem; }
.signup-tier-status { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; }
.signup-tier-status--open   { color: #2ea043; }
.signup-tier-status--closed { color: #dc3545; }
.signup-tier-hint { font-size: 0.83rem; color: var(--grey-mid); margin: 0; }
.signup-tier-hint code { background: var(--bg, #f5f5f5); padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.9em; }

.admin-stat-sub {
  font-size: 0.82rem;
  color: var(--grey-mid);
}

/* First-letter avatar circle (admin users table) */
.admin-pic-cell {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--grey-light);
  vertical-align: middle;
}
.admin-pic-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--grey-mid);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Gym card preview chip */
.gym-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius);
  border: 2px solid #b8860b;
  font-size: 0.85rem;
}

/* Admin edit dialog */
.admin-dialog {
  border: 1px solid var(--grey-light);
  border-radius: 8px;
  padding: 1.5rem;
  min-width: 400px;
  max-width: 520px;
  background: var(--card-bg, #fff);
  color: var(--text);
}
.admin-dialog::backdrop { background: rgba(0,0,0,0.45); }
.admin-dialog h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.admin-dialog-form { display: flex; flex-direction: column; gap: 0.8rem; }

[data-theme="dark"] .admin-stat-card { background: var(--card-bg, #1e1e1e); }
.admin-stat-card--alert { border-color: #c0392b; background: #fee2e2; }
.admin-stat-card--alert .admin-stat-value { color: #c0392b; }
[data-theme="dark"] .admin-stat-card--alert { background: rgba(220, 53, 69, 0.2); }
[data-theme="dark"] .admin-dialog { background: var(--card-bg, #1e1e1e); }

/* ── Issues ─────────────────────────────────────────────────── */

.issues-page { max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
.issues-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.issues-toolbar h1 { font-size: 1.5rem; }

/* Pinned strip */
.issues-pinned {
  border: 1px solid var(--grey-light);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  background: var(--grey-light);
}
.issues-pinned-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--black);
  border-bottom: 1px solid var(--grey-light);
}
.issues-pinned-row:hover .issue-title { color: var(--blue); }
.issue-icon--pin { color: var(--grey-mid); flex-shrink: 0; }

/* Main list */
.issues-list {
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  background: var(--white);
}
.issues-pinned + .issues-list {
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.issues-list-header {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--grey-light);
  border-bottom: 1px solid var(--grey-light);
}
.issues-tabs { display: flex; gap: 1rem; }
.issues-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-mid);
  text-decoration: none;
  padding: 0.25rem 0;
}
.issues-tab:hover { color: var(--black); }
.issues-tab--active { color: var(--black); font-weight: 700; }
.issues-count {
  background: var(--grey-light);
  color: var(--grey-dark);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
}
.issues-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--grey-light);
  text-decoration: none;
  color: var(--black);
}
.issues-row:last-child { border-bottom: none; }
.issues-row:hover { background: var(--grey-light); }
.issues-row-icon { flex-shrink: 0; padding-top: 2px; }
.issues-row-body { display: flex; flex-direction: column; gap: 0.2rem; }
.issue-title { font-size: 0.9rem; font-weight: 600; }
.issues-row:hover .issue-title { color: var(--blue); }
.issue-meta { font-size: 0.75rem; color: var(--grey-mid); }
.issues-empty { padding: 2rem 1rem; text-align: center; color: var(--grey-mid); font-size: 0.9rem; }

/* New issue page */
.issue-new-page { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
.issue-new-page h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.issue-new-form { display: flex; flex-direction: column; gap: 1rem; }
.issue-new-body { resize: vertical; }
.issue-new-actions { display: flex; justify-content: flex-end; gap: 0.75rem; align-items: center; }

/* Issue detail */
.issue-detail { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
.issue-detail-header { margin-bottom: 1.5rem; }
.issue-detail-header h1 { font-size: 1.5rem; margin: 0.5rem 0 0.25rem; }
.issue-body { font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; background: var(--white); border: 1px solid var(--grey-light); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.issue-badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 99px; margin-right: 0.5rem; }
.issue-badge--open { background: #dafbe1; color: #1a7f37; }
.issue-badge--closed { background: #ede9fe; color: #8250df; }
.pin-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 99px; background: #cce5ff; color: #004085; margin-right: 0.5rem; }
.issue-admin-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.btn--danger { background: #dc3545; color: var(--white); border: 1px solid #dc3545; border-radius: var(--radius); padding: 0.35rem 0.75rem; font-size: 0.8rem; cursor: pointer; }
.btn--danger:hover { background: #c82333; }

/* ── Program builder ─────────────────────────────────────────── */
.program-form { display: flex; flex-direction: column; gap: 2rem; max-width: 860px; }
.program-section-label { font-weight: 700; font-size: 0.9rem; margin: 1.25rem 0 0.5rem; }
.program-section-hint { font-weight: 400; color: var(--grey-mid); font-size: 0.85rem; }
.program-builder-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
.program-builder-table th { background: var(--black); color: var(--white); padding: 0.5rem 0.75rem; text-align: center; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.program-row-label-th { width: 48px; }
.program-builder-table td { padding: 0.4rem; border: 1px solid var(--grey-light); vertical-align: top; }
.program-row-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--grey-mid); letter-spacing: 0.05em; white-space: nowrap; padding: 0.5rem 0.75rem !important; background: var(--bg); text-align: center; }
.program-row-label-inner { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.program-row-color { width: 24px; height: 24px; border: 1px solid var(--grey-light); border-radius: 50%; cursor: pointer; padding: 0; background: transparent; }
.program-row-color::-webkit-color-swatch-wrapper { padding: 0; }
.program-row-color::-webkit-color-swatch { border: none; border-radius: 50%; }
.program-row-color::-moz-color-swatch { border: none; border-radius: 50%; }
.program-cell-input { min-height: 3.5rem; resize: vertical; font-size: 0.85rem; }

/* ── Program active card ─────────────────────────────────────── */
.program-card { background: var(--white); border: 1px solid var(--grey-light); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.program-card--active { border-color: var(--blue); }
.program-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.program-card-title { font-size: 1.1rem; font-weight: 700; }
.program-version-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 3px; background: var(--blue); color: #fff; margin-left: 0.4rem; }
.program-active-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 3px; background: var(--issue-open); color: #fff; margin-left: 0.4rem; }

/* ── Program schedule read grid ──────────────────────────────── */
.program-grid { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.program-grid th { text-align: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey-mid); padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--grey-light); }
.program-grid td { padding: 0.35rem 0.5rem; border: 1px solid var(--grey-light); vertical-align: top; min-width: 80px; }
.program-slot-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--grey-mid); white-space: nowrap; background: var(--bg); text-align: center; }
.program-grid-slot { font-size: 0.82rem; color: var(--grey-dark); white-space: pre-wrap; }
.program-grid-slot--empty { color: var(--grey-mid); }

/* ── Program layout ──────────────────────────────────────────── */
.program-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start; margin-bottom: 2rem; }
@media (max-width: 640px) { .program-layout { grid-template-columns: 1fr; } }

/* ── Program sidebar ─────────────────────────────────────────── */
.program-sidebar { background: var(--white); border: 1px solid var(--grey-light); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.program-sidebar-name { font-size: 0.95rem; font-weight: 700; }
.program-sidebar-today { border-top: 1px solid var(--grey-light); padding-top: 0.85rem; }
.program-sidebar-date { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); margin-bottom: 0.45rem; }
.program-sidebar-slot { font-size: 0.85rem; color: var(--grey-dark); margin-bottom: 0.25rem; line-height: 1.4; }
.program-sidebar-ampm { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--grey-mid); letter-spacing: 0.05em; margin-right: 0.3rem; }
.program-sidebar-noschd { font-size: 0.82rem; color: var(--grey-mid); }
.program-sidebar-status { font-size: 0.8rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: var(--radius); margin-bottom: 0.35rem; }
.program-sidebar-status--session  { background: #dafbe1; color: #1a7f37; }
.program-sidebar-status--rest     { background: #fff3cd; color: #856404; }
.program-sidebar-status--custom   { background: #cce5ff; color: #004085; }
.program-sidebar-status--untracked { background: var(--grey-light); color: var(--grey-mid); }
.program-sidebar-status--missed    { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.program-sidebar-status--cancelled { background: #fde68a; color: #78350f; text-decoration: line-through; }
.cal-tracked-time { color: var(--grey-mid); font-weight: 500; margin-left: 0.4rem; font-size: 0.7rem; }
.program-day-actions { display: flex; flex-direction: column; gap: 0.5rem; border-top: 1px solid var(--grey-light); padding-top: 0.85rem; }
.btn--block { width: 100%; text-align: center; }
.btn--active-slot { opacity: 0.65; text-decoration: line-through; }
.program-custom-panel { display: none; border-top: 1px solid var(--grey-light); padding-top: 0.85rem; }
.program-custom-panel--open { display: block; }
.program-cal-area { min-width: 0; }

/* ── Program calendar ────────────────────────────────────────── */
.program-cal-wrap { margin-bottom: 2rem; }
.program-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.program-cal-title { font-size: 1rem; font-weight: 700; }
.program-cal { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
.program-cal th { background: var(--black); color: var(--white); text-align: center; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.4rem; }
.cal-cell { position: relative; padding: 0; border: 1px solid var(--grey-light); width: calc(100% / 7); height: 5.5rem; vertical-align: top; }
.cal-cell--outside { background: var(--bg); }
.cal-cell--has-schedule { background: var(--grey-light); }
.cal-cell--today { outline: 2px solid var(--blue); outline-offset: -2px; z-index: 1; }
.cal-cell--today .cal-cell-num { color: var(--blue); font-weight: 800; }
.cal-cell--selected { outline: 2px solid var(--black); outline-offset: -2px; z-index: 2; }
.cal-cell--selected.cal-cell--today { outline-color: var(--blue); }
.cal-cell-inner { display: flex; flex-direction: column; height: 100%; padding: 0.2rem 0.25rem 0.2rem; gap: 0.15rem; }
.cal-cell-num { font-size: 0.7rem; font-weight: 600; color: var(--grey-dark); line-height: 1; align-self: flex-start; display: flex; justify-content: space-between; width: 100%; }
.cal-cell-flag { font-size: 0.6rem; color: #d1242f; }
.cal-cell-num--today { color: var(--blue); font-weight: 800; }
.cal-cell-slots { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.cal-slot { font-size: 0.58rem; font-weight: 600; text-align: left; padding: 0.1rem 0.25rem; border-radius: 2px; background: rgba(0,0,0,0.08); color: var(--grey-mid); letter-spacing: 0; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 0.25rem; }
.cal-slot-desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-slot-time { flex-shrink: 0; font-size: 0.55rem; font-weight: 500; opacity: 0.85; }
.cal-slot--done    { background: #2ea043; color: #fff; }
.cal-slot--custom  { background: #cce5ff; color: #004085; }
.cal-slot--rest    { background: #fff3cd; color: #856404; }
.cal-slot--missed   { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.cal-slot--cancelled { background: #fde68a; color: #78350f; text-decoration: line-through; }

/* Import-program dialog uses the standard .save-dialog (centred, dark-mode-aware) */
.import-program-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.import-program-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--grey-light); border-radius: var(--radius);
  background: var(--white);
}
[data-theme="dark"] .import-program-row { background: var(--card-bg, #2a2a2a); }
.import-program-name { font-weight: 600; flex: 1; min-width: 0; }

/* Multi-select on calendar */
.cal-cell--multi { background: rgba(59, 130, 246, 0.18); outline: 2px solid #3b82f6; outline-offset: -2px; z-index: 3; }
.cal-cell--multi.cal-cell--today { outline-color: #3b82f6; }
[data-theme="dark"] .cal-cell--multi { background: rgba(59, 130, 246, 0.3); }
.cal-multiselect-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.85rem; margin-bottom: 0.75rem;
  background: var(--white); border: 1px solid #3b82f6; border-radius: var(--radius);
  position: sticky; top: 0; z-index: 5;
}
[data-theme="dark"] .cal-multiselect-bar { background: var(--card-bg, #1e1e1e); }
.cal-multiselect-label { font-size: 0.85rem; color: var(--grey-mid); }
.cal-multiselect-label strong { color: var(--blue); font-size: 1rem; }
.cal-slot--full { width: 100%; }
.cal-cell[data-date]:hover { opacity: 0.85; }

/* ── Program misc ────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 1rem; }
.alert--error { background: #ffe0e0; color: #c00; border: 1px solid #f5c2c2; }
[data-theme="dark"] .alert--error { background: #2e0a0a; color: #f08080; border-color: #5a1a1a; }
.program-section--coming-soon { opacity: 0.45; border: 2px dashed var(--grey-light); border-radius: var(--radius); padding: 1.25rem 1.5rem; color: var(--grey-mid); font-size: 0.9rem; }
.program-empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--grey-mid); }

/* ── Stats page ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 860px;
  margin: 0 auto 3rem;
}
@media (max-width: 640px) { .stats-grid { grid-template-columns: 1fr; } }

.stats-panel {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}
.stats-panel--soon {
  opacity: 0.45;
  border-style: dashed;
}
.stats-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.stats-panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--black);
}
.stats-panel-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-mid);
  margin: 0;
}
.stats-no-data {
  font-size: 0.85rem;
  color: var(--grey-mid);
  margin: 0;
}
.stats-adherence {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.stats-donut-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.stats-donut { width: 80px; height: 80px; }
.stats-donut-track { stroke: var(--grey-light); }
.stats-donut-fill { stroke: var(--blue); }
.stats-donut-fill--good { stroke: #2ea043; }
.stats-donut-fill--mid  { stroke: #e0a800; }
.stats-donut-fill--low  { stroke: #dc3545; }
.stats-donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-donut-pct {
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
}
.stats-adherence-counts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stats-count-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--black);
}
.stats-count-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stats-count-dot--tracked { background: #2ea043; }
.stats-count-dot--planned { background: var(--grey-light); border: 1px solid var(--grey-mid); }
.stats-count-dot--pending { background: var(--grey-light); border: 1px solid var(--grey-mid); }
.stats-count-dot--missed  { background: #dc3545; }
[data-theme="dark"] .stats-donut-track { stroke: #333; }
[data-theme="dark"] .stats-count-dot--planned { background: #333; border-color: #666; }
[data-theme="dark"] .stats-count-dot--pending { background: #333; border-color: #666; }

/* 3-segment donut for monthly adherence — sized to fit the slim panel
 * column. The base `.stats-donut-wrap` forces height:80px (for the old
 * SVG); we override to height:auto so the matplotlib PNG isn't clipped
 * and doesn't overlap the breakdown table below. */
.stats-donut-wrap--lg { width: 100%; max-width: 220px; height: auto; margin: 0 auto 1rem; position: static; }
.stats-donut--lg { width: 100%; height: auto; }
.stats-donut-seg--tracked { stroke: #2ea043; }
.stats-donut-seg--missed  { stroke: #dc3545; }
.stats-donut-seg--pending { stroke: var(--grey-light); }
[data-theme="dark"] .stats-donut-seg--pending { stroke: #444; }
.stats-donut-wrap--lg .stats-donut-pct { font-size: 1.6rem; }
.stats-donut-sub { display: block; font-size: 0.7rem; color: var(--grey-mid); text-align: center; margin-top: 0.1rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stats-donut-wrap--lg .stats-donut-label { flex-direction: column; }

/* ── Testing & Stats page — adherence + PB row ───────────────── */
/* Two-column row: pie panel pinned narrow on the left, bar chart eats the
 * rest of the width. PB table panel (third child) spans the full row below.
 * Bar chart was getting cramped at 1:1.3 — at 300px : 1fr it actually has
 * room to breathe on a wide screen. */
.testing-stats-row { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 1.5rem; margin-bottom: 2rem; align-items: stretch; }
.testing-stats-row > .stats-panel:nth-child(3) { grid-column: 1 / -1; }
@media (max-width: 900px) { .testing-stats-row { grid-template-columns: 1fr; } .testing-stats-row > .stats-panel:nth-child(3) { grid-column: auto; } }
.testing-stats-panel { min-height: 0; align-items: center; }
/* ── Active minutes panel — wide bar chart + stat strip ──── */
.testing-active-minutes-panel { align-items: stretch; min-width: 0; }
.testing-active-minutes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; width: 100%; margin-bottom: 0.5rem; }
.testing-active-minutes-sub { font-size: 0.82rem; color: var(--grey-mid); margin: 0.15rem 0 0; }

.testing-active-minutes-help {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-light); color: var(--grey-mid);
  font-size: 0.85rem; font-weight: 700; cursor: help; position: relative;
  border: 1px solid transparent; flex-shrink: 0;
}
.testing-active-minutes-help:hover,
.testing-active-minutes-help:focus { background: var(--blue); color: #fff; outline: none; }
.testing-active-minutes-help::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 0.4rem); right: 0;
  background: var(--black); color: #fff;
  font-size: 0.78rem; font-weight: 500; line-height: 1.4;
  letter-spacing: 0; text-transform: none;
  padding: 0.5rem 0.7rem; border-radius: 6px;
  width: 280px; text-align: left;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.1s, transform 0.1s;
  z-index: 10;
}
.testing-active-minutes-help:hover::after,
.testing-active-minutes-help:focus::after { opacity: 1; transform: translateY(0); }

.testing-active-minutes-chart { width: 100%; max-width: 720px; margin: 0.25rem auto 1rem; }
.testing-chart-img { width: 100%; max-width: 100%; height: auto; display: block; }

.testing-active-minutes-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; width: 100%; }
@media (max-width: 820px) { .testing-active-minutes-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .testing-active-minutes-stats { grid-template-columns: 1fr; } }

.testing-stat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.6rem 0.85rem; background: var(--grey-light); border-radius: 6px; border-left: 3px solid var(--blue); }
.testing-stat-card-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); }
.testing-stat-card-value { font-size: 1.4rem; font-weight: 700; color: var(--grey-dark); font-variant-numeric: tabular-nums; line-height: 1.1; }
.testing-stat-card-unit { font-size: 0.7rem; font-weight: 600; color: var(--grey-mid); margin-left: 0.2rem; text-transform: lowercase; }
[data-theme="dark"] .testing-stat-card { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .testing-stat-card-value { color: var(--grey-light); }

.testing-pct--up   { color: #1a7f37; }
.testing-pct--down { color: #c0392b; }
.testing-pct--none { color: var(--grey-mid); }
.testing-stats-month-nav { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.testing-adherence-breakdown { width: 100%; max-width: 280px; border-collapse: collapse; }
.testing-adherence-breakdown td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--grey-light); font-size: 0.88rem; }
.testing-adherence-breakdown td .stats-count-dot { display: inline-block; vertical-align: middle; margin-right: 0.5rem; }
.testing-adherence-breakdown .testing-breakdown-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.testing-adherence-breakdown .testing-breakdown-total td { border-top: 2px solid var(--grey-light); border-bottom: none; padding-top: 0.6rem; font-weight: 700; }
.testing-pb-table { width: 100%; }
.testing-pb-table .testing-pb { font-weight: 600; }

/* Personal bests panel: header bar + filterable records table */
.testing-pb-panel { margin-top: 1.5rem; }
.testing-pb-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.testing-pb-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.testing-record-row--not-pb { display: none; }
.testing-records-show-all .testing-record-row--not-pb { display: table-row; }

/* Add-result dialog — slightly wider than the default 520px to fit the test-type grid */
.testing-add-dialog { max-width: 640px; width: 90vw; }
.testing-add-dialog .testing-type-grid { margin-top: 0.5rem; }

/* ── Testing page ────────────────────────────────────────────── */
.testing-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.testing-type-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--grey-light);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
}
.testing-type-option:has(input:checked) {
  border-color: var(--blue);
  background: rgba(13,110,253,0.06);
  font-weight: 600;
}
.testing-type-option--soon {
  opacity: 0.45;
  cursor: not-allowed;
}
.testing-type-option input { display: none; }
.soon-tag { font-size: 0.68rem; font-style: normal; color: var(--grey-mid); margin-left: 2px; }
.testing-time-input {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.testing-time-part { width: 4rem; text-align: center; }
.testing-time-sep { font-size: 1.2rem; font-weight: 700; color: var(--grey-mid); }

/* Table cells */
.testing-time-cell { font-variant-numeric: tabular-nums; font-weight: 500; }
.testing-pb { color: #2ea043; }
.testing-pb-badge {
  display: inline-block;
  background: #2ea043;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-left: 0.35rem;
  vertical-align: middle;
  letter-spacing: 0.03em;
}
.testing-verified {
  font-size: 1rem;
  color: #2ea043;
  font-weight: 700;
}
.testing-pending {
  font-size: 0.75rem;
  color: #e0a800;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}
.testing-notes-cell {
  font-size: 0.82rem;
  color: var(--grey-mid);
  max-width: 200px;
}
[data-theme="dark"] .testing-type-option:has(input:checked) { background: rgba(13,110,253,0.12); }
[data-theme="dark"] .testing-pending { background: #3a2a00; border-color: #c09000; color: #f0c040; }

/* ── Leaderboard ─────────────────────────────────────────────── */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.leaderboard-card {
  background: var(--card-bg, var(--white));
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.leaderboard-card-title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--grey-light);
}
.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--grey-light);
}
.leaderboard-entry:last-child { border-bottom: none; }
.leaderboard-medal { font-size: 1.3rem; flex-shrink: 0; }
.leaderboard-name  { flex: 1; font-weight: 500; }
.leaderboard-result {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--blue);
}
.leaderboard-result small { font-weight: 400; color: var(--grey-mid); }
.leaderboard-empty {
  color: var(--grey-mid);
  font-size: 0.85rem;
  font-style: italic;
  margin: 0.5rem 0 0;
}
.leaderboard-rank-1 .leaderboard-name { color: #d4a017; }

[data-theme="dark"] .leaderboard-card { background: var(--card-bg, #1e1e1e); }

/* Gym themes — banner on /mygym + cards on the themes admin page */
.gym-theme-banner { margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.gym-theme-row {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, rgba(13,110,253,0.08), rgba(168,85,247,0.06));
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.gym-theme-period { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-mid); font-weight: 700; }
.gym-theme-title  { font-weight: 700; color: var(--text); }
.gym-theme-desc   { color: var(--grey-mid); }
.gym-theme-dates  { margin-left: auto; color: var(--grey-mid); font-size: 0.78rem; }

.theme-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  background: var(--card-bg, #fff);
}
.theme-card--active { border-color: var(--blue); background: linear-gradient(135deg, rgba(13,110,253,0.04), transparent); }
.theme-card-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.theme-card-period { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue); font-weight: 700; }
.theme-card-title { font-weight: 700; }
.theme-card-dates { color: var(--grey-mid); font-size: 0.82rem; }
.theme-card-active { color: #2ea043; font-weight: 700; font-size: 0.72rem; }
.theme-card-desc { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--text); white-space: pre-wrap; }
.theme-card-links { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.82rem; }
.theme-card-meta { margin-top: 0.4rem; font-size: 0.72rem; color: var(--grey-mid); }

[data-theme="dark"] .theme-card { background: var(--card-bg, #1e1e1e); }

/* Personal program — multi-active sidebar + color dots */
.program-color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.program-color-stack { display: inline-flex; gap: 2px; align-items: center; }
.program-sidebar-actives { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.program-sidebar-actives-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); font-weight: 600; }
.program-sidebar-active-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.program-sidebar-active-name { flex: 1; font-weight: 600; }

/* Block pause marker on saved custom sessions */
.block-pause-marker { margin: 0.6rem 0 0; padding: 0.4rem 0.75rem; background: var(--grey-light); color: var(--grey-mid); border-radius: var(--radius); font-size: 0.78rem; font-style: italic; text-align: center; }

/* ── Custom session builder (gymgen/custom.html) ───────────── */
.custom-builder { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.custom-warmup-section { padding: 1rem 1.25rem; border: 1px solid var(--grey-light); border-radius: var(--radius); background: var(--card-bg, #fff); }
.custom-warmup-fields { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.custom-warmup-fields .form-group { flex: 1 1 200px; margin: 0; }

.custom-builder-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr) 240px; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .custom-builder-grid { grid-template-columns: 1fr; } }

.custom-palette { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem; border: 1px solid var(--grey-light); border-radius: var(--radius); background: var(--card-bg, #fff); height: fit-content; }
.custom-palette-title { margin: 0; font-size: 0.9rem; }
.custom-palette-hint { margin: 0; font-size: 0.78rem; color: var(--grey-mid); }
.custom-palette-card { padding: 0.6rem 0.75rem; border: 2px solid var(--grey-light); border-radius: var(--radius); cursor: grab; background: var(--white); transition: border-color 0.12s; user-select: none; }
.custom-palette-card:hover { border-color: var(--blue); }
.custom-palette-card:active { cursor: grabbing; }
.custom-palette-card-head { display: flex; align-items: baseline; gap: 0.5rem; }
.custom-palette-key { font-weight: 700; font-size: 1.1rem; color: var(--blue); }
.custom-palette-name { font-weight: 600; font-size: 0.85rem; }
.custom-palette-rounds { font-size: 0.72rem; color: var(--grey-mid); margin-bottom: 0.4rem; }
.custom-palette-level { font-size: 0.8rem; padding: 0.2rem 0.4rem; }

.custom-blocks-col { min-width: 0; }
.custom-blocks-dropzone { min-height: 240px; padding: 1rem; border: 2px dashed var(--grey-light); border-radius: var(--radius); display: flex; flex-direction: column; gap: 1rem; transition: border-color 0.12s, background 0.12s; }
.custom-blocks-dropzone.cb-drop-active { border-color: var(--blue); background: rgba(13,110,253,0.04); }
.custom-blocks-empty { color: var(--grey-mid); font-size: 0.85rem; text-align: center; margin: auto; padding: 2rem 0; }

.cb-block { padding: 1rem 1.25rem; border: 1px solid var(--grey-light); border-radius: var(--radius); background: var(--card-bg, #fff); display: flex; flex-direction: column; gap: 0.75rem; }
.cb-block-head { display: flex; align-items: center; gap: 0.6rem; }
.cb-block-num { font-weight: 700; color: var(--blue); }
.cb-block-title { flex: 1; font-size: 0.9rem; }
.cb-block-partner-toggle { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; color: var(--grey-mid); cursor: pointer; user-select: none; }
.cb-block-partner-toggle input { accent-color: #f5b400; cursor: pointer; }
.cb-block--partner .cb-block-partner-toggle { color: #f5b400; }
.cb-block-remove { padding: 0.2rem 0.55rem; font-size: 0.85rem; line-height: 1; }
.cb-block-timing { display: flex; gap: 1rem; flex-wrap: wrap; }
.cb-block-timing label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--grey-mid); }
.cb-block-timing input { width: 80px; font-size: 0.85rem; padding: 0.25rem 0.5rem; }

.cb-rounds { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.cb-round { display: flex; align-items: center; gap: 0.5rem; }
.cb-round-num { font-variant-numeric: tabular-nums; color: var(--grey-mid); width: 28px; text-align: right; flex-shrink: 0; }
.cb-round-desc { flex: 1; font-size: 0.85rem; padding: 0.3rem 0.55rem; }
.cb-round-del { padding: 0.15rem 0.4rem; font-size: 0.75rem; line-height: 1; }

/* + insert button between / before / after blocks */
.cb-insert {
  display: block; width: 100%; padding: 0.4rem 0;
  border: 1px dashed var(--grey-light); border-radius: var(--radius);
  background: transparent; color: var(--grey-mid);
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
  transition: all 0.12s;
}
.cb-insert:hover { border-color: var(--blue); color: var(--blue); background: rgba(90, 180, 229, 0.05); }
/* Active drop target — palette card hovering over + button */
.cb-insert--drop {
  border-style: solid !important;
  border-color: #2ea043 !important;
  color: #2ea043 !important;
  background: rgba(46, 160, 67, 0.14) !important;
  box-shadow: 0 0 0 2px rgba(46, 160, 67, 0.25);
}
/* + round button inside a custom-round block (appends a round to that block) */
.cb-add-round {
  display: block; margin: 0.5rem 0; padding: 0.3rem 0.7rem;
  border: 1px dashed var(--grey-light); border-radius: var(--radius);
  background: transparent; color: var(--grey-mid);
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all 0.12s;
}
.cb-add-round:hover { border-color: #f5b400; color: #f5b400; background: rgba(245, 180, 0, 0.06); }
.cb-block--custom-round { border-left: 3px solid #f5b400; }
[data-theme="dark"] .cb-block--custom-round { border-left-color: #f5b400; }

.cb-pause-row { padding-top: 0.5rem; border-top: 1px dashed var(--grey-light); }
.cb-pause-row label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--grey-mid); }
.cb-pause-row input { width: 80px; font-size: 0.85rem; padding: 0.25rem 0.5rem; }

/* ── Partner-mode toggle + dual-input rounds ─────────────── */
.page-header-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.mode-switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; font-size: 0.85rem; }
.mode-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mode-switch-track { position: relative; width: 38px; height: 22px; background: var(--grey-light); border-radius: 11px; transition: background 0.18s; flex-shrink: 0; border: 1px solid var(--grey-mid); }
.mode-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--white, #fff); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.18s; }
.mode-switch input:checked + .mode-switch-track { background: var(--blue); border-color: var(--blue); }
.mode-switch input:checked + .mode-switch-track .mode-switch-thumb { transform: translateX(16px); }
.mode-switch input:focus-visible + .mode-switch-track { box-shadow: 0 0 0 2px rgba(90, 180, 229, 0.45); }
.mode-switch-label { color: var(--grey-mid); }
.mode-switch input:checked ~ .mode-switch-label { color: var(--blue); font-weight: 600; }
[data-theme="dark"] .mode-switch-track { background: #2a2a2a; border-color: var(--grey-mid); }
[data-theme="dark"] .mode-switch-thumb { background: var(--grey-light); }

.cb-block--partner { border-color: var(--blue); }
.cb-round--partner { align-items: flex-start; }
.cb-round-partner-fields { flex: 1; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cb-round-partner-field { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 140px; }
.cb-round-partner-label { font-size: 0.7rem; color: var(--grey-mid); text-transform: uppercase; letter-spacing: 0.04em; }

.custom-save-bar { display: flex; align-items: center; gap: 0.75rem; padding-top: 0.5rem; }

/* ── Partner-drill table styling ─────────────────────────── */
.round-table--partner .col-boxer-a,
.round-table--partner .col-boxer-b { width: 48%; }
.round-table--partner td.col-boxer-a strong { color: var(--blue); }
.round-table--partner td.col-boxer-b { color: var(--grey-dark, #444); }
[data-theme="dark"] .round-table--partner td.col-boxer-b { color: var(--grey-light); }

/* ── Partner instructions in timer panel ─────────────────── */
/* Partner rounds: A and B sit side-by-side, each card fully colour-filled
   — pale on light theme, deep on dark theme. Text colour flips with the
   theme (black on pale, white on deep) so contrast holds either way.
   These are the canonical "boxer A blue / boxer B red" cards. */
.instr-steps--partner {
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.75rem;
}
.instr-partner-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  flex: 1;
}
.instr-partner-row:nth-child(1) {                  /* BOXER A */
  background: #d8ebf5;                              /* pale blue, light */
  align-items: flex-start;
  text-align: left;
}
.instr-partner-row:nth-child(2) {                  /* BOXER B */
  background: #f4d6d6;                              /* pale red, light */
  align-items: flex-end;
  text-align: right;
}
[data-theme="dark"] .instr-partner-row:nth-child(1) { background: #0d2a40; }   /* deep blue, dark */
[data-theme="dark"] .instr-partner-row:nth-child(2) { background: #3a0d0d; }   /* deep red, dark */

.instr-partner-label,
.instr-partner-text { color: #111; }                /* black on pale bg */
[data-theme="dark"] .instr-partner-label,
[data-theme="dark"] .instr-partner-text { color: #fff; }   /* white on deep bg */

.instr-partner-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.instr-partner-text  { font-size: 1rem;  font-weight: 600; }
.layout--timer .instr-partner-text { font-size: 1.4rem; }

/* ── GymGen hub cards ────────────────────────────────────── */
.gymgen-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.gymgen-hub-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.5rem; border: 1px solid var(--grey-light); border-radius: var(--radius); background: var(--card-bg, #fff); text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.gymgen-hub-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.gymgen-hub-card h2 { margin: 0; font-size: 1.2rem; }
.gymgen-hub-card p { margin: 0; font-size: 0.85rem; color: var(--grey-mid); }
.gymgen-hub-icon { font-size: 2rem; }
.gymgen-hub-meta { font-size: 0.75rem; color: var(--blue); margin-top: auto; padding-top: 0.5rem; }
[data-theme="dark"] .gymgen-hub-card { background: var(--card-bg, #1e1e1e); }

@media (max-width: 600px) {
  .cb-round-partner-fields { flex-direction: column; }
  .round-table--partner thead { display: none; }
  .round-table--partner tbody tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--grey-light); }
  .round-table--partner td { display: block; padding: 0.2rem 0.5rem; border: none; }
  .round-table--partner td.col-round { font-weight: 700; color: var(--blue); }
  .round-table--partner td.col-boxer-a::before { content: "Boxer A · "; font-size: 0.7rem; color: var(--grey-mid); }
  .round-table--partner td.col-boxer-b::before { content: "Boxer B · "; font-size: 0.7rem; color: var(--grey-mid); }
}

[data-theme="dark"] .custom-warmup-section,
[data-theme="dark"] .custom-palette,
[data-theme="dark"] .cb-block { background: var(--card-bg, #1e1e1e); }
[data-theme="dark"] .custom-palette-card { background: var(--card-bg, #1e1e1e); }

/* ── Flash messages (base.html) ───────────────────────────── */
.flash-bar-wrap { margin-bottom: 1.25rem; }
.flash-bar {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.flash-bar--success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-bar--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
[data-theme="dark"] .flash-bar--success { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .flash-bar--error   { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
.flash-bar--info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
[data-theme="dark"] .flash-bar--info    { background: #1e3a5f; color: #93c5fd; border-color: #1e40af; }
.flash-bar--warn    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
[data-theme="dark"] .flash-bar--warn    { background: #3a2a00; color: #fcd34d; border-color: #92400e; }

/* ── Account page ─────────────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.account-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--grey-light);
  border-radius: 8px;
  padding: 1.4rem 1.5rem;
}
.account-section--danger {
  border-color: #fca5a5;
}
.account-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.account-section-title--danger { color: #dc3545; }
.account-form { display: flex; flex-direction: column; gap: 0.9rem; }
.account-form .form-group { margin: 0; }
.account-hint {
  font-size: 0.82rem;
  color: var(--grey-mid);
  margin: 0 0 0.75rem;
}
.account-pw-match-hint { margin-top: 0.25rem; font-size: 0.8rem; min-height: 1em; }

/* ── My gyms list (account page) ─────────────────────────── */
.my-gyms-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.my-gyms-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.65rem 0.85rem; border: 1px solid var(--grey-light); border-radius: var(--radius); background: var(--white); }
[data-theme="dark"] .my-gyms-row { background: var(--card-bg, #1e1e1e); }
.my-gyms-row--active { border-left: 3px solid #2ea043; }
.my-gyms-row--inactive { opacity: 0.7; border-left: 3px solid var(--grey-light); }
.my-gyms-info { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; min-width: 0; flex: 1; }
.my-gyms-name { font-weight: 600; text-decoration: none; color: var(--black); }
[data-theme="dark"] .my-gyms-name { color: var(--grey-light); }
.my-gyms-name:hover { color: var(--blue); }
.my-gyms-role { font-size: 0.75rem; color: var(--grey-mid); text-transform: uppercase; letter-spacing: 0.04em; }
.my-gyms-inactive-badge { font-size: 0.72rem; color: var(--grey-mid); font-weight: 700; background: var(--grey-light); padding: 0.1rem 0.45rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.my-gyms-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.my-gyms-actions form { margin: 0; }
.account-details { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; }
.account-detail-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.account-detail-row dt {
  flex: 0 0 110px;
  font-weight: 600;
  color: var(--grey-mid);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.account-detail-row dd { margin: 0; }
.account-role-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--grey-light);
  color: var(--text);
}
.account-role-badge--admin   { background: #1a1a2e; color: #fff; }
.account-role-badge--member  { background: var(--blue); color: #fff; }
.account-status { font-size: 0.82rem; }
.account-status--active    { color: #2ea043; font-weight: 600; }
.account-status--cancelling { color: #e0a800; font-weight: 600; }
.account-status--warn      { color: #dc3545; font-weight: 600; }
.account-status--cancelled  { color: var(--grey-mid); }
.account-upgrade-placeholder {
  background: var(--grey-light);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--grey-mid);
  text-align: center;
}
.account-cancel-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
[data-theme="dark"] .account-section { background: var(--card-bg, #1e1e1e); }
[data-theme="dark"] .account-section--danger { border-color: #7f1d1d; }

/* ══════════════════════════════════════════════════════════════
   MOBILE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Header & nav ────────────────────────────────────────── */
  .site-header { flex-wrap: wrap; padding: 0.5rem 1rem; gap: 0.5rem; }
  .header-left { gap: 0.75rem; }
  .logo { height: 40px; }
  .logo-wordmark { font-size: 1.25rem; }
  .version-badge { display: none; }
  .about-link { font-size: 0.75rem; }
  .site-nav { gap: 0.75rem; flex-wrap: wrap; }
  .nav-link { font-size: 0.85rem; }

  /* ── Main content ────────────────────────────────────────── */
  .main-content { padding: 1.25rem 0.75rem; }
  .main-content--wide { max-width: 100%; }
  .page-header h1 { font-size: 1.5rem; }
  .page-header p { font-size: 0.85rem; }

  /* ── Dashboard cards ─────────────────────────────────────── */
  .dashboard { grid-template-columns: 1fr; }

  /* ── Forms ───────────────────────────────────────────────── */
  .form-control { font-size: 16px; } /* prevents iOS zoom on focus */

  /* ── Session builder (GymGen) ────────────────────────────── */
  .session-cards { flex-direction: column; }
  .session-card { min-width: 0; }
  .round-buttons { flex-wrap: wrap; }
  .timer-grid { flex-direction: column; }
  .timer-buttons { flex-wrap: wrap; }
  .difficulty-row { flex-direction: column; gap: 0.25rem; }

  /* ── Session display ─────────────────────────────────────── */
  .session-layout { flex-direction: column; }
  .panel-overview { max-height: none; overflow: visible; }
  .round-table { font-size: 0.72rem; }
  .round-table th, .round-table td { padding: 0.3rem 0.4rem; }
  .overview-header { flex-direction: column; gap: 0.75rem; }
  .overview-actions { flex-wrap: wrap; }

  /* ── Program / Calendar ──────────────────────────────────── */
  .program-layout { grid-template-columns: 1fr; }
  .program-sidebar { order: -1; }
  .program-cal { font-size: 0.7rem; }
  .cal-cell { min-height: 50px; }
  .cal-cell-num { font-size: 0.65rem; }
  .cal-slot { font-size: 0.5rem; padding: 0.05rem 0.15rem; }
  .program-cal-header { font-size: 0.85rem; }

  /* ── Testing ─────────────────────────────────────────────── */
  .testing-type-grid { grid-template-columns: 1fr; }

  /* ── Tables ──────────────────────────────────────────────── */
  .saved-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .saved-table { font-size: 0.78rem; min-width: 500px; }
  .admin-table { font-size: 0.78rem; }

  /* ── Dialogs ─────────────────────────────────────────────── */
  .save-dialog { max-width: 95vw; width: 95vw; }

  /* ── Login / Subscribe ───────────────────────────────────── */
  .login-card { margin: 1rem; padding: 1.5rem; }

  /* ── Issues ──────────────────────────────────────────────── */
  .issues-toolbar { flex-direction: column; gap: 0.5rem; }

  /* ── Journal ─────────────────────────────────────────────── */
  .journal-entry { padding: 0.75rem; }

  /* ── Stats ───────────────────────────────────────────────── */
  .stats-grid { grid-template-columns: 1fr; }

  /* ── Timer page ──────────────────────────────────────────── */
  .timer-circle-wrap { width: 260px; height: 260px; }
  .timer-ring { width: 100%; height: 100%; }
  .timer-time  { font-size: 3.5rem; }
  .timer-state { font-size: 0.95rem; letter-spacing: 0.1em; }
  .timer-round-label { font-size: 1rem; }
  .timer-controls { flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
  .timer-settings-row { flex-direction: column; gap: 0.75rem; }
  .timer-options-row { justify-content: center; flex-wrap: wrap; }
  /* Fullscreen session layout — shrink the big circle too */
  .layout--timer .timer-circle-wrap { width: 300px; height: 300px; }
  .layout--timer .timer-time  { font-size: 4.5rem; }
  .layout--timer .timer-state { font-size: 1.1rem; }

  /* ── Panel toggle bar (session page) ─────────────────────── */
  .panel-toggle-bar { bottom: 0; position: sticky; background: var(--white); border-top: 1px solid var(--grey-light); padding: 0.5rem; z-index: 10; }

  /* ── Footer ──────────────────────────────────────────────── */
  .site-footer { font-size: 0.7rem; }
  .footer-user { font-size: 0.7rem; }

  /* ── Mobile timer focus ──────────────────────────────────── */
  /* Phone: turn the timer pages into a real timer-app feel. Session
     name pinned as a thin band at top; the timer circle dominates the
     remaining viewport; zero wasted space. Desktop layout is unaffected
     (everything below lives inside the 768px media query). */

  /* Step 1: hide the noise above the timer. */

  .session-layout .panel-overview .session-meta,
  .session-layout .panel-overview .saved-record-meta,
  .session-layout .panel-overview .overview-actions,
  .session-layout .panel-overview .sub-structure,
  .session-layout .panel-overview .block-pause-marker {
    display: none;
  }
  /* gymgen/session only: round-instructions + up-next render ABOVE the
     timer-main; saved_session puts round-instructions BELOW the circle
     (the :has(~ .timer-main) check leaves it alone there). */
  .panel-timer .round-instructions:has(~ .timer-main),
  .panel-timer .up-next {
    display: none;
  }
  /* Standalone /timer page: drop the page-header description. */
  .page-header:has(+ .standalone-timer) p {
    display: none;
  }

  /* Step 2: collapse wasted vertical space so the timer dominates. */

  /* Tighten the global header — logo + nav stays clickable but compact. */
  .body--session .site-header,
  body:has(.standalone-timer) .site-header {
    padding: 0.3rem 0.75rem;
    min-height: 0;
    gap: 0.4rem;
  }
  .body--session .logo,
  body:has(.standalone-timer) .logo { height: 28px; }
  .body--session .logo-wordmark,
  body:has(.standalone-timer) .logo-wordmark { font-size: 1rem; }

  /* Session pages: hide the overview panel entirely — the session
     name now lives inside the timer block (see .timer-block-title
     positioning below). Timer panel fills the entire viewport below
     the global header. */
  .session-layout .panel-overview { display: none; }
  .session-layout .panel-timer {
    flex: 1;
    /* Top padding clears the absolutely-positioned .timer-block-title
       (~32px tall at top:0.5rem). Anything less and the title overlaps
       the circle. Bottom padding keeps controls clear of the home
       indicator. Vertical content flows from the TOP — no centering, so
       the circle sits high and there's real room for instructions /
       partner cards underneath. */
    padding: 2.25rem 0.5rem calc(1.25rem + env(safe-area-inset-bottom));
    gap: 0.6rem;
    justify-content: flex-start;
    position: relative;     /* anchor for .timer-block-title */
  }

  /* Show the session-name banner pinned top-left of the timer block.
     Subtle styling — present but doesn't fight the timer for attention. */
  .timer-block-title {
    display: block;
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    right: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--grey-mid);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
  }

  /* Inside-circle round counter: shown on mobile, replacing the larger
     above-circle label which is hidden in every template (in
     gymgen/session.html + timer.html it lives inside .timer-main; in
     saved_session.html it's a direct child of .panel-timer — so we hide
     the class outright on mobile rather than a too-narrow selector). */
  .timer-overlay-round {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--grey-mid);
    margin-top: 0.2rem;
  }
  .timer-round-label { display: none; }

  /* Tap-anywhere-in-the-circle = Start/Pause/Resume. Hide the now-
     redundant Start button on mobile. JS for each timer template wires
     the click handler. */
  .timer-circle-wrap { cursor: pointer; }
  #t-start { display: none; }

  /* Keep the remaining controls in a single horizontal row, smaller. */
  .timer-controls {
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: center;
  }
  .timer-controls .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    white-space: nowrap;
    flex: 0 1 auto;
  }

  /* Partner instructions edge-to-edge: the desktop `.round-instructions`
     rule sets `max-width: 380px` and `align-items: center` — that cap
     was the reason negative margins didn't reach the screen edges. We
     blow the cap off and stretch alignment so the Boxer A / B cards
     fill the viewport from edge to edge. */
  .panel-timer .round-instructions {
    max-width: none;
    width: calc(100% + 1rem);
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    align-items: stretch;
  }
  .instr-steps--partner { gap: 0.4rem; }
  .instr-partner-row { padding: 0.5rem 0.85rem; }

  /* Bottom Both/Timer/Session toggle is meaningless on phone — only
     one panel ever shows. */
  .panel-toggle-bar { display: none; }

  /* Step 3: scale the timer circle to dominate the viewport. */

  /* Circle scales to the smaller of (80% of width, 55% of height) so it
     fits both portrait and landscape, with sensible caps. */
  .timer-circle-wrap {
    width: min(80vw, 55vh);
    height: min(80vw, 55vh);
    max-width: 460px;
    max-height: 460px;
  }
  .timer-time  { font-size: clamp(3rem, 14vw, 5rem); }
  .timer-state { font-size: 0.9rem; letter-spacing: 0.15em; }
  .timer-round-label { font-size: 0.95rem; }
  .timer-controls { gap: 0.4rem; }

  /* Step 4: /timer standalone page — apply the same full-viewport layout. */

  /* Lock body to viewport so the column flex works (analogous to what
     body--session already does on the panel-layout pages). */
  body:has(.standalone-timer) {
    height: 100vh;
    overflow: hidden;
  }
  body:has(.standalone-timer) .main-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  /* /timer: hide the page-header entirely — title is now inside the
     standalone-timer block via .timer-block-title. */
  body:has(.standalone-timer) .page-header { display: none; }
  .standalone-timer {
    flex: 1;
    justify-content: center;
    padding: 0.5rem 0.5rem calc(1.5rem + env(safe-area-inset-bottom));
    gap: 0.75rem;
    overflow-y: auto;     /* settings can still scroll if needed pre-Start */
    position: relative;   /* anchor for .timer-block-title */
  }
  /* When settings panel is hidden (post-Start), there's nothing above the
     timer-area, so the area centers cleanly in the viewport. */
  body:has(.standalone-timer) .site-footer { display: none; }
}
