/* ═══════════════════════════════════════════════════════════════════════════
   FitMind V2 — auth screen + onboarding wizard
   Uses the app's existing design tokens (styles.css :root / [data-theme]).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Auth screen ─────────────────────────────────────────────────────────── */
#auth-screen {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
#auth-screen[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--card-bg, var(--fill-1));
  border: 1px solid var(--border, var(--fill-2));
  border-radius: 20px; padding: 26px 22px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 4px;
}
.auth-logo .auth-logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--lime-vivid);
}
.auth-title {
  text-align: center; font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.5px; margin: 0 0 2px;
}
.auth-sub {
  text-align: center; font-size: .78rem; color: var(--text-muted);
  margin: 0 0 18px; line-height: 1.5;
}
.auth-tabs {
  display: flex; gap: 4px; background: var(--fill-1);
  border-radius: 14px; padding: 4px; margin-bottom: 16px;
}
.auth-tabs button {
  flex: 1; border: none; background: none; padding: 9px 0;
  border-radius: 10px; font-size: .8rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; transition: all .2s;
}
.auth-tabs button.active { background: var(--lime-vivid); color: var(--on-accent, #191E00); }
#auth-form .input-label { margin-top: 10px; }
#auth-form .input { width: 100%; }
#auth-submit { width: 100%; margin-top: 18px; }
.auth-error {
  margin-top: 12px; font-size: .75rem; line-height: 1.45;
  color: var(--red, #ff6b6b); display: none;
}
.auth-note {
  margin-top: 12px; font-size: .72rem; line-height: 1.5;
  color: var(--text-muted); text-align: center;
}
#auth-dev-row { display: none; margin-top: 14px; text-align: center; }
#auth-dev-bypass {
  background: none; border: 1px dashed var(--fill-3); border-radius: 10px;
  color: var(--text-muted); font-size: .72rem; padding: 8px 14px; cursor: pointer;
}

/* ── Onboarding wizard ───────────────────────────────────────────────────── */
#onboarding-screen {
  position: fixed; inset: 0; z-index: 890;
  background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.ob-card { width: 100%; max-width: 420px; padding-top: 8px; }
.ob-progress {
  height: 4px; border-radius: 4px; background: var(--fill-2);
  overflow: hidden; margin-bottom: 26px;
}
.ob-progress-fill {
  height: 100%; background: var(--lime-vivid); border-radius: 4px;
  transition: width .35s cubic-bezier(.22, 1, .36, 1);
}
.ob-title { font-size: 1.45rem; font-weight: 700; margin: 0 0 6px; letter-spacing: .3px; }
.ob-sub { font-size: .82rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 20px; }
.ob-body .input { width: 100%; }
.ob-textarea { resize: none; line-height: 1.5; }
.ob-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.ob-hint { font-size: .72rem; color: var(--text-muted); margin-top: 10px; }

.ob-options { display: flex; flex-direction: column; gap: 10px; }
.ob-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--card-bg, var(--fill-1)); border: 1.5px solid var(--border, var(--fill-2));
  border-radius: 14px; padding: 14px 16px; transition: all .18s;
  color: var(--text);
}
.ob-option.selected { border-color: var(--lime-vivid); background: var(--lime-glow); }
.ob-option-label { font-size: .92rem; font-weight: 650; }
.ob-option-sub { font-size: .72rem; color: var(--text-muted); }
.ob-option.selected .ob-option-sub { color: var(--text-secondary); }

.ob-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ob-chip {
  border: 1.5px solid var(--border, var(--fill-2)); background: var(--fill-1);
  color: var(--text-secondary); border-radius: 999px; padding: 9px 15px;
  font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.ob-chip.selected {
  background: var(--lime-vivid); border-color: var(--lime-vivid);
  color: var(--on-accent, #191E00);
}
.ob-day { min-width: 52px; text-align: center; font-family: 'JetBrains Mono', monospace; }

.ob-review {
  display: flex; flex-direction: column; gap: 0;
  background: var(--card-bg, var(--fill-1)); border: 1px solid var(--border, var(--fill-2));
  border-radius: 14px; padding: 6px 16px; margin-bottom: 18px;
}
.ob-review-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; font-size: .78rem;
  border-bottom: 1px solid var(--fill-2);
}
.ob-review-row:last-child { border-bottom: none; }
.ob-review-row span { color: var(--text-muted); flex: 0 0 auto; }
.ob-review-row b { font-weight: 600; text-align: right; }

.ob-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px; gap: 12px;
}
.ob-back {
  background: none; border: none; color: var(--text-muted);
  font-size: .8rem; font-weight: 600; cursor: pointer; padding: 10px 6px;
}
.ob-next { min-width: 130px; }
.ob-build { margin-bottom: 4px; }
.ob-skip {
  display: block; width: 100%; text-align: center; background: none; border: none;
  color: var(--text-muted); font-size: .74rem; cursor: pointer;
  padding: 12px 0 2px; text-decoration: underline; text-underline-offset: 3px;
}
.ob-error { margin-top: 12px; font-size: .75rem; color: var(--red, #ff6b6b); }

/* ── Home header avatar ──────────────────────────────────────────────────── */
.home-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.home-header-text { min-width: 0; }
.home-avatar {
  position: relative; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--lime-vivid); padding: 0;
  background: var(--fill-1); cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.home-avatar:active { transform: scale(.94); }

/* ── Shared avatar internals (home + profile hero) ───────────────────────── */
.avatar-initials {
  font-weight: 700; color: var(--lime); letter-spacing: .5px;
  font-size: .95rem; line-height: 1; user-select: none;
}
.avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}

/* ── Profile hero ────────────────────────────────────────────────────────── */
.profile-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 22px;
}
.profile-avatar {
  position: relative; width: 96px; height: 96px; border-radius: 50%;
  border: 2.5px solid var(--lime-vivid); background: var(--fill-1);
  padding: 0; cursor: pointer; overflow: visible;
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar .avatar-initials { font-size: 2rem; }
.profile-avatar .avatar-img { border-radius: 50%; }
.profile-avatar-edit {
  position: absolute; right: -2px; bottom: -2px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--lime-vivid); color: var(--on-accent, #191E00);
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--bg);
}
.profile-hero-name-row {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
}
.profile-hero-name { font-size: 1.35rem; font-weight: 700; margin: 0; letter-spacing: .3px; }
.profile-name-input {
  font-size: 1.15rem; font-weight: 700; text-align: center;
  background: var(--fill-1); border: 1.5px solid var(--lime-vivid);
  border-radius: 10px; padding: 4px 10px; color: var(--text);
  width: 200px; outline: none;
}
.profile-name-edit {
  background: var(--fill-1); border: 1px solid var(--border, var(--fill-2));
  border-radius: 50%; width: 28px; height: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex: 0 0 auto;
}
.profile-hero-email-row {
  display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: .76rem;
}
.account-email { color: var(--text-muted); word-break: break-all; }
.account-badge {
  font-size: .58rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--lime-dim); color: var(--lime);
  flex: 0 0 auto;
}
.profile-stats {
  display: flex; gap: 10px; margin-top: 18px; width: 100%; max-width: 340px;
}
.profile-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--card-bg, var(--fill-1)); border: 1px solid var(--border, var(--fill-2));
  border-radius: 14px; padding: 10px 4px 8px;
}
.profile-stat b { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.profile-stat span { font-size: .6rem; color: var(--text-muted); }
.profile-stat label { font-size: .62rem; color: var(--text-secondary); margin-top: 3px; }

/* ── Garmin connection card (Profile → Connections) ──────────────────────── */
.garmin-block {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--fill-2);
}
.garmin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.garmin-last-sync { font-size: .66rem; }
.garmin-note { font-size: .7rem; line-height: 1.5; margin: 6px 0 10px; }
.garmin-error {
  font-size: .72rem; line-height: 1.5; color: var(--red, #ff6b6b);
  margin: 6px 0 10px;
}
.garmin-actions { display: flex; gap: 8px; margin-top: 4px; }
.garmin-actions .btn-ghost, .garmin-actions .btn-primary { flex: 1; }
.garmin-danger { color: var(--red, #ff6b6b); }

/* ── Garmin wellness strip on the Today recovery card ────────────────────── */
#garmin-wellness-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--fill-2);
}
.gw-label {
  font-size: .58rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-muted); margin-right: 2px;
}
.gw-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--fill-1); border: 1px solid var(--fill-2);
  border-radius: 999px; padding: 4px 10px;
  font-size: .66rem; color: var(--text-secondary); white-space: nowrap;
}
.gw-chip b { font-family: 'JetBrains Mono', monospace; font-size: .74rem; color: var(--text); font-weight: 600; }
.gw-chip i { font-style: normal; color: var(--text-muted); font-size: .6rem; }
.gw-chip.gw-status { color: var(--lime); border-color: var(--lime-dim); text-transform: capitalize; }

/* ── Training-profile rows ───────────────────────────────────────────────── */
.profile-detail-rows { display: flex; flex-direction: column; }
.profile-detail-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 9px 0; font-size: .78rem;
  border-bottom: 1px solid var(--fill-2);
}
.profile-detail-row:last-child { border-bottom: none; }
.profile-detail-row span { color: var(--text-muted); flex: 0 0 auto; }
.profile-detail-row b { font-weight: 600; text-align: right; }

/* "Watch" tag on a watch-only strength row in the training log */
.log-workout-src {
  font-size: .58rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-muted); background: var(--fill-1); border: 1px solid var(--fill-2);
  border-radius: var(--radius-full); padding: 2px 8px; margin-left: auto;
}

/* ── Activity detail overlay (js/activity-detail.js) ─────────────────────── */
/* Tap affordance on rows/cards that open the overlay */
.log-detail-tap, .day-summary-tap, .day-activity-tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Full-screen immersive view, Training-Mode-style lifecycle: .ad-in / .ad-closing */
.ad-overlay {
  position: fixed; top: 0; left: 0; right: 0;
  bottom: calc(0px - var(--bottom-strip, 0px));
  z-index: 860;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-top);
  transform: translateY(6%); opacity: 0;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0.28, 1), opacity 0.3s var(--ease);
  overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
.ad-overlay.ad-in { transform: translateY(0); opacity: 1; }
.ad-overlay.ad-closing { transform: translateY(8%); opacity: 0; pointer-events: none; }

.ad-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--space-md); flex: 0 0 auto;
}
.ad-back {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--fill-1); border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.ad-back svg { width: 20px; height: 20px; }
.ad-source {
  font-size: .62rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--lime); background: var(--lime-dim);
  border: 1px solid var(--lime-border);
  border-radius: var(--radius-full); padding: 4px 11px;
}

.ad-viewport {
  flex: 1; min-height: 0; padding: 4px var(--space-md) calc(28px + var(--safe-bottom));
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
}

.ad-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ad-title .ui-icon { color: var(--lime); flex: 0 0 auto; }
.ad-name {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.02em; margin: 0;
}
.ad-when { font-size: .72rem; color: var(--text-muted); margin: 2px 0 0; }

.ad-hero { margin: 4px 0 16px; }
.ad-hero-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 2.6rem; font-weight: 600; color: var(--lime); margin: 0; line-height: 1.05;
}
.ad-hero-unit { font-size: 1rem; color: var(--text-secondary); margin-left: 6px; font-weight: 500; }
.ad-hero-label {
  font-size: .64rem; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-muted); margin: 6px 0 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.ad-seg {
  display: flex; align-items: stretch; gap: 2px; padding: 3px;
  border-radius: var(--radius-full); background: var(--fill-1);
  border: 1px solid var(--border); margin-bottom: 14px;
}
.ad-seg-btn {
  flex: 1; min-height: 36px; border: none; background: transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-display); font-size: .78rem; font-weight: 600;
  color: var(--text-secondary);
  transition: background .2s, color .2s;
}
.ad-seg-btn.is-active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }

.ad-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ad-stat {
  background: var(--fill-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 6px; text-align: center;
}
.ad-stat-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 0;
}
.ad-stat-unit { font-size: .66rem; color: var(--text-secondary); margin-left: 3px; }
.ad-stat-label {
  font-size: .58rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); margin: 4px 0 0;
}

.ad-trace { margin-bottom: 14px; }
.ad-trace svg { width: 100%; height: auto; display: block; }
.ad-grid { stroke: var(--chart-grid, rgba(255,255,255,0.09)); stroke-width: 1; }
.ad-axis { fill: var(--chart-text, #8E8E93); font-size: 9px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ad-trace-line { fill: none; stroke: var(--red); stroke-width: 1.6; }
.ad-trace-avg { stroke: var(--fill-4); stroke-width: 1; stroke-dasharray: 3 3; }

.ad-note { font-size: .66rem; color: var(--text-muted); margin: 8px 0 0; }
.ad-note-accent { color: var(--lime); text-transform: capitalize; }
.ad-empty { font-size: .8rem; color: var(--text-secondary); margin: 10px 0; line-height: 1.55; }
.ad-retry {
  background: var(--fill-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 9px 16px;
  font-size: .78rem; font-weight: 600; color: var(--text-secondary);
}

.ad-zones { display: flex; flex-direction: column; gap: 7px; }
.ad-zone-row { display: flex; align-items: center; gap: 8px; }
.ad-zone-name {
  flex: 0 0 24px; font-family: var(--font-mono); font-size: .7rem; color: var(--text-secondary);
}
.ad-muscle-name { flex: 0 0 76px; font-family: var(--font-body); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-zone-track { flex: 1; height: 8px; border-radius: 4px; background: var(--fill-1); overflow: hidden; }
.ad-zone-fill { display: block; height: 100%; border-radius: 4px; }
.ad-zone-val {
  flex: 0 0 auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .68rem; color: var(--text-secondary);
}
.ad-z1 { background: var(--fill-4); }
.ad-z2 { background: var(--teal); }
.ad-z3 { background: var(--lime-vivid); }
.ad-z4 { background: var(--amber); }
.ad-z5 { background: var(--red); }

.ad-splits { display: flex; flex-direction: column; gap: 7px; }
.ad-split-row { display: flex; align-items: center; gap: 8px; }
.ad-split-idx { flex: 0 0 20px; font-family: var(--font-mono); font-size: .7rem; color: var(--text-muted); text-align: right; }
.ad-split-track { flex: 1; height: 7px; border-radius: 4px; background: var(--fill-1); overflow: hidden; }
.ad-split-fill { display: block; height: 100%; border-radius: 4px; background: var(--fill-4); }
.ad-split-row.is-best .ad-split-fill { background: var(--lime-vivid); }
.ad-split-row.is-best .ad-split-val { color: var(--lime); }
.ad-split-val {
  flex: 0 0 auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .68rem; color: var(--text-secondary);
}

.ad-ex-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 12px; margin-bottom: 8px;
}
.ad-ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ad-ex-name { font-size: .84rem; font-weight: 600; margin: 0; }
.ad-ex-e1rm {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .68rem; color: var(--text-secondary); white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 5px;
}
.ad-ex-sets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ad-set {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .7rem; color: var(--text-secondary);
  background: var(--fill-1); border: 1px solid var(--fill-2);
  border-radius: var(--radius-full); padding: 3px 8px;
}
.ad-set.is-skipped { opacity: 0.45; text-decoration: line-through; }

.ad-pill {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .62rem; font-weight: 600;
  background: var(--fill-1); color: var(--text-secondary);
  border-radius: var(--radius-full); padding: 2px 8px;
}
.ad-pill-up { background: var(--lime-dim); color: var(--lime); }
.ad-pill-down { background: var(--red-dim); color: var(--red); }

.ad-muscle-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; margin: 2px 0 6px; }
.ad-muscle-seg { display: block; height: 100%; }
.ad-muscle-rows { margin-top: 14px; }
.ad-m1 { background: var(--lime-vivid); }
.ad-m2 { background: var(--teal); }
.ad-m3 { background: var(--purple); }
.ad-m4 { background: var(--amber); }
.ad-m5 { background: var(--fill-4); }

@media (prefers-reduced-motion: reduce) {
  .ad-overlay { transform: none; opacity: 1; transition: none; }
  .ad-overlay.ad-closing { opacity: 0; }
}

/* ── Gym detail v3 (Variant B — tick gauge · radar · muscle map · tiles) ──── */
.adg-title-center { justify-content: center; text-align: center; }

/* Editorial title block — right-aligned under the source badge */
.ad-titlecard { text-align: right; margin: 6px 0 16px; }
.ad-titlecard .ad-name {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1; margin: 0;
}
.ad-name-icon { display: inline-flex; color: var(--text-muted); }
.ad-name-icon .ui-icon { width: 20px; height: 20px; }
.ad-titlecard .ad-when { font-size: .72rem; color: var(--text-muted); margin: 5px 0 0; }

/* Training-effect info button + explainer popover */
.adg-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: var(--radius-full);
  border: 1px solid var(--border-light); background: transparent;
  color: var(--text-secondary); font-family: Georgia, 'Times New Roman', serif;
  font-style: italic; font-size: .6rem; line-height: 1; vertical-align: middle;
  margin-left: 5px; cursor: pointer;
}
.adg-info-pop {
  background: var(--fill-1); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px; margin: 8px 0 14px;
  font-size: .72rem; line-height: 1.6; color: var(--text-secondary);
}
.adg-info-pop[hidden] { display: none; }

.adg-gauge-wrap { position: relative; width: 200px; height: 172px; margin: 2px auto 0; }
.adg-gauge { width: 200px; height: 172px; display: block; }
.adg-gauge-center {
  position: absolute; left: 50px; right: 50px; top: 64px; text-align: center; pointer-events: none;
}
.adg-gauge-num {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 2rem; font-weight: 600; color: var(--lime); line-height: 1; margin: 0;
}
.adg-gauge-cap {
  font-size: .54rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); margin: 3px 0 0; line-height: 1.35;
}
.adg-gauge-sub { font-size: .68rem; color: var(--text-secondary); text-align: center; margin: -4px 0 10px; }
@keyframes adgTick { to { opacity: 1; } }

.adg-hero-alt { text-align: center; margin: 6px 0 10px; }
.adg-impact { font-size: .9rem; font-weight: 700; color: var(--lime); margin: 0; }
.adg-hero-alt .adg-impact { font-size: 1.1rem; }
.adg-duration-hero {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 2.4rem; font-weight: 600; color: var(--lime); margin: 6px 0 0; line-height: 1;
}
.adg-duration-hero small { font-size: .95rem; color: var(--text-secondary); font-weight: 500; }

.adg-radar-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.adg-radar { width: 152px; height: 108px; flex: 0 0 auto; }
.adg-radar-grid { fill: none; stroke: var(--fill-2); }
.adg-radar-axis { stroke: var(--fill-2); }
.adg-radar-shape { fill: var(--lime-dim); stroke: var(--lime); stroke-width: 1.6; stroke-linejoin: round; }
.adg-radar-lab { font-size: 9px; fill: var(--text-secondary); font-family: var(--font-body); }
.adg-radar-side { flex: 1; min-width: 0; }
.adg-balance { font-size: .7rem; color: var(--text-secondary); line-height: 1.5; margin: 3px 0 0; }
.adg-pills { margin: 6px 0 0; display: flex; gap: 5px; flex-wrap: wrap; }
.adg-pills-center { justify-content: center; margin-bottom: 12px; }

.adg-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 11px 12px; margin-bottom: 12px;
}
.adg-microlabel {
  font-size: .6rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 6px;
}
#adg-bodymap { border-radius: var(--radius-md); overflow: hidden; }
#adg-bodymap svg { max-height: 235px; }

.adg-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 8px; }
.adg-tile {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 9px 6px 8px; text-align: center; position: relative;
}
.adg-tile-v {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1rem; font-weight: 600; color: var(--text); margin: 0;
}
.adg-tile-v small { font-size: .6rem; color: var(--text-secondary); font-weight: 500; margin-left: 2px; }
.adg-tile-l {
  font-size: .54rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); margin: 3px 0 0;
}
.adg-tile-bar { display: block; height: 4px; border-radius: 2px; background: var(--fill-1); margin-top: 7px; overflow: hidden; }
.adg-tile-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--teal), var(--lime-vivid)); }
/* Delta on its own reserved line (flattened — no pill background). Always
   present (empty when there's no delta) so all tiles are the same height. */
.adg-tile-d { min-height: 13px; margin: 2px 0 0; font-size: .56rem; font-weight: 600; line-height: 1; }
.adg-tile-delta .ad-pill, .adg-tile-d .ad-pill { background: transparent; padding: 0; font-size: 1em; }

.adg-hr-note { font-size: .66rem; color: var(--text-muted); text-align: center; margin: 0 0 12px; }

.adg-ov { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); }
.adg-ov:first-of-type { border-top: none; }
.adg-arrow {
  flex: 0 0 26px; height: 26px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}
.adg-arrow-upw { background: var(--lime-dim); color: var(--lime); }
.adg-arrow-reps { background: var(--teal-dim); color: var(--teal); }
.adg-arrow-hold { background: var(--fill-1); color: var(--text-muted); }
.adg-arrow-down { background: var(--amber-dim); color: var(--amber); }
.adg-arrow-first { background: var(--fill-1); color: var(--text-secondary); }
.adg-ov-body { flex: 1; min-width: 0; }
.adg-ov-name { display: block; font-size: .78rem; font-weight: 600; }
.adg-ov-sets {
  display: block; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .66rem; color: var(--text-muted); margin-top: 2px; word-break: break-word;
}
.adg-ov-tag { font-size: .6rem; font-weight: 600; color: var(--text-secondary); text-align: right; white-space: nowrap; }
.adg-tag-volt { color: var(--lime); }
.adg-tag-teal { color: var(--teal); }
.adg-tag-dim { color: var(--amber); }
.adg-pr { color: var(--lime); font-weight: 700; font-style: normal; }
.adg-skip { opacity: .45; }

/* ═══ Morning Report / At-a-Glance home dashboard (js/morning-report.js) ═══ */
/* Separate the whole dashboard from the AI Briefing card below it. Without
   this the .mr-glance block (last child) has no margin, so the HRV/Resting-HR
   tiles sit flush against the next card. Match the page's card rhythm. */
#morning-report { display: block; margin-bottom: var(--space-md); }
#morning-report:empty { margin-bottom: 0; }
.mr-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 14px; margin-bottom: 12px; }
.mr-hero { text-align: center; }
.mr-fade { opacity: 0; transform: translateY(10px); animation: mrUp .5s ease-out forwards; }
@keyframes mrUp { to { opacity: 1; transform: none; } }
@keyframes mrTick { to { opacity: 1; } }

.mr-gauge-wrap { position: relative; width: 210px; height: 176px; margin: 0 auto; }
.mr-gauge { width: 210px; height: 176px; display: block; }
.mr-gauge-center { position: absolute; left: 55px; right: 55px; top: 58px; text-align: center; pointer-events: none; }
.mr-gauge-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 3rem; font-weight: 600; color: var(--lime); line-height: 1; margin: 0; }
.mr-gauge-cap { font-size: .54rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin: 3px 0 0; }
.mr-skeleton { width: 130px; height: 130px; border-radius: 50%; margin: 20px auto; border: 7px solid var(--fill-1); border-top-color: var(--fill-3); animation: mrSpin 1.1s linear infinite; }
@keyframes mrSpin { to { transform: rotate(360deg); } }

.mr-status-word { font-size: 1rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin: 2px 0 0; }
.r-prime { color: var(--lime); } .r-push { color: var(--lime); } .r-steady { color: var(--teal); } .r-easy { color: var(--amber); }
.mr-coach { font-size: .82rem; color: var(--text-secondary); line-height: 1.55; max-width: 290px; margin: 8px auto 0; }
.mr-src { font-size: .58rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin: 8px 0 0; }
.mr-info { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: var(--radius-full); border: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); font-family: Georgia, serif; font-style: italic; font-size: .6rem; line-height: 1; vertical-align: middle; margin-left: 4px; }
.mr-info-pop { background: var(--fill-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; margin: 10px 0 0; font-size: .72rem; line-height: 1.6; color: var(--text-secondary); text-align: left; }
.mr-info-pop[hidden] { display: none; }

/* Empty ("calculating") + disconnected ("connect Garmin") states */
.mr-empty-title { font-size: .7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 6px; }
.mr-empty-body { font-size: .8rem; color: var(--text-secondary); line-height: 1.55; margin: 0; }
.mr-connect { display: flex; flex-direction: column; gap: 12px; }
.mr-connect-row { display: flex; align-items: flex-start; gap: 11px; }
.mr-connect-ico { font-size: 1.55rem; line-height: 1; flex: 0 0 auto; }
.mr-connect-title { font-size: .9rem; font-weight: 700; color: var(--text); margin: 0 0 3px; }
.mr-connect-sub { font-size: .74rem; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.mr-connect-btn { width: 100%; padding: 11px 14px; border: none; border-radius: var(--radius-md, 12px); background: var(--lime-vivid); color: var(--on-accent, #191E00); font-weight: 700; font-size: .84rem; letter-spacing: .2px; cursor: pointer; }
.mr-connect-btn:active { opacity: .85; }

.mr-glance-h { font-size: .6rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px 2px; }
.mr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mr-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }
.mr-tile-h { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: var(--text-secondary); margin: 0 0 8px; }
.mr-tile-score { margin-left: auto; font-family: var(--font-mono); font-size: .8rem; color: var(--lime); }
.mr-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.t-teal { background: var(--teal); } .t-lime { background: var(--lime); } .t-indigo { background: var(--indigo, #5E5CE6); } .t-amber { background: var(--amber); } .t-red { background: var(--red); }
.mr-big { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; color: var(--text); margin: 0; line-height: 1.05; }
.mr-big small { font-size: .68rem; color: var(--text-secondary); margin-left: 3px; }
.mr-sub { font-size: .64rem; color: var(--text-muted); margin: 5px 0 0; }
.mr-status { display: inline-block; margin-top: 6px; font-size: .6rem; font-weight: 600; text-transform: capitalize; color: var(--lime); background: var(--lime-dim); border: 1px solid var(--lime-border); border-radius: var(--radius-full); padding: 2px 8px; }

.mr-bb-ring { position: relative; width: 84px; height: 84px; margin: 2px auto 4px; }
.mr-bb-ring svg { width: 84px; height: 84px; display: block; }
.mr-bb-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 1.4rem; font-weight: 600; color: var(--text); }
.mr-bb-cd { display: flex; justify-content: center; gap: 14px; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; }
.mr-bb-cd i { font-style: normal; display: block; font-size: .54rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.mr-up { color: var(--lime); text-align: center; } .mr-dn { color: var(--amber); text-align: center; }

.mr-hypno { display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 8px 0 6px; }
.mr-hypno span { border-radius: 2px; }

.mr-empty { text-align: center; }
.mr-empty-title { font-size: .6rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 6px; }
.mr-empty-body { font-size: .8rem; color: var(--text-secondary); line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  .mr-fade { opacity: 1; transform: none; animation: none; }
  .mr-skeleton { animation: none; }
}
