/* © Pybox 2026 — All rights reserved */

/* ── 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;
  transition: background 1s ease, color 1s ease;
}
*, *::before, *::after { transition: background-color 1s ease, border-color 1s ease, color 1s ease, box-shadow 1s ease; }

/* ── 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--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 { 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); }

/* 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;
}
.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; }

/* ── 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-area .seq-panel {
  max-width: 280px;
  text-align: left;
}
.timer-area .seq-steps { justify-content: flex-start; }
.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; }
.seq-panel {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-align: center;
}
.seq-focus {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.seq-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.seq-steps li { font-weight: 600; font-size: 1rem; }

/* ── 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: 900px) { .pricing-grid--three { grid-template-columns: 1fr; } }
.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;
}
.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); }

/* ── 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; }

/* 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;
}
.admin-stat-sub {
  font-size: 0.82rem;
  color: var(--grey-mid);
}

/* Profile picture cell */
.admin-pic-cell {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--grey-light);
  vertical-align: middle;
}
.admin-pic-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.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;
}
.admin-pic-delete {
  background: transparent; border: none;
  color: var(--grey-mid); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0;
  vertical-align: middle;
}
.admin-pic-delete:hover { color: #dc3545; }

/* 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); }
[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-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-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; text-overflow: ellipsis; }
.cal-slot--done    { background: #2ea043; color: #fff; }
.cal-slot--custom  { background: #cce5ff; color: #004085; }
.cal-slot--rest    { background: #fff3cd; color: #856404; }
.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); }
[data-theme="dark"] .stats-donut-track { stroke: #333; }
[data-theme="dark"] .stats-count-dot--planned { background: #333; border-color: #666; }

/* ── Testing page ────────────────────────────────────────────── */
.testing-add-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.testing-add-panel--open { display: block; }
.testing-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}
.testing-add-field { flex: 1 1 160px; margin: 0; }
.testing-add-field--notes { flex: 2 1 220px; }
.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-add-panel { background: var(--card-bg, #1e1e1e); }
[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); }

/* ── 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; }
.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-add-row { flex-direction: column; }
  .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; }
}
