/* TheLab — Design System v2
 * Reference: Tremor, shadcn/ui, Neofolio. Utilitarian dashboard.
 * Neutral zinc palette + BLC green used sparingly (active states, primary CTA, key data).
 * No glow, no grain, no atmospheric gradients, no display serif.
 * Inter at every size. Tabular numerals on data.
 * Every existing class hook + ID preserved.
 *   Legacy --purple var aliased to brand green so old refs become green.
 */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Surfaces — pure neutrals, no tint */
  --bg:           #09090b;
  --bg2:          #0c0c0e;
  --surface:      #131316;
  --surface-2:    #18181b;
  --surface-3:    #1c1c20;
  --card:         #131316;          /* legacy alias */
  --bg-card:      #131316;          /* legacy alias */
  --bg-card-hover:#18181b;          /* legacy alias */

  /* Borders */
  --border:        #232327;
  --border-soft:   #1c1c20;
  --border-strong: #2e2e33;

  /* Text */
  --text:   #f4f4f5;
  --text-2: #a1a1aa;
  --muted:  #71717a;
  --dim:    #52525b;

  /* Brand accent — used sparingly */
  --accent:        #87cd0b;
  --accent-bright: #a3e324;
  --accent-dim:    rgba(135,205,11,0.18);
  --accent-soft:   rgba(135,205,11,0.07);
  --on-accent:     #09090b;

  /* Legacy aliases — every var(--purple) reference resolves to green now.
   * Don't add new var(--purple); use var(--accent). */
  --purple:               #87cd0b;
  --purple2:              #a3e324;
  --brand-green:          #87cd0b;
  --brand-green-light:    #a3e324;
  --brand-green-dim:      rgba(135,205,11,0.18);

  /* Data viz — desaturated */
  --blue:   #7eb6ff;
  --teal:   #5fcdc8;
  --gold:   #e8b540;
  --orange: #f08b48;
  --red:    #d96b6b;
  --green:  #74c365;

  /* Type */
  --font-body: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px;

  /* Radius */
  --r1: 4px; --r2: 6px; --r3: 8px; --r4: 12px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 100ms;
  --dur-2: 180ms;

  /* Layout */
  --sidebar:           220px;
  --sidebar-collapsed: 60px;

  /* Shadows — barely there */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
}

/* ── Reset ─────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }

html, body {
  height: auto;
  overflow: auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Tabular numerals where data lives */
.card-value, .card-sub, .pr-hero-rm, .pr-hero-sub, .pr-hero-meta,
.strength-pr, .strength-ratio, .score-number, .streak-num,
.ldr-rank, .ldr-count, .rank-name, .rank-lp,
.allex-card-1rm, .allex-list-item-rm, .allex-list-item-sub, .td-num,
input[type=number], .recent-date, .session-date, .stat-val,
.cal-day, .badge-need, .badge-date, .perf-streak-card .streak-num,
.allex-card-stat .val, .allex-list-detail .stat .val,
.log-card-stat strong, .top-ex-rank, .overall-rank-text,
.modal-set-row, .session-ex-table, .strength-level-badge,
.podium-rm, .podium-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

::selection { background: var(--accent); color: var(--on-accent); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── Bottom nav (mobile-first) ─────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(12, 12, 14, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 500;
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  padding: 6px 4px 8px;
  position: relative;
  transition: color var(--dur-1);
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.bnav-item:hover { color: var(--text-2); }
.bnav-item.active { color: var(--accent); }
.bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 2px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.bnav-icon {
  font-size: 19px;
  line-height: 1;
  filter: grayscale(0.15) brightness(0.95);
  transition: filter var(--dur-1), transform var(--dur-1);
}
.bnav-item.active .bnav-icon {
  filter: none;
  transform: translateY(-1px);
}
.bnav-label {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@media (max-width: 360px) {
  .bnav-label { font-size: 9.5px; }
  .bnav-icon { font-size: 17px; }
}

/* ── Page wrapper (mobile-first) ───────────────────────────────── */
.page-content {
  margin: 0 auto;
  padding: 18px 16px 92px;
  max-width: 720px;
  width: 100%;
  min-height: 100vh;
}
@media (min-width: 720px) {
  .page-content {
    padding: 28px 24px 100px;
  }
}

/* ── Typography ────────────────────────────────────────────────── */
.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  letter-spacing: 0;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 20px;
  position: relative;
  transition: border-color var(--dur-1);
}
.card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 14px 16px;
}
.card-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  text-transform: none;
  margin-bottom: 12px;
}
.card-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Grids ─────────────────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 20px; }

/* ── Tables ────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--r3); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  transition: color var(--dur-1);
}
thead th:hover { color: var(--text); }
tbody tr { border-top: 1px solid var(--border-soft); transition: background var(--dur-1); }
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }
.td-num { text-align: right; padding-right: 16px; }
.td-center { text-align: center; }

/* ── Set badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r1);
  font-size: 11px;
  font-weight: 500;
}
.badge-warmup { background: rgba(113,113,122,0.15); color: var(--text-2); }
.badge-normal { background: rgba(116,195,101,0.13); color: var(--green); }
.badge-failed { background: rgba(217,107,107,0.13); color: var(--red); }
.badge-drop   { background: rgba(240,139,72,0.13); color: var(--orange); }
.badge-cardio { background: rgba(95,205,200,0.13); color: var(--teal); }

/* ── Charts ────────────────────────────────────────────────────── */
.chart-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 20px;
}
.chart-box canvas { max-height: 260px; }

/* ── Controls ──────────────────────────────────────────────────── */
.controls { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=number], select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--r2);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type=text]::placeholder, input[type=number]::placeholder { color: var(--dim); }
select option { background: var(--surface); }

.btn {
  padding: 7px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--dur-1) var(--ease);
}
.btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.btn, button, [role="button"] { user-select: none; }
.btn > *, button > *, [role="button"] > * { pointer-events: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--on-accent);
}

/* ── Modals ────────────────────────────────────────────────────── */
.centre-modal {
  position: fixed; inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--dur-2) var(--ease);
}
.centre-modal[style*="display:flex"] { display: flex !important; }
.centre-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.centre-modal-content {
  position: relative;
  width: 92vw; max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r4);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow-md);
  animation: modalIn var(--dur-2) var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn var(--dur-2) var(--ease); }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 22px;
  max-width: 520px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: modalIn var(--dur-2) var(--ease);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r2);
  transition: color var(--dur-1), background var(--dur-1);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-ex-block { margin-bottom: 14px; }
.modal-ex-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-set-row {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--border-soft);
}

/* ── Pagination ────────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; margin-top: 12px; justify-content: flex-end; }
.page-btn {
  padding: 5px 10px;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  transition: all var(--dur-1);
}
.page-btn:hover, .page-btn.cur { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.page-btn.cur { color: var(--text); }
.page-info { font-size: 12px; color: var(--dim); }

/* ── Section header ────────────────────────────────────────────── */
.sec-hdr {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

/* ── Stat row ──────────────────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-val { font-weight: 600; color: var(--text); font-size: 13px; }

/* ── Color accents ─────────────────────────────────────────────── */
.c-purple, .c-accent { color: var(--accent); }
.c-blue   { color: var(--blue); }
.c-gold   { color: var(--gold); }
.c-green  { color: var(--green); }
.c-red    { color: var(--red); }
.c-muted  { color: var(--muted); }
.c-teal   { color: var(--teal); }
.c-orange { color: var(--orange); }

/* ── Pills ─────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  margin: 2px;
}

/* ── Banners ───────────────────────────────────────────────────── */
.warning {
  background: rgba(240,139,72,0.06);
  border: 1px solid rgba(240,139,72,0.2);
  border-radius: var(--r3);
  padding: 11px 14px;
  color: var(--orange);
  font-size: 12.5px;
  margin-bottom: 16px;
}
.note {
  background: rgba(126,182,255,0.05);
  border-left: 2px solid var(--blue);
  padding: 11px 14px;
  border-radius: 0 var(--r3) var(--r3) 0;
  color: var(--text-2);
  font-size: 12.5px;
  margin: 12px 0;
  line-height: 1.6;
}
.api-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.api-banner-icon { font-size: 24px; }
.api-banner-text strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.api-banner-text p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ── Progress ──────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--surface-3);
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 380ms var(--ease);
}

/* ── Session cards ─────────────────────────────────────────────── */
.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--dur-1);
}
.session-card:hover { border-color: var(--border-strong); }
.session-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.session-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
  letter-spacing: -0.005em;
}
.session-meta { font-size: 12px; color: var(--muted); min-width: 160px; }
.session-pills { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.session-toggle {
  color: var(--muted);
  font-size: 11px;
  transition: transform var(--dur-2) var(--ease);
  margin-left: 8px;
}
.session-toggle.open { transform: rotate(180deg); }
.session-body {
  border-top: 1px solid var(--border-soft);
  padding: 16px 18px;
  display: none;
  background: var(--bg2);
}
.session-ex-block { margin-bottom: 16px; }
.session-ex-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.session-ex-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.session-ex-table thead th {
  background: var(--bg);
  color: var(--muted);
  font-size: 10.5px;
  padding: 6px 10px;
  text-align: left;
  font-weight: 500;
  letter-spacing: 0;
}
.session-ex-table tbody td { padding: 6px 10px; border-top: 1px solid var(--border-soft); }
.session-ex-table tbody tr:hover { background: var(--surface-2); }

/* ── PR hero cards ─────────────────────────────────────────────── */
.pr-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.pr-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 18px;
  transition: border-color var(--dur-1);
}
.pr-hero-card:hover { border-color: var(--border-strong); }
.pr-hero-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}
.pr-hero-rm {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.025em;
}
.pr-hero-unit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 3px;
}
.pr-hero-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.pr-hero-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--dim); }

/* ── PR accordion ──────────────────────────────────────────────── */
.pr-accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  margin-bottom: 4px;
  overflow: hidden;
  transition: border-color var(--dur-1);
}
.pr-accordion-item:hover { border-color: var(--border-strong); }
.pr-accordion-header {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  cursor: pointer;
  gap: 10px;
}
.pr-accordion-header:hover { background: var(--surface-2); }
.pr-acc-name { flex: 1; font-weight: 500; font-size: 13px; }
.pr-acc-summary {
  color: var(--muted);
  font-size: 12px;
  min-width: 220px;
  text-align: right;
}
.pr-acc-chevron {
  color: var(--muted);
  font-size: 10px;
  margin-left: 8px;
  transition: transform var(--dur-2) var(--ease);
}
.pr-acc-chevron.open { transform: rotate(180deg); }
.pr-accordion-body { display: none; border-top: 1px solid var(--border-soft); padding: 14px 16px; }

/* ── Calendar ──────────────────────────────────────────────────── */
.cal-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 18px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--r2);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--dur-1);
}
.cal-nav-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.cal-month-label { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow {
  font-size: 10px;
  font-weight: 500;
  color: var(--dim);
  text-align: center;
  padding: 5px 0;
}
.cal-day {
  min-height: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  font-size: 11px;
  color: var(--dim);
  border: 1px solid transparent;
  position: relative;
  cursor: default;
  padding: 2px;
}
.cal-day-empty { background: none; }
.cal-has-workout {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
  cursor: pointer;
  font-weight: 500;
  align-items: stretch;
  justify-content: flex-start;
  padding: 4px 5px;
  min-height: 60px;
  transition: background var(--dur-1), border-color var(--dur-1);
}
.cal-has-workout:hover { background: var(--surface-3); border-color: var(--border-strong); }
.cal-has-workout .cal-day-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1px;
}
.cal-mini-card { overflow: hidden; flex: 1; }
.cal-most-recent { border-color: var(--accent); }
.cal-most-recent .cal-day-num { color: var(--accent); }
.cal-today { outline: 1px solid var(--text-2); outline-offset: -2px; }

/* ── Strength ──────────────────────────────────────────────────── */
.strength-card { position: relative; overflow: hidden; }
.strength-lift-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}
.strength-level-badge { font-size: 18px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.strength-pr { font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: -0.025em; }
.strength-pr-unit { font-size: 13px; color: var(--muted); font-weight: 400; }
.strength-ratio { font-size: 12px; color: var(--muted); margin-top: 4px; }
.strength-next { font-size: 12px; color: var(--muted); margin-top: 6px; }
.overall-rank-badge {
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--r4);
  border: 1px solid var(--border);
}
.overall-rank-text { font-size: 32px; font-weight: 600; color: var(--accent); letter-spacing: -0.028em; }
.standards-table td, .standards-table th { padding: 10px 14px; font-size: 12.5px; }

/* ── Dashboard goals ───────────────────────────────────────────── */
.goal-row { margin-bottom: 12px; }
.goal-row-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.goal-label { font-size: 12px; color: var(--muted); }
.goal-value { font-size: 12px; font-weight: 600; color: var(--text); }

/* ── Leaderboard ───────────────────────────────────────────────── */
.ldr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ldr-item:last-child { border-bottom: none; }
.ldr-rank { font-size: 16px; font-weight: 600; color: var(--dim); min-width: 26px; letter-spacing: -0.01em; }
.ldr-rank.g1 { color: var(--gold); }
.ldr-rank.g2 { color: var(--text-2); }
.ldr-rank.g3 { color: var(--orange); }
.ldr-name { flex: 1; font-size: 13px; font-weight: 500; }
.ldr-count { font-size: 12.5px; color: var(--text); font-weight: 600; }

/* ── Recent workouts ───────────────────────────────────────────── */
.recent-session { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.recent-session:last-child { border-bottom: none; }
.recent-date { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.recent-meta { font-size: 11px; color: var(--muted); margin: 3px 0 6px; }
.recent-pills { display: flex; flex-wrap: wrap; gap: 3px; }

/* ── Rank page ─────────────────────────────────────────────────── */
.rank-card { text-align: center; padding: 28px 24px; }
.rank-badge { font-size: 44px; margin-bottom: 8px; }
.rank-name { font-size: 22px; font-weight: 600; color: var(--accent); margin-bottom: 6px; letter-spacing: -0.018em; }
.rank-lp { font-size: 13px; color: var(--muted); }

/* ── Podium ────────────────────────────────────────────────────── */
.podium-wrap { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding: 20px 0 0; }
.podium-block {
  text-align: center;
  border-radius: var(--r4) var(--r4) 0 0;
  padding: 16px 12px;
  min-width: 110px;
  max-width: 150px;
  flex: 1;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--surface);
}
.podium-block.p1 { border-color: rgba(232,181,64,0.3); height: 180px; }
.podium-block.p2 { border-color: rgba(161,161,170,0.25); height: 145px; }
.podium-block.p3 { border-color: rgba(240,139,72,0.25); height: 115px; }
.podium-medal { font-size: 26px; }
.podium-name { font-size: 12px; font-weight: 600; color: var(--text); margin: 8px 0 4px; word-break: break-word; }
.podium-count { font-size: 11px; color: var(--muted); }
.podium-rm { font-size: 14px; font-weight: 600; color: var(--text); }
.podium-std { font-size: 10px; color: var(--dim); margin-top: 3px; }

/* ── Award badges ──────────────────────────────────────────────── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.badge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 14px;
  position: relative;
  transition: border-color var(--dur-1);
}
.badge-card:hover { border-color: var(--border-strong); }
.badge-card.earned { border-color: var(--accent-dim); }
.badge-card.locked { opacity: 0.32; pointer-events: none; }
.badge-card.near-complete { opacity: 0.7; pointer-events: auto; }
.badge-lock-overlay { position: absolute; top: 10px; right: 10px; font-size: 12px; color: var(--dim); }
.badge-icon { font-size: 24px; margin-bottom: 8px; }
.badge-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.badge-desc { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.badge-date { font-size: 10px; color: var(--accent); margin-top: 6px; }
.badge-need { font-size: 10px; color: var(--muted); margin-top: 6px; }
.badge-near-bar { height: 3px; background: var(--surface-3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.badge-near-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.badge-liftoff { border-color: var(--gold) !important; opacity: 1 !important; }
.badge-card.special { animation: shimmer 4s ease-in-out infinite; }
.badge-exclusive-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }
.badge-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.badge-cat-title { font-size: 11px; font-weight: 600; color: var(--text); letter-spacing: 0; }
.badge-cat-count { font-size: 11px; color: var(--muted); }
.badge-category-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  padding: 10px 0 6px;
  margin-top: 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

/* ── Achievements strip ────────────────────────────────────────── */
.achieve-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.achieve-strip::-webkit-scrollbar { display: none; }
.achieve-badge {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 8px 12px;
  text-align: center;
  cursor: default;
  position: relative;
}
.achieve-badge:hover .achieve-tooltip { display: block; }
.achieve-badge-icon { font-size: 20px; }
.achieve-tooltip {
  display: none;
  position: absolute;
  bottom: 110%; left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r2);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

/* ── Range buttons ─────────────────────────────────────────────── */
.range-btn-group { display: flex; gap: 4px; flex-wrap: wrap; }
.range-btn {
  padding: 5px 10px;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  transition: all var(--dur-1);
}
.range-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.range-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ── Compare bars ──────────────────────────────────────────────── */
.comp-bar-wrap { margin-bottom: 8px; }
.comp-bar-label { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.comp-bar-track { background: var(--surface-3); border-radius: var(--r1); height: 12px; position: relative; overflow: hidden; }
.comp-bar-fill {
  height: 100%;
  border-radius: var(--r1);
  transition: width 380ms var(--ease);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
}
.comp-bar-fill span { font-size: 10px; font-weight: 600; color: var(--on-accent); white-space: nowrap; }

/* ── Sort + view buttons ───────────────────────────────────────── */
.sort-btn-group { display: inline-flex; gap: 4px; margin-bottom: 12px; }
.sort-btn {
  padding: 6px 12px;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--dur-1);
}
.sort-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.sort-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.view-btn-group { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; background: var(--surface); }
.view-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--dur-1);
}
.view-btn:hover { background: var(--surface-2); color: var(--text); }
.view-btn.active { background: var(--text); color: var(--bg); }

/* ── Log cards ─────────────────────────────────────────────────── */
.log-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.log-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 18px;
  cursor: default;
  transition: border-color var(--dur-1);
}
.log-card:hover { border-color: var(--border-strong); }
.log-card-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  letter-spacing: -0.005em;
}
.log-card-dur { color: var(--text-2); font-size: 13px; font-weight: 500; }
.log-card-stats {
  display: flex;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 11px;
}
.log-card-stat { font-size: 11.5px; color: var(--muted); }
.log-card-stat strong { display: block; font-size: 16px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.log-card-exercises { font-size: 12px; color: var(--muted); line-height: 1.6; }
.log-card-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; line-height: 1.2; letter-spacing: -0.005em; }
.log-card-date-small { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.log-compact-table td { padding: 6px 10px; font-size: 12px; border-top: 1px solid var(--border-soft); }

/* ── Goal celebration (kept subtle) ────────────────────────────── */
@keyframes goalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,181,64,0); }
  50% { box-shadow: 0 0 12px 2px rgba(232,181,64,0.22); }
}
.goal-complete .progress-bar { animation: goalPulse 2.4s ease infinite; }
.goal-complete-pulse { animation: goalCompletePulse 0.5s ease; }
@keyframes goalCompletePulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-dim); }
  50%  { box-shadow: 0 0 12px 2px var(--accent-dim); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.ai-goal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 14px;
  margin-top: 8px;
}
.ai-goal-title { font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ai-goal-reason { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.ai-goal-btns { display: flex; gap: 6px; }
.ai-btn {
  padding: 5px 12px;
  border-radius: var(--r1);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
}
.ai-btn-confirm { background: var(--accent); color: var(--on-accent); }
.ai-btn-dismiss { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* ── Exercise charts ───────────────────────────────────────────── */
.ex-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  cursor: pointer;
  margin-bottom: 4px;
  transition: border-color var(--dur-1);
}
.ex-collapse-header:hover { border-color: var(--border-strong); }
.ex-collapse-body {
  display: none;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r3) var(--r3);
  padding: 16px;
}
.chart-outlier-note { font-size: 11px; color: var(--orange); padding: 4px 0; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }
  .nav-logo { opacity: 0; width: 0; }
  .nav-link-label { opacity: 0; width: 0; overflow: hidden; }
  .nav-link { justify-content: center; padding: 11px 0; gap: 0; }
  .nav-link.active::after { display: none; }
  .nav-link.active { background: var(--accent-soft); color: var(--accent); }
  .page-content { margin-left: var(--sidebar-collapsed); padding: 24px 18px 96px; }
  .page-title { font-size: 20px; }
  .page-sub { margin-bottom: 22px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .pr-hero-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 16px; }
  .card-value { font-size: 22px; }
  .pr-hero-rm { font-size: 24px; }
  .session-meta { display: none; }
  .session-date { min-width: 80px; font-size: 12.5px; }
  .pr-acc-summary { min-width: 0; font-size: 11px; }
  .modal-box, .centre-modal-content { padding: 18px; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .pr-hero-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 20px 14px 96px; }
  .page-title { font-size: 19px; }
  .pr-hero-rm { font-size: 22px; }
  body { font-size: 14px; }
}

/* ── Pills (strength/coaching/leaderboard/freq) ────────────────── */
.strength-pill, .coaching-pill, .lb-pill, .allex-freq-pill, .rec-pill {
  padding: 7px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--dur-1);
}
.strength-pill:hover, .coaching-pill:hover, .lb-pill:hover, .allex-freq-pill:hover, .rec-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}
.strength-pill.active, .coaching-pill.active, .lb-pill.active, .allex-freq-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.coaching-panel { display: none; animation: fadeIn var(--dur-2) var(--ease); }
.coaching-panel.active { display: block; }

/* ── All Exercises ─────────────────────────────────────────────── */
.allex-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.allex-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  overflow: hidden;
  transition: border-color var(--dur-1);
}
.allex-card:hover { border-color: var(--border-strong); }
.allex-card-header { padding: 14px 18px 10px; display: flex; justify-content: space-between; align-items: flex-start; }
.allex-card-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.allex-card-1rm { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.018em; }
.allex-card-1rm span { font-size: 11px; font-weight: 400; color: var(--muted); }
.allex-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-soft);
  margin: 0;
}
.allex-card-stat { padding: 9px 12px; background: var(--surface); text-align: center; }
.allex-card-stat .label { font-size: 10px; color: var(--dim); letter-spacing: 0; }
.allex-card-stat .val { font-size: 14px; font-weight: 600; margin-top: 2px; letter-spacing: -0.01em; }
.allex-card-expandable { padding: 0 18px; }
.allex-expand-btn {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  border-top: 1px solid var(--border-soft);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background var(--dur-1), color var(--dur-1);
}
.allex-expand-btn:hover { background: var(--surface-2); color: var(--text); }
.allex-chart-section {
  cursor: pointer;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  transition: color var(--dur-1);
}
.allex-chart-section:hover { color: var(--text); }
.allex-chart-section .chevron { color: var(--muted); font-size: 11px; transition: transform var(--dur-2) var(--ease); }
.allex-chart-section .chevron.open { transform: rotate(180deg); }
.allex-chart-wrap { overflow: hidden; max-height: 0; transition: max-height var(--dur-2) var(--ease); padding: 0; }
.allex-chart-wrap.open { max-height: 320px; padding: 10px 0; }
.allex-chart-wrap canvas { max-height: 200px; }

.allex-compact-tbl { width: 100%; border-collapse: collapse; }
.allex-compact-tbl th {
  background: var(--bg2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 10px 12px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}
.allex-compact-tbl td { padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--border-soft); }
.allex-compact-tbl tr:hover { background: var(--surface-2); }
.allex-compact-tbl .c-name { font-weight: 600; color: var(--text); cursor: pointer; }
.allex-compact-tbl .c-name:hover { color: var(--accent); }

.allex-list-item {
  border-bottom: 1px solid var(--border-soft);
  padding: 11px 6px;
  cursor: pointer;
  transition: background var(--dur-1);
}
.allex-list-item:hover { background: var(--surface-2); }
.allex-list-item-header { display: flex; justify-content: space-between; align-items: center; }
.allex-list-item-name { font-weight: 600; font-size: 13px; color: var(--text); }
.allex-list-item-rm { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.allex-list-item-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.allex-list-item-body { overflow: hidden; max-height: 0; transition: max-height var(--dur-2) var(--ease); }
.allex-list-item-body.open { max-height: 600px; }
.allex-list-detail { padding: 10px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.allex-list-detail .stat { padding: 10px 12px; background: var(--bg2); border-radius: var(--r2); border: 1px solid var(--border-soft); }
.allex-list-detail .stat .label { font-size: 10px; color: var(--dim); }
.allex-list-detail .stat .val { font-size: 14px; font-weight: 600; margin-top: 3px; letter-spacing: -0.01em; }

/* ── Profile hero ──────────────────────────────────────────────── */
.profile-hero-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  overflow: hidden;
  position: relative;
}
.profile-hero-top-border { display: none; }
.profile-hero-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.profile-hero-body { text-align: center; padding: 22px; }
.profile-hero-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin: 0 auto 12px;
}
.profile-hero-avatar-init {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0 auto 12px;
  border: 1px solid var(--border);
}
.profile-slots-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.profile-slot-fixed { padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.profile-slot-chosen {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--dur-1);
  min-width: 80px;
  text-align: center;
  border: 1px solid var(--border);
  color: var(--muted);
}
.profile-slot-chosen.filled { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.profile-slot-chosen.empty { border-style: dashed; }
.profile-slot-chosen:hover { color: var(--text); border-color: var(--border-strong); }

/* ── Edit profile / slot picker modals ─────────────────────────── */
.edit-profile-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.edit-profile-modal.open { display: flex; animation: fadeIn var(--dur-2) var(--ease); }
.edit-profile-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  width: 92vw; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-md);
  animation: modalIn var(--dur-2) var(--ease);
}
.ep-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.ep-pill-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ep-pill {
  padding: 6px 13px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  transition: all var(--dur-1);
}
.ep-pill.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.ep-pill:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }

.slot-picker-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 5100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.slot-picker-modal.open { display: flex; animation: fadeIn var(--dur-2) var(--ease); }
.slot-picker-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  width: 92vw; max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.slot-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-1);
}
.slot-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.slot-card.equipped { border-color: var(--accent); }
.slot-card.locked { opacity: 0.4; filter: grayscale(1); cursor: default; }

/* ── Performance score ─────────────────────────────────────────── */
.perf-score-row { display: flex; gap: 22px; justify-content: center; align-items: center; flex-wrap: nowrap; margin-bottom: 22px; }
.perf-score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.perf-score-ring svg { transform: rotate(-90deg); display: block; }
.perf-score-ring .score-label {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.perf-score-ring .score-number { font-weight: 600; line-height: 1; letter-spacing: -0.025em; }
.perf-score-ring .score-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.perf-streak-row { display: flex; gap: 10px; margin-bottom: 22px; }
.perf-streak-card {
  flex: 1;
  border-radius: var(--r3);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.perf-streak-card .streak-icon { font-size: 24px; }
.perf-streak-card .streak-num { font-size: 24px; font-weight: 600; letter-spacing: -0.022em; }
.perf-streak-card .streak-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Log toggle bar ────────────────────────────────────────────── */
.log-toggle-bar {
  display: flex;
  gap: 0;
  border-radius: var(--r3);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 22px;
  background: var(--surface);
}
.log-toggle-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all var(--dur-1);
}
.log-toggle-btn:hover { color: var(--text); background: var(--surface-2); }
.log-toggle-btn.active { background: var(--text); color: var(--bg); font-weight: 600; }

/* ── Leaderboard mini cards ────────────────────────────────────── */
.lb-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color var(--dur-1);
}
.lb-mini-card:hover { border-color: var(--border-strong); }
.lb-mini-card.gold { border-color: rgba(232,181,64,0.35); }
.lb-mini-card.silver { border-color: rgba(161,161,170,0.3); }
.lb-mini-card.bronze { border-color: rgba(240,139,72,0.3); }

/* ── Top exercises ─────────────────────────────────────────────── */
.top-ex-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.top-ex-item:last-child { border-bottom: none; }
.top-ex-rank { font-size: 14px; font-weight: 600; min-width: 22px; color: var(--muted); }

/* ── Legacy multi-page sidebar ─────────────────────────────────── */
#app { display: flex; height: 100vh; }
#sidebar {
  width: var(--sidebar);
  min-width: var(--sidebar);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
#main { flex: 1; overflow-y: auto; background: var(--bg); }
.sidebar-header { padding: 20px 18px 14px; border-bottom: 1px solid var(--border); }
.sidebar-header h1 { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.sidebar-header p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.nav-section { padding: 6px 0; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 18px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  cursor: pointer;
  color: var(--muted);
  transition: all var(--dur-1);
  border-left: 2px solid transparent;
  font-size: 13px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); border-left-color: var(--accent); font-weight: 600; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.page { display: none; padding: 24px; min-height: 100%; }
.page.active { display: block; }

/* ── Profile actions panel ─────────────────────────────────────── */
.profile-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: 20px;
  margin-bottom: 22px;
}
.profile-actions-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}
.profile-actions-title { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.profile-actions-status { font-size: 11px; color: var(--accent); opacity: 0; transition: opacity var(--dur-2); }
.profile-actions-status.show { opacity: 1; }
.profile-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--r2);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-1);
}
.profile-action-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.profile-action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.profile-action-btn.primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}
.profile-action-btn.danger { color: var(--red); }
.profile-action-btn.danger:hover { background: rgba(217,107,107,0.06); border-color: rgba(217,107,107,0.4); color: var(--red); }
.profile-actions-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.55;
}
.profile-actions-help code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--text);
  border: 1px solid var(--border);
}

/* ── FAB (workout quick-launch) — minimal, no glow ─────────────── */
#workout-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1);
  box-shadow: var(--shadow-md);
}
#workout-fab:hover { background: var(--accent-bright); transform: translateY(-1px); }
#workout-fab:active { transform: translateY(0); }
@media (max-width: 480px) {
  #workout-fab { bottom: 18px; right: 18px; width: 48px; height: 48px; font-size: 20px; }
}
