/* ─────────────────────────────────────────────────────────────────────────────
   Forge — Analytics Page CSS
───────────────────────────────────────────────────────────────────────────── */


.an-period-pill {
  padding: 4px 12px; border-radius: 20px;
  border: 0.5px solid var(--gold-border); background: var(--gold-dim);
  font-size: 12px; font-weight: 600; color: var(--gold);
  cursor: pointer; letter-spacing: 1px; user-select: none;
  transition: all 0.15s;
}
.an-period-pill:hover { background: rgba(200,150,62,0.2); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.an-tabs {
  display: flex; background: var(--surface);
  border-bottom: 0.5px solid var(--border); overflow-x: auto;
  position: relative;
  min-height: 44px;
}
.an-tabs::-webkit-scrollbar { display: none; }
.an-tab {
  flex: 1; padding: 12px 6px; border: none;
  border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font-family: var(--font-cond);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.an-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.an-main {
  width: 100%;
  max-width: 600px; margin: 0 auto;
  padding: 20px; padding-bottom: 80px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.an-panel { display: none; }
.an-panel.active { display: block; animation: fadeUp 0.2s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.an-section-label {
  font-family: var(--font-cond); font-size: 11px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; margin-top: 20px;
}
.an-section-label:first-child { margin-top: 0; }

/* ── Hero stats grid ──────────────────────────────────────────────────────── */
.an-hero-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 20px;
}
.an-hero-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 12px 8px; text-align: center;
}
.an-hero-icon  { font-size: 18px; margin-bottom: 5px; }
.an-hero-num   {
  font-family: var(--font-display); font-size: 26px;
  color: var(--gold); letter-spacing: 1px; line-height: 1;
}
.an-hero-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-top: 3px;
}

/* ── Heatmap ──────────────────────────────────────────────────────────────── */
.an-heatmap-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 4px;
}
.an-heatmap-days {
  display: flex; flex-direction: column; gap: 0;
  position: absolute; font-size: 9px; color: var(--muted);
  letter-spacing: 0.5px;
}
.an-heatmap-wrap {
  display: flex; gap: 8px;
}
.an-heatmap-grid {
  display: block;
}
.an-heat-cell {
  border-radius: 2px;
  transition: transform 0.1s;
  cursor: default;
}
.an-legend-cells .an-heat-cell {
  width: 12px !important; height: 12px !important;
  min-width: 12px; min-height: 12px;
  aspect-ratio: 1;
}
.an-heat-cell:hover { transform: scale(1.3); }
.an-heat-cell[data-level="0"] { background: rgba(255,255,255,0.10); }
.an-heat-cell[data-level="1"] { background: rgba(200,150,62,0.20); }
.an-heat-cell[data-level="2"] { background: rgba(200,150,62,0.45); }
.an-heat-cell[data-level="3"] { background: rgba(200,150,62,0.70); }
.an-heat-cell[data-level="4"] { background: #C8963E; }

.an-heatmap-legend {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 10px; color: var(--muted);
}
.an-legend-cells {
  display: flex; gap: 3px;
}

/* ── Chart cards ──────────────────────────────────────────────────────────── */
.an-chart-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 4px;
  overflow-x: auto;
}
.an-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.an-chart-title { font-size: 13px; font-weight: 600; color: var(--text); }
.an-chart-value {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: 1px; color: var(--gold);
}
.an-canvas { width: 100%; height: 140px !important; display: block; min-width: 0; }
.an-chart-empty {
  text-align: center; padding: 28px 12px;
  font-size: 13px; color: var(--muted); line-height: 1.6;
}

/* ── Week navigation ─────────────────────────────────────────────────────── */
.an-week-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.an-week-range {
  font-family: var(--font-cond); font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted);
}
.an-week-btn {
  background: none; border: 0.5px solid var(--border); border-radius: 6px;
  color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1;
  padding: 2px 10px; transition: color 0.15s, border-color 0.15s;
}
.an-week-btn:hover:not(:disabled) { color: var(--gold); border-color: var(--gold); }
.an-week-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Muscle group breakdown ───────────────────────────────────────────────── */
.an-muscle-grid {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px;
}
.an-muscle-row {
  display: grid; grid-template-columns: 80px 1fr 36px; gap: 10px;
  align-items: center;
}
.an-muscle-name { font-size: 13px; color: var(--text); font-weight: 500; }
.an-muscle-bar-wrap {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.an-muscle-bar {
  height: 100%; border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.an-muscle-sets { font-size: 12px; color: var(--muted); text-align: right; }

/* ── PB list ──────────────────────────────────────────────────────────────── */
.an-pb-list { display: flex; flex-direction: column; margin-top: 6px; }

/* ── Completion ring ──────────────────────────────────────────────────────── */
.an-completion-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 20px;
  display: flex; align-items: center; gap: 20px; margin-bottom: 4px;
}
.an-completion-ring-wrap { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.an-ring-svg { width: 100px; height: 100px; transform: rotate(-90deg); }
.an-ring-bg   { fill: none; stroke: var(--border);      stroke-width: 10; }
.an-ring-fill {
  fill: none; stroke: var(--gold); stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 251.33;
  stroke-dashoffset: 251.33;
  transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1);
}
.an-ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.an-ring-pct {
  font-family: var(--font-display); font-size: 22px;
  color: var(--text); letter-spacing: 1px; line-height: 1;
}
.an-ring-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.an-completion-stats { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.an-completion-stat { display: flex; justify-content: space-between; align-items: center; }
.an-completion-stat-label { font-size: 13px; color: var(--muted); }
.an-completion-stat-val   { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Session log ──────────────────────────────────────────────────────────── */
.an-session-log { display: flex; flex-direction: column; gap: 6px; }
.an-session-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
}
.an-session-row-left { display: flex; flex-direction: column; gap: 2px; }
.an-session-row-title { font-size: 13px; font-weight: 600; color: var(--text); }
.an-session-row-meta  { font-size: 11px; color: var(--muted); }
.an-session-row-dur   { font-family: var(--font-display); font-size: 20px; color: var(--gold); }

/* ── Running goal card ────────────────────────────────────────────────────── */
.an-run-goal-card {
  background: linear-gradient(135deg, var(--gold-900) 0%, #1E1A10 60%, var(--dark) 100%);
  border: 0.5px solid var(--gold-border); border-radius: 16px;
  padding: 20px; margin-bottom: 4px;
  transition: box-shadow var(--transition);
}
.an-run-goal-card:has(.an-run-goal-bar.achieved) {
  box-shadow: var(--shadow-molten);
}
.an-run-goal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}
.an-run-goal-title {
  font-family: var(--font-display); font-size: 22px;
  letter-spacing: 2px; color: var(--text); margin-bottom: 4px;
}
.an-run-goal-sub  { font-size: 13px; color: var(--muted); }
.an-run-goal-badge { font-size: 28px; }
.an-run-goal-progress {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.an-run-goal-bar-wrap {
  flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.an-run-goal-bar {
  height: 100%; background: var(--gold); border-radius: 3px;
  transition: width 0.6s ease;
}
.an-run-goal-bar.achieved { background: var(--green); }
.an-run-goal-pct { font-size: 13px; font-weight: 600; color: var(--gold); min-width: 36px; text-align: right; }
.an-run-goal-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.an-run-stat { text-align: center; }
.an-run-stat-val {
  font-family: var(--font-display); font-size: 22px;
  color: var(--text); letter-spacing: 1px;
}
.an-run-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── Run log ──────────────────────────────────────────────────────────────── */
.an-run-log { display: flex; flex-direction: column; gap: 6px; }
.an-run-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px; gap: 10px;
}
.an-run-row-left { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.an-run-row-date  { font-size: 12px; color: var(--muted); }
.an-run-row-type  {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: var(--gold-dim);
  color: var(--gold); border: 0.5px solid var(--gold-border);
  display: inline-block; margin-top: 2px;
}
.an-run-row-right { text-align: right; }
.an-run-row-pace {
  font-family: var(--font-display); font-size: 22px;
  color: var(--gold); letter-spacing: 1px;
}
.an-run-row-dist { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── Run entry form ───────────────────────────────────────────────────────── */
.an-field-group { display: flex; flex-direction: column; gap: 5px; }
.an-field-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}
.an-field-input {
  width: 100%; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--input-border); border-radius: 8px;
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; -webkit-appearance: none; transition: border-color 0.15s;
}
.an-field-input:focus { border-color: var(--gold-border); box-shadow: var(--shadow-focus); }
.an-field-input::placeholder { color: var(--muted); }

.an-save-btn {
  width: 100%; padding: 13px; border: none; border-radius: 8px;
  background: var(--gold); color: #0E0E0F;
  font-family: var(--font-cond); font-size: 15px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  transition: opacity 0.15s, transform 0.25s var(--ease-precise);
}
.an-save-btn:hover { opacity: 0.9; transform: translateY(-4px); }

/* ── Body stats grid ──────────────────────────────────────────────────────── */
.an-body-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px;
}
.an-body-stat-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 14px 10px; text-align: center;
}
.an-body-stat-icon  { font-size: 18px; margin-bottom: 5px; }
.an-body-stat-val   {
  font-family: var(--font-display); font-size: 24px;
  color: var(--gold); letter-spacing: 1px; line-height: 1;
}
.an-body-stat-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-top: 3px;
}

/* ── TDEE card ────────────────────────────────────────────────────────────── */
.an-tdee-card {
  background: var(--gold-dim); border: 0.5px solid var(--gold-border);
  border-radius: 14px; padding: 20px; text-align: center;
}
.an-tdee-value {
  font-family: var(--font-display); font-size: 52px;
  color: var(--text); letter-spacing: 3px; line-height: 1;
}
.an-tdee-label { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.an-tdee-breakdown {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.an-tdee-item { text-align: center; }
.an-tdee-item-val {
  font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 3px;
}
.an-tdee-item-label { font-size: 11px; color: var(--muted); }

/* ── Strength Analytics — exercise picker ─────────────────────────────────── */
.an-ex-picker { display: flex; flex-direction: column; gap: 10px; }

.an-ex-dropdown { position: relative; }

.an-ex-dropdown-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; background: var(--card);
  border: 0.5px solid var(--border); border-radius: 10px;
  color: var(--muted); font-family: var(--font-body); font-size: 14px;
  cursor: pointer; text-align: left; transition: border-color 0.15s;
}
.an-ex-dropdown-trigger:hover,
.an-ex-dropdown-trigger.open { border-color: var(--gold-border); color: var(--text); }

.an-ex-chevron {
  flex-shrink: 0; transition: transform 0.2s;
}
.an-ex-dropdown-trigger.open .an-ex-chevron { transform: rotate(180deg); }

.an-ex-dropdown-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 0.5px solid var(--gold-border);
  border-radius: 10px; z-index: 50; max-height: 280px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.an-ex-dropdown-list::-webkit-scrollbar { width: 4px; }
.an-ex-dropdown-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.an-ex-search-wrap {
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.an-ex-search {
  width: 100%; box-sizing: border-box;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 6px; padding: 6px 10px;
  font-size: 12px; color: var(--text); outline: none;
}
.an-ex-search::placeholder { color: var(--muted); }
.an-ex-search:focus { border-color: var(--gold-border); box-shadow: var(--shadow-focus); }

.an-ex-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background 0.1s;
  font-size: 13px; color: var(--text);
}
.an-ex-dropdown-item:hover    { background: rgba(200,150,62,0.08); }
.an-ex-dropdown-item.selected { color: var(--gold); }
.an-ex-dropdown-item.disabled { opacity: 0.35; cursor: default; }
.an-ex-dropdown-item.disabled:hover { background: none; }
.an-ex-no-data { margin-left: auto; font-size: 10px; color: var(--muted); letter-spacing: 0.5px; }

.an-ex-item-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--gold);
  flex-shrink: 0;
}
.an-ex-dropdown-item.selected .an-ex-item-check {
  background: var(--gold-dim); border-color: var(--gold-border);
}

.an-ex-dropdown-empty {
  padding: 16px 14px; font-size: 13px; color: var(--muted); text-align: center;
}
.an-ex-dropdown-none {
  border-bottom: 0.5px solid var(--border);
  color: var(--muted) !important;
  font-style: italic;
}
.an-ex-dropdown-none.selected { color: var(--text) !important; font-style: normal; }
.an-ex-dropdown-ctrl {
  padding: 8px 12px; border-bottom: 0.5px solid var(--border);
  display: flex; justify-content: flex-end;
}
.an-ex-ctrl-btn {
  background: none; border: 0.5px solid var(--gold-border);
  color: var(--gold); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; cursor: pointer;
  letter-spacing: 0.5px; transition: background 0.15s;
}
.an-ex-ctrl-btn:hover { background: var(--gold-dim); }
.an-ex-no-data {
  margin-left: auto; font-size: 10px; color: var(--muted);
  font-style: italic; padding-right: 2px;
}

/* ── Selected exercise chips ──────────────────────────────────────────────── */
.an-ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.an-ex-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px;
  background: var(--card); border: 1px solid; /* color set inline */
  font-size: 12px; font-weight: 500; color: var(--text);
}
.an-ex-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.an-ex-chip-name { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-ex-chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px; line-height: 1;
  padding: 0 0 0 2px; transition: color 0.1s;
}
.an-ex-chip-remove:hover { color: var(--text); }

/* ── Progress chart legend ────────────────────────────────────────────────── */
.an-progress-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 12px 0 4px;
}
.an-progress-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.an-progress-legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.an-empty-state {
  text-align: center; padding: 24px; font-size: 13px;
  color: var(--muted); line-height: 1.6;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 12px;
}

/* ── Strength Standards cards ─────────────────────────────────────────────── */
.an-std-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
}
.an-std-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.an-std-left { display: flex; align-items: center; gap: 10px; }
.an-std-icon { font-size: 20px; }
.an-std-name { font-size: 14px; font-weight: 600; color: var(--text); }
.an-std-rm   { font-size: 11px; color: var(--muted); margin-top: 1px; }
.an-std-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  padding: 3px 10px; border-radius: 20px; border: 1px solid;
}
.an-std-badge--dim { background: rgba(255,255,255,0.05); color: var(--muted); border-color: var(--border); }
.an-std-track {
  display: flex; gap: 3px; margin-bottom: 4px;
}
.an-std-seg {
  flex: 1; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.07);
}
.an-std-seg.filled { background: var(--gold); }
.an-std-track-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--muted); letter-spacing: 0.4px;
}
.an-std-no-bw { font-size: 11px; color: var(--muted); font-style: italic; }

/* ── Body fat category card ───────────────────────────────────────────────── */
.an-bf-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.an-bf-top {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
}
.an-bf-num  { font-family: var(--font-display); font-size: 32px; line-height: 1; }
.an-bf-cat  { font-size: 14px; font-weight: 600; }
.an-bf-ranges { display: flex; flex-direction: column; gap: 6px; }
.an-bf-range {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 0.5px solid transparent;
  transition: border-color 0.15s;
}
.an-bf-range.active { border-color: var(--border); background: rgba(255,255,255,0.05); }
.an-bf-range-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.an-bf-range-label { font-size: 12px; font-weight: 600; color: var(--text); }
.an-bf-range-val   { font-size: 11px; color: var(--muted); }

/* ── Weight change card ───────────────────────────────────────────────────── */
.an-wchange-card {
  display: flex; gap: 10px;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 16px;
}
.an-wchange-item { flex: 1; text-align: center; }
.an-wchange-val  { font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
.an-wchange-lbl  { font-size: 10px; color: var(--muted); letter-spacing: 0.6px; margin-top: 2px; }
.an-wchange-sub  { font-size: 10px; color: var(--muted); margin-top: 3px; }

/* ── Macro grid ───────────────────────────────────────────────────────────── */
.an-macro-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.an-macro-item {
  background: var(--card); border: 0.5px solid; /* set inline */
  border-radius: 12px; padding: 12px 10px;
}
.an-macro-goal  { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; margin-bottom: 4px; }
.an-macro-kcal  { font-family: var(--font-display); font-size: 18px; color: var(--text); margin-bottom: 8px; }
.an-macro-rows  { display: flex; flex-direction: column; gap: 4px; }
.an-macro-row   { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.an-macro-row strong { margin-left: auto; color: var(--text); font-weight: 600; }
.an-macro-dot   { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* ── Exercise stat cards ──────────────────────────────────────────────────── */
.an-ex-stat-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px;
}
.an-ex-stat-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.an-ex-stat-title::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 7px;
  vertical-align: middle;
}
.an-ex-stat-grid  {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.an-ex-stat-item  { text-align: center; }
.an-ex-stat-val   { font-family: var(--font-display); font-size: 16px; line-height: 1.2; color: var(--text); }
.an-ex-stat-lbl   { font-size: 9px; color: var(--muted); letter-spacing: 0.5px; margin-top: 2px; }
.an-ex-stat-dates { font-size: 10px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ── Training frequency list ─────────────────────────────────────────────── */
.an-freq-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 0.5px solid var(--border);
}
.an-freq-row:last-child { border-bottom: none; }
.an-freq-name    { font-size: 12px; color: var(--text); min-width: 110px; }
.an-freq-bar-wrap{ flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.an-freq-bar     { height: 100%; background: linear-gradient(90deg,#C8963E,rgba(200,150,62,0.6)); border-radius: 3px; }
.an-freq-count   { font-size: 11px; color: var(--muted); width: 28px; text-align: right; }

/* ── Strength progress list (overview) ───────────────────────────────────── */
.an-sp-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
  align-items: center;
}
.an-sp-row:last-child { border-bottom: none; }
.an-sp-name    { font-size: 13px; font-weight: 500; color: var(--text); grid-column: 1; grid-row: 1; }
.an-sp-best    { font-size: 11px; color: var(--muted); grid-column: 1; grid-row: 2; }
.an-sp-weights { font-size: 12px; color: var(--muted); grid-column: 2; grid-row: 1 / 3; white-space: nowrap; }
.an-sp-arrow   { margin: 0 4px; opacity: 0.4; }
.an-sp-latest  { color: var(--text); font-weight: 500; }
.an-sp-delta   { font-size: 12px; font-weight: 600; grid-column: 3; grid-row: 1 / 3; white-space: nowrap; }
.an-sp-delta.pos { color: #4CAF76; }
.an-sp-delta.neg { color: #E05252; }

/* ── Session log: nested week rows ───────────────────────────────────────── */
.an-week-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 0.5px solid var(--border);
  transition: background 0.1s;
}
.an-week-row:hover { background: rgba(255,255,255,0.04); }
.an-week-row--active .an-week-row-label { color: var(--gold); }
.an-week-row-arrow { font-size: 9px; color: var(--muted); width: 10px; flex-shrink: 0; }
.an-week-row-info  { flex: 1; min-width: 0; }
.an-week-row-label { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.an-week-row-meta  { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }
.an-week-row-check { font-size: 13px; color: var(--gold); width: 16px; text-align: center; }
.an-session-nested-item { padding-left: 28px !important; background: rgba(0,0,0,0.15); align-items: flex-start !important; }
.an-session-nested-item:last-child { border-bottom: 0.5px solid var(--border); }
.an-session-nested-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.an-session-nested-day  { font-size: 13px; font-weight: 600; color: var(--text); }
.an-session-nested-focus{ font-size: 11px; color: var(--muted); }

/* ── Session detail cards (Training tab session log) ─────────────────────── */
.an-session-detail-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
}
.an-session-detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.an-session-detail-exercises {
  display: flex; flex-direction: column; gap: 5px;
  border-top: 0.5px solid var(--border); padding-top: 10px;
}
.an-session-detail-ex {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.an-session-detail-ex-name { color: var(--text); font-weight: 500; }
.an-session-detail-ex-meta { color: var(--muted); font-size: 11px; }
.an-session-detail-notes {
  margin-top: 10px; font-size: 11px; color: var(--muted);
  font-style: italic; border-top: 0.5px solid var(--border); padding-top: 8px;
}

/* ── Exercise group headers (accordion inside dropdown) ──────────────────── */
.an-ex-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.15);
  cursor: pointer; user-select: none;
  border-top: 0.5px solid var(--border);
  transition: background 0.15s;
}
.an-ex-group-header:hover { background: rgba(255,255,255,0.04); }
.an-ex-group-arrow { font-size: 11px; color: var(--muted); width: 12px; flex-shrink: 0; }
.an-ex-group-label { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; letter-spacing: 0.3px; }
.an-ex-group-count {
  background: var(--gold); color: var(--dark);
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}
.an-ex-group-item { padding-left: 28px !important; }

/* ── Dropdown description text ───────────────────────────────────────────── */
.an-dropdown-desc {
  margin: 4px 0 0 2px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Log Exercise form ───────────────────────────────────────────────────── */
.an-logex-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.an-logex-sets-header {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 2px;
  font-family: var(--font-cond);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.an-logex-sets-header span:first-child { text-align: left; }

.an-logex-set-row {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}
.an-logex-set-num {
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--gold);
}
.an-logex-set-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  text-align: center;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.an-logex-set-input:focus { border-color: var(--gold-border); box-shadow: var(--shadow-focus); }
.an-logex-set-input::placeholder { color: var(--muted); }

.an-logex-add-set-btn {
  background: none;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  color: var(--gold);
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s, transform 0.25s var(--ease-precise);
  text-transform: uppercase;
  width: 100%;
}
.an-logex-add-set-btn:hover {
  border-color: var(--gold-border);
  background: var(--gold-dim);
  transform: translateY(-4px);
}

.an-logex-saved {
  text-align: center;
  color: #4CAF76;
  font-size: 13px;
  font-weight: 600;
}

/* ── Focus states (keyboard / gym-floor accessibility) ───────────────────── */
.an-period-pill:focus-visible,
.an-tab:focus-visible,
.an-week-btn:focus-visible,
.an-save-btn:focus-visible,
.an-ex-dropdown-trigger:focus-visible,
.an-ex-ctrl-btn:focus-visible,
.an-logex-add-set-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .an-hero-grid { grid-template-columns: repeat(2, 1fr); }
  .an-body-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .an-macro-grid { grid-template-columns: 1fr; }
  .an-ex-stat-grid { grid-template-columns: repeat(2, 1fr); }
}