/* JaymakRuns — Site-Wide Neutral Surface, Cobalt Selection & Semantic Status Design System */

:root {
  /* 4-Level Neutral Surface Elevation Ladder (Zero blue tint on neutral surfaces) */
  --surface-canvas: #f1f5f9;
  --surface-card: #ffffff;
  --surface-section: #f8fafc;
  --surface-control: #ffffff;
  --surface-hover: #f1f5f9;

  /* Backward-compatible surface aliases */
  --bg-page: var(--surface-canvas);
  --bg-card: var(--surface-card);
  --bg-subtle: var(--surface-section);
  --bg-elevated: var(--surface-section);

  /* Typography hierarchy */
  --text-main: #0f172a;
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;

  /* Neutral borders */
  --border-subtle: #e2e8f0;
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #cbd5e1;

  /* Unified Selection & Interactive Primary (Cobalt — 6.70:1 vs white, WCAG AA+) */
  --accent-primary: #1d4ed8;
  --accent-primary-hover: #1e40af;
  --accent-primary-text: #1d4ed8;
  --accent-primary-border: #93c5fd;
  --selection-bg: #eff6ff;
  --selection-shadow: 0 2px 10px rgba(29, 78, 216, 0.14);

  /* Semantic Status Palette (Strictly reserved for meaning) */
  --status-success: #059669;
  --status-success-text: #047857;
  --status-success-bg: #ecfdf5;
  --status-success-border: #a7f3d0;

  --status-warning: #d97706;
  --status-warning-text: #b45309;
  --status-warning-bg: #fffbeb;
  --status-warning-border: #fcd34d;

  --status-danger: #dc2626;
  --status-danger-hover: #b91c1c;
  --status-danger-text: #b91c1c;
  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;

  /* Harmonized Data-Viz & Workout Type Accents (Charts, phases, workout pills only) */
  --viz-long: #1d4ed8;
  --viz-quality: #4f46e5;
  --viz-aerobic: #0d9488;
  --viz-aerobic-bg: #f0fdfa;
  --viz-endurance: #059669;
  --viz-taper: #d97706;
  --viz-rest: #64748b;

  /* Backward-compatible semantic & tint aliases */
  --bg-highlight: var(--selection-bg);
  --bg-tint-blue: var(--selection-bg);
  --bg-tint-orange: var(--selection-bg);
  --bg-tint-green: var(--status-success-bg);
  --bg-tint-amber: var(--status-warning-bg);
  --bg-tint-red: var(--status-danger-bg);

  --accent-blue: var(--viz-aerobic);
  --accent-green: var(--status-success);
  --accent-amber: var(--status-warning);
  --accent-red: var(--status-danger);
  --accent-crimson: var(--status-danger);
  --accent-cobalt: var(--accent-primary);
  --accent-pine: var(--status-success);
  --accent-terra: var(--accent-primary);

  --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px -4px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 10px 28px -8px rgba(15, 23, 42, 0.14);
  --shadow-md: 0 8px 22px -6px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 20px 45px -10px rgba(15, 23, 42, 0.22);
  --shadow-modal: 0 20px 45px -10px rgba(15, 23, 42, 0.22);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --surface-canvas: #0b1120;
  --surface-card: #111827;
  --surface-section: #182234;
  --surface-control: #0f172a;
  --surface-hover: #1e293b;

  --bg-page: var(--surface-canvas);
  --bg-card: var(--surface-card);
  --bg-subtle: var(--surface-section);
  --bg-elevated: var(--surface-section);

  --text-main: #f8fafc;
  --text-heading: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;

  --border-subtle: #263348;
  --border-light: #263348;
  --border-medium: #334155;
  --border-strong: #334155;

  /* Solid fill #2563eb keeps white button/pill text at 5.17:1 (WCAG AA+); text/borders use #60a5fa (7.4:1). */
  --accent-primary: #2563eb;
  --accent-primary-hover: #3b82f6;
  --accent-primary-text: #60a5fa;
  --accent-primary-border: #60a5fa;
  --selection-bg: rgba(59, 130, 246, 0.18);
  --selection-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);

  --status-success: #34d399;
  --status-success-text: #34d399;
  --status-success-bg: rgba(52, 211, 153, 0.14);
  --status-success-border: rgba(52, 211, 153, 0.36);

  --status-warning: #f59e0b;
  --status-warning-text: #fbbf24;
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-warning-border: rgba(251, 191, 36, 0.38);

  --status-danger: #ef4444;
  --status-danger-hover: #dc2626;
  --status-danger-text: #f87171;
  --status-danger-bg: rgba(239, 68, 68, 0.16);
  --status-danger-border: rgba(248, 113, 113, 0.38);

  --viz-long: #60a5fa;
  --viz-quality: #818cf8;
  --viz-aerobic: #2dd4bf;
  --viz-aerobic-bg: rgba(45, 212, 191, 0.14);
  --viz-endurance: #34d399;
  --viz-taper: #fbbf24;
  --viz-rest: #94a3b8;

  --bg-highlight: var(--selection-bg);
  --bg-tint-blue: var(--selection-bg);
  --bg-tint-orange: var(--selection-bg);
  --bg-tint-green: var(--status-success-bg);
  --bg-tint-amber: var(--status-warning-bg);
  --bg-tint-red: var(--status-danger-bg);

  --accent-blue: var(--viz-aerobic);
  --accent-green: var(--status-success);
  --accent-amber: var(--status-warning-text);
  --accent-red: var(--status-danger);
  --accent-crimson: var(--status-danger);
  --accent-cobalt: var(--accent-primary-text);
  --accent-pine: var(--status-success);
  --accent-terra: var(--accent-primary-text);

  --shadow-soft: 0 10px 30px -6px rgba(2, 8, 20, 0.55);
  --shadow-card: 0 14px 36px -8px rgba(2, 8, 20, 0.72);
  --shadow-md: 0 10px 26px -6px rgba(2, 8, 20, 0.65);
  --shadow-lg: 0 24px 55px -12px rgba(2, 8, 20, 0.8);
  --shadow-modal: 0 24px 55px -12px rgba(2, 8, 20, 0.8);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 4rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Clean Top Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #0b152b 0%, #1d4ed8 55%, #0891b2 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 6px 16px -3px rgba(29, 78, 216, 0.32);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
}

.jaymak-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.02rem;
}

.jaymak-word-main {
  color: var(--text-main);
}

.jaymak-word-runs {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.garmin-live-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.garmin-live-bar:hover {
  border-color: var(--accent-primary);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-green);
}
.status-dot.warn { background: var(--accent-amber); }
.status-dot.alert { background: var(--accent-red); }

/* ========================================================================== */
/* Left-Sidebar 3-Category Workspace Layout & Sub-Tabs Bar                    */
/* ========================================================================== */

.app-workspace-shell {
  max-width: 1320px;
  margin: 1.35rem auto 0;
  padding: 0 1.5rem;
}

.app-workspace-grid {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  transition: grid-template-columns 0.18s ease;
}

.app-workspace-grid.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.app-left-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1rem;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 5.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: padding 0.18s ease;
}

.app-workspace-grid.sidebar-collapsed .app-left-sidebar {
  padding: 0.85rem 0.45rem;
  align-items: center;
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.app-workspace-grid.sidebar-collapsed .sidebar-header-row {
  justify-content: center;
}

.app-workspace-grid.sidebar-collapsed .sidebar-section-label {
  display: none;
}

.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

.sidebar-collapse-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  color: var(--accent-primary-text);
  border-color: var(--accent-primary-border);
  background: var(--selection-bg);
}

.app-workspace-grid.sidebar-collapsed .sidebar-nav-list {
  width: 100%;
  align-items: center;
}

.app-workspace-grid.sidebar-collapsed .sidebar-nav-btn {
  justify-content: center;
  padding: 0.6rem;
  width: 44px;
  height: 44px;
}

.app-workspace-grid.sidebar-collapsed .sidebar-nav-text {
  display: none;
}

.app-workspace-grid.sidebar-collapsed .sidebar-coach-box {
  width: 100%;
  align-items: center;
  padding-top: 0.65rem;
}

.app-workspace-grid.sidebar-collapsed .sidebar-coach-caption,
.app-workspace-grid.sidebar-collapsed .sidebar-coach-btn-label,
.app-workspace-grid.sidebar-collapsed .sidebar-wipe-btn-label {
  display: none;
}

.app-workspace-grid.sidebar-collapsed .sidebar-coach-btn,
.app-workspace-grid.sidebar-collapsed .sidebar-wipe-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
}

.app-workspace-grid.sidebar-collapsed .sidebar-wipe-box {
  width: 100%;
  align-items: center;
  padding-top: 0.55rem;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-nav-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  font-family: var(--font-sans);
  text-align: left;
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.sidebar-nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
  color: var(--text-main);
}

.sidebar-step-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-section);
  border: 1px solid var(--border-strong);
  color: var(--text-body);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-nav-text strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.sidebar-nav-text small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

.sidebar-nav-btn.active {
  background: var(--selection-bg);
  border-color: var(--accent-primary);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.sidebar-nav-btn.active .sidebar-step-badge {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.sidebar-nav-btn.active .sidebar-nav-text strong {
  color: var(--accent-primary-text);
}

.tab-count-badge {
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: 99px;
  background: var(--status-success-bg);
  color: var(--status-success-text);
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-coach-box {
  margin-top: 0.5rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-coach-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.sidebar-wipe-box {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--status-danger);
  background: var(--status-danger);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn-danger:hover:not(:disabled) {
  background: var(--status-danger-hover);
  border-color: var(--status-danger-hover);
}

.btn-danger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.sidebar-wipe-btn {
  width: 100%;
}

.sidebar-coach-btn {
  width: 100%;
  justify-content: center;
}

/* Sub-Tabs Bar inside Category 1 */
.sub-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-soft);
}

.sub-tab-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.sub-tab-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Slide-Out AI Coach Drawer */
.coach-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
  z-index: 95;
  display: flex;
  justify-content: flex-end;
}

.coach-slide-drawer {
  width: 100%;
  max-width: 520px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-modal);
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
}

.coach-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

/* Main Content Container */
.main-container {
  min-width: 0;
  width: 100%;
}

@media (max-width: 960px) {
  .app-workspace-grid {
    grid-template-columns: 1fr;
  }
  .app-left-sidebar {
    position: static;
  }
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.25rem;
}

/* Upfront Plain-English Hero Summary */
.clean-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.75rem;
  align-items: center;
}

.eyebrow-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary-text);
  display: inline-block;
  margin-bottom: 0.35rem;
}

.race-main-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.plain-race-summary {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1rem;
}

.race-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.race-goal-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}

/* Compact Race Goal Banner & Above-the-Fold Today's Focus Strip */
.compact-race-goal-bar {
  padding: 1rem 1.35rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem 1.25rem;
}

.compact-race-goal-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  flex: 1;
  min-width: 240px;
}

.compact-race-goal-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
}

.compact-race-goal-scores-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.compact-race-goal-scores-row:not(:has(button[style*="inline-flex"])) {
  display: none;
}

.compact-race-title-group {
  display: flex;
  flex-direction: column;
}

.compact-race-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0;
}

.compact-race-goal-right {
  display: flex;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
  gap: 0.5rem;
}

.compact-goal-manage-btn {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.compact-goal-overview-drawer {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.82rem;
  background: var(--bg-subtle);
}

.compact-goal-overview-drawer summary {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.today-readiness-hero-card {
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
}

.today-focus-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.today-focus-pane.today-focus-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.today-focus-left {
  flex: 1;
  min-width: 260px;
}

.today-focus-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.today-focus-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.22;
  margin: 0;
}

.today-focus-summary {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0 0 0.85rem;
}

.today-focus-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.week-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.week-Send-group,
.week-pager-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.meta-chip {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  color: var(--text-body);
}

.meta-chip.accent {
  background: var(--selection-bg);
  border-color: var(--accent-primary-border);
  color: var(--accent-primary-text);
}

.meta-chip.pine {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success-text);
}

.meta-chip.warn {
  background: var(--status-warning-bg);
  border-color: var(--status-warning-border);
  color: var(--status-warning-text);
}

/* Right Side of Hero: Simple Garmin Readiness Box */
.garmin-simple-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  border: 1px solid var(--border-light);
}

.garmin-simple-stats {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0 1.1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.simple-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.simple-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Unified Two-Number Hero: Overall Fitness + Today's Recovery */
.fitness-recovery-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 820px) {
  .fitness-recovery-hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-score-panel {
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hero-score-panel.tone-green {
  border-top-color: var(--status-success);
}

.hero-score-panel.tone-amber {
  border-top-color: var(--status-warning);
}

.hero-score-panel.tone-red {
  border-top-color: var(--status-danger);
}

.hero-score-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-score-kicker {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.hero-score-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.hero-score-number-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-score-big {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.hero-score-denom {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hero-score-summary {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0.1rem 0 0;
}

.hero-scores-footer-link {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.7rem;
}

.btn-inline-guide-link {
  background: none;
  border: none;
  padding: 0.2rem 0.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary-text);
  cursor: pointer;
  transition: opacity 0.14s ease;
}

.btn-inline-guide-link:hover {
  text-decoration: underline;
  opacity: 0.88;
}

.how-scores-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 780px) {
  .how-scores-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.how-score-detail-panel {
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
}

.fitness-pillars-list {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.fitness-pillar-row {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.fitness-pillar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
}

.fitness-pillar-label {
  font-weight: 700;
  color: var(--text-main);
}

.fitness-pillar-detail {
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.3rem;
}

.fitness-pillar-val {
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.score-mini-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.score-mini-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-primary);
  transition: width 0.25s ease;
}

.score-mini-fill.tone-green { background: var(--status-success); }
.score-mini-fill.tone-amber { background: var(--status-warning); }
.score-mini-fill.tone-red { background: var(--status-danger); }
.score-mini-fill.tone-unknown { background: var(--border-strong); }

.banner-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  color: var(--text-body);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.banner-score-chip:hover {
  border-color: var(--accent-primary-border);
  background: var(--selection-bg);
}

.banner-chip-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.banner-chip-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  line-height: 1.25;
}

.banner-chip-label {
  font-weight: 600;
}

.banner-chip-val {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text-main);
}

.banner-score-chip.tone-green .banner-chip-val {
  color: var(--status-success-text);
}

.banner-score-chip.tone-amber .banner-chip-val {
  color: var(--status-warning-text);
}

.banner-score-chip.tone-red .banner-chip-val {
  color: var(--status-danger-text);
}

/* Wave 2 Dual Readiness sub-breakdown inside Today's Recovery card */
.dual-readiness-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.dual-readiness-tile {
  background: var(--surface-control);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.dual-readiness-tile.tone-green {
  border-left-color: var(--status-success);
}

.dual-readiness-tile.tone-amber {
  border-left-color: var(--status-warning);
}

.dual-readiness-tile.tone-red {
  border-left-color: var(--status-danger);
}

.dual-readiness-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.dual-readiness-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.dual-state-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-section);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.dual-state-pill.tone-green {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}

.dual-state-pill.tone-amber {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-color: var(--status-warning-border);
}

.dual-state-pill.tone-red {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}

.dual-readiness-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.dual-readiness-score {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.dual-readiness-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dual-readiness-reason {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.dual-shield-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.dual-shield-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}

.dual-ledger-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}

@media (max-width: 780px) {
  .dual-ledger-cards-grid {
    grid-template-columns: 1fr;
  }
}

.dual-ledger-subcard {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dual-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}

.dual-progress-fill {
  height: 100%;
  border-radius: 999px;
}

/* Week Selector Header */
.week-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.week-headline {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.week-subline {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.day-miles-orig {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.35rem;
}

.workout-type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
}

.pill-quality { background: var(--selection-bg); color: var(--accent-primary-text); }
.pill-long_run, .pill-b2b_long, .pill-race { background: var(--status-success-bg); color: var(--status-success-text); }
.pill-aerobic, .pill-medium_long { background: var(--viz-aerobic-bg); color: var(--viz-aerobic); }
.pill-recovery, .pill-rest { background: var(--surface-control); color: var(--text-muted); border: 1px solid var(--border-light); }

.garmin-diff-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--accent-primary);
  color: #ffffff;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
}

/* Clean Expandable Drawers (<details>) for Deep Info */
.clean-drawer {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card .clean-drawer {
  background: var(--surface-section);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.card .clean-drawer summary {
  padding: 0.95rem 1.2rem;
}

.card .clean-drawer .drawer-inner {
  padding: 1rem 1.2rem 1.15rem;
}

.onboarding-step-pane > .card {
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: none;
  padding: 1.25rem;
}

.onboarding-step-pane > .card .gpx-empty-state,
.onboarding-step-pane > .card .gpx-kpi-box,
.onboarding-step-pane > .card .gpx-comparison-card,
.onboarding-step-pane > .card .gpx-elevation-strip {
  background: var(--surface-control);
}

.clean-drawer summary {
  padding: 1.2rem 1.6rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.clean-drawer summary::-webkit-details-marker {
  display: none;
}

.clean-drawer summary::after {
  content: "Show Details ↓";
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary-text);
}

.clean-drawer[open] summary {
  border-bottom: 1px solid var(--border-light);
}

.clean-drawer[open] summary::after {
  content: "Hide ↑";
}

.drawer-inner {
  padding: 1.5rem 1.6rem;
}

/* Selected Day Detail Box */
.workout-detail-card {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
}

.workout-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.workout-meta-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.workout-meta-tile-rest {
  grid-column: span 2;
}

.workout-meta-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.workout-meta-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.detail-structure-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.structure-step {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.structure-step-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
}

.structure-step-row.tone-warmup { border-left-color: var(--viz-aerobic); }
.structure-step-row.tone-easy { border-left-color: var(--viz-endurance); }
.structure-step-row.tone-steady { border-left-color: var(--viz-long); }
.structure-step-row.tone-hard { border-left-color: var(--viz-quality); }
.structure-step-row.tone-cooldown { border-left-color: var(--viz-rest); }

.structure-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 800;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}

.structure-step-main {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.structure-step-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
  max-width: 220px;
}

.structure-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.structure-step-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.structure-step-duration {
  font-size: 0.74rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.14rem 0.5rem;
  white-space: nowrap;
}

.structure-step-targets {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.structure-target-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  border-radius: 5px;
  background: var(--selection-bg);
  color: var(--accent-primary-text);
  text-align: right;
}

.structure-target-chip.hr-chip {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.structure-step-body {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .workout-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .structure-step-row {
    grid-template-columns: 26px minmax(0, 1fr);
  }
  .structure-step-meta {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    max-width: none;
    margin-top: 0.2rem;
  }
}

/* Macrocycle Dual-Track Bar Chart (Miles + Vert vs. Expected) */
.macrocycle-card-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.macro-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
}

.macro-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.32rem 0.72rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.macro-toggle-btn:hover {
  color: var(--text-main);
}

.macro-toggle-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Plan-to-Date Progress Check-In Banner */
.progress-checkin-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--status-warning);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
  margin-bottom: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.progress-checkin-banner.tone-ahead {
  border-left-color: var(--status-success);
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
}
.progress-checkin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.progress-checkin-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}
.progress-checkin-summary {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-body);
}
.progress-checkin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.progress-checkin-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.progress-checkin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Neutral Gray Container for Mileage & Vert Chart (matches .baseline-telemetry-tile) */
.macrocycle-chart-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.8rem 1rem 0.7rem;
  margin-bottom: 0.95rem;
}

.macrocycle-window-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-light);
}

.macrocycle-window-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.macrocycle-window-range {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-body);
  letter-spacing: 0.02em;
}

.macrocycle-jump-btn {
  border: 1px solid var(--accent-primary-border);
  background: var(--selection-bg);
  color: var(--accent-primary-text);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.macrocycle-jump-btn:hover {
  background: #dbeafe;
  border-color: var(--accent-primary);
}

.macrocycle-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.macrocycle-nav-btn {
  border: 1px solid var(--border-medium);
  background: var(--surface-control);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.macrocycle-nav-btn:hover:not(:disabled) {
  background: var(--selection-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary-text);
}

.macrocycle-nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.macrocycle-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 0.1rem 0.15rem;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.macro-track-block {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  min-width: 0;
}

.macro-track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.macro-track-cols {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: flex-end;
  width: 100%;
}

.week-bar-col {
  flex: 1 1 0;
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: auto;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
  border-radius: 9px;
  border: 1.5px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.week-bar-col:hover {
  background: var(--surface-card);
  border-color: var(--accent-primary-border);
}
.week-bar-col.active {
  background: var(--selection-bg);
  border-color: var(--accent-primary);
}
.week-bar-col.current-calendar-week .week-bar-label {
  color: var(--accent-primary-text);
  font-weight: 800;
}
.week-bar-col.active .week-bar-label {
  color: var(--accent-primary-text);
}

.week-bar-miles {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.24rem;
  white-space: nowrap;
  line-height: 1.1;
}

.week-bar-miles strong {
  color: var(--text-main);
}

.week-bar-fill {
  width: 100%;
  max-width: 28px;
  border-radius: 5px 5px 2px 2px;
  background: #94a3b8;
  border: 1px solid #64748b;
}
.week-bar-fill.expected-miles {
  background: #94a3b8;
  border-color: #64748b;
}
.week-bar-fill.expected-vert {
  background: #94a3b8;
  border-color: #64748b;
}
.week-bar-fill.cutback {
  background: #cbd5e1;
  border-color: #64748b;
  border-style: dashed;
  opacity: 0.92;
}

.week-bar-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-body);
  margin-top: 0.32rem;
  white-space: nowrap;
  line-height: 1.1;
}

/* Cross-Training Sync Banner Prompt Row & Dismiss X */
.cross-training-prompt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.3rem 0;
}

.cross-training-prompt-row + .cross-training-prompt-row {
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.cross-training-prompt-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-dismiss-modality {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-control);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.btn-dismiss-modality:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

/* Adaptation Banner */
.adaptation-banner {
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.adaptation-banner-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-primary-text);
  margin-bottom: 0.25rem;
}

.adaptation-banner-text {
  font-size: 0.92rem;
  color: var(--text-body);
  max-width: 760px;
}

/* Buttons */
.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--surface-control);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.05rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent-primary-border);
}

.icon-btn {
  background: var(--surface-control);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-primary-border);
}

/* Forms & Section Wells (L2 neutral grouping inside L1 white cards) */
.form-section-well {
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.form-section-well-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.form-section-well-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.15rem;
}

.form-section-well-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.form-section-well .form-section-grid .form-group:last-child,
.form-section-well .form-section-grid .form-group:nth-last-child(2) {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--surface-control);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:hover, .form-select:hover {
  border-color: var(--accent-primary-border);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--selection-bg);
}

.preset-scenarios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 0.85rem;
}

.preset-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

.dropzone-box {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
}

.zones-table-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.35rem 0.65rem;
  margin-top: 0.85rem;
  overflow-x: auto;
}

.zones-table-box .zones-table {
  margin-top: 0;
}

.zones-table-box .zones-table tbody tr:last-child td {
  border-bottom: none;
}

.zones-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.zones-table th, .zones-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.92rem;
}

.zones-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.strategy-prose p {
  margin-bottom: 0.9rem;
  font-size: 0.96rem;
  color: var(--text-body);
  line-height: 1.7;
}

.chat-messages-box {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.chat-bubble {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-bubble.user {
  background: var(--bg-tint-orange);
  color: var(--text-main);
  align-self: flex-end;
  max-width: 80%;
  font-weight: 600;
}

.chat-bubble.coach {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-body);
  align-self: flex-start;
  max-width: 90%;
}

.mono-val {
  font-family: var(--font-mono);
}

/* ========================================================================== */
/* Calm, Single-Screen Split Home & Login Gateway (Garmin / HumanGO Inspired) */
/* ========================================================================== */

.home-gateway-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.25rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(29, 78, 216, 0.10), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(8, 145, 178, 0.10), transparent 45%),
    var(--bg-page);
}

.home-gateway-topbar {
  max-width: 880px;
  width: 100%;
  margin: auto auto 0;
  padding: 0 0 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark-sunrise {
  background: linear-gradient(135deg, #1d4ed8 0%, #0891b2 55%, #059669 100%);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
}

.home-gateway-main {
  max-width: 880px;
  width: 100%;
  margin: 0 auto auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.home-gateway-card {
  max-width: 880px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px -8px rgba(15, 23, 42, 0.10),
    0 28px 60px -16px rgba(29, 78, 216, 0.12);
}

[data-theme="dark"] .home-gateway-card {
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 24px 55px -12px rgba(2, 8, 20, 0.78);
}

.home-gateway-visual {
  position: relative;
  min-height: 100%;
  height: 100%;
  background: #0f172a;
  overflow: hidden;
}

.home-gateway-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.0) 55%,
    rgba(15, 23, 42, 0.28) 100%
  );
  pointer-events: none;
}

.home-gateway-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  display: block;
}

.home-gateway-welcome {
  padding: 1.55rem 1.7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
}

[data-theme="dark"] .home-gateway-welcome {
  background: var(--bg-card);
}

.home-gateway-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.16);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 0.6rem;
}

[data-theme="dark"] .home-gateway-kicker {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.24);
}

.home-gateway-title {
  font-size: 1.56rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-main);
  margin: 0 0 0.55rem;
}

.home-gateway-lead {
  font-size: 0.89rem;
  color: var(--text-body);
  line-height: 1.48;
  margin: 0 0 0.95rem;
}

.home-gateway-highlights {
  list-style: none;
  padding: 0.68rem 0.9rem;
  margin: 0 0 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
}

[data-theme="dark"] .home-gateway-highlights {
  background: rgba(255, 255, 255, 0.025);
}

.home-gateway-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.84rem;
  line-height: 1.32;
  color: var(--text-body);
}

.home-gateway-highlights li + li {
  padding-top: 0.52rem;
  border-top: 1px solid var(--border-light);
}

.home-highlight-copy {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
}

.home-highlight-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.home-highlight-sub {
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.home-check {
  width: 21px;
  height: 21px;
  margin-top: 0.08rem;
  border-radius: 50%;
  background: var(--bg-tint-green);
  color: var(--accent-green);
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-gateway-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.home-gateway-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  align-items: stretch;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.65rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, filter 0.16s ease;
}

.btn-google-gateway {
  width: 100%;
  max-width: none;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  gap: 0.42rem;
  border-radius: 12px;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 8px 20px -6px rgba(37, 99, 235, 0.38);
}

.btn-google-gateway:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 12px 24px -6px rgba(37, 99, 235, 0.48);
}

.btn-google-gateway:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.2),
    0 6px 14px -4px rgba(37, 99, 235, 0.38);
}

.btn-google-gateway:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.btn-google-gateway .google-g-icon {
  background: #ffffff;
  border-radius: 50%;
  padding: 2.5px;
  width: 20px;
  height: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
  flex-shrink: 0;
}

.home-gateway-footnote {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0.05rem 0 0;
  text-align: center;
}

.home-gateway-action .splash-deployed-stamp {
  text-align: center;
}

@media (max-width: 860px) {
  .home-gateway-card {
    grid-template-columns: 1fr;
  }
  .home-gateway-visual {
    min-height: 220px;
  }
  .home-gateway-welcome {
    padding: 1.5rem 1.5rem;
  }
  .btn-google-gateway {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .home-gateway-cta-row {
    grid-template-columns: 1fr;
  }
}

/* Google Sign-In Account Chooser Modal */
.google-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.25rem;
}

.google-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  max-width: 430px;
  width: 100%;
  padding: 1.75rem;
}

.google-modal-header {
  text-align: center;
  margin-bottom: 1.15rem;
}

.google-account-tile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.google-account-tile:hover {
  border-color: var(--accent-primary-border);
  background: var(--selection-bg);
}

.google-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4285F4;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Authenticated Google User Pill & Dropdown Menu in Header */
.user-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.google-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.google-user-pill:hover,
.google-user-pill[aria-expanded="true"],
.google-user-pill.active-view {
  border-color: var(--accent-primary);
  background: var(--bg-card);
}

.google-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4285F4;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.google-user-email {
  font-weight: 600;
  color: var(--text-body);
}

.user-pill-caret {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.1rem;
  transition: transform 0.15s ease;
}

.google-user-pill[aria-expanded="true"] .user-pill-caret {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 205px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0.4rem;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: background 0.12s ease, color 0.12s ease;
}

.user-dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--accent-primary-text);
}

.user-dropdown-item.active {
  background: var(--selection-bg);
  color: var(--accent-primary-text);
}

.user-dropdown-item.danger {
  color: var(--status-danger-text);
}

.user-dropdown-item.danger:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.2rem 0.25rem;
}

/* ========================================================================== */
/* Compliance Chart, Shoe Rotation Tracker, GPX Analyzer & Aid-Station Styles */
/* ========================================================================== */

.compliance-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.compliance-log-bar {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.macro-bar-dual {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 76px;
}

.macro-bar-dual.vert-track {
  height: 64px;
}

.macro-bar-actual {
  width: 46%;
  max-width: 24px;
  border-radius: 5px 5px 2px 2px;
  background: var(--status-success, var(--accent-green));
  transition: height 0.2s ease;
}

.macro-bar-actual.under {
  background: var(--status-warning, var(--accent-amber));
}

.macro-bar-actual.over {
  background: var(--accent-primary, var(--accent-blue));
}

.macro-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.macro-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.macro-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.macro-legend-swatch.expected {
  background: #94a3b8;
  border: 1px solid #64748b;
}

.macro-legend-swatch.ontarget {
  background: var(--status-success, var(--accent-green));
}

.macro-legend-swatch.under {
  background: var(--status-warning, var(--accent-amber));
}

.macro-legend-swatch.over {
  background: var(--accent-primary, var(--accent-blue));
}

.week-progress-strip {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.week-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.week-progress-meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 640px) {
  .week-progress-meters {
    grid-template-columns: 1fr;
  }
}

.week-meter-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
}

.week-meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.week-meter-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-section);
  overflow: hidden;
}

.week-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--status-success, var(--accent-green));
  transition: width 0.25s ease;
}

.week-meter-fill.under {
  background: var(--status-warning, var(--accent-amber));
}

.week-meter-fill.over {
  background: var(--accent-primary, var(--accent-blue));
}

.week-meter-fill.upcoming {
  background: rgba(148, 163, 184, 0.38);
}

.shoe-rotation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.shoe-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
}

.shoe-card.warning {
  border-color: var(--status-warning-border);
  background: var(--status-warning-bg);
}

.shoe-card.replace_now {
  border-color: var(--status-danger-border);
  background: var(--status-danger-bg);
}

.shoe-card.retired {
  opacity: 0.62;
}

.shoe-progress-track {
  width: 100%;
  height: 9px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.shoe-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-green);
  transition: width 0.25s ease;
}

.shoe-progress-fill.warning {
  background: var(--accent-amber);
}

.shoe-progress-fill.replace_now {
  background: var(--accent-red);
}

.shoe-add-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}

.gpx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.gpx-kpi-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
}

.gpx-comparison-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  margin-bottom: 0.95rem;
}

.gpx-comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.gpx-comparison-warning {
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  color: var(--status-warning-text);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.84rem;
  margin-bottom: 0.75rem;
}

.gpx-comparison-table {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.gpx-comparison-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gpx-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.gpx-status-pill.ok {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.gpx-status-pill.warn {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

.gpx-status-pill.error {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.gpx-apply-terrain-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--status-warning-border);
  background: var(--status-warning-bg);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.gpx-apply-terrain-toggle input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.gpx-apply-time-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.gpx-time-option-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface-section);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.gpx-time-option-card:hover {
  border-color: var(--border-strong);
}

.gpx-time-option-card.selected {
  border-color: var(--accent-primary);
  background: var(--surface-card);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

.gpx-time-option-card input[type="radio"] {
  accent-color: var(--accent-primary);
  margin: 0;
  flex-shrink: 0;
}

.gpx-time-option-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.gpx-time-option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gpx-time-option-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
}

.gpx-time-option-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.gpx-time-option-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.77rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.gpx-elevation-strip {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 76px;
  padding: 0.55rem 0.65rem 0.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.gpx-elev-col {
  flex: 1;
  min-width: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.gpx-elev-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--accent-green);
}

.gpx-elev-bar.climb {
  background: var(--accent-primary);
}

.gpx-elev-bar.steep-descent {
  background: var(--accent-blue);
}

@media (max-width: 860px) {
  .clean-hero-grid,
  .marketing-hero-grid,
  .marketing-steps-grid,
  .marketing-pillars-grid,
  .form-section-grid,
  .preset-scenarios-grid,
  .detail-structure-grid,
  .gpx-kpi-grid,
  .onboarding-garmin-choice-grid {
    grid-template-columns: 1fr;
  }
  .marketing-hero-banner {
    padding: 1.65rem;
  }
  .marketing-hero-title {
    font-size: 1.85rem;
  }
}

/* ==========================================================================
   3-Step New-User Onboarding Wizard (#new-user-onboarding-view)
   ========================================================================== */
.onboarding-wizard-shell {
  max-width: 820px;
  margin: 2.25rem auto 4rem;
  padding: 0 1.25rem;
}

.onboarding-wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.25rem 2.4rem;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.onboarding-wizard-header {
  margin-bottom: 1.5rem;
}

.onboarding-stepper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.85rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.onboarding-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.onboarding-step-pill .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  color: var(--text-body);
  font-size: 0.76rem;
  font-weight: 800;
}

.onboarding-step-pill.active {
  background: var(--selection-bg);
  border-color: var(--accent-primary);
  color: var(--text-main);
}

.onboarding-step-pill.active .step-num {
  background: var(--accent-primary);
  color: #ffffff;
}

.onboarding-step-pill.completed {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  color: var(--status-success-text);
}

.onboarding-step-pill.completed .step-num {
  background: var(--status-success);
  color: #ffffff;
}

.onboarding-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-light);
}

.onboarding-dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0;
}

.onboarding-dist-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--surface-control);
  border: 2px solid var(--border-light);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.onboarding-dist-card:hover {
  border-color: var(--accent-primary-border);
  background: var(--surface-control);
  transform: translateY(-1px);
}

.onboarding-dist-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.onboarding-dist-card.selected {
  border-color: var(--accent-primary);
  background: var(--selection-bg);
  box-shadow: var(--selection-shadow);
}

.onboarding-dist-card.selected::after {
  content: "✓";
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.onboarding-dist-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.onboarding-dist-card.selected .onboarding-dist-badge {
  color: var(--accent-primary-text);
}

.onboarding-dist-card strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
}

.onboarding-dist-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Unified Weekly Running Days Picker (L2 Section Well + Solid Cobalt Selected Pills) */
.run-days-picker-card {
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface-section);
  border: 1px solid var(--border-light);
}

.run-days-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.run-days-pill-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.run-day-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-height: 52px;
  padding: 0.55rem 0.35rem;
  border-radius: 10px;
  background: var(--surface-control);
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.run-day-pill:hover {
  border-color: var(--accent-primary-border);
  color: var(--text-main);
  transform: translateY(-1px);
}

.run-day-pill:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.run-day-pill.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.24);
}

.run-day-pill.selected:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: #ffffff;
}

.run-day-pill.selected.is-long-run::after {
  content: "LR";
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.run-days-picker-footer {
  margin-top: 0.85rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.run-days-summary-wrap {
  flex: 1;
  min-width: 220px;
}

.run-days-summary-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-body);
}

.run-days-error-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--status-danger-text);
  margin-top: 0.25rem;
  min-height: 0;
}

.gpx-empty-state {
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: var(--surface-section);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  .run-days-pill-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.onboarding-garmin-choice-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.onboarding-choice-box {
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
}

.onboarding-choice-box.primary {
  background: var(--surface-card);
  border: 2px solid var(--accent-primary);
  box-shadow: var(--selection-shadow);
}

.onboarding-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-light);
}

/* ========================================================================== */
/* Read-Only Garmin Baseline Telemetry Grid (Category 2 & Onboarding Step 2)  */
/* ========================================================================== */

.garmin-baseline-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

@media (max-width: 1024px) {
  .garmin-baseline-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .garmin-baseline-telemetry-grid {
    grid-template-columns: 1fr;
  }
}

.baseline-telemetry-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.baseline-tile-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.baseline-tile-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.baseline-tile-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.splash-deployed-stamp {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.78;
  margin-top: 0.55rem;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   7-Column Left-to-Right Weekly Calendar Grid & Pop-Up Workout Modal
   ========================================================================== */
/* The week always stays one Mon→Sun row. Sizing follows the calendar's container (not the
   viewport): next to the 272px sidebar the cards switch to a compact layout so all 7 days fit from
   ~1300px up; below that, columns stop shrinking at a readable minimum and the row scrolls
   horizontally instead of splitting the week across two rows. */
.week-calendar-container {
  container-type: inline-size;
  container-name: weekcal;
}

.week-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  gap: 0.6rem;
  align-items: stretch;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 1.55rem 2px 0.6rem;
}

.week-calendar-grid > .calendar-day-card {
  scroll-snap-align: start;
  min-width: 0;
}

.calendar-day-card.pre-plan-card {
  opacity: 0.56;
  border-style: dashed;
  background: var(--bg-subtle);
}

.calendar-day-card.completed-run {
  background: var(--status-success-bg);
  border-color: var(--status-success-border);
  border-top-color: var(--status-success);
}

.calendar-day-card.completed-run:hover {
  border-color: var(--status-success);
}

.calendar-day-card.completed-run .cal-day-footer {
  color: var(--status-success-text);
}

.calendar-day-card.completed-run .cal-day-pill-line .workout-type-pill.pill-completed {
  background: var(--status-success);
  color: #ffffff;
}

.cal-day-plan-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.workout-type-pill.pill-pre_plan {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.completed-run-panel {
  margin-top: 0.9rem;
  padding: 0.9rem 1.05rem;
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  border-left: 4px solid var(--status-success);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.completed-run-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.completed-run-item {
  background: var(--surface-control);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
}

.planned-ref-drawer {
  margin-top: 0.9rem;
  margin-bottom: 0;
  background: var(--surface-section);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.planned-ref-drawer summary {
  padding: 0.8rem 1rem;
}

.completed-analysis-panel {
  margin-top: 0.9rem;
  padding: 0.95rem 1.05rem;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.completed-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.completed-analysis-body {
  font-size: 0.91rem;
  line-height: 1.6;
  color: var(--text-main);
}

.completed-analysis-loading {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.86rem;
}

.completed-qa-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.completed-qa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.completed-qa-chip {
  font-size: 0.76rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
}

.completed-qa-log {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}

.completed-qa-log:empty {
  display: none;
}

.completed-qa-bubble {
  padding: 0.6rem 0.78rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border-light);
}

.completed-qa-bubble.user {
  align-self: flex-end;
  max-width: 88%;
  background: var(--selection-bg);
  border-color: var(--accent-primary);
  color: var(--text-main);
  font-weight: 600;
}

.completed-qa-bubble.coach {
  align-self: flex-start;
  max-width: 96%;
  background: var(--surface-card);
  color: var(--text-main);
}

.completed-qa-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.completed-qa-form .form-input {
  flex: 1;
  min-width: 180px;
  height: 36px;
  font-size: 0.84rem;
}

.completed-qa-form .btn-primary {
  height: 36px;
  padding: 0 0.9rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

@container weekcal (max-width: 1000px) {
  .week-calendar-grid {
    grid-template-columns: repeat(7, minmax(114px, 1fr));
    gap: 0.45rem;
  }
  .calendar-day-card {
    padding: 0.65rem 0.6rem;
    min-height: 158px;
  }
  .cal-day-miles {
    font-size: 1.12rem;
  }
  .cal-day-footer {
    font-size: 0.68rem;
  }
}

/* Phones: a vertical Mon→Sun list is easier to read than a sideways scroller. */
@container weekcal (max-width: 520px) {
  .week-calendar-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
  .calendar-day-card {
    min-height: 0;
  }
  .calendar-day-card.today-card {
    margin-top: 1.15rem;
  }
}

.calendar-day-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--accent-primary);
  border-radius: 14px;
  padding: 0.75rem 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 168px;
  text-align: left;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

.calendar-day-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.calendar-day-card:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

.calendar-day-card.type-rest {
  border-top-color: var(--border-strong);
  background: var(--bg-subtle);
}

.cal-day-top {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  flex: 1;
}

.cal-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
  padding-bottom: 0.42rem;
  border-bottom: 1px solid var(--border-light);
  min-height: 24px;
}

.cal-day-name-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.cal-day-name {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  line-height: 1;
}

.cal-day-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  line-height: 1;
  flex-shrink: 0;
}

.cal-day-metric-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
}

.cal-day-miles-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  min-height: 24px;
  width: 100%;
}

.cal-day-miles {
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.calendar-day-card.type-rest .cal-day-miles {
  color: var(--text-muted);
}

.cal-day-pill-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  flex-wrap: wrap;
  min-height: 22px;
  width: 100%;
}

.cal-day-pill-line .workout-type-pill {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  line-height: 1.15;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.calendar-day-card:not(.type-rest) .cal-day-pill-line .workout-type-pill {
  background: var(--selection-bg);
  color: var(--accent-primary-text);
}

.cal-adapt-chip {
  font-size: 0.6rem !important;
  padding: 0.12rem 0.38rem !important;
  border-radius: 5px !important;
  line-height: 1.15;
}

.cal-day-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-body);
  line-height: 1.32;
  min-height: calc(1.32em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cal-day-footer {
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--accent-primary-text);
  font-weight: 700;
  margin-top: auto;
}

.cal-day-arrow {
  font-size: 0.78rem;
  transition: transform 0.15s ease;
}

.calendar-day-card:hover .cal-day-arrow {
  transform: translate(1px, -1px);
}

/* Workout Details Pop-Up Modal */
.workout-modal-backdrop {
  z-index: 1200;
  padding: 1.25rem;
}

.workout-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.5rem 1.65rem;
  position: relative;
}

.workout-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.workout-modal-close-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.workout-modal-close-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.workout-modal-footer {
  margin-top: 1.2rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Adaptation Banner Actions & Diff Strip */
.adaptation-diff-strip {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.adaptation-diff-chip {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  color: var(--text-main);
}

.adaptation-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 195px;
  justify-content: center;
}

/* ========================================================================== */
/* Category 4 — How Your Plan Works (Plain-English Guide & Split Bar)         */
/* ========================================================================== */

.how-journey-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .how-journey-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .how-journey-track {
    grid-template-columns: 1fr;
  }
}

.how-journey-step {
  position: relative;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--viz-long);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.how-journey-step.step-peak {
  border-top-color: var(--viz-quality);
}

.how-journey-step.step-rehearsal {
  border-top-color: var(--viz-aerobic);
}

.how-journey-step.step-finish {
  border-top-color: var(--status-success);
  background: var(--status-success-bg);
}

.how-journey-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.how-journey-big {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  line-height: 1.25;
}

.how-journey-sub {
  font-size: 0.8rem;
  color: var(--text-body);
  line-height: 1.42;
}

.how-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 0.85rem;
}

.how-pillars-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.how-pillars-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 920px) {
  .how-pillars-grid.three-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  .how-pillars-grid.two-col {
    grid-template-columns: 1fr;
  }
}

.how-pillar-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-primary);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
}

.how-pillar-box:nth-child(3n + 2) {
  border-left-color: var(--accent-blue);
}

.how-pillar-box:nth-child(3n + 3) {
  border-left-color: var(--accent-pine);
}

.how-pillar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.how-pillar-body {
  font-size: 0.87rem;
  color: var(--text-body);
  line-height: 1.52;
}

.how-pillar-stat-pill {
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-light);
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.how-split-bar-wrap {
  display: flex;
  width: 100%;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
}

.how-split-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  padding: 0 0.35rem;
  transition: width 0.25s ease;
}

.how-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-body);
}

.how-split-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.how-split-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.how-run-types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 740px) {
  .how-run-types-grid {
    grid-template-columns: 1fr;
  }
}

.how-run-type-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-blue);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
}

.how-phases-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

@media (max-width: 960px) {
  .how-phases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .how-phases-grid {
    grid-template-columns: 1fr;
  }
}

.how-phase-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-blue);
  border-radius: 12px;
  padding: 0.9rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Chapter 7: Compact 5-Row Neutral Gray Box (zero orphan cards) */
.how-origins-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.25rem 1.05rem;
}

.how-origin-row {
  display: grid;
  grid-template-columns: minmax(210px, 270px) 1fr;
  align-items: baseline;
  gap: 0.45rem 1.1rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--border-light);
}

.how-origin-row:last-child {
  border-bottom: none;
}

.how-origin-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.how-origin-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.how-origin-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.how-origin-desc {
  font-size: 0.86rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 720px) {
  .how-origin-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ========================================================================== */
/* Read-Only Administrator Bar, User Selector & Read-Only UI Guardrails       */
/* ========================================================================== */

.admin-readonly-bar {
  position: sticky;
  top: 0;
  z-index: 65;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-medium);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.admin-readonly-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-readonly-bar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 1 1 320px;
  min-width: 0;
}

.admin-ro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  color: var(--accent-primary-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.admin-bar-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-bar-select {
  flex: 1 1 240px;
  max-width: 440px;
  min-width: 180px;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-bar-select:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

.admin-readonly-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-bar-btn {
  padding: 0.38rem 0.75rem !important;
  font-size: 0.8rem !important;
}

.admin-selector-shell {
  max-width: 1180px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.25rem;
}

.admin-selector-card {
  padding: 1.6rem 1.75rem;
}

.admin-selector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-selector-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.15rem 0 0.35rem;
  color: var(--text-main);
}

.admin-selector-subtitle {
  font-size: 0.9rem;
  color: var(--text-body);
  max-width: 64ch;
  line-height: 1.55;
  margin: 0;
}

.admin-selector-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.admin-search-input {
  min-width: 230px;
  padding: 0.48rem 0.8rem;
  font-size: 0.86rem;
}

.admin-selector-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.admin-user-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 0.9rem;
}

.admin-user-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.admin-user-card:hover {
  background: var(--surface-card);
  border-color: var(--accent-primary-border);
  box-shadow: var(--shadow-soft);
}

.admin-user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.admin-user-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-user-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-race-line {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-body);
}

.admin-user-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-user-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-light);
}

/* Declarative Read-Only UI Guardrails when viewing as Administrator */
body.admin-readonly-mode #life-flex-drawer,
body.admin-readonly-mode #drawer-life-flex-controls,
body.admin-readonly-mode #completed-run-qa-form,
body.admin-readonly-mode .completed-run-qa-chips,
body.admin-readonly-mode #btn-completed-run-analyze,
body.admin-readonly-mode .sidebar-coach-box,
body.admin-readonly-mode #sidebar-wipe-everything-box,
body.admin-readonly-mode #btn-accept-adaptation,
body.admin-readonly-mode #btn-revert-week,
body.admin-readonly-mode #btn-checkin-recalibrate,
body.admin-readonly-mode #btn-checkin-dismiss,
body.admin-readonly-mode #btn-checkin-review-goal,
body.admin-readonly-mode .btn-tag-modality,
body.admin-readonly-mode .btn-tag-incline,
body.admin-readonly-mode .btn-dismiss-modality,
body.admin-readonly-mode #btn-delete-race-goal,
body.admin-readonly-mode #btn-save-goal-rebuild,
body.admin-readonly-mode #btn-apply-gpx-course,
body.admin-readonly-mode #btn-upload-course-gpx,
body.admin-readonly-mode #course-gpx-file-input,
body.admin-readonly-mode #btn-save-personal-settings,
body.admin-readonly-mode #btn-garmin-connect,
body.admin-readonly-mode #btn-garmin-mfa-submit,
body.admin-readonly-mode #btn-garmin-disconnect,
body.admin-readonly-mode #btn-garmin-sync-now,
body.admin-readonly-mode #btn-garmin-push-week,
body.admin-readonly-mode #btn-garmin-push-4w,
body.admin-readonly-mode #btn-garmin-push-full,
body.admin-readonly-mode #btn-garmin-upload-activity,
body.admin-readonly-mode #form-add-shoe,
body.admin-readonly-mode .shoe-action-btn,
body.admin-readonly-mode #panel-garmin button[type="submit"],
body.admin-readonly-mode #panel-edit-goal button[type="submit"] {
  display: none !important;
}

/* ========================================================================== */
/* Interactive Mini Calendar Popup & Current Training Week / Today Badges     */
/* ========================================================================== */

.mini-cal-field-wrap {
  position: relative;
}

.mini-cal-trigger-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-control);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
}

.mini-cal-trigger-btn:hover {
  border-color: var(--accent-primary-border);
}

.mini-cal-trigger-btn:focus-visible {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--selection-bg);
  outline: none;
}

.mini-cal-trigger-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.mini-cal-icon {
  font-size: 1rem;
  line-height: 1;
}

.mini-cal-date-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cal-weeks-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--selection-bg);
  color: var(--accent-primary-text);
  border: 1px solid var(--accent-primary-border);
  white-space: nowrap;
}

.mini-calendar-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1200;
  width: 312px;
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
  padding: 0.9rem;
  user-select: none;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.mini-cal-month-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
}

.mini-cal-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-section);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}

.mini-cal-nav-btn:hover {
  background: var(--selection-bg);
  border-color: var(--accent-primary-border);
  color: var(--accent-primary-text);
}

.mini-cal-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.mini-cal-preset-btn {
  padding: 0.28rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  border-radius: 7px;
  border: 1px solid var(--border-light);
  background: var(--surface-section);
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.14s ease;
}

.mini-cal-preset-btn:hover {
  border-color: var(--accent-primary-border);
  background: var(--selection-bg);
  color: var(--accent-primary-text);
}

.mini-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.mini-cal-day {
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.mini-cal-day:hover:not(:disabled) {
  background: var(--selection-bg);
  border-color: var(--accent-primary-border);
  color: var(--accent-primary-text);
}

.mini-cal-day.weekend:not(.selected):not(:disabled) {
  background: var(--surface-section);
}

.mini-cal-day.today:not(.selected) {
  border-color: var(--status-success);
  color: var(--status-success-text);
  font-weight: 800;
}

.mini-cal-day.selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.28);
}

.mini-cal-day.muted,
.mini-cal-day:disabled {
  color: var(--text-muted);
  opacity: 0.35;
  cursor: not-allowed;
}

.mini-cal-footer {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-today-pill {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
  pointer-events: none;
  z-index: 2;
}

.cal-today-pill::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px 4px 0 4px;
  border-style: solid;
  border-color: var(--accent-primary) transparent transparent transparent;
}

.week-bar-col.current-calendar-week .week-bar-label {
  color: var(--accent-green);
  font-weight: 800;
}



/* ==========================================================================
   Toast notifications, busy buttons, hints & Garmin requirement notes
   ========================================================================== */
.toast-region {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2.5rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-primary);
  box-shadow: var(--shadow-modal);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}

.toast-success {
  border-left-color: var(--status-success);
}

.toast-error {
  border-left-color: var(--status-danger);
}

.toast-text {
  flex: 1;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.15rem;
}

button[aria-busy="true"],
button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

.home-gateway-requirement {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--text-body);
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.garmin-required-callout {
  max-width: 620px;
  margin: 0 auto 1rem;
  font-size: 0.86rem;
  color: var(--text-body);
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  line-height: 1.5;
}

/* Finish-time suggestions (Easy / Moderate / Hard), SPEC §5.8 — unified with Distance Cards */
.finish-sugg-card {
  margin: 0.75rem 0 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-section);
}
.finish-sugg-card.compact {
  margin: 0.25rem 0 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
}
.finish-sugg-head {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}
.finish-sugg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.finish-sugg-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
  padding: 0.8rem 0.95rem;
  text-align: left;
  cursor: pointer;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface-control);
  color: var(--text-main);
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.finish-sugg-btn:hover {
  border-color: var(--accent-primary-border);
  transform: translateY(-1px);
}
.finish-sugg-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.finish-sugg-btn.selected {
  border-color: var(--accent-primary);
  background: var(--selection-bg);
  box-shadow: var(--selection-shadow);
}
.finish-sugg-btn.selected::after {
  content: "✓";
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.finish-sugg-btn.selected .finish-sugg-tier {
  color: var(--accent-primary-text);
}
.finish-sugg-btn .finish-sugg-tier {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.finish-sugg-btn .finish-sugg-time {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}
.finish-sugg-btn .finish-sugg-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.finish-sugg-note {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.finish-sugg-custom-box {
  position: relative;
  margin-top: 0.75rem;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-control);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.finish-sugg-custom-box.selected {
  border-color: var(--accent-primary);
  background: var(--selection-bg);
  box-shadow: var(--selection-shadow);
}
.finish-sugg-custom-box.selected::after {
  content: "✓";
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.finish-sugg-custom-head {
  margin-bottom: 0.45rem;
  padding-right: 1.75rem;
}
.finish-sugg-custom-box .finish-sugg-tier {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.finish-sugg-custom-box.selected .finish-sugg-tier {
  color: var(--accent-primary-text);
}
.finish-sugg-custom-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.finish-sugg-custom-box.selected .form-input {
  border-color: var(--accent-primary-border);
  font-weight: 700;
}
.finish-sugg-custom-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.finish-sugg-custom-meta .custom-pace {
  font-weight: 700;
  color: var(--text-main);
}
.finish-sugg-custom-meta .custom-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-primary-soft, rgba(16, 185, 129, 0.12));
  color: var(--accent-primary-text);
}
@media (max-width: 560px) { .finish-sugg-grid { grid-template-columns: 1fr; } }

/* Reusable Semantic Callouts (Info / Warning / Success / Danger) */
.callout-info {
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  color: var(--text-body);
}
.callout-warning {
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-left: 4px solid var(--status-warning);
  border-radius: var(--radius-sm);
  color: var(--status-warning-text);
}
.callout-success {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  border-left: 4px solid var(--status-success);
  border-radius: var(--radius-sm);
  color: var(--status-success-text);
}

/* Clean Print / Export to PDF layout for "How Your Plan Works" */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.printing-how-it-works {
    background: #ffffff !important;
    color: #0f172a !important;
  }
  body.printing-how-it-works .app-header,
  body.printing-how-it-works .sidebar-nav,
  body.printing-how-it-works .app-sidebar,
  body.printing-how-it-works .no-print,
  body.printing-how-it-works .toast-container,
  body.printing-how-it-works .google-modal-backdrop,
  body.printing-how-it-works .tab-panel:not(#panel-how-it-works) {
    display: none !important;
  }
  body.printing-how-it-works .app-shell,
  body.printing-how-it-works .app-main-layout,
  body.printing-how-it-works .main-content-area {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.printing-how-it-works #panel-how-it-works {
    display: block !important;
  }
  body.printing-how-it-works #panel-how-it-works .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 1rem !important;
    break-inside: avoid-page;
  }
  body.printing-how-it-works #panel-how-it-works .how-pillar-box,
  body.printing-how-it-works #panel-how-it-works .how-phase-card,
  body.printing-how-it-works #panel-how-it-works .how-journey-step,
  body.printing-how-it-works #panel-how-it-works .how-run-type-card,
  body.printing-how-it-works #panel-how-it-works .how-origin-row,
  body.printing-how-it-works #panel-how-it-works tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* ==========================================================================
   Performance Trends (`#panel-trends`) — Calm 2-Column SVG Analytics Grid
   ========================================================================== */
.trends-header-card {
  margin-bottom: 1.1rem;
}
.trends-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.trends-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0.2rem 0 0.25rem;
}
.trends-page-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}
.trends-controls-col {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.trends-range-bar {
  display: inline-flex;
  background: var(--surface-section);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.trends-range-pill {
  border: none;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.trends-range-pill:hover {
  background: var(--surface-hover);
}
.trends-range-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
}
.trends-brief-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  white-space: nowrap;
}
body.admin-readonly-mode #btn-generate-trend-brief {
  display: none !important;
}
.trends-brief-box {
  margin-top: 1rem;
  padding: 0.9rem 1.05rem;
  background: var(--surface-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.trends-brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.trends-brief-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-heading);
}
.trends-brief-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-body);
}
.trends-brief-body ul {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
}
.trends-brief-body li {
  margin-bottom: 0.35rem;
}
.trends-section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.45rem 0 -0.25rem;
  padding: 0 0.15rem;
}
.trends-section-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trends-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.05rem;
}
@media (max-width: 900px) {
  .trends-grid {
    grid-template-columns: 1fr;
  }
}
.trend-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.15rem 0.95rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.trend-card-wide {
  grid-column: 1 / -1;
}
.ff-metrics-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.4rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.7rem;
  background: var(--surface-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.ff-metric-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
.ff-metric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}
.ff-metric-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ff-metric-value {
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-heading);
}
.ff-metric-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}
.trend-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.trend-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 26px;
}
.trend-card-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.trend-card-headline-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow: hidden;
  min-height: 1.45rem;
}
.trend-metric-item {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.trend-metric-item.static {
  cursor: default;
}
.trend-metric-item:not(.static):hover,
.trend-metric-item:not(.static):focus-visible {
  color: var(--accent-primary);
  outline: none;
}
.trend-metric-item.active {
  font-weight: 800;
  color: var(--text-heading);
}
.trend-metric-sep {
  color: var(--border-medium);
  font-weight: 700;
  user-select: none;
  flex-shrink: 0;
}
.trend-delta-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
  background: var(--surface-section);
  color: var(--text-body);
  flex-shrink: 0;
}
.trend-delta-pill.good {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}
.trend-delta-pill.warn {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-color: var(--status-warning-border);
}
.trend-delta-pill.danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}
.trend-card-toggle {
  display: inline-flex;
  background: var(--surface-section);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.trend-sub-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.trend-sub-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}
.trend-svg-wrap {
  width: 100%;
  background: var(--surface-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem 0.3rem;
  min-height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trend-svg {
  width: 100%;
  height: 144px;
  display: block;
  overflow: visible;
}
.trend-empty-state {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0.75rem;
}
.trend-legend-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 24px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.trend-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.trend-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.trend-explain {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}
.trend-takeaway {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-body);
  font-weight: 500;
  margin: 0;
}
.trend-expand-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.44rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--border-medium);
  background: var(--surface-section);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.trend-expand-btn:hover {
  background: var(--selection-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary-text);
}
.trend-modal-card {
  max-width: 760px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.trend-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.trend-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}
.trend-modal-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.trend-modal-headline {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-heading);
}
.trend-modal-chart-wrap {
  width: 100%;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.65rem 0.75rem 0.4rem;
}
.trend-modal-chart-wrap .trend-svg {
  width: 100%;
  height: 250px;
  display: block;
}
.trend-modal-legend-row {
  margin-top: -0.35rem;
}
.trend-modal-explain-box {
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.trend-modal-section-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.trend-modal-explain-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-body);
}
.trend-modal-coach-box {
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.trend-modal-coach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.trend-modal-coach-body {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.58;
  color: var(--text-main);
}
.trend-modal-coach-body.is-loading {
  color: var(--text-muted);
  font-style: italic;
}
.trends-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.42rem 0.62rem;
  font-size: 0.76rem;
  line-height: 1.35;
  box-shadow: var(--shadow-md);
  max-width: 240px;
}
.trends-tooltip strong {
  display: block;
  font-family: var(--font-mono);
  color: var(--text-heading);
}

/* ==========================================================================
   Public Interactive Demo Mode (Landing CTA, Persistent Banner, Garmin Locks)
   ========================================================================== */
.btn-demo-gateway {
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 20px -6px rgba(13, 148, 136, 0.36);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn-demo-gateway:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0f766e 0%, #047857 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 24px -6px rgba(13, 148, 136, 0.46);
}
.btn-demo-gateway:active:not(:disabled) {
  transform: translateY(0);
}
.btn-demo-gateway:disabled {
  opacity: 0.65;
  cursor: wait;
}

.demo-mode-bar {
  background: var(--surface-section);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.52rem 1.25rem;
}
.demo-mode-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.demo-mode-bar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.demo-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.demo-mode-copy {
  font-size: 0.82rem;
  color: var(--text-body);
  font-weight: 500;
}
.demo-bar-btn {
  padding: 0.34rem 0.78rem;
  font-size: 0.78rem;
  font-weight: 700;
}

body.demo-mode #onboard-garmin-card,
body.demo-mode .garmin-required-callout,
body.demo-mode #btn-onboard-resync-baseline,
body.demo-mode #garmin-api-login-box,
body.demo-mode #garmin-api-connected-box,
body.demo-mode #btn-garmin-api-logout,
body.demo-mode #garmin-baseline-unconnected-callout,
body.demo-mode #panel-garmin .clean-drawer,
body.demo-mode #btn-push-week-garmin,
body.demo-mode #btn-push-4w-garmin,
body.demo-mode #btn-push-full-garmin,
body.demo-mode #btn-pull-live-garmin-now,
body.demo-mode #btn-garmin-pull-baseline,
body.demo-mode #drawer-push-garmin-btn {
  display: none !important;
}

body.demo-mode .demo-only-notice {
  display: block !important;
}

/* ==========================================================================
   Workout-Matched Route Builder (Interactive Map + Ordered Waypoints)
   ========================================================================== */
.route-builder-summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.route-builder-body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.route-start-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.route-start-autocomplete {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}
.route-start-autocomplete .form-input {
  width: 100%;
  padding: 0.48rem 0.7rem;
  font-size: 0.86rem;
}
.route-start-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}
.route-sugg-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-sans);
}
.route-sugg-item:last-child {
  border-bottom: none;
}
.route-sugg-item:hover,
.route-sugg-item.active {
  background: var(--selection-bg);
}
.route-sugg-primary {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}
.route-sugg-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
}
.route-sm-btn {
  padding: 0.48rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.route-map-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.route-map-wrap {
  position: relative;
  width: 100%;
}
.route-map-canvas {
  width: 100%;
  height: 400px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--surface-section);
  overflow: hidden;
  z-index: 1;
  transition: height 0.18s ease;
}
.route-map-canvas.is-expanded {
  height: 580px;
}
.route-map-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 410;
  padding: 0.34rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: background 0.14s ease, transform 0.12s ease;
}
.route-map-expand-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
}
[data-theme="dark"] .route-map-expand-btn {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-color: #334155;
}
.route-pin-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #0d9488;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.route-pin-badge.start-pin {
  background: #2563eb;
}
.route-hit-polyline {
  cursor: grab !important;
}
.route-drag-ghost-hit {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}
.route-drag-ghost-hit:active {
  cursor: grabbing;
}
.route-drag-ghost {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #ffffff;
  border: 3.5px solid #1d4ed8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
  pointer-events: none;
  transition: transform 0.1s ease;
}
.route-drag-ghost-hit:hover .route-drag-ghost {
  transform: scale(1.18);
}
.route-drag-ghost-hit:active .route-drag-ghost {
  transform: scale(1.22);
}
.route-waypoints-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}
.route-waypoints-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 220px;
}
.route-wp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}
.route-wp-chip.is-start {
  background: var(--selection-bg);
  border-color: var(--accent-primary-border);
}
.route-wp-num {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #0d9488;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.route-wp-chip.is-start .route-wp-num {
  background: #2563eb;
}
.route-wp-label {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-wp-mini-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.16rem;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}
.route-wp-mini-btn:hover {
  color: var(--text-main);
}
.route-clear-btn {
  padding: 0.28rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
}
.route-controls-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.route-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.route-control-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.route-seg-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.route-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.34rem 0.62rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.route-seg-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}
.route-gen-btn {
  padding: 0.52rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}
.route-builder-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-height: 1rem;
}
.route-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-light);
}
.route-candidate-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.route-cand-tab {
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-body);
  border-radius: 9px;
  padding: 0.36rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.route-cand-tab.active {
  border-color: var(--accent-primary);
  background: var(--selection-bg);
  color: var(--accent-primary-text);
}
.route-metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
}
.route-info-note {
  font-size: 0.78rem;
  color: var(--accent-primary-text);
  background: var(--selection-bg);
  border: 1px solid var(--accent-primary-border);
  border-radius: 8px;
  padding: 0.42rem 0.65rem;
}
.route-warn-note {
  font-size: 0.78rem;
  color: var(--status-warning-text);
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  padding: 0.42rem 0.65rem;
}
.route-surface-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.route-surface-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.route-surface-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.route-legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 0.15rem;
  vertical-align: middle;
}
.route-legend-dot.road {
  background: #2563eb;
}
.route-legend-dot.path {
  background: #0d9488;
}
.route-legend-dot.trail {
  background: #d97706;
}
.route-live-hud {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--surface-section);
  border: 1px solid var(--border-light);
}
.route-hud-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 640px) {
  .route-hud-grid {
    grid-template-columns: 1fr;
  }
}
.route-hud-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.78rem;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}
.route-hud-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.route-hud-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.route-hud-delta {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  background: var(--surface-section);
  color: var(--text-muted);
  white-space: nowrap;
}
.route-hud-delta.is-match {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}
.route-hud-delta.is-over {
  background: var(--selection-bg);
  color: var(--accent-primary-text);
}
.route-hud-delta.is-under {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}
.route-hud-values {
  display: flex;
  align-items: baseline;
  gap: 0.42rem;
  flex-wrap: wrap;
}
.route-hud-values strong {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}
.route-hud-expected {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.route-hud-loss {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.route-hud-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}
.route-hud-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #f59e0b;
  transition: width 0.2s ease, background-color 0.2s ease;
}
.route-hud-bar-fill.is-match {
  background: #10b981;
}
.route-hud-bar-fill.is-over {
  background: #2563eb;
}
.route-hud-bar-fill.is-neutral {
  background: #94a3b8;
}
.route-manual-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.route-manual-tools-left {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
}
.route-manual-toolbar button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.route-pin-badge.end-pin {
  background: #0f172a;
}
.route-surface-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: var(--border-light);
}
.route-elev-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
}
.route-elev-strip svg {
  width: 100%;
  height: 68px;
  display: block;
}
.route-actions-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.route-action-btn {
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
}
body.demo-mode #btn-push-route-garmin,
body.admin-readonly-mode #btn-push-route-garmin,
body.admin-readonly-mode #tab-btn-routes {
  display: none !important;
}

/* Dedicated Full-Workspace Route Builder Panel (#panel-route-builder) */
.standalone-route-header-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.standalone-route-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.standalone-mode-seg {
  align-self: flex-start;
}
.standalone-route-context-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}
.standalone-workout-select-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.standalone-workout-select-row .form-select {
  flex: 1 1 280px;
  max-width: 560px;
}
.standalone-route-custom-grid {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}
.standalone-route-custom-grid .form-input {
  width: 155px;
  padding: 0.48rem 0.65rem;
  font-size: 0.88rem;
}
.standalone-route-custom-grid #input-custom-route-title {
  width: 100%;
  min-width: 210px;
}
.standalone-route-map-card {
  padding: 1.15rem 1.25rem;
}
#panel-route-builder .route-builder-body {
  margin-top: 0;
  gap: 0.85rem;
}
#panel-route-builder .route-map-canvas {
  height: 520px;
}
#panel-route-builder .route-map-canvas.is-expanded {
  height: 680px;
}

/* ==========================================================================
   Mobile & PWA Responsive Layout (<= 768px ONLY — Desktop > 768px Untouched)
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
  }

  /* Safe-area support for iPhone notch / Dynamic Island & standalone PWA status bar */
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
  .header-inner {
    padding: 0.6rem 0.9rem;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .brand-mark svg {
    width: 24px;
    height: 24px;
  }
  .brand-title {
    font-size: 1.12rem;
  }
  .brand-subtitle {
    display: none;
  }
  .google-user-pill {
    padding: 0.32rem 0.6rem 0.32rem 0.36rem;
    min-height: 38px;
    max-width: 175px;
  }
  .google-user-email {
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
  }
  .user-dropdown-menu {
    right: 0;
    min-width: 205px;
  }
  .user-dropdown-item {
    min-height: 44px;
    font-size: 0.92rem;
  }

  /* Compact Demo & Read-Only Admin banners on phones */
  .demo-mode-bar,
  .admin-readonly-bar {
    padding: 0.45rem 0.85rem;
  }
  .demo-mode-bar-left,
  .admin-readonly-bar-inner {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .demo-mode-copy {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  /* Replace stacked left sidebar with native-feeling fixed bottom tab bar */
  .app-workspace-grid {
    display: block;
    padding: 0.75rem 0.75rem 0;
    gap: 0;
  }
  .app-left-sidebar {
    display: none !important;
  }
  .main-container {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
    padding: 0.3rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  }
  body.admin-readonly-mode .mobile-bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.admin-readonly-mode #mobile-nav-coach {
    display: none;
  }
  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.14rem;
    min-height: 48px;
    padding: 0.25rem 0.15rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease;
  }
  .mobile-nav-icon {
    font-size: 1.12rem;
    line-height: 1;
  }
  .mobile-nav-label {
    line-height: 1.1;
    white-space: nowrap;
  }
  .mobile-nav-btn.active {
    color: var(--accent-primary-text);
    background: var(--selection-bg);
  }

  /* Compact cards & vertical rhythm */
  .card {
    padding: 1.05rem;
    border-radius: 16px;
    margin-bottom: 0.9rem;
  }

  /* Compact Race Goal Banner & Today Focus Hero */
  .compact-race-goal-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .compact-race-goal-title-row {
    gap: 0.4rem;
  }
  .compact-race-title {
    font-size: 1.12rem;
  }
  .compact-race-goal-scores-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }
  .banner-score-chip {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
  }
  .compact-race-goal-right,
  .compact-goal-manage-btn {
    width: 100%;
  }
  .compact-goal-manage-btn {
    min-height: 44px;
    justify-content: center;
  }

  .today-focus-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .today-focus-right,
  .today-focus-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .today-focus-actions .btn-primary,
  .today-focus-actions .btn-secondary {
    flex: 1 1 140px;
    min-height: 44px;
    justify-content: center;
  }

  /* Week navigator & 7-day calendar cards */
  .week-nav-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
  }
  .week-nav-bar button {
    min-height: 42px;
  }
  .week-calendar-grid {
    gap: 0.6rem;
  }
  .calendar-day-card {
    padding: 0.85rem 0.9rem;
  }

  /* Login screen mobile polish + safe areas */
  .home-gateway-shell {
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0.85rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .home-gateway-visual {
    min-height: 195px;
    max-height: 225px;
  }
  .home-gateway-welcome {
    padding: 1.25rem 1.15rem;
  }
  .home-gateway-title {
    font-size: 1.38rem;
  }
  .home-gateway-lead {
    font-size: 0.86rem;
    margin-bottom: 0.8rem;
  }
  .home-gateway-highlights {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.9rem;
  }

  /* Onboarding wizard mobile stacking */
  .onboarding-wizard-shell {
    padding: 0.75rem 0.75rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
  .onboarding-wizard-card {
    padding: 1.15rem 1rem;
    border-radius: 16px;
  }
  .onboarding-wizard-title {
    font-size: 1.28rem;
  }
  .onboarding-stepper {
    gap: 0.35rem;
  }
  .onboarding-step-pill {
    padding: 0.35rem 0.55rem;
    font-size: 0.74rem;
  }
  .onboarding-step-line {
    display: none;
  }

  /* Anti-zoom 16px inputs on iOS Safari + comfortable 44px touch targets */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  select,
  textarea,
  .form-input,
  .form-control {
    font-size: 16px;
    min-height: 44px;
  }
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    min-height: 44px;
  }
  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .clean-hero-grid {
    grid-template-columns: 1fr !important;
  }
  .finish-sugg-grid {
    grid-template-columns: 1fr;
  }

  /* Modals & AI Coach Slide-Over Drawer: 100dvh full-viewport mobile sheets */
  .workout-modal-backdrop,
  .google-modal-backdrop {
    padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    align-items: flex-end;
  }
  .workout-modal-card,
  .google-modal-card {
    width: 100%;
    max-width: 100% !important;
    max-height: calc(100dvh - 1rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
    padding: 1.1rem 1rem;
  }
  .workout-modal-close-btn {
    min-width: 44px;
    min-height: 44px;
  }
  /* Route Builder (Beta) is desktop-only (> 768px) */
  #tab-btn-routes,
  #panel-route-builder {
    display: none !important;
  }
  .coach-slide-drawer {
    max-width: 100vw;
    width: 100vw;
    height: 100dvh;
    border-left: none;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }

  /* Horizontal touch-scrolling for data tables (Compliance, GPX Splits, Zones, Aid Stations) */
  .table-wrap,
  .splits-table-wrap,
  .compliance-table-wrap,
  .gpx-splits-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  table {
    max-width: 100%;
  }

  /* Performance Trends: strict viewport fit & clean text alignment on mobile */
  .trends-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .trends-page-title {
    font-size: 1.25rem;
  }
  .trends-controls-col {
    width: 100%;
    align-items: stretch;
    gap: 0.55rem;
  }
  .trends-range-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  .trends-range-pill {
    text-align: center;
    padding: 0.45rem 0.25rem;
    min-height: 36px;
  }
  .trends-brief-btn {
    width: 100%;
    justify-content: center;
  }
  .trends-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    width: 100%;
  }
  .trend-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0.9rem 0.9rem 0.85rem;
    overflow: hidden;
    box-sizing: border-box;
  }
  .trend-card-top-row {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
  }
  .trend-card-kicker {
    white-space: normal;
    line-height: 1.25;
  }
  .trend-card-toggle {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .trend-sub-btn {
    padding: 0.22rem 0.48rem;
    font-size: 0.68rem;
  }
  .trend-card-headline-row {
    flex-wrap: wrap;
    overflow: visible;
    align-items: center;
    gap: 0.25rem 0.4rem;
  }
  .trend-metric-item {
    font-size: 0.96rem;
    min-height: 28px;
  }
  .trend-delta-pill {
    font-size: 0.7rem;
  }
  .trend-svg-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0.35rem 0.3rem 0.25rem;
    overflow: hidden;
    box-sizing: border-box;
  }
  .trend-card svg,
  .trend-svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 460 / 152;
    display: block;
    overflow: hidden;
  }
  .trend-legend-row {
    gap: 0.35rem 0.65rem;
    font-size: 0.72rem;
    line-height: 1.35;
  }
  .trend-explain,
  .trend-takeaway {
    overflow-wrap: break-word;
  }
}

@media (max-width: 460px) {
  .google-user-email {
    display: none;
  }
  .google-user-pill {
    padding: 0.3rem 0.5rem 0.3rem 0.32rem;
    gap: 0.25rem;
  }
  .home-gateway-cta-row {
    grid-template-columns: 1fr;
  }
  .btn-google-gateway,
  .btn-demo-gateway {
    min-height: 48px;
    font-size: 0.9rem;
  }
}
