*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0e0e10;
  --surface:     #1a1a1e;
  --surface-alt: #26262c;
  --border:      #2e2e36;
  --accent:      #e8622a;
  --accent-dim:  #b34d20;
  --text:        #f0f0f0;
  --text-muted:  #8a8a96;
  --success:     #4caf7d;
  --danger:      #e05252;
  --radius-card: 10px;
  --radius-sm:   6px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ── */

header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 4px; }
nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 120ms ease, background 120ms ease;
}
nav a:hover { color: var(--text); background: var(--surface-alt); }
nav a.active { color: var(--text); background: var(--surface-alt); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ── Page layout ── */

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  transition: background 120ms ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.btn-ghost:hover { background: var(--surface-alt); border-color: #44444e; }

.btn-danger { background: var(--danger); color: #fff; font-family: inherit; font-size: 13px; font-weight: 600; padding: 10px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: opacity 120ms ease; }
.btn-danger:hover { opacity: 0.85; }
.btn-danger:disabled { opacity: 0.5; cursor: default; }
.btn-danger-outline { border-color: var(--danger); color: var(--danger); }
.btn-danger-outline:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }

.chart-tabs { display: flex; gap: 4px; }
.chart-tab { background: transparent; border: 1px solid var(--border); color: var(--text-muted); font-family: inherit; font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: border-color 120ms ease, color 120ms ease, background 120ms ease; }
.chart-tab.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart-tab:hover:not(.active) { border-color: #44444e; color: var(--text); }

/* ── Inputs ── */

input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  transition: border-color 120ms ease;
}
input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}
input::placeholder,
textarea::placeholder { color: var(--text-muted); }

input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button { display: none; }
input[readonly] { color: var(--text-muted); cursor: default; }
input[readonly]:focus { border-color: var(--border); }

/* ── Cards ── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

/* ── Bodyweight bar ── */

.bw-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 28px;
}
.bw-bar { flex-wrap: wrap; row-gap: 10px; }
.bw-bar label,
.bw-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.bw-value { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.bw-meta { font-size: 13px; color: var(--text-muted); }
.bw-update-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.bw-bar input[type="number"] {
  width: 90px;
  text-align: center;
  padding: 7px 10px;
  font-size: 15px;
}
.bw-bar .unit { font-size: 13px; color: var(--text-muted); }
.bw-bar .btn-ghost { margin-left: auto; }

/* ── Week tabs ── */

.week-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.week-tab {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 0;
  text-align: center;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  user-select: none;
}
.week-tab:hover { color: var(--text); background: var(--surface-alt); }
.week-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Day cards ── */

.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
  overflow: hidden;
}
.day-card.completed { border-left: 3px solid var(--success); }
.day-card.completed .card-header { opacity: 0.7; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.day-card.completed .card-header { border-bottom: none; }
.card-header--toggle { cursor: pointer; user-select: none; }
.card-header--toggle:hover { opacity: 1 !important; }

.card-header-right { display: flex; align-items: center; gap: 10px; }

.card-chevron { color: var(--text-muted); font-size: 13px; }

.card-body { display: none; }
.day-card.completed.expanded .card-body { display: block; }
.day-card.completed.expanded .card-header { border-bottom: 1px solid var(--border); opacity: 1; }

.session-summary {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-notes-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-header-left { display: flex; flex-direction: column; gap: 2px; }

.day-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.day-focus {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.completed-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  background: rgba(76, 175, 125, 0.12);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── Exercise blocks ── */

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 20px 4px;
}

.exercise-block { padding: 14px 20px 10px; }
.exercise-block + .exercise-block { border-top: 1px solid var(--border); }

.exercise-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.exercise-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 10px;
}

.set-rows { display: flex; flex-direction: column; gap: 6px; }

.set-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr;
  gap: 8px;
  align-items: center;
}
.set-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.set-input-group { display: flex; align-items: center; gap: 6px; }
.set-input-group input[type="number"] {
  width: 72px;
  text-align: center;
  padding: 6px 8px;
}
.set-input-group .unit { font-size: 12px; color: var(--text-muted); }

/* ── Log footer (fatigue, notes, button) ── */

.log-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fatigue-row { display: flex; flex-direction: column; gap: 8px; }
.fatigue-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fatigue-options { display: flex; gap: 4px; }
.fatigue-opt {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 0;
  text-align: center;
  cursor: pointer;
  transition: all 120ms ease;
  user-select: none;
}
.fatigue-opt:hover { border-color: #44444e; color: var(--text); }
.fatigue-opt.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.notes-row { display: flex; flex-direction: column; gap: 6px; }
.notes-row label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.notes-row textarea {
  resize: vertical;
  min-height: 72px;
}

.btn-log {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-log:hover { background: var(--accent-dim); }

/* ── Rest day ── */

.rest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}
.rest-icon { font-size: 18px; }

/* ── Dashboard dynamic content ── */

.loading-msg {
  color: var(--text-muted);
  font-size: 14px;
  padding: 32px 0;
  text-align: center;
}

.week-content { display: block; }

/* ── Page header ── */

.page-header { margin-bottom: 32px; }
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-header p { font-size: 14px; color: var(--text-muted); }

/* ── Onboarding form ── */

.form-section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.form-section:first-child { border-top: none; padding-top: 0; }

.form-section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.form-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 12px;
}

.form-section textarea { width: 100%; resize: vertical; min-height: 88px; }

.option-cards { display: flex; flex-direction: column; gap: 8px; }

.option-card {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.option-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-card:hover { border-color: #44444e; }
.option-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(232, 98, 42, 0.06);
}

.option-card-body { display: flex; flex-direction: column; gap: 2px; }
.option-title { font-size: 14px; font-weight: 600; }
.option-desc { font-size: 12px; color: var(--text-muted); }

.days-select { display: flex; gap: 4px; }

.day-opt { flex: 1; position: relative; cursor: pointer; }
.day-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.day-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 0;
  transition: all 120ms ease;
  user-select: none;
}
.day-opt:hover span { border-color: #44444e; color: var(--text); }
.day-opt:has(input:checked) span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  position: relative;
  cursor: pointer;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 120ms ease;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:hover { border-color: #44444e; color: var(--text); }
.chip:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  margin-bottom: 12px;
  display: none;
}
.form-error.visible { display: block; }

.onboarding-submit { width: 100%; padding: 13px 0; font-size: 15px; }

/* ── Auth page ── */

form fieldset { border: none; padding: 0; margin: 0; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 28px 32px;
}

.auth-logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 24px;
}
.auth-logo span { color: var(--accent); }

.auth-tabs {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease, background 120ms ease;
}
.auth-tab.active { background: var(--surface); color: var(--text); }

.auth-pane { display: none; }
.auth-pane.active { display: block; }

.auth-fields { display: flex; flex-direction: column; gap: 14px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-field input { width: 100%; }

.auth-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  margin-top: 10px;
  display: none;
}
.auth-error.visible { display: block; }

.auth-submit {
  margin-top: 20px;
  width: 100%;
  padding: 12px 0;
  font-size: 15px;
}

.auth-forgot {
  margin-top: 14px;
  text-align: center;
}
.auth-forgot a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.auth-forgot a:hover { color: var(--text); }

.auth-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ── Block selector ── */

.block-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
}
.block-selector-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.block-nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  font-family: inherit;
}
.block-nav-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-alt);
  border-color: #44444e;
}
.block-nav-btn:disabled { opacity: 0.3; cursor: default; }

.not-logged-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(138, 138, 150, 0.12);
  border-radius: 20px;
  padding: 3px 10px;
}

.day-card.past-unlogged { opacity: 0.65; }
.day-card.past-unlogged .card-header { border-bottom: none; }

.day-card.skipped { border-left: 3px solid var(--text-muted); opacity: 0.75; }
.day-card.skipped .card-header { border-bottom: none; }

.skipped-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(138, 138, 150, 0.12);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── Skip button ── */

.btn-skip {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 0 0;
  cursor: pointer;
  text-align: center;
  transition: color 120ms ease;
}
.btn-skip:hover { color: var(--text); }

/* ── Add exercise button ── */

.btn-add-exercise {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px;
  text-align: center;
  font-size: 13px;
  color: var(--accent);
  border: 1px dashed rgba(232,98,42,0.35);
  padding: 7px 0;
  margin-bottom: 0;
}
.btn-add-exercise:hover { background: rgba(232,98,42,0.04); border-color: rgba(232,98,42,0.6); }
.exercise-block + .btn-add-exercise { border-top: none; }

/* ── Add set button (inside custom exercise block) ── */

.btn-add-set {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  padding: 6px 0;
  color: var(--text-muted);
  text-align: center;
}

/* ── Exercise name input (for custom exercises) ── */

.exercise-name-input {
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  margin-bottom: 10px;
}
.exercise-name-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

/* ── Exercise name with swap button ── */

.exercise-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.exercise-name span:first-child { flex: 1; }

.btn-swap {
  background: transparent;
  border: 1px solid #44444e;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  transition: color 120ms ease, border-color 120ms ease;
  font-family: inherit;
}
.btn-swap:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.btn-swap:disabled { opacity: 0.4; cursor: default; }

/* ── Swap panel ── */

.swap-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}
.swap-loading { color: var(--text-muted); }
.swap-result { display: flex; flex-direction: column; gap: 6px; }
.swap-result-name { font-weight: 600; color: var(--text); }
.swap-result-note { color: var(--text-muted); font-style: italic; }
.swap-actions { display: flex; gap: 8px; padding-top: 4px; }
.swap-actions .btn-ghost { padding: 5px 12px; font-size: 12px; }

/* ── PR badge ── */

.pr-badge {
  font-size: 10px;
  font-weight: 700;
  color: #f5c842;
  background: rgba(245, 200, 66, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
  margin-left: 8px;
  flex-shrink: 0;
}

/* ── Block complete card ── */

.block-complete-card {
  margin-top: 24px;
  padding: 20px 24px;
  border-color: var(--accent);
}
.block-complete-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.block-complete-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.block-complete-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.block-complete-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Regen prompt ── */

.regen-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 16px;
}
.regen-prompt p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Swap panel (redesigned) ── */

.swap-suggestion-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: border-color 120ms ease, background 120ms ease;
}
.swap-suggestion-item:hover { border-color: var(--accent); background: rgba(232,98,42,0.06); }

.swap-custom { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.swap-custom input { flex: 1; }

.swap-footer { margin-top: 10px; text-align: right; }
.btn-swap-cancel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color 120ms ease;
}
.btn-swap-cancel:hover { color: var(--text); }

/* ── Exercise info button ── */

.btn-info {
  background: transparent;
  border: 1px solid #44444e;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  width: 20px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  font-family: inherit;
}
.btn-info:hover { color: var(--text); border-color: var(--accent); background: rgba(232,98,42,0.08); }

/* ── Exercise info panel ── */

.info-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}
.info-text {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Swap limit notice ── */

.swap-limit-notice {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 20px 0;
  margin: 0;
}
.swap-limit-msg {
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Plan generation spinner ── */

.plan-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 56px 0;
}
.plan-spinner-dots { display: flex; gap: 6px; }
.plan-spinner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}
.plan-spinner-dot:nth-child(2) { animation-delay: 0.2s; }
.plan-spinner-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }
.plan-spinner-saying {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}

/* ── Cardio on rest days ── */

.rest-card .btn-ghost { margin-left: auto; font-size: 12px; padding: 5px 10px; }

.cardio-log-panel {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cardio-log-panel textarea { width: 100%; resize: vertical; min-height: 64px; }

.cardio-logged-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(232,98,42,0.1);
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: auto;
}

.rest-card-notes {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Progress page ── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chart-wrap { width: 100%; }

.chart-empty {
  padding: 32px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.chart-select {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

.chart-select:focus { border-color: var(--accent); outline: none; }

.chart-tooltip {
  position: fixed;
  padding: 5px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  pointer-events: none;
  display: none;
  z-index: 1000;
  white-space: nowrap;
}

.timespan-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.timespan-tab {
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.timespan-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.timespan-tab:hover:not(.active) { border-color: var(--text-muted); color: var(--text); }

.insights-output {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

/* ── Error banner ── */

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.35);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.error-banner-dismiss {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 120ms ease;
}
.error-banner-dismiss:hover { opacity: 1; }

/* ── Fatigue alert ── */

.fatigue-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-color: rgba(245, 200, 66, 0.4);
  background: rgba(245, 200, 66, 0.06);
}
.fatigue-alert-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}
.fatigue-alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.fatigue-alert-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.fatigue-alert-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.alert-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 120ms ease;
}
.alert-dismiss:hover { color: var(--text); }

/* ── Block stats ── */

.block-stats {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 20px;
  margin-bottom: 16px;
  gap: 0;
}
.block-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.block-stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.1;
}
.block-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.block-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ── Responsive ── */

@media (max-width: 500px) {
  main { padding: 20px 16px 80px; }
  header { padding: 0 16px; }
  .set-row { grid-template-columns: 36px 1fr 1fr; gap: 6px; }
  .fatigue-opt { padding: 7px 0; font-size: 12px; }
  .stat-value { font-size: 22px; }
}

/* ── Session duration (log footer + completed summary) ── */

.duration-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.duration-row label,
.duration-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.duration-value {
  font-size: 14px;
  color: var(--text);
}
.duration-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.duration-input-group input {
  width: 72px;
  text-align: center;
}

/* ── Cardio logging (progress page) ── */

.cardio-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.cardio-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.cardio-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,98,42,0.1);
}
.cardio-inputs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cardio-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cardio-field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.cardio-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cardio-duration-input,
.cardio-distance-input {
  width: 80px;
  text-align: center;
}
.cardio-log-btn { margin-top: 4px; }
.cardio-error {
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 6px;
}
.cardio-list {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cardio-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.cardio-entry-date { color: var(--text-muted); min-width: 56px; font-size: 13px; }
.cardio-entry-type { font-weight: 500; }
.cardio-entry-duration { color: var(--text-muted); font-size: 13px; }
.cardio-entry-distance { color: var(--text-muted); font-size: 13px; }
.cardio-empty { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ── Account page ── */

.avatar { text-decoration: none; cursor: pointer; }

.info-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  min-width: 120px;
  flex-shrink: 0;
}
.info-value {
  font-size: 15px;
  color: var(--text);
}

.plan-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.plan-badge--free {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.billing-upgrade {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}
.billing-upgrade-header { margin-bottom: 12px; }
.billing-upgrade-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.billing-feature-list {
  list-style: none;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.billing-feature-list li {
  font-size: 14px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}
.billing-feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-size: 12px;
}
.billing-coming-soon {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Feedback page ── */

.feedback-card { padding: 24px; }

.feedback-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-field label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.feedback-field select,
.feedback-field textarea {
  width: 100%;
}

.feedback-field textarea { resize: vertical; min-height: 140px; }

.feedback-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 0;
  display: none;
}

.feedback-submit { width: 100%; padding: 13px 0; font-size: 15px; }

.feedback-sent-card {
  padding: 40px 24px;
  text-align: center;
}

.feedback-sent-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.feedback-sent-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
