/* ==========================================================================
   ANALYTICS — Premium analytics stylesheet
   Target: Garmin Connect / COROS / TrainingPeaks / Strava Premium / Whoop depth.
   Dark-first. Augments analytics context only — does not override global styles.
   ========================================================================== */

/* ---- V2 analytics pattern: Overview | Stats tabs + headline hero --------- */
.an-tabbar { display: flex; gap: 8px; margin-bottom: 16px; }
.an-tab {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: var(--touch-target); padding: 10px; border-radius: 10px;
  background: var(--overlay-sm); border: 1px solid var(--border-default);
  color: var(--text-muted); font-weight: 700; font-size: 0.85rem; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.an-tab--active { background: var(--color-blue); border-color: transparent; color: #fff; }

.an-hero { padding: 20px; margin-bottom: 12px; text-align: center; }
.an-hero__k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.an-hero__val { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.an-hero__unit { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); margin-left: 4px; }
.an-hero__delta { display: inline-block; font-size: 0.78rem; font-weight: 700; margin-top: 6px; }
.an-hero__empty { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
.an-spark { display: block; width: 100%; height: 40px; margin-top: 14px; overflow: visible; }

/* --------------------------------------------------------------------------
   1. CRITICAL: LAYOUT GRID
   -------------------------------------------------------------------------- */

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.grid-3-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

/* --------------------------------------------------------------------------
   2. DOMAIN COLOR SYSTEM
   Each analytics section cascades its accent colour for themed components.
   -------------------------------------------------------------------------- */

#analytics-strength,
#analytics-strength_pr     { --an-domain: var(--color-blue); --an-domain-r: 59;  --an-domain-g: 130; --an-domain-b: 246; }

#analytics-running,
#analytics-avg-pace,
#analytics-vdot,
#analytics-run-crossref    { --an-domain: var(--color-pink); --an-domain-r: 236; --an-domain-g: 72;  --an-domain-b: 153; }

#analytics-recovery,
#analytics-recovery-score  { --an-domain: var(--color-green); --an-domain-r: 16;  --an-domain-g: 185; --an-domain-b: 129; }

#analytics-training-status,
#analytics-load-focus,
#analytics-stress-balance  { --an-domain: var(--color-amber); --an-domain-r: 245; --an-domain-g: 158; --an-domain-b: 11; }

#analytics-bodyweight      { --an-domain: var(--data-5); --an-domain-r: 167; --an-domain-g: 139; --an-domain-b: 250; }

#analytics-weekly-summary,
#analytics-weekly-volume,
#analytics-progress,
#analytics-streak,
#analytics-activity        { --an-domain: var(--color-cyan); --an-domain-r: 34;  --an-domain-g: 211; --an-domain-b: 238; }

/* --------------------------------------------------------------------------
   3. SECTION HEADERS — Domain chip system
   -------------------------------------------------------------------------- */

.analytics-section h2.section-header {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 0.67rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  margin: 20px 0 12px !important;
  padding: 0 !important;
}

.analytics-section h2.section-header::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--an-domain);
  border-radius: 2px;
  flex-shrink: 0;
}

.analytics-section h2.section-header::after {
  display: none !important;
}

/* --------------------------------------------------------------------------
   4. STAT CARDS — .an-stat premium treatment
   -------------------------------------------------------------------------- */

.an-stat {
  position: relative;
  overflow: hidden;
  border-radius: 12px !important;
  font-variant-numeric: tabular-nums;
  /* padding override: slightly more generous than the p-3 default */
  padding: 14px 13px 12px !important;
}

/* Top-edge ambient fade from accent color */
.an-stat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 2.5%, transparent) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

.an-stat__label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
  line-height: 1;
}

.an-stat__value {
  font-size: 1.38rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.an-stat__unit {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 3px;
  letter-spacing: 0;
}

.an-stat__status {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Fallback: keep all analytics cards consistently rounded */
.analytics-section .card-dark {
  border-radius: 12px !important;
}

/* --------------------------------------------------------------------------
   5. INSIGHTS PANEL
   -------------------------------------------------------------------------- */

.an-insights {
  background: var(--overlay-xs);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  animation: an-fade-up 0.22s ease both;
}

.an-insights__title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.an-insight {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 5px;
  border-left: 2.5px solid transparent;
  font-size: 0.81rem;
  line-height: 1.52;
  color: var(--text-strong);
}

.an-insight:last-child {
  margin-bottom: 0;
}

.an-insight--alert {
  background: color-mix(in srgb, var(--danger) 6.5%, transparent);
  border-left-color: var(--color-red);
}

.an-insight--good {
  background: color-mix(in srgb, var(--success) 6.5%, transparent);
  border-left-color: var(--color-green);
}

.an-insight--info {
  background: color-mix(in srgb, var(--info) 6.5%, transparent);
  border-left-color: var(--color-blue);
}

.an-insight__icon {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 900;
  margin-top: 1px;
}

.an-insight--alert .an-insight__icon { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--color-red); }
.an-insight--good  .an-insight__icon { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--color-green); }
.an-insight--info  .an-insight__icon { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--color-blue); }

/* --------------------------------------------------------------------------
   6. CHART CONTAINER CHROME
   -------------------------------------------------------------------------- */

.an-chart {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 15px 14px 12px;
  margin-bottom: 10px;
}

.an-chart__title {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 3px;
}

.an-chart__subtitle {
  font-size: 0.70rem;
  color: var(--text-faint);
  margin-bottom: 10px;
  line-height: 1.35;
}

.an-zone-bar {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--danger) 30%, transparent)  0%,
    color-mix(in srgb, var(--warning) 45%, transparent) 18%,
    color-mix(in srgb, var(--success) 65%, transparent) 32%,
    color-mix(in srgb, var(--success) 65%, transparent) 52%,
    color-mix(in srgb, var(--warning) 55%, transparent) 68%,
    color-mix(in srgb, var(--danger) 65%, transparent) 84%,
    color-mix(in srgb, var(--danger) 80%, transparent) 100%
  );
  position: relative;
}

.an-zone-bar__marker {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #000;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 25%, transparent), 0 2px 6px rgba(0,0,0,0.6);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.an-zone-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.59rem;
  color: var(--text-faint);
  padding: 4px 1px 0;
}

/* --------------------------------------------------------------------------
   8. KPI HERO DISPLAY
   -------------------------------------------------------------------------- */

.an-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 14px;
  text-align: center;
}

.an-kpi__label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.an-kpi__unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-sub);
  margin-left: 4px;
  letter-spacing: 0;
}

.an-kpi__status {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 7px;
}

.an-kpi__sub {
  font-size: 0.70rem;
  color: var(--text-faint);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   9. READINESS RING WRAPPER
   -------------------------------------------------------------------------- */

.an-readiness-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 16px;
}

.an-readiness-components {
  width: 100%;
  max-width: 200px;
  margin-top: 16px;
}

.an-readiness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.76rem;
}

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

.an-readiness-row__label { color: var(--text-muted); }
.an-readiness-row__value { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   10. ANALYTICS WEEK NAV BAR
   -------------------------------------------------------------------------- */

#analyticsWeekNav.week-nav-bar,
.week-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--overlay-xs) !important;
  border-bottom: 1px solid var(--border-default) !important;
  padding: 10px 16px !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  /* Sticky resolves against the scrollport, not the padded .view-container, so
     top:0 parks this bar under the status bar once the page scrolls — taking
     its week-stepper buttons with it. */
  top: 0;
  top: var(--safe-top);
  z-index: 10;
}

/* A 28px text pill. It is the primary way back to the live week, so it carries
   the shared `.hit-target` (css/styles.css) treatment: the pill keeps its
   measured 28px height and the ::after grows a 44px-tall, full-width tap area.
   The hit area never exceeds the button's width, so it cannot reach the 44px
   arrows either side; vertically it runs 8px above and 8px below the pill,
   which stays inside the bar (2px gap + date line above, 10px padding below). */
.week-nav-today {
  border: 0;
  background: transparent;
  color: var(--color-blue);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 750;
  padding: 3px 8px;
  min-height: 28px;
}

/* --------------------------------------------------------------------------
   WEEKLY VOLUME DETAIL
   -------------------------------------------------------------------------- */

.an-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin:8px 0 2px; }
.an-detail-head h2 { color:var(--text-primary); font-size:1.65rem; letter-spacing:-0.04em; margin:2px 0 0; }
.an-detail-kicker { color:var(--color-blue); font-size:0.68rem; font-weight:800; letter-spacing:0.09em; text-transform:uppercase; }
.an-detail-period { color:var(--text-muted); font-size:0.78rem; margin:0 0 16px; }
.an-period-status { background:var(--overlay-md); border:1px solid var(--border-default); border-radius:999px; color:var(--text-muted); font-size:0.66rem; font-weight:750; padding:6px 9px; white-space:nowrap; }
.an-period-status.is-live { background:color-mix(in srgb, var(--success) 10%, transparent); border-color:color-mix(in srgb, var(--success) 25%, transparent); color:var(--color-green); }
.an-ex-hero { background:linear-gradient(145deg,color-mix(in srgb, var(--info) 14%, transparent),var(--bg-card)); border:1px solid color-mix(in srgb, var(--info) 26%, transparent); border-radius:16px; margin-bottom:10px; padding:16px; }
.an-ex-hero__k { color:var(--color-blue); display:block; font-size:.64rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.an-ex-hero__v { color:var(--text-primary); display:block; font-size:1.55rem; font-variant-numeric:tabular-nums; font-weight:850; letter-spacing:-.02em; margin:6px 0 4px; }
.an-ex-hero__sub { color:var(--text-muted); display:block; font-size:.7rem; line-height:1.45; }
.an-ex-hero__sub b { font-weight:800; }
.an-ex-hero__sub b.is-up { color:var(--color-green); }
.an-ex-hero__sub b.is-down { color:var(--color-red); }
.an-ex-chart { display:block; height:auto; width:100%; }
.an-ex-chart__grid { stroke:var(--border-subtle); stroke-width:1; }
.an-ex-chart__axis { fill:var(--text-muted); font-size:9px; font-variant-numeric:tabular-nums; }
.an-ex-chart__area { fill:color-mix(in srgb, var(--info) 12%, transparent); }
.an-ex-chart__line { fill:none; stroke:var(--color-blue); stroke-linecap:round; stroke-linejoin:round; stroke-width:2.2; }
.an-ex-chart__dot { fill:var(--bg-card); stroke:var(--color-blue); stroke-width:2; }
.an-ex-chart__dot.is-pr { fill:var(--color-amber); stroke:var(--color-amber); }
.an-ex-pr { background:color-mix(in srgb, var(--warning) 16%, transparent); border-radius:999px; color:var(--color-amber); display:inline-block; font-size:.56rem; font-weight:850; margin-left:4px; padding:1px 5px; vertical-align:middle; }
.an-volume-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.an-volume-summary article { background:var(--bg-card); border:1px solid var(--border-default); border-radius:12px; padding:12px; min-width:0; }
.an-volume-summary span { color:var(--text-muted); display:block; font-size:.68rem; margin-bottom:5px; }
.an-volume-summary strong { color:var(--text-primary); display:block; font-size:1.12rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.an-volume-compare { align-items:center; background:linear-gradient(135deg,color-mix(in srgb, var(--info) 12%, transparent),var(--bg-card)); border:1px solid color-mix(in srgb, var(--info) 22%, transparent); border-radius:12px; display:flex; justify-content:space-between; gap:12px; margin-bottom:10px; padding:13px; }
.an-volume-compare__label,.an-volume-compare__meta,.an-volume-compare__periods span { color:var(--text-muted); display:block; font-size:.66rem; }
.an-volume-compare__value { color:var(--text-primary); display:block; font-size:1rem; margin:2px 0; }
.an-volume-compare__value--up { color:var(--color-green); }.an-volume-compare__value--down { color:var(--color-red); }
.an-volume-compare__periods { text-align:right; white-space:nowrap; }
.an-data-note { background:color-mix(in srgb, var(--warning) 8%, transparent); border:1px solid color-mix(in srgb, var(--warning) 20%, transparent); border-radius:10px; color:var(--text-muted); font-size:.72rem; margin:10px 0; padding:10px; }
.an-segment { background:var(--overlay-xs); border:1px solid var(--border-default); border-radius:11px; display:grid; grid-template-columns:repeat(4,1fr); gap:3px; margin:16px 0 10px; padding:3px; }
.an-segment__button { background:transparent; border:0; border-radius:8px; color:var(--text-muted); font-size:.7rem; font-weight:750; min-height:44px; padding:6px 2px; }
.an-segment__button.is-active { background:var(--bg-card); box-shadow:0 1px 5px rgba(0,0,0,.16); color:var(--text-primary); }
/* The merged Strength Volume screen has two tabs, not the segment's default
   four, so it overrides the column count rather than stretching two buttons
   across a four-track grid. */
.sv-tabs { grid-template-columns:repeat(2,1fr); margin-top:6px; }
.sv-tabs .an-segment__button { font-size:.76rem; }
.an-detail-substatus { display:flex; justify-content:flex-end; margin:10px 0 2px; }
.an-segment--three { grid-template-columns:repeat(3,1fr); }
.an-segment--five { grid-template-columns:repeat(5,1fr); }
.an-segment--five .an-segment__button { font-size:.64rem; letter-spacing:-.01em; }
.run-best { margin: 4px 0 16px; padding: 12px; border: 1px solid var(--border-default); border-radius: 16px; background: var(--surface-2); }
.run-best__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.run-best__source { color: var(--text-3); font-size: .64rem; font-weight: 700; }
.run-best__list { list-style: none; margin: 8px 0 0; padding: 0; }
.run-best__row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border-default); }
.run-best__row:first-child { border-top: 0; }
.run-best__dist { color: var(--text-2); font-size: .72rem; font-weight: 800; }
.run-best__time { color: var(--text); font-size: .92rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.run-best__meta { color: var(--text-3); font-size: .68rem; text-align: right; }
.run-best__races { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-default); }
.run-best__eyebrow { margin: 0 0 4px; color: var(--text-2); font-size: .64rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.run-best__eyebrow b { color: var(--warning); }
.run-best__race-list { list-style: none; margin: 0; padding: 0; }
.run-best__race { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: baseline; gap: 8px; padding: 5px 0; color: var(--text-2); font-size: .74rem; }
.run-best__race strong { color: var(--text); font-variant-numeric: tabular-nums; }
.run-best__est { color: var(--warning); font-size: .6rem; font-weight: 800; text-align: right; text-transform: uppercase; }
.run-best__basis, .run-best__note { margin: 8px 0 0; color: var(--text-3); font-size: .66rem; line-height: 1.4; }
.pg-block { margin: 4px 0 16px; padding: 12px; border: 1px solid var(--border-default); border-radius: 16px; background: var(--surface-2); }
.pg-block__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pg-block__eyebrow { margin: 0; color: var(--text-2); font-size: .66rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.pg-block__range { margin: 2px 0 0; color: var(--text-3); font-size: .7rem; }
.pg-block__status { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.pg-block__status--muted { color: var(--text-3); background: color-mix(in srgb, var(--text-3) 12%, transparent); }
.pg-block__status--ok { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.pg-block__status--note { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.pg-block__status--warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.pg-block__headline { margin: 8px 0 0; color: var(--text-2); font-size: .74rem; line-height: 1.4; }
.pg-block__totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.pg-block__totals div { display: grid; gap: 1px; min-width: 0; }
.pg-block__totals strong { color: var(--text); font-size: .98rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.pg-block__totals span { color: var(--text-3); font-size: .62rem; font-weight: 700; }
.pg-block__lifts { list-style: none; margin: 0 0 10px; padding: 0; }
.pg-block__lift { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border-default); }
.pg-block__lift:first-child { border-top: 0; }
.pg-block__lift-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: .78rem; font-weight: 700; }
.pg-block__pr { padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); font-size: .58rem; font-weight: 850; }
.pg-block__lift-value { color: var(--text-2); font-size: .72rem; font-variant-numeric: tabular-nums; }
.pg-block__lift-delta { min-width: 44px; text-align: right; font-size: .7rem; font-weight: 800; }
.pg-block__lift-delta--up { color: var(--success); }
.pg-block__lift-delta--down { color: var(--warning); }
.pg-block__lift-delta--flat { color: var(--text-3); }
.pg-block__checks { list-style: none; margin: 0 0 10px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--warning) 26%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--warning) 6%, transparent); }
.pg-block__check { color: var(--text-2); font-size: .72rem; line-height: 1.45; }
.pg-block__check + .pg-block__check { margin-top: 4px; }
.pg-block__check b { color: var(--text); }
.pg-block__rec { margin: 0 0 10px; color: var(--text-2); font-size: .76rem; line-height: 1.45; }
.pg-block__action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); font: inherit; font-size: .74rem; font-weight: 800; cursor: pointer; }
.pg-year { margin: 0 0 18px; }
.pg-year__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.pg-year__range { margin: 0; color: var(--text-3); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.pg-year__total { margin: 0; color: var(--text-2); font-size: .72rem; font-weight: 700; text-align: right; }
.pg-year__months { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pg-year__month { min-width: 0; }
.pg-year__month-name { margin: 0 0 4px; color: var(--text-2); font-size: .68rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.pg-year__dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 3px; }
.pg-year__dow span { color: var(--text-3); font-size: .55rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.pg-year__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.pg-year__cell { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: color-mix(in srgb, var(--text-3) 10%, transparent); color: var(--text); font: inherit; }
.pg-year__pad { display: block; min-height: 44px; }
.pg-year__num { font-size: .66rem; font-weight: 700; }
.pg-year__cell--l1 { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pg-year__cell--l2 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.pg-year__cell--l3 { background: color-mix(in srgb, var(--accent) 46%, transparent); }
.pg-year__cell--l4 { background: color-mix(in srgb, var(--accent) 66%, transparent); }
.pg-year__cell--logged:not(.pg-year__cell--measured) { border-style: dashed; border-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.pg-year__cell--future { background: none; color: var(--text-3); opacity: .45; }
.pg-year__cell--future .pg-year__num { font-weight: 600; }
.pg-year__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 12px; color: var(--text-3); font-size: .66rem; }
.pg-year__swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.pg-year__less { font-weight: 700; }
.pg-year__legend-note { flex-basis: 100%; margin-top: 2px; }
.pg-year__note { margin: 8px 0 0; color: var(--text-3); font-size: .68rem; line-height: 1.4; }
@media (min-width: 560px) { .pg-year__months { grid-template-columns: 1fr 1fr; gap: 14px 18px; } }
.pg-mix { margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-2); }
.pg-mix__label { margin: 0 0 5px; color: var(--text-3); font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pg-mix__label--gap { margin-top: 12px; }
.pg-mix__bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--text-3) 15%, transparent); }
.pg-mix__bar span { display: block; height: 100%; min-width: 2px; }
.pg-mix__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 6px 0 0; padding: 0; color: var(--text-2); font-size: .7rem; }
.pg-mix__legend b { color: var(--text); }
.pg-mix__dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.pg-mix__fit { margin: 8px 0 0; color: var(--text-2); font-size: .72rem; line-height: 1.4; }
.pg-mix__fit--ok { color: var(--success); }
.pg-stalls { margin: 0 0 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warning) 34%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--warning) 6%, transparent); }
.pg-stalls__title { margin: 0 0 6px; color: var(--warning); font-size: .66rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.pg-stall { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 44px; padding: 6px 0; border: 0; border-top: 1px solid color-mix(in srgb, var(--warning) 18%, transparent); background: none; color: var(--text); text-align: left; cursor: pointer; }
.pg-stalls__title + .pg-stall { border-top: 0; }
.pg-stall__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .8rem; }
.pg-stall__head span { color: var(--text-3); font-size: .7rem; font-weight: 700; }
.pg-stall__msg { color: var(--text-2); font-size: .72rem; line-height: 1.4; }
.pg-stalls__more { margin: 6px 0 0; color: var(--text-3); font-size: .68rem; }
.pg-muscle-target { margin:6px 0 0; color:var(--text-secondary); font-size:.76rem; font-weight:600; }
.pg-muscle-target b { color:var(--text-primary); font-weight:800; }
.pg-muscle-action { margin-top:8px; }
.an-ex-relative { margin:10px 0 4px; color:var(--text-secondary); font-size:.8rem; font-weight:650; }
.an-ex-relative b { color:var(--text-primary); }
.an-ex-relative small { color:var(--text-muted); font-size:.7rem; font-weight:600; }
.an-ex-rate { margin:8px 0 14px; color:var(--text-secondary); font-size:.76rem; font-weight:650; }
.an-ex-rate > span { color:var(--text-primary); font-weight:800; }
.an-ex-rate small { color:var(--text-muted); font-size:.68rem; font-weight:600; }
.an-volume-panel { background:var(--bg-card); border:1px solid var(--border-default); border-radius:14px; margin-bottom:12px; padding:14px; }
.an-volume-panel__head { align-items:baseline; display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; }
.an-volume-panel__head h3 { color:var(--text-primary); font-size:.88rem; margin:0; }.an-volume-panel__head span { color:var(--text-muted); font-size:.65rem; }
.an-volume-bars { align-items:end; display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; height:176px; }
.an-volume-bar { align-items:center; align-self:stretch; background:transparent; border:0; color:var(--text-muted); display:flex; flex-direction:column; gap:4px; min-width:0; padding:0; }
.an-volume-bar__value { font-size:.57rem; font-variant-numeric:tabular-nums; min-height:14px; overflow:hidden; text-overflow:ellipsis; width:100%; }
.an-volume-bar__track { align-items:end; background:var(--overlay-sm); border-radius:6px; display:flex; flex:1; overflow:hidden; width:100%; }
.an-volume-bar__track span { background:linear-gradient(180deg,var(--info),var(--accent)); border-radius:6px; display:block; min-height:3px; transition:height .2s ease; width:100%; }
.an-volume-bar.is-selected .an-volume-bar__track { box-shadow:0 0 0 2px var(--color-blue); }.an-volume-bar.is-future { opacity:.35; }
.an-volume-bar__label { font-size:.66rem; font-weight:750; }
.an-volume-selection { border-top:1px solid var(--border-subtle); margin-top:14px; padding-top:12px; }
.an-volume-selection__head { display:flex; justify-content:space-between; gap:10px; color:var(--text-primary); font-size:.78rem; }
.an-volume-selection p { color:var(--text-muted); font-size:.7rem; margin:4px 0 9px; }
.an-evidence-list { display:flex; flex-direction:column; gap:7px; }
.an-evidence-row { align-items:center; background:var(--overlay-xs); border:1px solid var(--border-subtle); border-radius:10px; color:inherit; display:flex; gap:10px; min-height:52px; padding:9px 10px; text-align:left; width:100%; }
.an-evidence-row__date { color:var(--color-blue); font-size:.65rem; font-weight:750; min-width:46px; }.an-evidence-row__body { display:flex; flex:1; flex-direction:column; min-width:0; }
.an-evidence-row__title { color:var(--text-primary); font-size:.76rem; font-weight:750; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.an-evidence-row__meta { color:var(--text-muted); font-size:.64rem; margin-top:2px; }
.an-evidence-row__arrow { color:var(--text-muted); font-size:1.1rem; }
.an-ranked-list { display:flex; flex-direction:column; gap:7px; }
.an-ranked-row { background:transparent; border:0; border-bottom:1px solid var(--border-subtle); color:inherit; min-height:66px; padding:7px 0 10px; text-align:left; width:100%; }
.an-ranked-row:last-child { border-bottom:0; }.an-ranked-row__head { color:var(--text-primary); display:flex; font-size:.76rem; justify-content:space-between; gap:12px; }.an-ranked-row__head span { font-variant-numeric:tabular-nums; white-space:nowrap; }
.an-ranked-row__track { background:var(--overlay-sm); border-radius:999px; display:block; height:5px; margin:7px 0; overflow:hidden; }.an-ranked-row__track span { background:var(--color-blue); display:block; height:100%; }.an-ranked-row__track--muscle span { background:var(--color-green); }
.an-ranked-row__meta { color:var(--text-muted); display:block; font-size:.64rem; }.an-ranked-row__meta b { color:var(--color-blue); float:right; }
.an-empty-state,.an-empty-inline { color:var(--text-muted); font-size:.72rem; padding:18px 8px; text-align:center; }.an-empty-state strong,.an-empty-state span { display:block; }.an-empty-state strong { color:var(--text-primary); font-size:.8rem; margin-bottom:5px; }
.an-method { border-top:1px solid var(--border-subtle); color:var(--text-muted); font-size:.7rem; margin-top:12px; padding:12px 2px 4px; }.an-method summary { align-items:center; color:var(--text-sub); cursor:pointer; display:flex; font-weight:750; min-height:44px; }.an-method p { line-height:1.55; margin:7px 0; }
.an-stat--action { color:inherit; cursor:pointer; font:inherit; min-height:110px; padding:12px; position:relative; text-align:left; width:100%; }
.an-stat--action:focus-visible,.an-ranked-row:focus-visible,.an-evidence-row:focus-visible,.an-volume-bar:focus-visible,.an-segment__button:focus-visible { outline:2px solid var(--color-blue); outline-offset:2px; }
.an-stat__drill { color:var(--color-blue); font-size:.62rem; font-weight:750; margin-top:auto; padding-top:7px; }
.an-entity-link { align-items:center; background:transparent; border:0; color:var(--text-primary); display:inline-flex; gap:5px; min-height:44px; padding:4px 0; text-align:left; }.an-entity-link > span:last-child { color:var(--color-blue); }
.an-exercise-trend { align-items:end; background:linear-gradient(180deg,transparent,var(--overlay-xs)); border-bottom:1px solid var(--border-default); display:flex; gap:4px; height:110px; margin-bottom:12px; overflow-x:auto; padding:8px 2px 0; }
.an-exercise-trend span { background:linear-gradient(180deg,var(--info),var(--accent)); border-radius:4px 4px 0 0; flex:1 0 8px; max-width:22px; min-height:4px; }
.an-muscle-trend { align-items:end; display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:5px; height:130px; }
.an-muscle-trend div { align-items:center; display:flex; flex-direction:column; height:100%; justify-content:flex-end; }.an-muscle-trend div > span { background:linear-gradient(180deg,var(--success),#059669); border-radius:5px 5px 0 0; display:block; min-height:4px; width:100%; }.an-muscle-trend small { color:var(--text-muted); font-size:.55rem; margin-top:4px; }

/* Volume Guide ----------------------------------------------------------- */
.vg-guide { padding: 14px; margin-bottom: 16px; }
.vg-guide__intro { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; }
.vg-guide__intro > div { display:grid; gap:3px; min-width:0; }
.vg-guide__intro strong { color:var(--text-primary); font-size:.88rem; }
.vg-guide__intro span { color:var(--text-muted); font-size:.65rem; }
.vg-guide__status,.vg-priority-label { border:1px solid var(--border-default); border-radius:999px; padding:4px 7px; color:var(--text-secondary)!important; white-space:nowrap; }
.vg-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-bottom:12px; }
.vg-summary > div,.vg-summary > button { min-width:0; padding:9px; border:1px solid var(--border-default); border-radius:10px; background:var(--overlay-xs); text-align:left; }
.vg-summary > button { cursor:pointer; }
.vg-summary span { display:block; color:var(--text-muted); font-size:.61rem; margin-bottom:4px; }
.vg-summary strong { display:block; color:var(--text-primary); font-size:.9rem; overflow-wrap:anywhere; }
/* Four tabs must still clear 44px at 320px, so they wrap to two rows rather
   than shrinking below the touch target. */
.vg-tabs { display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
.vg-tab { flex:1 1 calc(50% - 3px); min-width:0; min-height:44px; padding:0 6px; border:1px solid var(--border-default); border-radius:9px; background:var(--overlay-xs); color:var(--text-muted); font-size:.7rem; font-weight:700; }
@media (min-width: 420px) { .vg-tab { flex:1 1 0; } }
.vg-tab.is-active { border-color:var(--color-blue); background:color-mix(in srgb,var(--color-blue) 16%,transparent); color:var(--text-primary); }
.vg-guide__note { margin:0 0 10px; padding:8px 9px; border-left:3px solid var(--color-blue); background:color-mix(in srgb,var(--color-blue) 6%,transparent); color:var(--text-secondary); font-size:.68rem; line-height:1.45; }
.vg-muscle-list { display:grid; gap:11px; }
.vg-muscle-row { display:grid; gap:5px; padding:10px; border:1px solid var(--border-default); border-radius:11px; background:var(--overlay-xs); }
.vg-muscle-row__head,.vg-muscle-row__numbers,.vg-muscle-row__meta { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.vg-muscle-row__head .an-entity-link { min-height:44px; color:var(--text-primary); font-size:.78rem; font-weight:750; }
.vg-priority select { min-height:44px; max-width:116px; border:1px solid var(--border-default); border-radius:8px; background:var(--bg-card); color:var(--text-primary); font-size:.68rem; padding:0 8px; }
.vg-muscle-row__numbers,.vg-muscle-row__meta { color:var(--text-muted); font-size:.62rem; }
.vg-muscle-row__meta strong { color:var(--text-secondary); font-size:.62rem; text-align:right; }
/* Landmark scale: axis runs 0 → MRV (the usual ceiling), with MV/MEV/MAV/MRV
   labelled. Replaces the old unlabelled 4-overlay bar, on which "12 of 10–20"
   and "30 of 10–20" were indistinguishable. */
.vg-scale { margin:3px 0 2px; }
.vg-scale__track { position:relative; height:10px; border-radius:999px; background:var(--overlay-sm); overflow:hidden; }
.vg-scale__band { position:absolute; inset-block:0; background:color-mix(in srgb,var(--color-green) 16%,transparent); border-inline:1px solid color-mix(in srgb,var(--color-green) 45%,transparent); }
.vg-scale__direct,.vg-scale__indirect { position:absolute; inset-block:0; left:0; }
.vg-scale__direct { background:var(--color-blue); }
.vg-scale__indirect { background:var(--color-cyan); }
.vg-scale__plan { position:absolute; inset-block:0; width:2px; background:var(--text-primary); }
.vg-scale__ticks { position:relative; height:13px; margin-top:2px; }
.vg-tick { position:absolute; top:0; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; }
.vg-tick i { display:block; width:1px; height:3px; background:var(--border-strong); }
.vg-tick b { color:var(--text-muted); font-size:.5rem; font-weight:700; letter-spacing:.02em; line-height:1.4; }

.vg-muscle-row__numbers strong { color:var(--text-primary); font-size:.86rem; font-weight:800; font-variant-numeric:tabular-nums; }
.vg-muscle-row__numbers { justify-content:flex-start; gap:6px; align-items:baseline; flex-wrap:wrap; }
.vg-muscle-row__planned { margin-left:auto; }
.vg-muscle-row__detail { margin:1px 0 0; color:var(--text-muted); font-size:.63rem; line-height:1.4; }
/* Attention tones. Amber/blue, never red: a volume band is guidance, not danger. */
.vg-status--low { color:var(--color-amber)!important; }
.vg-status--high { color:var(--color-amber)!important; }
.vg-status--ok { color:var(--color-green)!important; }
.vg-muscle-row--low { border-color:color-mix(in srgb,var(--color-amber) 34%,var(--border-default)); }
.vg-muscle-row--high { border-color:color-mix(in srgb,var(--color-amber) 34%,var(--border-default)); }

.vg-spread { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:11px; }
.vg-spread__item { flex:1 1 auto; min-width:0; padding:5px 8px; border:1px solid var(--border-default); border-radius:999px; color:var(--text-muted); font-size:.62rem; font-weight:650; text-align:center; white-space:nowrap; }
.vg-spread__item--low,.vg-spread__item--high { border-color:color-mix(in srgb,var(--color-amber) 32%,transparent); color:var(--color-amber); }
.vg-spread__item--ok { border-color:color-mix(in srgb,var(--color-green) 32%,transparent); color:var(--color-green); }

.vg-legend { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0 4px; color:var(--text-muted); font-size:.6rem; }
.vg-legend span { display:flex; align-items:center; gap:4px; }
.vg-legend i { display:inline-block; width:13px; height:5px; border-radius:2px; }
.vg-legend .is-direct { background:var(--color-blue); }.vg-legend .is-indirect { background:var(--color-cyan); }.vg-legend .is-reference { background:color-mix(in srgb,var(--color-green) 30%,transparent); }.vg-legend .is-plan { width:2px; height:10px; background:var(--text-primary); }

.an-volume-corridor { position:relative; height:150px; margin-top:6px; padding-top:6px; }
.an-volume-corridor__band { position:absolute; z-index:0; left:0; right:0; bottom:var(--corridor-bottom, 0%); height:var(--corridor-height, 0%); background:color-mix(in srgb,var(--color-green) 12%,transparent); border-block:1px solid color-mix(in srgb,var(--color-green) 35%,transparent); }
.an-volume-corridor__bars { position:absolute; inset:6px 0 0; z-index:1; display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); align-items:end; gap:5px; }
.an-volume-corridor__week { position:relative; display:flex; align-items:center; justify-content:flex-end; flex-direction:column; height:100%; }
.an-volume-corridor__logged { display:block; width:70%; min-height:3px; border-radius:4px 4px 0 0; background:linear-gradient(180deg,var(--color-cyan),var(--color-blue)); }
.an-volume-corridor__planned { position:absolute; left:8%; right:8%; bottom:18px; border:1px dashed var(--text-secondary); border-bottom:0; border-radius:4px 4px 0 0; }
.an-volume-corridor__week small { color:var(--text-muted); font-size:.55rem; margin-top:4px; }
.an-volume-corridor-legend { display:flex; gap:10px; flex-wrap:wrap; color:var(--text-muted); font-size:.62rem; margin-top:8px; }

@media (min-width: 520px) { .an-volume-summary { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width: 390px) { .vg-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }.vg-summary > div:last-child { grid-column:1/-1; }.vg-muscle-row__head { align-items:flex-start; }.vg-priority select { max-width:104px; } }
@media (max-width: 360px) { .an-volume-compare { align-items:flex-start; flex-direction:column; }.an-volume-compare__periods { text-align:left; }.an-segment__button { font-size:.63rem; } }

/* --------------------------------------------------------------------------
   11. LIFT PROGRESSION CARDS
   -------------------------------------------------------------------------- */

.an-lift-card {
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--info) 11%, transparent);
  border-left: 3px solid var(--color-blue);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.an-pr-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.60rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--success) 11%, transparent);
  color: var(--color-green);
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   12. MUSCLE GROUP STATUS BADGES
   -------------------------------------------------------------------------- */

.an-muscle-badge {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.an-muscle-badge--optimal      { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--color-green); }
.an-muscle-badge--undertrained { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--color-red); }
.an-muscle-badge--overtrained  { background: color-mix(in srgb, var(--data-3) 12%, transparent); color: var(--data-3); }
.an-muscle-badge--no_data      { background: var(--overlay-md); color: var(--text-faint); }

/* --------------------------------------------------------------------------
   13. METRIC ROW (structured data rows in cards)
   -------------------------------------------------------------------------- */

.an-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

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

.an-metric-label {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.an-metric-label small {
  color: var(--text-muted);
  display: block;
  font-size: 0.62rem;
  margin-top: 2px;
}

.an-metric-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   14. PACE ROW
   -------------------------------------------------------------------------- */

.an-pace-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.an-pace-value {
  font-size: 0.90rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   15. WELLNESS FORM
   -------------------------------------------------------------------------- */

.wellness-checkin-form input[type="number"],
.wellness-checkin-form input[type="text"] {
  background: var(--overlay-md) !important;
  border: 1px solid var(--border-medium) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-size: 0.88rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.wellness-checkin-form input:focus {
  outline: none !important;
  border-color: var(--color-green) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 15%, transparent) !important;
}

/* --------------------------------------------------------------------------
   16. SECTION DIVIDER
   -------------------------------------------------------------------------- */

.an-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 7%, transparent), transparent);
  margin: 18px 0;
}

/* --------------------------------------------------------------------------
   17. TREND TRACK (horizontal fill bar used in legacy 1RM list)
   -------------------------------------------------------------------------- */

.trend-track-bg {
  background: var(--overlay-lg);
  border-radius: 4px;
  overflow: hidden;
}

.trend-track-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --------------------------------------------------------------------------
   18. ENTRY ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes an-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.an-stat {
  animation: an-fade-up 0.24s ease both;
}

/* Stagger grid children */
.grid-2-col > .an-stat:nth-child(1) { animation-delay: 0.03s; }
.grid-2-col > .an-stat:nth-child(2) { animation-delay: 0.07s; }
.grid-2-col > .an-stat:nth-child(3) { animation-delay: 0.11s; }
.grid-2-col > .an-stat:nth-child(4) { animation-delay: 0.15s; }

/* --------------------------------------------------------------------------
   19. TABULAR NUMBERS ACROSS ALL ANALYTICS METRICS
   -------------------------------------------------------------------------- */

.analytics-section .font-heavy,
.analytics-section .font-bold,
.analytics-section [style*="font-size"] {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   20. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 360px) {
  .an-stat__value { font-size: 1.18rem; }
}

/* --------------------------------------------------------------------------
   21. LIGHT MODE OVERRIDES — Comprehensive
   -------------------------------------------------------------------------- */

/* -- Section header chip -------------------------------------------------- */

/* -- an-stat cards --------------------------------------------------------
   The global light-mode rule in styles.css applies:
     html[data-theme="light"] .card-dark { border: 1px solid rgba(0,0,0,0.07) !important }
   That !important strips our inline border-top accent. Restore it here using
   higher-specificity (two classes vs one class) so our !important wins.
   Top accent falls back to --an-domain which cascades from the section wrapper.
   -------------------------------------------------------------------------- */
html[data-theme="light"] .card-dark.an-stat {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-top: 2px solid var(--an-domain) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.055), inset 0 1px 0 color-mix(in srgb, var(--surface-1) 90%, transparent) !important;
}

html[data-theme="light"] .an-stat::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.01) 0%, transparent 60%);
}


/* -- Insights panel ------------------------------------------------------- */
html[data-theme="light"] .an-insights {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .an-insight--alert   { background: color-mix(in srgb, var(--danger) 6%, transparent); }
html[data-theme="light"] .an-insight--good    { background: color-mix(in srgb, var(--success) 6%, transparent); }
html[data-theme="light"] .an-insight--info    { background: color-mix(in srgb, var(--info) 6%, transparent); }

html[data-theme="light"] .an-insight--alert .an-insight__icon { background: color-mix(in srgb, var(--danger) 12%, transparent); }
html[data-theme="light"] .an-insight--good  .an-insight__icon { background: color-mix(in srgb, var(--success) 12%, transparent); }
html[data-theme="light"] .an-insight--info  .an-insight__icon { background: color-mix(in srgb, var(--info) 12%, transparent); }

/* -- Chart chrome --------------------------------------------------------- */


/* -- ACWR zone bar -------------------------------------------------------- */

html[data-theme="light"] .an-zone-bar__marker {
  background: #1e293b;
  border-color: color-mix(in srgb, var(--text) 80%, transparent);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15), 0 2px 5px rgba(0,0,0,0.25);
}

/* -- Metric rows ---------------------------------------------------------- */

/* -- Pace rows ------------------------------------------------------------ */

/* -- Readiness rows ------------------------------------------------------- */

/* -- Week nav bar --------------------------------------------------------- */
html[data-theme="light"] #analyticsWeekNav.week-nav-bar,
html[data-theme="light"] .week-nav-bar {
  background: color-mix(in srgb, var(--surface-1) 92%, transparent) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

/* -- Trend track bar ----------------------------------------------------- */

/* -- Section divider ----------------------------------------------------- */
html[data-theme="light"] .an-divider {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.07), transparent);
}

/* -- KPI hero display ---------------------------------------------------- */

/* -- Lift progression card ----------------------------------------------- */
html[data-theme="light"] .an-lift-card { border-color: color-mix(in srgb, var(--info) 14%, transparent); }

html[data-theme="light"] .an-pr-badge {
  background: color-mix(in srgb, var(--success) 9%, transparent);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
}

/* -- Muscle group badges -------------------------------------------------- */
html[data-theme="light"] .an-muscle-badge--optimal      { background: color-mix(in srgb, var(--success) 10%, transparent); }
html[data-theme="light"] .an-muscle-badge--undertrained { background: color-mix(in srgb, var(--danger) 10%, transparent); }
html[data-theme="light"] .an-muscle-badge--overtrained  { background: color-mix(in srgb, var(--data-3) 10%, transparent); }
html[data-theme="light"] .an-muscle-badge--no_data      { background: rgba(0,0,0,0.05); color: rgba(15,23,42,0.35); }

/* -- Wellness form ------------------------------------------------------- */
html[data-theme="light"] .wellness-checkin-form input[type="number"],
html[data-theme="light"] .wellness-checkin-form input[type="text"] {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: rgba(15, 23, 42, 0.92) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.07) !important;
}

html[data-theme="light"] .wellness-checkin-form input:focus {
  border-color: var(--color-green) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 14%, transparent), inset 0 1px 2px rgba(0,0,0,0.05) !important;
}

/* -- SVG chart cards --------------------------------------------------------
   Charts now draw with semantic tokens (A3), so in light mode they belong on
   the same light card as every other surface. This used to force a dark card
   because grid/text colours were hard-coded white.
   -------------------------------------------------------------------------- */
html[data-theme="light"] .analytics-section .card-dark:has(svg) {
  background: var(--surface-1) !important;
  border-color: var(--divider) !important;
  box-shadow: var(--elevation-1) !important;
}

/* -- Inline white-border row fix ------------------------------------------
   Muscle group rows and pace list rows use inline
   "border-bottom:1px solid color-mix(in srgb, var(--text) 6%, transparent)" which becomes invisible
   on white card backgrounds. !important overrides inline styles.
   -------------------------------------------------------------------------- */
html[data-theme="light"] .analytics-section .flex-between[style*="rgba(255,255,255"] {
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

/* -- Empty state text colour fix ------------------------------------------ */
html[data-theme="light"] .analytics-section p[style*="rgba(255,255,255"] {
  color: var(--text-2) !important;
}

/* -- deltaBadge tick arrow stroke (SVG dot halo) --------------------------
   This selector only fires when the SVG is NOT inside a dark chart card,
   which after the :has(svg) rule above means it's essentially unused in
   light mode — left here as a safety net.
   -------------------------------------------------------------------------- */
html[data-theme="light"] .analytics-section:not(:has(.card-dark:has(svg))) svg circle[stroke="#0d1117"] {
  stroke: color-mix(in srgb, var(--text) 55%, transparent);
}

/* ==========================================================================
   FASTING ANALYTICS — Domain colour + Components
   ========================================================================== */

#analytics-fasting {
  --an-domain:   var(--warning);
  --an-domain-r: 245;
  --an-domain-g: 158;
  --an-domain-b: 11;
}

/* Non-an-stat card border normalisation */
#analytics-fasting .card-dark:not(.an-stat) {
  border: 1px solid var(--border-default) !important;
}

/* --------------------------------------------------------------------------
   Fasting Calendar
   -------------------------------------------------------------------------- */

.fa-cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: default;
  transition: transform 0.15s;
  min-width: 0;
  min-height: 0;
}

.fa-cal-cell:hover { transform: scale(1.06); }

.fa-cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.fa-cal-pulse {
  animation: fa-pulse 2s ease-in-out infinite;
}

@keyframes fa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 0%, transparent); }
  50%       { box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
}

.fa-cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fa-cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.67rem;
  color: var(--text-muted);
}

.fa-cal-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Fasting Achievements
   -------------------------------------------------------------------------- */

.fa-achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.fa-achievement {
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  transition: transform 0.15s, opacity 0.2s;
  cursor: default;
}

.fa-achievement:hover { transform: translateY(-2px); }

.fa-achievement__icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 6px;
}

.fa-achievement__label {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.25;
  margin-bottom: 3px;
}

.fa-achievement__desc {
  font-size: 0.58rem;
  color: var(--text-faint);
  line-height: 1.35;
  margin-bottom: 4px;
}

.fa-achievement__tier {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Fasting Sheet — Analytics button + Phase Info
   -------------------------------------------------------------------------- */

.fasting-btn-analytics {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-amber);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
  border-radius: 14px;
  padding: 5px 12px;
  cursor: pointer;
  margin-right: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.fasting-btn-analytics:hover { background: color-mix(in srgb, var(--warning) 18%, transparent); }

.fz-phase-info {
  background: var(--overlay-sm);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.fz-phase-label {
  font-size: 0.75rem;
  color: var(--text-sub);
  flex: 1;
  min-width: 120px;
}

.fz-phase-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.fz-phase-track {
  width: 100%;
  height: 4px;
  background: var(--overlay-lg);
  border-radius: 2px;
  overflow: hidden;
}

.fz-phase-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s linear;
}

/* --------------------------------------------------------------------------
   Light-mode overrides for fasting analytics
   -------------------------------------------------------------------------- */

html[data-theme="light"] .fz-phase-info {
  background: rgba(0, 0, 0, 0.025);
  border-color: rgba(0, 0, 0, 0.08);
}


html[data-theme="light"] .fasting-btn-analytics {
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  border-color: color-mix(in srgb, var(--warning) 25%, transparent);
  color: #b45309;
}


/* ==========================================================================
   FASTING ANALYTICS — New Phase 2 Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fasting Score Card
   -------------------------------------------------------------------------- */

.fa-score-card {
  position: relative;
  overflow: hidden;
}

.fa-comp-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.fa-comp-label {
  font-size: 0.70rem;
  color: var(--text-sub);
}

.fa-comp-value {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Active Fast Card
   -------------------------------------------------------------------------- */

.fa-active-card {
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Inline Educational Tips — small contextual callouts within analytics flow
   -------------------------------------------------------------------------- */

.fa-edu-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: color-mix(in srgb, var(--warning) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 14%, transparent);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.55;
}

.fa-edu-tip__icon {
  flex-shrink: 0;
  font-size: 0.88rem;
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   Light-mode overrides — new components
   -------------------------------------------------------------------------- */


html[data-theme="light"] .fa-edu-tip {
  background: color-mix(in srgb, var(--warning) 5%, transparent);
  border-color: color-mix(in srgb, var(--warning) 14%, transparent);
  color: rgba(15, 23, 42, 0.60);
}

html[data-theme="light"] .fa-score-card {
  background: rgba(0, 0, 0, 0.015);
}

/* SVG ring cards in light mode: semantic tokens make a light card readable. */
html[data-theme="light"] #analytics-fasting .card-dark:has(svg) {
  background: var(--surface-1) !important;
  border-color: var(--divider) !important;
  box-shadow: var(--elevation-1) !important;
}

/* ==========================================================================
   ANALYTICS — Light Mode Completions
   Fixes all hardcoded rgba(255,255,255,…) values for light theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   Stat cards
   -------------------------------------------------------------------------- */

html[data-theme="light"] .an-stat {
  background: linear-gradient(160deg, var(--surface-1) 0%, var(--surface-2) 100%) !important;
  border-color: rgba(0,0,0,0.07) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07) !important;
}

html[data-theme="light"] .an-stat::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.015) 0%, transparent 60%) !important;
}




html[data-theme="light"] .an-stat__status {
  /* accent colours remain vibrant; only adjust muted state */
}


/* --------------------------------------------------------------------------
   Insights panel
   -------------------------------------------------------------------------- */

html[data-theme="light"] .an-insights {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.07) !important;
}



html[data-theme="light"] .an-insight--alert {
  background: color-mix(in srgb, var(--danger) 5.5%, transparent) !important;
}

html[data-theme="light"] .an-insight--good {
  background: color-mix(in srgb, var(--success) 5.5%, transparent) !important;
}

html[data-theme="light"] .an-insight--info {
  background: color-mix(in srgb, var(--info) 5.5%, transparent) !important;
}


/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */



/* --------------------------------------------------------------------------
   Analytics grid layout cards
   -------------------------------------------------------------------------- */

html[data-theme="light"] .analytics-section .metric-mini-box {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.08) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

html[data-theme="light"] .analytics-section .metric-mini-box .lbl {
  color: rgba(0,0,0,0.42) !important;
}

html[data-theme="light"] .analytics-section .metric-mini-box .val {
  color: #0f172a !important;
}

html[data-theme="light"] .analytics-section .metric-mini-box .sub {
  color: rgba(0,0,0,0.48) !important;
}


/* --------------------------------------------------------------------------
   Fasting analytics — domain colours (section-level override)
   -------------------------------------------------------------------------- */

html[data-theme="light"] #analytics-fasting { --an-domain: var(--color-amber); }



/* --------------------------------------------------------------------------
   SVG chart elements — additional overrides
   -------------------------------------------------------------------------- */

html[data-theme="light"] #view-analytics svg .chart-grid-line {
  stroke: rgba(0, 0, 0, 0.08) !important;
}


/* --------------------------------------------------------------------------
   Analytics charts — chart wrapper polish
   -------------------------------------------------------------------------- */

.analytics-chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

html[data-theme="light"] .analytics-chart-wrap {
  background: rgba(0,0,0,0.015);
  border-radius: var(--radius-lg, 12px);
}


/* ==========================================================================
   INSIGHTS HUB — the index screen that surfaces every analytics section.
   Reached from the Home "Insights & Analytics" entry. Leaf sections route
   "back" here so the user can browse without returning to the dashboard.
   ========================================================================== */

/* Prominent Home entry point (a louder variant of .btn-history-link). */
.btn-history-link--feature {
  padding: 16px 18px;
  font-size: 0.98rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent-pressed) 12%, transparent));
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--domain-strength);
}
@media (hover: hover) {
  .btn-history-link--feature:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent-pressed) 18%, transparent));
  }
}

.hub-head {
  margin: 4px 0 18px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.hub-customize-btn {
  flex: 0 0 auto; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--border-default); border-radius: 11px;
  background: var(--overlay-sm);
  color: var(--text-secondary); font: inherit; font-size: .72rem; font-weight: 750;
  cursor: pointer;
}
.hub-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}
.hub-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.hub-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.hub-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 12px);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
@media (hover: hover) {
  .hub-link:hover {
    background: var(--surface-3);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  }
}
.hub-link:active { transform: scale(0.985); }

.hub-link__icon {
  flex: 0 0 auto;
  font-size: 1.35rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 10px;
}
.hub-link__label {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hub-link__title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}
.hub-link__desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-link__arrow {
  flex: 0 0 auto;
  font-size: 1.05rem;
  opacity: 0.45;
}

html[data-theme="light"] .hub-link {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .hub-link__icon {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* ==========================================
   PROGRESS HUB — four live domain cards (roadmap Phase 3A)

   The landing answers "what changed, and does it matter" before the user taps
   anything, so the four headline domains carry real weight and the remaining
   destinations are deliberately quieter (.hub-link--quiet).
   ========================================== */
.ph-empty {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 12px);
  padding: 14px;
  margin: 0 0 14px;
}
.ph-empty p { margin: 0 0 12px; }
.ph-empty__cta {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--color-cyan);
  font-size: 0.8rem;
  font-weight: 800;
}
.ph-weeks__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}
.ph-card--empty .ph-card__value { font-size: 1.15rem; }

.ph-week {
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 14px);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, transparent), var(--surface-2));
}
.ph-week__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ph-week__eyebrow { display: block; color: var(--text-muted); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.ph-week__title { margin: 4px 0 0; color: var(--text-primary); font-size: 1.5rem; line-height: 1.1; }
.ph-week__link { flex-shrink: 0; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--color-cyan); font-size: 0.75rem; font-weight: 800; }
.ph-week__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ph-week__stats div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ph-week__stats b { color: var(--text-primary); font-size: 0.9rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-week__stats span { color: var(--text-muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ph-week__adherence { height: 6px; margin-top: 14px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.ph-week__adherence span { display: block; height: 100%; border-radius: inherit; background: var(--color-green); }
.ph-week__adherence-label { margin: 6px 0 0; color: var(--text-muted); font-size: 0.68rem; }
/* ---- Untrained selected week ---------------------------------------------
   A week with nothing logged still renders the week card, so it keeps the same
   rhythm as a trained one. It deliberately drops the indigo reward gradient
   (there is no progress to celebrate), charts no metric bars and rewards no
   adherence — one muted line says what is missing. The History shortcut is the
   only action on the card, so it keeps the 44px target. */
.ph-week--empty {
  background: var(--surface-2);
}
.ph-week--empty .ph-week__link {
  min-height: 44px;
}
.ph-week__empty {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.ph-weeks {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 14px);
  background: var(--surface-2);
}
.ph-weeks__head { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.ph-weeks__bars { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 4px; height: 48px; margin-top: 8px; }
.ph-weeks__bar { display: block; min-height: 3px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--text) 9%, transparent); }
.ph-weeks__bar.is-trained { background: linear-gradient(180deg, var(--color-cyan), var(--color-indigo)); }

.ph-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .ph-grid { grid-template-columns: 1fr 1fr; }
}

.ph-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 14px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 12px);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
@media (hover: hover) {
  .ph-card:hover {
    background: var(--surface-3);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  }
}
.ph-card:active { transform: scale(0.99); }
.ph-card--empty { opacity: 0.82; }

.ph-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-card__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text-muted);
}
.ph-card__title {
  flex: 1 1 auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 0;
}
.ph-card__arrow {
  flex: 0 0 auto;
  font-size: 0.95rem;
  opacity: 0.4;
}

.ph-card__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ph-card__unit {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-muted);
}

.ph-card__delta,
.ph-card__support,
.ph-card__say {
  margin: 0;
  line-height: 1.4;
}
.ph-card__delta {
  font-size: 0.76rem;
  font-weight: 600;
}
.ph-card__support {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.ph-card__trend {
  display: block;
  margin: 2px 0 1px;
}
.ph-card__trend .an-spark {
  display: block;
  width: 100%;
  height: 26px;
}
.ph-card__trend small {
  display: block;
  margin-top: 2px;
  font-size: 0.66rem;
  color: var(--text-muted);
}
/* The plain-language answer to "so what?" — the reason this card exists. */
.ph-card__say {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Secondary destinations: same control, lower contrast and no icon well. */
.hub-link--quiet {
  min-height: 52px;
  background: transparent;
  border-color: var(--border-subtle);
}
.hub-link--quiet .hub-link__title {
  font-size: 0.88rem;
  font-weight: 600;
}

html[data-theme="light"] .ph-card,
html[data-theme="light"] .ph-empty {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.08);
}
/* The empty-state CTA is the only action on a Progress page with no training,
   so it must clear AA. The cyan accent (var(--accent)) painted 1.49:1 on this tint,
   and cyan-700 (#0e7490) tops out around 4.1:1 on the app background (4.48:1
   even over white), so the text and border are cyan-800 instead: the measured
   pixel contrast is 5.46:1 on the #f0f4f8 backdrop and 5.98:1 on a white card,
   with the same 10% tint so the button keeps its soft filled look. */
html[data-theme="light"] .ph-empty__cta {
  border-color: rgba(21,94,117,0.36);
  background: rgba(21,94,117,0.10);
  color: #155e75;
}
/* The untrained week drops the reward gradient for the same flat tint as the
   other hub cards (--surface-2 has no light-theme value), and its History link
   is the card's only action, so it uses the readable cyan-800 rather than the
   accent cyan that measured 1.49:1 on a light tint. */
html[data-theme="light"] .ph-week--empty {
  background: rgba(0,0,0,0.02);
}
html[data-theme="light"] .ph-week--empty .ph-week__link {
  color: #155e75;
}
html[data-theme="light"] .hub-link--quiet {
  background: transparent;
  border-color: rgba(0,0,0,0.07);
}
html[data-theme="light"] .ph-card__say { color: var(--text-secondary); }

/* ==========================================
   PROJECTIONS (R12)
   ========================================== */
.proj-races { display: flex; flex-direction: column; gap: 2px; }
.proj-race { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 5%, transparent); }
.proj-race:last-child { border-bottom: none; }
.proj-race__d { font-weight: 700; color: var(--text); font-size: 0.84rem; }
.proj-race__t { font-weight: 800; color: var(--color-blue); font-size: 0.92rem; }
.proj-race__p { color: var(--text-muted); font-size: 0.68rem; min-width: 62px; text-align: right; }
.proj-eta { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 13px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--success) 10%, transparent); border: 1px solid color-mix(in srgb, var(--success) 28%, transparent); }
.proj-eta__k { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-green); }
.proj-eta__v { font-size: 0.86rem; color: var(--text); font-weight: 600; }
.proj-lift__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.proj-lift__name { font-weight: 700; color: var(--text); font-size: 0.86rem; }
.proj-lift__now { font-weight: 800; color: var(--text); }
.proj-lift__bar { height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.proj-lift__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--info), var(--success)); }
.proj-lift__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 0.76rem; color: var(--text-secondary); }
.proj-eta-chip { font-size: 0.68rem; font-weight: 800; color: var(--color-green); background: color-mix(in srgb, var(--success) 14%, transparent); padding: 2px 9px; border-radius: 999px; }
.proj-muted { font-size: 0.68rem; color: var(--text-muted); }
.proj-note { font-size: 0.68rem; color: var(--text-muted); line-height: 1.5; margin-top: 14px; text-align: center; }

/* Watch-only analytics (HR zones, cadence) collapsed by default so a user
   without a .FIT import isn't met with a stack of empty charts. */
.watch-analytics-group { border: 1px solid var(--overlay-sm); border-radius: 14px; padding: 4px 14px; margin-bottom: 20px; }
.watch-analytics-summary { list-style: none; cursor: pointer; padding: 12px 2px; font-size: 0.82rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.watch-analytics-summary::-webkit-details-marker { display: none; }
.watch-analytics-summary::after { content: '›'; margin-left: auto; font-size: 1.1rem; color: var(--text-muted); transition: transform 0.2s ease; }
.watch-analytics-group[open] .watch-analytics-summary::after { transform: rotate(90deg); }
.watch-analytics-hint { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); }

/* ==========================================
   METRIC-SPECIFIC RUNNING DETAILS
   ========================================== */
.an-hero--action {
  appearance: none;
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  min-height: 176px;
  position: relative;
  width: 100%;
}
.an-hero--action:active,
.metric-evidence-row:active,
.profile-stat-card--action:active { transform: scale(0.985); }
.an-hero--action:focus-visible,
.metric-range button:focus-visible,
.metric-bars__point:focus-visible,
.metric-line__point:focus-visible,
.metric-evidence-row:focus-visible,
.profile-stat-card--action:focus-visible { outline: 2px solid var(--color-blue); outline-offset: 2px; }
.running-metric-group + .running-metric-group { margin-top: 20px; }
.an-insight-card {
  background: color-mix(in srgb, var(--color-blue) 8%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--color-blue) 22%, transparent);
  border-radius: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 14px 16px;
}
.an-insight-card__eyebrow,
.metric-detail__eyebrow,
.metric-detail__section-head span {
  color: var(--color-blue);
  display: block;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.an-insight-card p { font-size: .82rem; margin: 6px 0 0; }
.metric-detail__header {
  background: linear-gradient(155deg, color-mix(in srgb, var(--color-blue) 10%, var(--bg-card)), var(--bg-card));
  border: 1px solid var(--border-default);
  border-radius: 20px;
  margin-bottom: 12px;
  padding: 20px;
}
.metric-detail__header h2 { color: var(--text-primary); font-size: 1.35rem; margin: 5px 0 4px; }
.metric-detail__header p { color: var(--text-secondary); font-size: .8rem; line-height: 1.5; margin: 12px 0 0; }
.metric-detail__value { font-size: clamp(2rem, 12vw, 3.25rem); font-weight: 850; letter-spacing: -.04em; line-height: 1.05; overflow-wrap: anywhere; }
.metric-detail__period { align-items: baseline; display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 8px; }
.metric-detail__period strong { color: var(--text-primary); font-size: .72rem; }
.metric-detail__period span,
.metric-detail__muted { color: var(--text-muted); font-size: .7rem; }
.metric-comparison {
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px 13px;
}
.metric-comparison strong { color: var(--text-primary); font-size: .92rem; white-space: nowrap; }
.metric-comparison span { color: var(--text-muted); font-size: .68rem; line-height: 1.35; }
.metric-comparison--good strong { color: var(--color-green); }
.metric-comparison--caution strong { color: var(--color-amber); }
.metric-daily-strip {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}
.metric-daily-strip__day {
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 58px;
  padding: 8px 4px;
  text-align: center;
}
.metric-daily-strip__day span { color: var(--text-muted); font-size: .58rem; font-weight: 750; text-transform: uppercase; }
.metric-daily-strip__day strong { color: var(--text-primary); font-size: .62rem; overflow-wrap: anywhere; }
.metric-daily-strip__day.is-upcoming { opacity: .48; }
.metric-detail__section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 18px;
  margin-bottom: 12px;
  padding: 15px;
}
.metric-detail__section-head { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 13px; }
.metric-detail__section-head h3 { color: var(--text-primary); font-size: 1rem; margin: 2px 0 0; }
.metric-range { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.metric-range::-webkit-scrollbar { display: none; }
.metric-range button {
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-muted);
  flex: 0 0 auto;
  font: inherit;
  font-size: .66rem;
  font-weight: 750;
  /* 44px, not 36px: this rule is shared by the Running, Strength and Recovery
     metric details, so every range selector in the app was below the touch
     target. The row scrolls horizontally, so the extra height costs nothing. */
  min-height: 44px;
  padding: 7px 12px;
}
.metric-range button.is-selected { background: color-mix(in srgb, var(--color-blue) 18%, transparent); border-color: color-mix(in srgb, var(--color-blue) 55%, transparent); color: var(--text-primary); }
.metric-bars { align-items: stretch; display: flex; gap: 4px; min-height: 190px; overflow-x: auto; padding: 6px 2px 0; scrollbar-width: thin; }
.metric-bars__point {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  display: grid;
  flex: 1 0 34px;
  font: inherit;
  grid-template-rows: 28px 118px 28px;
  min-width: 34px;
  padding: 0;
}
.metric-bars__value { color: var(--text-primary); font-size: .58rem; font-weight: 800; overflow: visible; white-space: nowrap; }
.metric-bars__track { align-items: flex-end; background: color-mix(in srgb, var(--text-muted) 5%, transparent); border-radius: 5px; display: flex; justify-content: center; overflow: hidden; }
.metric-bars__bar { background: var(--metric-color); border-radius: 4px 4px 1px 1px; height: var(--metric-height); min-height: 2px; opacity: .52; width: min(18px, 72%); }
.metric-bars__point.is-selected .metric-bars__bar { box-shadow: 0 0 0 2px color-mix(in srgb, var(--metric-color) 35%, transparent); opacity: 1; }
.metric-bars__label { font-size: .55rem; padding-top: 7px; white-space: nowrap; }
.metric-line { min-width: 0; overflow: hidden; position: relative; }
.metric-line__svg { display: block; height: 190px; width: 100%; }
.metric-line__axis { stroke: color-mix(in srgb, var(--text-muted) 22%, transparent); stroke-width: 1; }
.metric-line__points { inset: 0 0 48px; pointer-events: none; position: absolute; }
.metric-line__dot { background: var(--metric-color); border: 2px solid var(--bg-card); border-radius: 50%; height: 10px; left: var(--metric-x); position: absolute; top: var(--metric-y); transform: translate(-50%,-50%); width: 10px; }
.metric-line__inspectors { display: flex; gap: 4px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.metric-line__point {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  display: flex;
  flex: 1 0 48px;
  flex-direction: column;
  font: inherit;
  font-size: .55rem;
  gap: 2px;
  min-height: 44px;
  padding: 5px 4px;
}
.metric-line__point.is-selected { background: color-mix(in srgb, var(--color-blue) 12%, transparent); color: var(--text-primary); }
.metric-line__point strong { font-size: .58rem; white-space: nowrap; }
.metric-point-summary { align-items: baseline; border-top: 1px solid var(--border-default); display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 10px; padding-top: 10px; }
.metric-point-summary strong { color: var(--text-primary); font-size: .9rem; }
.metric-point-summary span { color: var(--text-muted); font-size: .68rem; }
.metric-chart-empty,
.metric-evidence-empty { color: var(--text-muted); padding: 28px 12px; text-align: center; }
.metric-chart-empty strong,
.metric-evidence-empty strong { color: var(--text-primary); display: block; font-size: .86rem; }
.metric-chart-empty p,
.metric-evidence-empty p { font-size: .72rem; line-height: 1.45; margin: 6px auto 0; max-width: 32rem; }
.metric-evidence-list { display: flex; flex-direction: column; gap: 6px; }
.metric-evidence-row {
  align-items: center;
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  color: inherit;
  display: flex;
  font: inherit;
  gap: 10px;
  justify-content: space-between;
  min-height: 54px;
  padding: 9px 11px;
  text-align: left;
  width: 100%;
}
.metric-evidence-row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.metric-evidence-row__main strong { color: var(--text-primary); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-evidence-row__main small { color: var(--text-muted); font-size: .62rem; }
.metric-evidence-row__metric { align-items: center; color: var(--text-secondary); display: flex; flex: 0 0 auto; font-size: .68rem; gap: 8px; }
.metric-evidence-row__metric b { color: var(--color-blue); font-size: 1rem; }
.metric-method { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 16px; margin-bottom: 24px; padding: 0 14px; }
.metric-method summary { color: var(--text-primary); cursor: pointer; font-size: .8rem; font-weight: 800; min-height: 48px; padding: 14px 0; }
.metric-method p,
.metric-method li,
.metric-method dd { color: var(--text-secondary); font-size: .7rem; line-height: 1.5; }
.metric-method dl { display: grid; gap: 7px; }
.metric-method dl div { border-top: 1px solid var(--border-default); padding-top: 7px; }
.metric-method dt { color: var(--text-muted); font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.metric-method dd { margin: 2px 0 0; }
.metric-method ul { padding-left: 18px; }
.metric-projection-grid { display: grid; gap: 7px; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 0 12px; }
.metric-projection-grid div { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 13px; display: flex; flex-direction: column; padding: 11px; }
.metric-projection-grid span,
.metric-projection-grid small { color: var(--text-muted); font-size: .62rem; }
.metric-projection-grid strong { color: var(--text-primary); font-size: 1rem; margin: 3px 0; }

@media (max-width: 359px) {
  .metric-detail__header { padding: 16px; }
  .metric-detail__section { padding: 12px; }
  .metric-detail__section-head { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .an-hero--action:active,
  .metric-evidence-row:active,
  .profile-stat-card--action:active { transform: none; }
}
/* Gym Performance: fixed-period activity totals with inspectable bars. */
.gym-performance { display: grid; gap: 14px; }
.gym-performance__header { text-align: center; }
.gym-performance__period-nav {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center; gap: 8px; margin: 10px 0 14px;
}
.gym-performance__period-nav button {
  min-width: 44px; min-height: 44px; border-radius: 12px;
  border: 1px solid var(--border-medium); background: var(--overlay-sm);
  color: var(--text-primary); font: inherit; font-size: 1.25rem; cursor: pointer;
}
.gym-performance__period-nav button:disabled { opacity: .28; cursor: default; }
.gym-performance__period-nav strong { font-size: .82rem; color: var(--text-secondary); }
.gym-performance__controls { display: grid; gap: 8px; }
.gym-performance__controls .metric-range { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.gym-performance__controls .metric-range button { min-width: 0; min-height: 44px; }
.gym-performance__comparison {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0; color: var(--text-secondary); font-size: .78rem;
}
.gym-performance__comparison strong { color: var(--color-blue); font-size: .92rem; }
.gym-performance__comparison.is-muted { color: var(--text-muted); }
.gym-performance__comparison.is-favorable strong { color: var(--color-green); }
.gym-performance__comparison.is-unfavorable strong { color: var(--color-amber); }
.gym-performance__chart {
  display: grid; grid-template-columns: repeat(var(--gym-bin-count), minmax(0, 1fr));
  align-items: end; gap: 5px; min-height: 210px; padding-top: 14px;
}
.gym-performance__bin {
  display: grid; grid-template-rows: 28px 140px 26px; align-items: end;
  min-width: 0; padding: 0; border: 0; background: transparent;
  color: var(--text-muted); font: inherit; cursor: pointer;
}
.gym-performance__bin:disabled { cursor: default; opacity: .28; }
.gym-performance__bin-value {
  align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .58rem; font-weight: 800; color: var(--text-primary);
}
.gym-performance__track {
  position: relative; display: block; height: 140px; border-bottom: 1px solid var(--border-medium);
}
.gym-performance__bar {
  position: absolute; inset-inline: 15%; bottom: 0; height: var(--gym-height);
  min-height: 2px; border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, var(--color-blue), var(--color-indigo));
  transition: height var(--duration-base) ease, filter var(--duration-fast) ease;
}
.gym-performance__bin.is-selected .gym-performance__bar {
  filter: brightness(1.22); box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3px var(--color-blue);
}
.gym-performance__bin-label {
  align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .58rem; font-weight: 700;
}
.gym-performance__bin.is-selected .gym-performance__bin-label { color: var(--text-primary); }
@media (max-width: 380px) {
  .gym-performance__chart { gap: 3px; }
  .gym-performance__bar { inset-inline: 10%; }
  .gym-performance__bin-label, .gym-performance__bin-value { font-size: .52rem; }
}

/* ==========================================
   RECOVERY METRIC DETAIL (roadmap 3D)

   The axis is framed on the observed range rather than zero: a 50bpm resting
   HR is not "half" of 100, and a zero-based axis would flatten every
   meaningful movement in this domain.
   ========================================== */
.rm-chart { margin: 6px 0 2px; }
.rm-chart svg { display:block; width:100%; height:88px; }
.rm-chart__axis,
.rm-chart__range {
  display:flex; justify-content:space-between; gap:10px;
  color:var(--text-muted); font-size:.62rem; margin-top:4px;
}
.rm-chart__range { font-variant-numeric:tabular-nums; opacity:.8; }
.metric-evidence-row--static { cursor:default; }
/* Projection confidence (roadmap 3D) — an ETA from three uneven weeks must not
   look like one from six clean ones. */
.proj-confidence {
  display:inline-block; margin-left:6px; padding:2px 7px; border-radius:999px;
  font-size:.58rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  border:1px solid var(--border-default); color:var(--text-muted);
}
.proj-confidence--high { border-color:color-mix(in srgb,var(--color-green) 40%,transparent); color:var(--color-green); }
.proj-confidence--moderate { border-color:color-mix(in srgb,var(--color-amber) 40%,transparent); color:var(--color-amber); }
.proj-confidence--low { border-color:color-mix(in srgb,var(--color-amber) 30%,transparent); color:var(--color-amber); }
.proj-lift__confidence { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:6px; }
.proj-lift__confidence span { color:var(--text-muted); font-size:.64rem; line-height:1.4; }
.proj-eta__note { display:block; margin-top:4px; color:var(--text-muted); font-size:.64rem; line-height:1.4; }

/* Body weight goal + weekly rate */
.bw-goal-editor { margin-top: 10px; border-top: 1px solid var(--border-subtle); padding-top: 6px; }
.bw-goal-editor summary {
  min-height: 44px; display: flex; align-items: center; cursor: pointer;
  color: var(--text-secondary); font-size: .78rem; font-weight: 800;
}
.bw-goal-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px;
}
.bw-goal-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--text-muted); font-size: .68rem; font-weight: 700; }
.bw-goal-grid input, .bw-goal-grid select {
  min-height: 44px; width: 100%; box-sizing: border-box;
  border: 1px solid var(--border-medium); border-radius: 9px;
  background: var(--overlay-md); color: var(--text-primary);
  padding: 8px 10px; font: inherit; font-size: .8rem;
}
.bw-summary { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.bw-summary__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  min-height: 30px; color: var(--text-secondary); font-size: .78rem;
}
.bw-summary__row strong { color: var(--text-primary); font-size: .9rem; font-variant-numeric: tabular-nums; }
.bw-summary__status { font-weight: 800; }
.bw-summary__note { color: var(--text-muted); font-size: .7rem; line-height: 1.45; }
.bw-week-card { margin-top: 10px; }
.bw-week-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 44px; padding: 4px 0; border: 0; border-bottom: 1px solid var(--border-subtle);
  background: none; text-align: left; cursor: pointer;
  font: inherit; font-size: .76rem; color: var(--text-secondary);
}
.bw-week-row:last-child { border-bottom: none; }
.bw-week-row strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bw-week-row small { color: var(--text-muted); font-size: .66rem; }

/* Muscle load — a compact, actionable per-muscle list. */
.muscle-load-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 10px;
}
.muscle-load-summary > div {
  padding: 10px; min-width: 0; border: 1px solid var(--border-light); border-radius: 12px;
  background: var(--bg-card); display: flex; flex-direction: column; gap: 2px;
}
.muscle-load-summary strong { color: var(--text-primary); font-size: 1.05rem; }
.muscle-load-summary span { color: var(--text-muted); font-size: .66rem; line-height: 1.35; }
.muscle-load-row {
  padding: 10px 2px; border-bottom: 1px solid var(--border-subtle);
}
.muscle-load-section-title {
  margin: 14px 0 2px; color: var(--text-muted); font-size: .68rem;
  font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.muscle-load-row:last-child { border-bottom: none; }
.muscle-load-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.muscle-load-head strong { color: var(--text-primary); font-size: .86rem; }
.muscle-load-recovery { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.recovery-recovering { color: var(--color-amber); }
.recovery-ready { color: var(--color-green); }
.recovery-fresh { color: var(--color-cyan); }
.recovery-untrained { color: var(--text-muted); }
.muscle-load-detail { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-top: 3px; color: var(--text-secondary); font-size: .74rem; }
.muscle-load-status { color: var(--text-muted); text-align: right; margin-left: auto; }
.muscle-load-row.tone-low .muscle-load-status { color: var(--color-amber); }
.muscle-load-row.tone-high .muscle-load-status { color: var(--color-cyan); }
.muscle-load-meta { margin-top: 3px; color: var(--text-muted); font-size: .68rem; }
