/* Cameron Fitness PWA — Design System v2
 * "Bold athletic energy, premium execution"
 * Loaded: Bricolage Grotesque (display), Inter (body), JetBrains Mono (numbers)
 */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* === Brand palette (same in both themes) === */
  --amber: #ff7a1a;
  --amber-dim: rgba(255, 122, 26, 0.14);
  --amber-glow: rgba(255, 122, 26, 0.05);
  --amber-shadow: rgba(255, 122, 26, 0.3);

  --navy: #0e1a2b;
  --navy-2: #16243e;

  --rose: #ff5a78;
  --rose-dim: rgba(255, 90, 120, 0.14);
  --rose-glow: rgba(255, 90, 120, 0.05);

  --sage: #7a8e6f;
  --sage-dim: rgba(122, 142, 111, 0.16);

  /* === Text on bright surfaces (amber/rose/sage buttons) ===
     Always dark — these backgrounds are always bright, so contrast stays. */
  --text-on-bright: #0a0a0a;

  /* === Surfaces (DARK default) === */
  --bg: #0a0a0a;
  --card: #141414;
  --card-2: #1c1c1c;
  --card-3: #232323;
  --border: #262626;
  --border-2: #333;
  --backdrop: rgba(0, 0, 0, 0.45);

  /* === Text (DARK default) === */
  --text: #f5f5f5;
  --text-muted: #8a8a8a;
  --text-faint: #555;
  --text-dim: #6a6a6a;

  /* === Shadows (always dark, regardless of theme) === */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  --shadow-bottom: 0 -4px 30px rgba(0, 0, 0, 0.4);
  --shadow-top: 0 -20px 40px rgba(0, 0, 0, 0.5);
  --shadow-header: 0 2px 8px rgba(0, 0, 0, 0.4);

  /* === Type === */
  --display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  /* === Spacing (v2: 8/16/24/32/48/64) === */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;
  --s-6: 64px;

  /* === Radii === */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;
}

/* === Light theme override (manual + auto via media query below) === */
[data-theme="light"] {
  --bg: #faf8f3;
  --card: #ffffff;
  --card-2: #f5f2eb;
  --card-3: #ebe7df;
  --border: #e5e1d8;
  --border-2: #d5d0c4;
  --backdrop: rgba(20, 20, 20, 0.35);

  --text: #1a1816;
  --text-muted: #6a6660;
  --text-faint: #b0aca4;
  --text-dim: #8a8680;

  /* Light theme uses warmer, lighter shadows */
  --shadow-sm: 0 2px 8px rgba(60, 50, 30, 0.08);
  --shadow-md: 0 10px 30px rgba(60, 50, 30, 0.06);
  --shadow-lg: 0 20px 50px -20px rgba(60, 50, 30, 0.15);
  --shadow-bottom: 0 -4px 30px rgba(60, 50, 30, 0.08);
  --shadow-top: 0 -20px 40px rgba(60, 50, 30, 0.08);
  --shadow-header: 0 2px 8px rgba(60, 50, 30, 0.06);
}

/* === Auto: respect system preference only when user hasn't chosen === */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #faf8f3;
    --card: #ffffff;
    --card-2: #f5f2eb;
    --card-3: #ebe7df;
    --border: #e5e1d8;
    --border-2: #d5d0c4;
    --backdrop: rgba(20, 20, 20, 0.35);

    --text: #1a1816;
    --text-muted: #6a6660;
    --text-faint: #b0aca4;
    --text-dim: #8a8680;

    --shadow-sm: 0 2px 8px rgba(60, 50, 30, 0.08);
    --shadow-md: 0 10px 30px rgba(60, 50, 30, 0.06);
    --shadow-lg: 0 20px 50px -20px rgba(60, 50, 30, 0.15);
    --shadow-bottom: 0 -4px 30px rgba(60, 50, 30, 0.08);
    --shadow-top: 0 -20px 40px rgba(60, 50, 30, 0.08);
    --shadow-header: 0 2px 8px rgba(60, 50, 30, 0.06);
  }
}

/* === Reduce motion: kill animations + transitions when user opts in === */
[data-reduce-motion="1"] *,
[data-reduce-motion="1"] *::before,
[data-reduce-motion="1"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  font-feature-settings: 'cv11', 'ss01';
}

body {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  -webkit-appearance: none;
}

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

a { color: var(--amber); text-decoration: none; }

/* === Type utilities === */

.display { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* === App shell === */

#app { flex: 1; display: flex; flex-direction: column; }

main { flex: 1; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* === Topbar === */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  /* iOS standalone mode: push down past the status bar */
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}

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

.shape-grid {
  display: flex;
  gap: 2px;
  align-items: center;
}

.shape-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shape-cell {
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--card-2);
}

.shape-cell.done {
  background: var(--amber);
  box-shadow: 0 0 4px -1px var(--amber-shadow);
}

.shape-cell.today {
  outline: 1px solid var(--text-muted);
  outline-offset: 1px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  color: var(--amber);
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--amber-dim);
  color: var(--amber);
  padding: 5px 11px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* === Hero === */

.hero {
  position: relative;
  margin: 4px 16px 0;
  border-radius: var(--r-2xl);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--navy);
  box-shadow: var(--shadow-lg);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 40%, rgba(10,10,10,0.6) 100%);
  pointer-events: none;
}

.hero-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--backdrop);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.hero-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.hero-tag.rest .dot { background: var(--sage); box-shadow: 0 0 10px var(--sage); }

/* === Content blocks === */

.content { padding: 32px 20px 100px; }

.date-line {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.session-block { margin-bottom: 32px; }

.session-title {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin: 8px 0 14px;
}

.session-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.session-meta .mono {
  font-family: var(--mono);
  color: var(--text);
  font-weight: 500;
}

/* PT voice */
.pt-voice {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 18px 0 18px 20px;
  border-left: 3px solid var(--amber);
  margin-bottom: 24px;
}

.pt-voice em {
  font-style: normal;
  color: var(--amber);
}

.pt-voice-top {
  margin: 12px 0 20px;
  font-size: 20px;
  font-style: italic;
  background: linear-gradient(90deg, var(--amber-dim) 0%, transparent 100%);
  padding: 14px 16px;
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  position: relative;
}

.pt-voice-top::before {
  content: '"';
  position: absolute;
  top: -8px;
  left: 8px;
  font-family: var(--display);
  font-size: 36px;
  color: var(--amber);
  opacity: 0.5;
  line-height: 1;
}

/* PR callout */
.pr-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--rose-dim) 0%, transparent 100%);
  border-radius: var(--r-lg);
  margin-bottom: 32px;
}

.pr-pill {
  background: var(--rose);
  color: var(--text-on-bright);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
}

.pr-text {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.pr-text strong {
  color: var(--rose);
  font-weight: 700;
}

/* CTA */
button.start-btn {
  display: block;
  width: 100%;
  padding: 20px;
  background: var(--amber);
  color: var(--text-on-bright);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  border-radius: var(--r-lg);
  cursor: pointer;
  box-shadow: 0 10px 30px -8px var(--amber-shadow);
  transition: transform 0.1s, box-shadow 0.2s;
}

button.start-btn:active {
  transform: scale(0.98);
  box-shadow: 0 6px 20px -8px var(--amber-shadow);
}

/* Daily check-in */
.checkin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  background: var(--card);
  border-radius: var(--r-lg);
  margin-top: 32px;
  border: 1px solid var(--border);
}

.checkin-text h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.checkin-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.checkin-btn {
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
}

.checkin-btn.done {
  background: var(--sage-dim);
  color: var(--sage);
  border-color: var(--sage);
}

.checkin-card {
  cursor: pointer;
  transition: border-color 0.15s;
}
.checkin-card:hover { border-color: var(--amber); }

.checkin-mood-pill {
  font-size: 28px;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-2);
  border-radius: 50%;
}

.mood-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.mood-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-family: var(--body);
  transition: all 0.15s;
}

.mood-btn:active { transform: scale(0.95); }
.mood-btn.selected {
  border-color: var(--amber);
  background: var(--amber-dim);
  color: var(--text);
}

.mood-emoji {
  font-size: 24px;
  line-height: 1;
}

.mood-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

/* Recent */
.recent-section { margin-top: 40px; }

.recent-section .label { margin-bottom: 16px; display: block; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.recent-item:last-child { border-bottom: none; }

.recent-day {
  width: 44px;
  flex-shrink: 0;
  text-align: center;
}

.recent-day .day {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}

.recent-day .month {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-top: 2px;
}

.recent-info { flex: 1; min-width: 0; }
.recent-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.recent-stats {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.recent-stats .pr { color: var(--rose); font-weight: 700; }

/* === Rest card (rest day state) === */

.rest-card {
  background: var(--card);
  border-radius: var(--r-2xl);
  padding: 32px 24px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.rest-title {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 6px 0 8px;
}

.rest-sub {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  color: var(--sage);
  letter-spacing: -0.2px;
  margin-bottom: 24px;
}

.rest-next {
  background: var(--card-2);
  border-radius: var(--r-md);
  padding: 16px;
}

.rest-next .label { margin-bottom: 6px; }
.rest-next .name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.rest-next .when {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* === Skipped banner (missed day) === */

.skipped-banner {
  background: var(--card);
  border-left: 3px solid var(--text-faint);
  padding: 12px 16px;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 16px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.skipped-banner .icon { font-size: 14px; opacity: 0.6; }
.skipped-banner strong { color: var(--text); font-weight: 600; }

/* === Plan screen === */

.plan-header {
  padding: 14px 20px 0;
}

.plan-title {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 16px 0 4px;
  padding: 0 20px;
}

.plan-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-bottom: 20px;
  padding: 0 20px;
}

.session-list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px; }

.session-row {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
}

.session-row.next {
  border-color: rgba(255, 122, 26, 0.4);
  background:
    linear-gradient(90deg, var(--amber-dim) 0%, transparent 100%),
    var(--card);
}

.session-num {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.session-row.next .session-num { background: var(--amber); color: var(--text-on-bright); }
.session-row.done .session-num { background: var(--sage); color: var(--text-on-bright); }

.session-info { flex: 1; min-width: 0; }
.session-focus {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.session-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.session-side { text-align: right; flex-shrink: 0; }
.session-status {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.session-row.done .session-status { color: var(--sage); }

.next-pill {
  display: inline-block;
  background: var(--amber);
  color: var(--text-on-bright);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* === Tab bar === */

nav.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 12px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  flex: 1;
  padding: 4px 0;
}

.tab.active { color: var(--amber); }

.tab-icon {
  width: 22px;
  height: 22px;
}

/* === States === */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.error {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  padding: 16px;
  border-radius: var(--r-md);
  margin: 16px;
  font-size: 13px;
}

.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.coming-soon .icon { font-size: 48px; margin-bottom: 20px; opacity: 0.5; }
.coming-soon h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.coming-soon p { font-size: 14px; max-width: 280px; line-height: 1.5; }

/* === Workout (live) === */

.workout-view {
  padding: 0;
}

.workout-topbar-wrap {
  padding: 14px 20px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
}

.workout-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 16px;
  gap: 12px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.workout-stats {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.workout-stats .stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  text-align: center;
  flex: 1;
  max-width: 84px;
}

.workout-stats .stat-label {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.workout-stats .stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.workout-stats .stat-value.accent {
  color: var(--rose);
}

.workout-header {
  padding: 8px 20px 16px;
}

.workout-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 6px;
}

.workout-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.w-sections {
  padding: 8px 16px 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.w-section {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.w-section.done {
  border-color: rgba(122, 142, 111, 0.3);
}

.w-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.w-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text);
}

.w-section-title .done-text { color: var(--sage); }

.w-section-title .check-mark {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--text-on-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.w-section-side {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
}

.w-section-progress {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.w-section.open .w-section-side svg { transform: rotate(180deg); }

.w-section-body {
  padding: 0 8px 8px;
}

.w-exercise {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.w-exercise:first-child { border-top: none; }

.w-exercise.current {
  background: linear-gradient(90deg, var(--rose-dim) 0%, transparent 100%);
  margin: 0 -8px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border-top: none;
}

.w-exercise.done { opacity: 0.6; }
.w-exercise.done .ex-name { text-decoration: line-through; }

.ex-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.w-exercise.current .ex-icon { color: var(--rose); background: rgba(255, 90, 120, 0.1); }
.w-exercise.done .ex-icon { color: var(--sage); }

.ex-info { flex: 1; min-width: 0; }
.ex-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.w-exercise.current .ex-name { color: var(--rose); }
.ex-pr-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--rose-dim);
  color: var(--rose);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}
.ex-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ex-status { flex-shrink: 0; }
.ex-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.ex-check.done { background: var(--sage); color: var(--text-on-bright); }
.ex-check.current { background: var(--rose); color: var(--text-on-bright); }
.ex-check.pending {
  border: 1.5px solid var(--border);
}

button.finish-btn {
  position: fixed;
  bottom: 90px;
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  padding: 16px;
  background: var(--rose);
  color: var(--text-on-bright);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px -8px rgba(255, 90, 120, 0.4);
  z-index: 50;
}

/* === Set Logger (sheet) — v2 polish: card rows, warmup as prep, progress meter === */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
}

.sheet {
  position: fixed;
  top: 24px;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  z-index: 201;
  overflow-y: auto;
  padding: 4px 20px 32px;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.55);
}

/* Subtle inner top edge so the sheet doesn't blend with the backdrop */
.sheet::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
  pointer-events: none;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 10px auto 14px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 12px;
}

button.sheet-back {
  color: var(--amber);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  transition: opacity 0.15s;
}
button.sheet-back:active { opacity: 0.6; }

.sheet-title {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Progress meter — replaces "Exercise X of Y" with a tactile visual */
.progress-meter {
  display: flex;
  gap: 4px;
  padding: 0 4px 18px;
}
.progress-meter-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.2s;
}
.progress-meter-seg.done { background: var(--sage); }
.progress-meter-seg.current {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose-dim);
}

.sheet-title-main {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 6px;
  padding: 0 4px;
}

/* "Next: Incline DB Press" peek */
.next-up {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.next-up-label {
  font-family: var(--body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 10px;
  color: var(--text-faint);
}
.next-up-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.1px;
}
.next-up-done {
  color: var(--sage);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}

.sheet-content { padding: 0 0 0; }

.sheet-exercise {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin: 0 4px 18px;
}

.ex-thumb {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--rose);
  flex-shrink: 0;
}

.ex-info-line {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
}
.ex-info-line .mono { color: var(--text); font-weight: 700; }
.ex-info-line em {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 500;
}

.rest-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--amber-dim);
  color: var(--amber);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  font-family: var(--body);
  letter-spacing: 0.3px;
}

/* === Set list — card rows, not table rows === */

.set-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 4px 12px;
}

/* Header row — small, monochrome, sits above the cards */
.set-row.head {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr 44px;
  gap: 8px;
  padding: 0 4px 4px;
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.set-row.head > div { text-align: center; }
.set-row.head > div:nth-child(1) { text-align: left; }

/* Working + completed + warmup cards */
.set-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr 44px;
  align-items: center;
  padding: 14px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.set-row.done {
  opacity: 0.55;
  background: var(--card);
}

/* The current/active set — rose ring, lifted. Warmups never get this. */
.set-row.current {
  background: var(--card);
  border-color: var(--rose);
  box-shadow: 0 0 0 1px var(--rose), 0 8px 24px -12px var(--rose-dim);
}
/* Belt-and-suspenders: warmup cards can never be current, even if a class slips through */
.set-row.set-card-warmup.current {
  background: var(--amber-glow);
  border-color: rgba(255, 122, 26, 0.25);
  border-style: dashed;
  box-shadow: none;
}
.set-row.set-card-warmup.current .set-input,
.set-row.set-card-warmup.current .set-num,
.set-row.set-card-warmup.current .set-prev { color: var(--text-muted); }

/* Warmup row — amber tint, no chrome, no check button */
.set-row.set-card-warmup {
  background: var(--amber-glow);
  border-color: rgba(255, 122, 26, 0.25);
  border-style: dashed;
  padding: 10px 14px;
}
.set-row.set-card-warmup .set-input {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  font-weight: 500;
}
.set-row.set-card-warmup .set-check { color: var(--amber); }

.set-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  text-align: left;
  color: var(--text-muted);
  letter-spacing: -0.5px;
}
.set-num.warmup {
  color: var(--amber);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.set-row.current .set-num { color: var(--rose); }
.set-row.done .set-num { color: var(--sage); }

.set-prev {
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
  font-family: var(--mono);
  letter-spacing: 0.2px;
}

.set-input {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 4px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  min-width: 0;
  height: 36px;
  transition: border-color 0.15s, background 0.15s;
}
.set-input:focus {
  border-color: var(--rose);
  background: var(--card);
  outline: none;
}
.set-row.current .set-input {
  border-color: var(--rose);
  background: rgba(255, 90, 120, 0.04);
}
.set-row.current .set-input:focus {
  background: var(--card);
}

.set-check {
  display: flex;
  justify-content: center;
  align-items: center;
}

.check-done {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--text-on-bright);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.check-warmup {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--amber-dim);
  color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.5px;
}

button.check-empty {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--rose);
  background: var(--rose);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px -4px var(--rose-dim);
}
button.check-empty::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-bright);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
}
button.check-empty:active { transform: scale(0.9); }
button.check-empty:active::after { opacity: 1; transform: scale(1.1); }
.set-row.current button.check-empty {
  animation: pulse 1.6s ease-in-out infinite;
  background: var(--rose);
  box-shadow: 0 0 0 6px var(--rose-glow), 0 8px 24px -4px var(--rose-dim);
}
.set-row.current button.check-empty::after { opacity: 0.6; }
.check-empty.pending {
  width: 28px; height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.check-empty.pending::after { display: none; }

/* Set plates — moves to bottom of the card, not bottom of inputs row */
.set-plates {
  grid-column: 2 / 5;
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  letter-spacing: 0.4px;
  font-family: var(--mono);
}

/* Extras (note + RPE) sit below the card as an expansion */
.set-extras {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.set-extra-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
  font-family: var(--body);
  letter-spacing: 0.2px;
  transition: border-color 0.15s, color 0.15s;
}
.set-extra-btn.has-value {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-glow);
}

.rpe-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rpe-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-right: 4px;
}

.rpe-btn {
  width: 36px;
  height: 36px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.rpe-btn:active { transform: scale(0.92); }
.rpe-btn.selected {
  background: var(--amber);
  color: var(--text-on-bright);
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-dim);
}

.set-note-input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--amber);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
}
.set-note-input:focus { background: var(--card); outline: none; }

/* === Workout list (main, behind the sheet) — small visual upgrades === */

/* The "back to today" link at the top of the workout list */
.workout-topbar-wrap { padding: 12px 20px 4px; }

.back-link {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.back-link:hover { color: var(--text); }

/* The topbar (Time / Vol / Sets) is fine — keep it. Just align padding */
.workout-topbar { padding: 8px 20px 12px; }

/* Section card spacing */
.w-section {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s;
}
.w-section.open { border-color: var(--border-2); }
.w-section.done { border-color: rgba(122, 142, 111, 0.3); }
.w-section-body { padding: 0 6px 6px; }

/* Exercise list rows: slightly more breathing room + clearer hover state */
.w-exercise {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.w-exercise:active { background: var(--card-2); }
.w-exercise:first-child { border-top: none; }
.w-exercise.current {
  background: linear-gradient(90deg, var(--rose-dim) 0%, transparent 100%);
  margin: 0 -6px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border-top: none;
}
.w-exercise.done { opacity: 0.6; }
.w-exercise.done .ex-name { text-decoration: line-through; text-decoration-color: var(--sage); text-decoration-thickness: 1.5px; }

.ex-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.w-exercise.current .ex-icon { color: var(--rose); background: rgba(255, 90, 120, 0.1); }
.w-exercise.done .ex-icon { color: var(--sage); background: var(--sage-dim); }

.ex-info { flex: 1; min-width: 0; }
.ex-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.w-exercise.current .ex-name { color: var(--rose); }
.ex-pr-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  background: var(--rose-dim);
  color: var(--rose);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}
.ex-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.2px;
}

.ex-status { flex-shrink: 0; }
.ex-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ex-check.done { background: var(--sage); color: var(--text-on-bright); }
.ex-check.current { background: var(--rose); color: var(--text-on-bright); }
.ex-check.pending {
  border: 1.5px solid var(--border);
}
.w-exercise.current .ex-check.pending { border-color: var(--rose); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--rose-dim); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

button.add-set {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

button.add-set:hover { color: var(--amber); border-color: var(--amber); }

.rest-timer {
  position: sticky;
  bottom: -32px;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 40%);
  padding-top: 32px;
  margin: 0 -20px -32px;
  padding-left: 20px;
  padding-right: 20px;
}

.rest-card {
  background: var(--card);
  border: 1.5px solid var(--rose);
  border-radius: var(--r-xl);
  padding: 20px;
  text-align: center;
  box-shadow: 0 10px 30px -8px rgba(255, 90, 120, 0.25);
}

.rest-label {
  font-size: 11px;
  color: var(--rose);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.rest-time {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.rest-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

button.rest-btn {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
}

button.rest-btn.skip {
  background: var(--rose);
  color: var(--text-on-bright);
  border-color: var(--rose);
  padding: 8px 24px;
}

button.swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  border-radius: var(--r-md);
}

button.swap-btn:hover { color: var(--text); }

/* === Check-in Page === */

.checkin-page {
  padding: 0 20px 40px;
}

.checkin-intro {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  font-style: italic;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.checkin-slider {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

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

.spark {
  display: block;
}

.slider-label {
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
}

.checkin-timestamp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  margin: -12px 0 16px;
  letter-spacing: 0.4px;
}

.slider-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--amber);
}

.slider-track {
  position: relative;
  height: 6px;
  background: var(--card-2);
  border-radius: 3px;
  cursor: pointer;
  touch-action: none;
}

.slider-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--amber);
  border-radius: 3px;
  pointer-events: none;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  background: var(--text);
  border: 3px solid var(--amber);
  border-radius: 50%;
  box-shadow: var(--shadow-header);
  pointer-events: none;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.checkin-input-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weight-input,
.text-input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
}

.weight-input {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}

.weight-input:focus,
.text-input:focus {
  outline: none;
  border-color: var(--amber);
}

.weight-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

button.save-btn {
  display: block;
  width: 100%;
  padding: 18px;
  background: var(--amber);
  color: var(--text-on-bright);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: var(--r-lg);
  cursor: pointer;
  margin-top: 24px;
  box-shadow: 0 8px 24px -6px var(--amber-shadow);
}

/* === History detail styles === */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 0;
}

.page-title {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
  padding: 0 20px;
}

.page-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin: 4px 0 20px;
  padding: 0 20px;
}

.export-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.export-btn:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.summary-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px 12px;
  display: flex;
  justify-content: space-around;
  margin: 0 20px 18px;
  border: 1px solid var(--border);
}

.summary-item { text-align: center; }

.summary-value {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: -0.5px;
}

.summary-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-top: 2px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 0 20px 18px;
}

.filter-pill {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: var(--amber);
}

.history-group { margin-bottom: 24px; padding: 0 20px; }

.history-group .group-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 10px;
}

.session-card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
}

.session-day {
  width: 50px;
  flex-shrink: 0;
  text-align: center;
}

.session-day .day {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}

.session-day .month {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-top: 3px;
}

.session-body { flex: 1; min-width: 0; }

.session-focus {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.focus-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--body);
}

.focus-tag.focus-amber {
  background: var(--amber-dim);
  color: var(--amber);
}

.focus-tag.focus-rose {
  background: var(--rose-dim);
  color: var(--rose);
}

.focus-tag.focus-sage {
  background: var(--sage-dim);
  color: var(--sage);
}

.session-stats {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.session-stats .pr-pill {
  background: var(--rose);
  color: var(--text-on-bright);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-stats .chev {
  margin-left: auto;
  color: var(--text-faint);
  display: inline-flex;
}

.session-card {
  cursor: pointer;
  transition: border-color 0.15s;
}
.session-card:hover { border-color: var(--amber); }

.view-toggle {
  display: flex;
  gap: 8px;
  margin: 0 20px 18px;
}

.toggle-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
}

.toggle-btn.active {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: var(--amber);
}

/* === Heatmap === */

.heatmap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin: 0 20px 24px;
  overflow-x: auto;
}

.heatmap-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  height: 14px;
}

.heatmap-month {
  font-size: 9px;
  color: var(--text-faint);
}

.heatmap-grid {
  display: flex;
  gap: 4px;
}

.heatmap-days {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 700;
  padding-top: 2px;
}

.heatmap-days span {
  height: 12px;
  line-height: 12px;
}

.heatmap-weeks {
  display: flex;
  gap: 2px;
  flex: 1;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.heat-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--card-2);
  min-height: 12px;
}

.heat-cell.h-1 { background: rgba(255, 122, 26, 0.25); }
.heat-cell.h-2 { background: rgba(255, 122, 26, 0.5); }
.heat-cell.h-3 { background: rgba(255, 122, 26, 0.75); }
.heat-cell.h-4 { background: var(--amber); }
.heat-cell.future { opacity: 0.2; }
.heat-cell.today { outline: 1.5px solid var(--text-muted); outline-offset: 1px; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 10px;
  color: var(--text-faint);
  justify-content: flex-end;
}

.heatmap-legend .heat-cell { width: 12px; height: 12px; }

/* === Year in review === */

.year-review {
  padding: 0 0 40px;
}

.year-hero {
  padding: 20px 20px 24px;
  text-align: center;
  position: relative;
}

.year-hero-tag {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.year-hero-title {
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
  font-size: 80px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--amber);
  margin: 0 0 12px;
  font-variant-numeric: tabular-nums;
}

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

.heatmap-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin: 0 20px 24px;
  overflow-x: auto;
}

.heatmap-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.heatmap-total {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-faint);
}

.legend-label { margin: 0 4px; }

.legend-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--card-2);
  display: inline-block;
}

.legend-cell[data-intensity="1"] { background: rgba(255, 122, 26, 0.25); }
.legend-cell[data-intensity="2"] { background: rgba(255, 122, 26, 0.5); }
.legend-cell[data-intensity="3"] { background: rgba(255, 122, 26, 0.75); }
.legend-cell[data-intensity="4"] { background: var(--amber); }

.heatmap-wrap {
  display: flex;
  gap: 4px;
}

.heatmap-day-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 700;
  padding-top: 2px;
  flex-shrink: 0;
  width: 22px;
}

.heatmap-day-labels span {
  height: 11px;
  line-height: 11px;
}

.heatmap-grid {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.heatmap-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--card-2);
  min-height: 8px;
}

.heatmap-cell[data-intensity="1"] { background: rgba(255, 122, 26, 0.25); }
.heatmap-cell[data-intensity="2"] { background: rgba(255, 122, 26, 0.5); }
.heatmap-cell[data-intensity="3"] { background: rgba(255, 122, 26, 0.75); }
.heatmap-cell[data-intensity="4"] { background: var(--amber); }
.heatmap-cell.heatmap-future { opacity: 0.25; }

.heatmap-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 9px;
  color: var(--text-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
  padding-left: 26px;
  height: 12px;
}

.heatmap-months span {
  text-align: left;
}

.top-prs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px;
  margin-bottom: 24px;
}

.top-pr-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.top-pr-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--amber);
}

.top-pr-rank {
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: var(--amber);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.top-pr-info {
  flex: 1;
  min-width: 0;
}

.top-pr-name {
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-pr-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.top-pr-e1rm {
  text-align: right;
  flex-shrink: 0;
}

.top-pr-e1rm-value {
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--amber);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.top-pr-e1rm-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
  font-weight: 700;
}

.muscle-bars {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.muscle-row {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.muscle-name {
  text-transform: capitalize;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muscle-bar-wrap {
  height: 8px;
  background: var(--card-2);
  border-radius: 4px;
  overflow: hidden;
}

.muscle-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), #ffa44d);
  border-radius: 4px;
  transition: width 0.3s;
}

.muscle-vol {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.streak-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--card), var(--card-2));
  border: 1px solid var(--amber);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 20px 24px;
}

.streak-emoji {
  font-size: 40px;
  line-height: 1;
}

.streak-info { flex: 1; }
.streak-value {
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}
.streak-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-top: 2px;
}
.streak-dates {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.year-review-actions {
  padding: 0 20px;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.year-review-actions .btn-primary {
  min-width: 200px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 360px) {
  .year-hero-title { font-size: 64px; }
  .muscle-row { grid-template-columns: 70px 1fr 56px; font-size: 11px; }
}

/* === Session detail === */

.detail-header {
  padding: 14px 20px 20px;
}

.detail-date {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-bottom: 6px;
}

.detail-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.detail-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  text-align: center;
  flex: 1;
}

.detail-stat-val {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.detail-stat-val.accent { color: var(--rose); }
.detail-stat-lbl {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-top: 2px;
}

.pr-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--rose-dim);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text);
}

.pr-text-inline {
  color: var(--rose);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 12px;
}

.detail-exercises {
  padding: 0 20px 40px;
}

.detail-ex {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.detail-ex-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}

.detail-ex-sets {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.set-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.set-summary-row:first-child { border-top: none; }

.set-summary-idx {
  font-family: var(--display);
  font-weight: 800;
  color: var(--text-muted);
  font-size: 11px;
  min-width: 16px;
  text-align: center;
}

.set-summary-load, .set-summary-reps {
  font-family: var(--mono);
  color: var(--text);
  font-weight: 600;
}

.rpe-tag {
  background: var(--amber-dim);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}

.set-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
  padding-left: 24px;
}

.empty-detail {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* === Progress styles === */

.chart-card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 0 20px 12px;
  border: 1px solid var(--border);
}

.recovery-card {
  background: linear-gradient(135deg, var(--sage-dim) 0%, transparent 100%), var(--card);
  border-radius: var(--r-lg);
  padding: 20px;
  margin: 0 20px 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.recovery-left { display: flex; flex-direction: column; gap: 4px; }

.recovery-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

.recovery-value {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 800;
  color: var(--sage);
  line-height: 1;
  letter-spacing: -0.04em;
}

.recovery-tag {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  margin-top: 2px;
}

.recovery-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  flex: 1;
  min-width: 120px;
}

.mg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mg-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: 8px;
}

.mg-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  text-transform: capitalize;
}

.mg-bar-track {
  background: var(--card-2);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.mg-bar-fill {
  background: linear-gradient(90deg, var(--amber) 0%, var(--rose) 100%);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.mg-vol {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.lift-list {
  margin: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lift-row {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
}

.lift-info { flex: 1; min-width: 0; }

.lift-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.lift-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--mono);
}

.lift-spark { flex-shrink: 0; }

.lift-current {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  min-width: 40px;
  text-align: right;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
}

.chart-range {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.chart-svg {
  width: 100%;
  height: 110px;
  display: block;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-faint);
}

.chart-meta strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
}

.goal-list {
  margin: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-row {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
}

.goal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

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

.goal-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.goal-progress {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.pr-list {
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0 20px 32px;
}

.pr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.pr-row:first-child { border-top: none; }

.pr-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.pr-date {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.pr-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--rose);
}

/* === Toast === */

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--sage);
  color: var(--text-on-bright);
  padding: 14px 24px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 700;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-md);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* === More menu (Profile) === */

.menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 0 20px 8px;
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.menu-row:hover { border-color: var(--amber); }
.menu-row[data-action] { cursor: pointer; }

.settings-card {
  background: var(--card);
  border-radius: var(--r-lg);
  margin: 0 20px 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.settings-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.settings-section:first-child { border-top: none; }

.settings-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 10px;
}

.settings-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-pill {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  min-width: 48px;
  cursor: pointer;
}

.toggle-pill.active {
  background: var(--amber);
  color: var(--text-on-bright);
  border-color: var(--amber);
}

/* v1.4: settings input (display name) */
.settings-input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--body);
  color: var(--text);
  margin-top: 8px;
  transition: border-color 0.15s;
}
.settings-input:focus {
  outline: none;
  border-color: var(--amber);
}
.settings-input::placeholder {
  color: var(--text-faint);
}
.settings-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* v1.4: About card */
.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin: 0 16px 16px;
  overflow: hidden;
}
.about-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.about-section:first-child { border-top: none; }
.about-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.0px;
  font-weight: 700;
  margin-bottom: 6px;
}
.about-value {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.about-stat {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.about-stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.about-value.about-warn {
  color: var(--amber);
}
.changelog { margin-top: 4px; }
.changelog-block { margin-top: 12px; }
.changelog-block:first-child { margin-top: 0; }
.changelog-version {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}
.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.changelog-list li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 0 3px 14px;
  position: relative;
  line-height: 1.45;
}
.changelog-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

.app-version {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
  padding: 32px 20px 80px;
}

.section-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 0 20px;
  margin: 24px 0 8px;
}

.menu-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--amber);
  flex-shrink: 0;
}

.menu-info { flex: 1; min-width: 0; }

.menu-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.menu-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.menu-arrow {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* === Catch-up offer (missed day) === */

.catch-up {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
}

.catch-up-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}

.catch-up-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.catch-up-btns {
  display: flex;
  gap: 8px;
}

.catch-up-btns button {
  flex: 1;
  padding: 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--amber);
  color: var(--text-on-bright);
  border: 1px solid var(--amber);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* === Swap modal === */

.swap-sheet { z-index: 202; }

.sheet-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

.swap-section { margin-bottom: 16px; }

.swap-section .section-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 10px;
}

.swap-option {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  cursor: pointer;
}

.swap-option.recommended {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-dim) 0%, transparent 60%), var(--card);
}

.swap-option.current {
  opacity: 0.5;
  cursor: not-allowed;
}

.swap-option .thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.swap-option.recommended .thumb { color: var(--amber); }

.swap-option .info { flex: 1; min-width: 0; }

.rec-pill {
  display: inline-block;
  background: var(--amber);
  color: var(--text-on-bright);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.swap-option .name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.swap-option .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.swap-reason {
  font-size: 10px;
  color: var(--amber);
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.2px;
}

.swap-option .select {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.remember-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card-2);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  margin-top: 12px;
}

.remember-row input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
}

.remember-row label {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

button.confirm-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--card-2);
  color: var(--text-faint);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-radius: var(--r-md);
  cursor: not-allowed;
  margin-top: 16px;
}

button.confirm-btn:not([disabled]) {
  background: var(--amber);
  color: var(--text-on-bright);
  cursor: pointer;
}


/* === Install banner (PWA) === */

.install-banner {
  position: fixed;
  bottom: 90px;
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--amber);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  z-index: 90;
  box-shadow: var(--shadow-bottom);
  animation: installSlideUp 0.4s ease-out;
}

@keyframes installSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.install-banner[hidden] { display: none; }

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-banner-text { flex: 1; min-width: 0; }

.install-banner-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.install-banner-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.install-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.install-btn-dismiss,
.install-btn-install {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.install-btn-install {
  background: var(--amber);
  color: var(--text-on-bright);
  border-color: var(--amber);
}

/* === Update toast (service worker) === */

.update-toast {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--sage);
  color: var(--text-on-bright);
  padding: 12px 16px;
  border-radius: var(--r-md);
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: updateSlideDown 0.3s ease-out;
  z-index: 200;
}

@keyframes updateSlideDown {
  from { transform: translateY(-40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.update-toast button {
  background: rgba(0, 0, 0, 0.15);
  border: none;
  color: var(--text-on-bright);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* === Onboarding overlay (v1.4) === */
.onb-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow-y: auto;
  animation: onbFade 0.3s ease-out;
}

@keyframes onbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.onb-screen {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 40px;
  min-height: 100%;
  box-sizing: border-box;
}

.onb-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 0;
}

.onb-logomark {
  width: 72px;
  height: 72px;
  color: var(--amber);
  margin-bottom: 24px;
}
.onb-logomark svg { width: 100%; height: 100%; }

.onb-check {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}
.onb-check svg { width: 100%; height: 100%; }

.onb-headline {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  line-height: 1.05;
}

.onb-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto;
}

.onb-step {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.onb-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}

.onb-lede {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 32px;
}

.onb-section {
  margin-bottom: 24px;
}

.onb-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 10px;
}

.onb-input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 16px;
  font-family: var(--body);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.onb-input:focus {
  outline: none;
  border-color: var(--amber);
}
.onb-input::placeholder { color: var(--text-faint); }

.onb-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.onb-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onb-pill {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 64px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.onb-pill:focus-visible {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-dim);
}

.onb-pill.active {
  background: var(--amber);
  color: var(--text-on-bright);
  border-color: var(--amber);
}

.onb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.onb-btn-primary {
  background: var(--amber);
  color: var(--text-on-bright);
  border: none;
  border-radius: var(--r-md);
  padding: 16px 24px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.1s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.onb-btn-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--amber-dim);
}
.onb-btn-primary:active {
  transform: scale(0.98);
}

.onb-btn-skip {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 12px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.onb-btn-skip:focus-visible { color: var(--text); }
.onb-btn-skip:hover { color: var(--text); }

/* === Pull to refresh (v1.4) === */
.pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  margin-left: -20px;
  width: 40px;
  height: 40px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-40px);
  z-index: 50;
  transition: opacity 0.15s;
  color: var(--amber);
}
.pull-spinner {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pull-spinner svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
}
.pull-indicator.past-threshold .pull-spinner svg {
  transform: scale(1.2);
}
.pull-indicator.refreshing .pull-spinner svg {
  animation: pullSpin 0.9s linear infinite;
}
@keyframes pullSpin {
  to { transform: rotate(360deg); }
}

/* === iOS install hint (v1.5) === */
.ios-install-hint {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 12px;
  right: 12px;
  margin-top: 8px;
  z-index: 80;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 12px 14px;
  animation: iosHintSlide 0.4s ease-out;
}

@keyframes iosHintSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ios-hint-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ios-hint-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--amber-dim);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-hint-icon svg {
  width: 20px;
  height: 20px;
}

.ios-hint-text {
  flex: 1;
  min-width: 0;
}
.ios-hint-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.ios-hint-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}
.ios-hint-sub strong {
  color: var(--text);
  font-weight: 700;
}

.ios-hint-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.ios-hint-dismiss:hover { color: var(--text); background: var(--card-2); }
.ios-hint-dismiss:focus-visible { box-shadow: 0 0 0 2px var(--amber); }

/* === What's new banner (v1.5) === */
.whats-new {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  max-width: 448px;
  margin: 0 auto;
  z-index: 95;
  animation: whatsNewSlide 0.4s ease-out;
}
[data-reduce-motion="1"] .whats-new { animation: none; }

@keyframes whatsNewSlide {
  from { transform: translateY(-40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.whats-new.dismissing {
  animation: whatsNewOut 0.25s ease-in forwards;
}
@keyframes whatsNewOut {
  to { transform: translateY(-20px); opacity: 0; }
}

.whats-new-content {
  background: var(--card);
  border: 1px solid var(--amber);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.whats-new-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.whats-new-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--amber);
  color: var(--text-on-bright);
  padding: 2px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.4px;
}
.whats-new-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.2px;
}
.whats-new-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.whats-new-close:hover { color: var(--text); background: var(--card-2); }

.whats-new-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.whats-new-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.45;
}
.whats-new-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.whats-new-cta {
  width: 100%;
  background: var(--amber);
  color: var(--text-on-bright);
  border: none;
  border-radius: var(--r-sm);
  padding: 10px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.whats-new-cta:focus-visible { box-shadow: 0 0 0 3px var(--amber-dim); }

/* === Weekly summary card (v1.6) === */
.weekly-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin: 16px 20px;
}

.weekly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.weekly-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
}

.weekly-stats-inline {
  display: flex;
  gap: 16px;
}

.weekly-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.weekly-stat-num {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}
.weekly-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
  font-weight: 600;
}

.weekly-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-items: end;
  height: 60px;
  margin-bottom: 6px;
}

.week-bar {
  background: var(--border);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: background 0.15s, transform 0.15s;
}
.week-bar.has-data {
  background: var(--amber);
}
.week-bar.is-today {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}
.week-bar.is-future {
  opacity: 0.3;
}
[data-reduce-motion="1"] .week-bar { transition: none; }

.weekly-bars-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.weekly-bars-labels span.is-today {
  color: var(--amber);
  font-weight: 700;
}

.weekly-footer {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.weekly-vol, .weekly-recovery {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.weekly-vol-num, .weekly-rec-num {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.weekly-recovery.good .weekly-rec-num { color: var(--sage); }
.weekly-recovery.ok .weekly-rec-num { color: var(--amber); }
.weekly-recovery.low .weekly-rec-num { color: var(--rose); }

.weekly-vol-lbl, .weekly-rec-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
  font-weight: 600;
}

/* === Coming up (v1.6) === */
.coming-up-section {
  margin-top: 24px;
}
.coming-up-section .label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 0 20px;
  margin-bottom: 8px;
}

.coming-up-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  margin: 0 20px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.coming-up-item:hover { border-color: var(--amber); }
.coming-up-item:active { background: var(--card-2); }
[data-reduce-motion="1"] .coming-up-item { transition: none; }

.coming-up-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-on-bright);
  background: var(--card-3);
  padding: 4px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.8px;
  flex-shrink: 0;
}
.coming-up-item:first-of-type .coming-up-num {
  background: var(--amber);
}

.coming-up-info {
  flex: 1;
  min-width: 0;
}
.coming-up-name {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
}
.coming-up-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.coming-up-arrow {
  font-size: 24px;
  color: var(--text-faint);
  line-height: 1;
}

/* === Last time hint (v1.6) === */
.last-time-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: var(--card-2);
  border: 1px dashed var(--amber);
  border-radius: var(--r-md);
}
.last-time-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.last-time-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.0px;
  font-weight: 700;
}
.last-time-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.last-time-cta {
  background: var(--amber);
  color: var(--text-on-bright);
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: background 0.15s, transform 0.1s;
}
.last-time-cta:active { transform: scale(0.96); }
.last-time-cta-done {
  background: var(--sage);
}
.last-time-cta:focus-visible { box-shadow: 0 0 0 3px var(--amber-dim); }
[data-reduce-motion="1"] .last-time-cta { transition: none; }

/* === Progression CTA (v1.6) === */
.last-time-cta-progress {
  background: var(--rose);
}
.last-time-cta-progress:hover { background: var(--rose); }
.last-time-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
  line-height: 1.3;
}

/* === About link === */
.about-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
}
.about-link:hover { text-decoration: underline; }

/* === Privacy page (v1.6) === */
.privacy-page {
  padding: 0 20px 100px;
  max-width: 480px;
  margin: 0 auto;
}
.privacy-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-top: 16px;
  padding: 24px;
}
.privacy-header {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.privacy-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: var(--r-md);
  background: var(--sage-dim);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
}
.privacy-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  margin: 0 0 6px;
}
.privacy-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.privacy-section {
  margin-bottom: 24px;
}
.privacy-section:last-of-type { margin-bottom: 0; }
.privacy-section h2 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.privacy-section p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  margin: 0 0 10px;
}
.privacy-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.privacy-section li {
  font-size: 13px;
  color: var(--text);
  padding: 5px 0 5px 18px;
  position: relative;
  line-height: 1.5;
}
.privacy-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}
.privacy-section li strong {
  color: var(--text);
  font-weight: 700;
}
.privacy-section a {
  color: var(--amber);
  text-decoration: none;
}
.privacy-section a:hover { text-decoration: underline; }

.privacy-back {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.privacy-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}
.privacy-back-link:hover { color: var(--text); }

/* === PR row highlight + share button (v1.7) === */
.set-summary-row.is-pr {
  background: var(--amber-dim);
  border-left: 2px solid var(--amber);
  padding-left: 8px;
  border-radius: var(--r-sm);
}
.set-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.pr-tag {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-on-bright);
  background: var(--amber);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  letter-spacing: 0.4px;
}
.set-share-btn {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.set-share-btn:hover { background: var(--amber-dim); color: var(--amber); }
.set-share-btn:active { transform: scale(0.92); }
.set-share-btn.sharing { opacity: 0.5; pointer-events: none; }
.set-share-btn.shared {
  background: var(--sage-dim);
  color: var(--sage);
  border-color: var(--sage);
}
.set-share-btn:focus-visible { box-shadow: 0 0 0 2px var(--amber); }

/* === Just-PR share banner in workout sheet (v1.7) === */
.pr-share-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  border-radius: var(--r-md);
  animation: prBannerPop 0.35s ease-out;
}
@keyframes prBannerPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.pr-share-content {
  flex: 1;
  min-width: 0;
}
.pr-share-eyebrow {
  font-family: var(--display);
  font-size: 10px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: 1.0px;
  text-transform: uppercase;
}
.pr-share-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.pr-share-btn {
  background: var(--amber);
  color: var(--text-on-bright);
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.pr-share-btn:focus-visible { box-shadow: 0 0 0 3px var(--amber-dim); }
.pr-share-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.pr-share-dismiss:hover { color: var(--text); background: var(--card-2); }

/* === Per-exercise history page (v1.8) === */
.ex-page {
  padding: 0 20px 100px;
  max-width: 480px;
  margin: 0 auto;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 0;
  cursor: pointer;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }
.ex-page-header {
  margin: 8px 0 20px;
}
.ex-page-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  margin: 0 0 4px;
}
.ex-page-muscle {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.ex-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 20px;
}
.ex-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.ex-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.ex-stat-num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}
.ex-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
  font-weight: 600;
}
.ex-summary-meta {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ex-section { margin-bottom: 20px; }
.ex-section-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 0 4px 8px;
}
.ex-section .pr-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.ex-section .pr-list-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.ex-section .pr-list-item:first-child { border-top: none; }
.pr-list-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-on-bright);
  background: var(--amber);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  text-align: center;
  letter-spacing: 0.4px;
}
.pr-tag-rep { background: var(--sage); }
.pr-tag-e1rm { background: var(--rose); color: var(--text-on-bright); }
.pr-list-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.pr-list-meta {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
  padding-left: 46px;
}
.pr-list-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.ex-day {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 8px;
  overflow: hidden;
}
.ex-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
}
.ex-day-date {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.ex-day-volume {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}
.ex-day-sets {
  padding: 4px 14px;
}
.ex-set-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  font-size: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.ex-set-row:first-child { border-top: none; }
.ex-set-row.is-pr {
  background: var(--amber-dim);
  margin: 0 -14px;
  padding: 7px 14px;
  border-left: 2px solid var(--amber);
}
.ex-set-load { color: var(--text); font-weight: 700; min-width: 36px; }
.ex-set-x { color: var(--text-faint); }
.ex-set-reps { color: var(--text); font-weight: 700; min-width: 24px; }
.set-pr-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-on-bright);
  background: var(--amber);
  padding: 2px 5px;
  border-radius: var(--r-sm);
  letter-spacing: 0.4px;
  margin-left: auto;
}
.set-pr-tag.pr-tag-rep { background: var(--sage); }
.set-pr-tag.pr-tag-e1rm { background: var(--rose); }
.rpe-mini, .e1rm-mini {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
}
.ex-set-note {
  margin-left: 4px;
  font-size: 14px;
  cursor: help;
}

.ex-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-top: 20px;
}
.ex-empty-icon { font-size: 48px; margin-bottom: 12px; }
.ex-empty-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.ex-empty-sub { font-size: 13px; color: var(--text-muted); }

/* Tappable lift row */
.lift-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.lift-row:hover { background: var(--card-2); }
.lift-arrow {
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
}
[data-reduce-motion="1"] .lift-row { transition: none; }

/* === Volume landmarks gauge (v1.8) === */
.landmarks-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin: 0 20px 16px;
}
.landmarks-header {
  margin-bottom: 14px;
}
.landmarks-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
}
.landmarks-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.landmarks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.landmark-row {
  display: grid;
  grid-template-columns: 88px 1fr 64px;
  gap: 8px;
  align-items: center;
}
.landmark-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}
.landmark-track {
  position: relative;
  height: 18px;
  background: var(--card-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.landmark-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--r-full);
  transition: width 0.3s;
}
.landmark-fill.zone-low { background: var(--rose); }
.landmark-fill.zone-mid { background: var(--amber); }
.landmark-fill.zone-good { background: var(--sage); }
.landmark-fill.zone-high { background: var(--rose); }
.landmark-mev, .landmark-mav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text-faint);
  opacity: 0.5;
  z-index: 1;
}
.landmark-num {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.landmark-zone {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.3px;
}
.landmark-zone.zone-low { color: var(--rose); }
.landmark-zone.zone-mid { color: var(--amber); }
.landmark-zone.zone-good { color: var(--sage); }
.landmark-zone.zone-high { color: var(--rose); }
.landmarks-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}
.landmarks-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.zone-low { background: var(--rose); }
.legend-dot.zone-mid { background: var(--amber); }
.legend-dot.zone-good { background: var(--sage); }
.legend-dot.zone-high { background: var(--rose); }
[data-reduce-motion="1"] .landmark-fill { transition: none; }

/* === Milestone celebration banner (v1.9) === */
.milestone-banner {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 12px;
  right: 12px;
  margin-top: 12px;
  z-index: 95;
  background: var(--card);
  border: 2px solid var(--amber);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  transition: opacity 0.3s, transform 0.3s;
}
.milestone-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.milestone-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 122, 26, 0.18), transparent 60%);
  pointer-events: none;
}
.milestone-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.milestone-emoji {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(255, 122, 26, 0.4));
}
.milestone-text {
  flex: 1;
  min-width: 0;
}
.milestone-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.milestone-headline {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1.1;
  margin: 2px 0 2px;
}
.milestone-label {
  font-size: 12px;
  color: var(--text-muted);
}
.milestone-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.milestone-share-btn {
  background: var(--amber);
  color: var(--text-on-bright);
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.milestone-share-btn:focus-visible { box-shadow: 0 0 0 3px var(--amber-dim); }
.milestone-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.milestone-dismiss:hover { color: var(--text); background: var(--card-2); }
[data-reduce-motion="1"] .milestone-banner { transition: none; transform: none; }

/* === Past check-ins (v1.9) === */
.past-checkins {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 20px;
  margin-bottom: 20px;
}
.past-checkin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.past-checkin-info { flex: 1; min-width: 0; }
.past-checkin-date {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.past-checkin-stats {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.past-checkin-actions { display: flex; gap: 4px; }
.past-checkin-btn {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: background 0.15s, color 0.15s;
}
.past-checkin-btn:hover { background: var(--amber-dim); color: var(--amber); }
.past-checkin-btn-danger:hover { background: rgba(255, 90, 120, 0.14); color: var(--rose); }
