:root {
  --bg:        #111111;
  --surface:   #1e1e1e;
  --surface2:  #272727;
  --surface3:  #303030;
  --border:    #383838;
  --text:      #f2f2f2;
  --text2:     #888;
  --text3:     #555;
  --lime:       #c8ff00;
  --lime-dim:   rgba(200,255,0,.13);
  --lime-glow:  0 0 24px rgba(200,255,0,.3);
  --accent-fg:  #0d0d0d;
  --cyan:      #00e5cc;
  --danger:    #ff4757;
  --warn:      #ffa502;
  --success:   #00e5cc;
  --radius:    14px;
  --radius-sm: 9px;
  --nav-h:     64px;
  --card-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 4px 20px rgba(0,0,0,.5);
  --font-body: 'Outfit', sans-serif;
  --font-num:  'Barlow Condensed', sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  height: 100%;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

#view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px calc(var(--nav-h) + 20px);
}

/* ── Bottom Nav ─────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: rgba(16,16,16,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid #3a3a3a;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}

#bottom-nav.hidden { display: none; }

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s;
}

.nav-btn .nav-icon { font-size: 19px; line-height: 1; }
.nav-btn.active { color: var(--lime); }

/* ── Typography ─────────────────────────────────────────────── */
h1 {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
  letter-spacing: -.02em;
}

h2 {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 12px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.card h3 { font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.card .meta { font-size: .78rem; color: var(--text2); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}

.btn:active { opacity: .8; transform: scale(.97); }

.btn-primary {
  background: var(--lime);
  color: var(--accent-fg);
}

.btn-success {
  background: var(--lime);
  color: var(--accent-fg);
}

.btn-danger {
  background: var(--surface2);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,.3);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 13px; font-size: .8rem; }

/* ── Inputs ─────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: .95rem;
  margin-bottom: 10px;
  transition: border-color .15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--lime);
}

label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 5px;
}

.form-group { margin-bottom: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }

/* ── Banner ─────────────────────────────────────────────────── */
.banner {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 500;
}

.banner-warn { background: rgba(255,165,2,.1); border: 1px solid rgba(255,165,2,.3); color: var(--warn); }
.banner-pr   { background: rgba(0,229,204,.1); border: 1px solid rgba(0,229,204,.3); color: var(--cyan); }

/* ── Onboarding ─────────────────────────────────────────────── */
.onboarding {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 12px;
}

.steps-indicator {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
}

.step-dot {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--surface3);
}

.step-dot.active { background: var(--lime); }

/* ── Exercise Card ──────────────────────────────────────────── */
/* ── Muscle Group Avatar ────────────────────────────────────── */
.mg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .03em;
  flex-shrink: 0;
  color: var(--accent-fg);
}

/* ── Exercise Card ──────────────────────────────────────────── */
.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.exercise-header-text {
  flex: 1;
  min-width: 0;
}

.exercise-name {
  font-size: .97rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exercise-meta-sub {
  font-size: .73rem;
  color: var(--text2);
  margin-top: 2px;
}

.exercise-target-weight {
  font-family: var(--font-num);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--lime);
  flex-shrink: 0;
  letter-spacing: -.01em;
}

.muscle-tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text2);
  background: var(--surface2);
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Exercise Progress Bar ──────────────────────────────────── */
.exercise-progress {
  height: 2px;
  background: var(--surface3);
  border-radius: 1px;
  margin-bottom: 10px;
  overflow: hidden;
}

.exercise-progress-fill {
  height: 100%;
  background: var(--lime);
  border-radius: 1px;
  transition: width .3s ease;
  width: 0%;
}

/* ── Set Row — Compact ──────────────────────────────────────── */
.set-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 38px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.set-row.logged {
  opacity: .4;
}

.set-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  font-family: var(--font-num);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.set-row.logged .set-num {
  background: var(--lime-dim);
  border-color: rgba(200,255,0,.2);
  color: var(--lime);
}

.num-input-group {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  height: 36px;
}

.num-input-group button {
  background: none;
  border: none;
  color: var(--text2);
  width: 28px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .1s;
}

.num-input-group button:active { color: var(--lime); }

.num-input-group input {
  flex: 1;
  background: none;
  border: none;
  text-align: center;
  margin: 0;
  padding: 0;
  min-width: 0;
  font-family: var(--font-num);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  height: 36px;
}

.ref-row {
  font-size: .72rem;
  color: var(--text2);
  margin-bottom: 8px;
  letter-spacing: .01em;
}

.pr-badge {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--lime);
  color: var(--accent-fg);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ── Log Button ─────────────────────────────────────────────── */
.log-btn {
  width: 38px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text3);
  font-size: .95rem;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
}

.log-btn:active { transform: scale(.9); }

.log-btn.logged {
  background: var(--surface3);
  border-color: var(--border);
  color: var(--text2);
}

.log-btn.pr {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--accent-fg);
  font-size: .75rem;
  font-weight: 700;
}

/* ── Timer ──────────────────────────────────────────────────── */
.timer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,13,13,.95);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  gap: 28px;
}

.timer-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--border);
  outline: 2px solid var(--lime);
  outline-offset: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--lime);
}

/* ── Progress ───────────────────────────────────────────────── */
.progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

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

.stat-card .value {
  font-family: var(--font-num);
  font-size: 2rem;
  font-weight: 800;
  color: var(--lime);
  letter-spacing: -.02em;
}

.stat-card .label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text2);
  margin-top: 4px;
}

.chart-wrap { position: relative; height: 200px; margin-bottom: 14px; }

/* ── Progress Exercise List ─────────────────────────────────── */
.progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.progress-item:active { border-color: var(--lime); }
.progress-item .ex-name { font-weight: 600; font-size: .95rem; }
.progress-item .ex-meta { font-size: .75rem; color: var(--text2); margin-top: 3px; }

/* ── Plan Manager ───────────────────────────────────────────── */
/* Plan list cards */
.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
  transition: border-left-color .15s;
}

.plan-card.active-plan {
  border-left-color: var(--lime);
  background: var(--surface2);
}

.badge-active {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--accent-fg);
  padding: 3px 9px;
  border-radius: 4px;
}

/* Day sections in plan */
.day-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.day-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.day-section-name {
  font-weight: 700;
  font-size: .95rem;
}

.day-section-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
}

.day-chip {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}

/* Exercise rows in day editor */
.ex-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.ex-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.ex-list-row:last-child { border-bottom: none; }

.ex-list-name {
  font-size: .9rem;
  font-weight: 500;
}

.ex-list-meta {
  font-size: .76rem;
  color: var(--text2);
  margin-top: 2px;
}

.ex-weight-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ex-weight-input {
  width: 56px;
  text-align: right;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .85rem;
  padding: 4px 6px;
}

.ex-weight-unit {
  font-size: .75rem;
  color: var(--text2);
}

/* keep plan-item for backward compat (legacy) */
.plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

/* ── Login ──────────────────────────────────────────────────── */
.login-wrap {
  max-width: 360px;
  margin: 52px auto 0;
}

.login-wrap h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 6px;
}

.login-wrap .subtitle {
  text-align: center;
  color: var(--text2);
  margin-bottom: 36px;
  font-size: .88rem;
}

/* ── Settings ───────────────────────────────────────────────── */
.settings-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text2);
  margin: 18px 0 6px 4px;
}

.settings-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 50px;
}

.settings-row:last-child { border-bottom: none; }

.settings-row-label {
  font-size: .9rem;
  flex: 1;
  min-width: 0;
}

.settings-row-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  min-width: 180px;
}

.settings-row .cal-stepper { flex-shrink: 0; }
.settings-row .cal-stepper input { width: 52px; text-align: center; }
.settings-row .settings-unit { min-width: 36px; text-align: left; }

.settings-input {
  width: 64px;
  text-align: right;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  padding: 5px 8px;
}

.settings-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  padding: 5px 8px;
}

.settings-unit {
  font-size: .8rem;
  color: var(--text2);
  white-space: nowrap;
}

/* ── Toggle Switch ──────────────────────────────────────────── */
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--text2);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--lime-dim);
  border-color: rgba(200,255,0,.4);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--lime);
}

/* legacy — keep for any remaining references */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.dash-header {
  padding: 8px 0 20px;
}

.dash-greeting {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.15;
}

.dash-sub {
  font-size: .88rem;
  color: var(--text2);
  margin-top: 4px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  min-width: 0;
  box-shadow: var(--card-shadow);
}

.stat-tile-value {
  font-family: var(--font-num);
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 800;
  color: var(--lime);
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-tile-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text2);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-workout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
}

.next-workout-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 6px;
}

.next-workout-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.next-workout-meta {
  font-size: .8rem;
  color: var(--text2);
  margin-bottom: 14px;
}

.next-workout-exercises {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.ex-chip {
  font-size: .72rem;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  color: var(--text2);
  white-space: nowrap;
}

.ex-chip-more {
  color: var(--lime);
  border-color: rgba(200,255,0,.3);
  background: var(--lime-dim);
}

/* ── Session Header ─────────────────────────────────────────── */
.session-header {
  padding: 4px 0 16px;
}

.session-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.session-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.session-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--text2);
}

.session-badge-live {
  background: rgba(200,255,0,.1);
  border-color: rgba(200,255,0,.3);
  color: var(--lime);
}

/* ── Period Filter Tabs ─────────────────────────────────────── */
.period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.period-tab {
  flex: 1;
  padding: 7px 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}

.period-tab.active {
  background: var(--lime-dim);
  border-color: rgba(200,255,0,.35);
  color: var(--lime);
}

/* ── Misc ───────────────────────────────────────────────────── */
.empty         { text-align: center; color: var(--text2); padding: 48px 0; font-size: .9rem; }
.divider       { height: 1px; background: var(--border); margin: 14px 0; }
.text-sm       { font-size: .82rem; }
.text-muted    { color: var(--text2); }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.gap-8         { gap: 8px; }
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full        { width: 100%; }
.spinner       { text-align: center; padding: 48px; color: var(--text2); font-size: .9rem; }

/* ── Calibration stepper ────────────────────────────────────── */
.cal-stepper    { display: flex; align-items: center; gap: 0; background: var(--surface2); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.cal-step-btn   { background: none; border: none; color: var(--text1); font-size: 1.3rem; width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.cal-step-btn:active { background: var(--lime-dim); color: var(--lime); }
.cal-stepper input  { background: none; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); color: var(--text1); font-size: 1rem; font-weight: 600; height: 40px; padding: 0; margin: 0; line-height: 40px; vertical-align: middle; display: flex; align-items: center; justify-content: center; -moz-appearance: textfield; }
.cal-stepper input::-webkit-outer-spin-button,
.cal-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cal-step-unit  { font-size: .8rem; color: var(--text3); padding: 0 8px; }

/* ── Step-by-Step Training Flow ─────────────────────────────── */
.step-wrap         { display: flex; flex-direction: column; gap: 16px; padding-bottom: 80px; }
.step-progress-bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.step-progress-fill{ height: 100%; background: var(--lime); border-radius: 2px; transition: width .4s ease; }

.step-topbar       { display: flex; justify-content: space-between; align-items: center; }
.step-ex-label     { font-size: .82rem; color: var(--text3); font-weight: 500; }
.step-set-label    { font-size: .82rem; color: var(--lime); font-weight: 700; }

.step-avatar-row   { display: flex; align-items: center; gap: 14px; }
.step-ex-name      { font-size: 1.25rem; font-weight: 800; color: var(--text1); line-height: 1.2; }
.step-ex-sub       { font-size: .8rem; color: var(--text3); margin-top: 2px; }

.step-ref          { font-size: .78rem; color: var(--text3); background: var(--surface2);
                     padding: 6px 10px; border-radius: 8px; }

.step-phase-card   { background: var(--surface); border: 1px solid var(--border);
                     border-radius: 16px; padding: 24px 20px;
                     box-shadow: var(--card-shadow);
                     display: flex; flex-direction: column; align-items: center; gap: 16px; }

.step-phase-label  { font-size: .82rem; color: var(--text3); text-transform: uppercase;
                     letter-spacing: .08em; font-weight: 600; }
.step-weight-done  { font-size: 1.1rem; font-weight: 700; color: var(--text2); }
.step-hint         { font-size: .85rem; color: var(--text3); }

.step-adjuster     { display: flex; align-items: center; gap: 0; }
.step-adj          { width: 60px; height: 60px; background: var(--surface2);
                     border: 1px solid var(--border); color: var(--text1);
                     font-size: 1.8rem; border-radius: 14px; cursor: pointer;
                     display: flex; align-items: center; justify-content: center;
                     transition: background .12s; -webkit-tap-highlight-color: transparent; }
.step-adj:active   { background: var(--lime-dim); color: var(--lime); }
.step-val-wrap     { min-width: 110px; text-align: center; }
.step-value-main   { font-size: 3rem; font-weight: 900; color: var(--text1); line-height: 1; }
.step-val-unit     { font-size: .9rem; color: var(--text3); margin-left: 4px; }

.step-timer        { font-size: 3.5rem; font-weight: 900; color: var(--lime);
                     font-variant-numeric: tabular-nums; line-height: 1; }
.step-cta          { width: 100%; margin-top: 4px; }
.step-value-input  { background: none; border: none; border-bottom: 2px solid var(--border);
                     border-radius: 0; text-align: center; width: 100px; padding: 0;
                     color: var(--text1); -moz-appearance: textfield; }
.step-value-input:focus { outline: none; border-bottom-color: var(--lime); }
.step-value-input::-webkit-outer-spin-button,
.step-value-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Step menu ───────────────────────────────────────────────── */
.step-menu-list    { display: flex; flex-direction: column; gap: 8px; }
.step-menu-item    { display: flex; align-items: center; gap: 12px;
                     background: var(--surface); border: 1px solid var(--border);
                     border-radius: 12px; padding: 12px;
                     transition: background .12s; -webkit-tap-highlight-color: transparent; }
.step-menu-item:active { background: var(--surface2); }
.step-menu-active  { border-color: var(--lime); background: var(--lime-dim); }
.step-menu-done    { }
.step-menu-name    { font-weight: 600; font-size: .95rem; white-space: nowrap;
                     overflow: hidden; text-overflow: ellipsis; }
.step-menu-meta    { font-size: .78rem; color: var(--text3); margin-top: 2px; }
.step-menu-status  { font-size: .85rem; font-weight: 700; color: var(--lime);
                     min-width: 28px; text-align: right; }

/* ── Session History & Detail ───────────────────────────────── */
.hist-row          { display:flex; align-items:center; gap:10px; padding:12px;
                     background:var(--surface); border:1px solid var(--border);
                     border-radius:12px; margin-bottom:8px; cursor:pointer;
                     transition:background .12s; }
.hist-row:active   { background:var(--surface2); }
.hist-date-col     { min-width:90px; }
.hist-date         { font-weight:700; font-size:.9rem; }
.hist-day          { font-size:.78rem; color:var(--text3); margin-top:2px; }
.hist-stats-col    { flex:1; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.hist-stat         { font-size:.82rem; color:var(--text2);
                     background:var(--surface2); padding:2px 8px; border-radius:6px; }
.hist-pr-badge     { font-size:.78rem; font-weight:700; color:var(--lime);
                     background:var(--lime-dim); padding:2px 8px; border-radius:6px; }
.hist-arrow        { color:var(--text3); font-size:1.1rem; }

.hist-detail-stats { display:flex; gap:8px; margin-bottom:16px; }
.hist-detail-stat  { flex:1; background:var(--surface); border:1px solid var(--border);
                     border-radius:12px; padding:12px 8px; text-align:center; }
.hist-detail-val   { font-size:1.4rem; font-weight:800; color:var(--text1); }
.hist-detail-lbl   { font-size:.75rem; color:var(--text3); margin-top:2px; }

.hist-set-row      { display:flex; align-items:center; gap:8px; padding:6px 0;
                     border-bottom:1px solid var(--border); font-size:.9rem; }
.hist-set-row:last-child { border-bottom:none; }
.hist-set-num      { width:20px; color:var(--text3); font-size:.8rem; }
.hist-set-weight   { font-weight:700; min-width:52px; }
.hist-set-x        { color:var(--text3); }
.hist-set-reps     { flex:1; }
.hist-set-pr-tag   { font-size:.72rem; font-weight:700; color:var(--lime);
                     background:var(--lime-dim); padding:1px 6px; border-radius:4px; }
.hist-set-pr       { background:rgba(200,255,0,.04); border-radius:6px; padding:6px 4px; }
.hist-set-dur      { font-size:.72rem; color:var(--text3); margin-left:auto; }

.hist-section-label { font-size:.72rem; font-weight:700; color:var(--text3);
                      text-transform:uppercase; letter-spacing:.08em;
                      padding:12px 0 6px; }
.hist-mg-row        { display:flex; align-items:center; gap:8px; padding:4px 0; }
.hist-mg-name       { flex:1; font-size:.88rem; color:var(--text2); }
.hist-mg-reps       { font-size:.88rem; font-weight:700; color:var(--text1); }

/* ── Training Calendar ─────────────────────────────────────── */
.cal-card        { background:var(--surface); border:1px solid var(--border);
                   border-radius:16px; padding:14px 12px; margin-bottom:16px; }
.cal-month       { font-size:.8rem; font-weight:700; color:var(--text3);
                   text-transform:uppercase; letter-spacing:.08em; margin-bottom:10px; }
.cal-grid        { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.cal-dow         { text-align:center; font-size:.68rem; color:var(--text3);
                   font-weight:600; padding-bottom:4px; }
.cal-day         { position:relative; aspect-ratio:1; display:flex;
                   align-items:center; justify-content:center;
                   font-size:.8rem; border-radius:8px; color:var(--text2); }
.cal-empty       { }
.cal-day-today   { font-weight:800; color:var(--text1);
                   outline:2px solid var(--lime); outline-offset:-2px; }
.cal-day-trained { background:var(--lime); color:var(--accent-fg); font-weight:700; }
.cal-day-deload  { background:var(--surface2); border:1px solid var(--border);
                   color:var(--text3); font-style:italic; }
.cal-day-today.cal-day-trained { outline-color:var(--accent-fg); }
.cal-pr-dot      { position:absolute; bottom:3px; left:50%; transform:translateX(-50%);
                   width:4px; height:4px; border-radius:50%; background:#000; }
.cal-day-deload .cal-pr-dot   { background:var(--lime); }

/* ── Accent Swatches ───────────────────────────────────────── */
.accent-swatches     { display:flex; gap:10px; flex-wrap:wrap; }
.accent-swatch       { width:32px; height:32px; border-radius:50%; border:3px solid transparent;
                        cursor:pointer; transition:transform .15s, border-color .15s;
                        padding:0; flex-shrink:0; }
.accent-swatch:hover { transform:scale(1.15); }
.accent-swatch-active{ border-color:#fff; transform:scale(1.1); }

/* ── Day Select (Dashboard) ────────────────────────────────── */
.next-workout-day-select { margin-bottom: 10px; }
.day-select { width: auto; min-width: 140px; margin-bottom: 0; font-weight: 700;
              font-size: 1.1rem; background: var(--surface2);
              border: 1px solid var(--border); border-radius: var(--radius-sm);
              color: var(--text1); padding: 8px 12px; }

/* ── Cancel Session Overlay ────────────────────────────────── */
.cancel-overlay  { position: fixed; inset: 0; background: rgba(0,0,0,.7);
                   display: flex; align-items: center; justify-content: center;
                   z-index: 9999; padding: 24px; }
.cancel-dialog   { background: var(--surface); border: 1px solid var(--border);
                   border-radius: var(--radius); padding: 24px; max-width: 360px;
                   width: 100%; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.cancel-dialog-title  { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.cancel-dialog-body   { font-size: .88rem; color: var(--text2); margin-bottom: 20px;
                        line-height: 1.5; }
.cancel-dialog-actions{ display: flex; gap: 10px; justify-content: flex-end; }

/* ── Toast ─────────────────────────────────────────────────── */
.toast         { position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
                 transform: translateX(-50%) translateY(8px);
                 background: var(--surface3); border: 1px solid var(--border);
                 color: var(--text1); font-size: .88rem; font-weight: 600;
                 padding: 10px 20px; border-radius: 24px;
                 box-shadow: 0 4px 20px rgba(0,0,0,.5);
                 opacity: 0; transition: opacity .25s, transform .25s;
                 z-index: 9998; white-space: nowrap; pointer-events: none; }
.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Password inputs (settings) ────────────────────────────── */
.settings-pw-input { width: 100%; background: var(--surface2); border: 1px solid var(--border);
                     border-radius: var(--radius-sm); color: var(--text1); padding: 10px 12px;
                     font-family: var(--font-body); font-size: .9rem; margin: 0; }
.settings-pw-input:focus { outline: none; border-color: var(--lime); }

.session-notes-input { width: 100%; min-height: 72px; background: transparent; border: none;
  color: var(--text); font: inherit; font-size: .92rem; resize: none; overflow: hidden;
  padding: 0; line-height: 1.5; }
.session-notes-input:focus { outline: none; }
.session-notes-input::placeholder { color: var(--text-dim); }
