@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111726;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 38, 60, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.3);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Physiological Category Colors: Aerobic (Green), LAT (Yellow), VO2Max (Orange), Anaerobic (Red) */
  --cat-base: #10b981;
  --cat-base-glow: rgba(16, 185, 129, 0.35);
  --cat-endurance: #eab308;
  --cat-endurance-glow: rgba(234, 179, 8, 0.35);
  --cat-speed: #f97316;
  --cat-speed-glow: rgba(249, 115, 22, 0.35);
  --cat-sprint: #ef4444;
  --cat-sprint-glow: rgba(239, 68, 68, 0.35);

  --warning-amber: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.4);

  --danger-red: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);

  --success-emerald: #10b981;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px var(--border-subtle);
  --shadow-glow: 0 0 25px -5px;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 15% 15%, rgba(56, 189, 248, 0.07) 0px, transparent 50%),
    radial-gradient(at 85% 25%, rgba(168, 85, 247, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 85%, rgba(249, 115, 22, 0.05) 0px, transparent 50%);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Header & Top Bar */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(10, 13, 20, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #9333ea, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.logo-badge svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Unit Toggle Switch */
.unit-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.unit-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.unit-btn:hover {
  color: #fff;
}

.unit-btn.active {
  background: var(--cat-base);
  color: #0b0f17;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
}

.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Main Container */
main.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Date Range / Analysis Window Toolbar */
.date-range-bar {
  position: relative;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.date-range-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.date-range-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 16px;
}

.date-range-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cat-base);
  flex-shrink: 0;
}

.date-range-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.date-range-indicator {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.date-range-summary {
  font-size: 15px;
  font-weight: 500;
  color: #e2e8f0;
  letter-spacing: 0.15px;
  line-height: 1.4;
  margin: 0;
  text-align: center;
}

.date-range-summary strong {
  color: #38bdf8;
  font-weight: 700;
  font-size: 15.5px;
}

.date-range-controls {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.date-range-presets {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  flex-wrap: wrap;
}

.date-preset-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.date-preset-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.date-preset-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

.btn-time-window-configure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-time-window-configure:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.time-window-option-card {
  transition: all 0.2s ease;
}

.time-window-option-card:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.time-window-option-card.selected {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: help;
  transition: all 0.2s ease;
  user-select: none;
}

.confidence-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.confidence-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  line-height: 1;
}

.confidence-val {
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-mono, monospace);
}

.date-preset-input {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-preset-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.date-preset-input.date-picker {
  color-scheme: dark;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  min-width: 118px;
  cursor: pointer;
}

.date-preset-input.num-picker {
  width: 44px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.date-preset-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
}

.date-custom-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  animation: fadeInDown 0.2s ease;
}

.custom-inputs-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.date-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.2s;
}

.date-input:focus {
  border-color: var(--cat-base);
}

/* Weakness & Hero Banner */
.hero-diagnosis-card {
  position: relative;
  background: linear-gradient(135deg, rgba(24, 30, 48, 0.9), rgba(15, 20, 32, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  overflow: hidden;
}

.hero-diagnosis-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #a855f7, #38bdf8);
}

.diagnosis-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diagnosis-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  width: fit-content;
}

.diagnosis-left h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}

.diagnosis-left h2 span.highlight-weakness {
  color: #f87171;
  text-decoration: underline;
  text-decoration-color: rgba(239, 68, 68, 0.4);
  text-underline-offset: 4px;
}

.diagnosis-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.diagnosis-actions {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

/* Missing / Derived Data Alert Box inside Hero */
.missing-data-alert {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.missing-data-alert.derived-mode {
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warning-amber);
  font-weight: 700;
  font-size: 15px;
}

.missing-data-alert.derived-mode .alert-header {
  color: #38bdf8;
}

.alert-body {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
}

.alert-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.alert-stat-item {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.missing-data-alert.derived-mode .alert-stat-item {
  border-color: rgba(56, 189, 248, 0.22);
}

.alert-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.alert-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #fef3c7;
}

/* 4 Physiological Category Cards Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.6);
}

.category-card.cat-base {
  border-top: 3px solid var(--cat-base);
}
.category-card.cat-endurance {
  border-top: 3px solid var(--cat-endurance);
}
.category-card.cat-speed {
  border-top: 3px solid var(--cat-speed);
}
.category-card.cat-sprint {
  border-top: 3px solid var(--cat-sprint);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title-group h3 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-group p.sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.status-badge.missing {
  background: var(--warning-bg);
  color: var(--warning-amber);
  border: 1px solid var(--warning-border);
}

.status-badge.strong {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.good {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.status-badge.moderate {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Score Circle & Gauge */
.score-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.score-radial {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}

.score-radial svg {
  transform: rotate(-90deg);
  width: 76px;
  height: 76px;
}

.score-radial circle {
  fill: none;
  stroke-width: 6;
}

.score-radial .bg-circle {
  stroke: rgba(255, 255, 255, 0.08);
}

.score-radial .progress-circle {
  stroke-dasharray: 219.9;
  stroke-dashoffset: 219.9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease-in-out;
}

.score-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.score-val span.total {
  font-size: 10px;
  color: var(--text-dim);
  display: block;
  margin-top: -3px;
}

.score-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.score-level {
  font-size: 14px;
  font-weight: 700;
}

.score-benchmark {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Category Metric Rows */
.category-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.metric-row .metric-name {
  color: var(--text-muted);
}

.metric-row .metric-val {
  font-weight: 600;
  color: #fff;
}

/* Applicable Workouts Chips inside Category Cards */
.contributing-workouts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
}

.contrib-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contrib-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-height: 144px;
  min-height: 100px;
  overflow-y: auto;
  padding-right: 4px;
}

.contrib-chips::-webkit-scrollbar {
  width: 4px;
}
.contrib-chips::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}
.contrib-chips::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.contrib-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.contrib-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.contrib-chip.chip-aerobic, .contrib-chip.chip-base { border-left: 2px solid #10b981; color: #6ee7b7; background: rgba(16, 185, 129, 0.08); }
.contrib-chip.chip-lat, .contrib-chip.chip-threshold, .contrib-chip.chip-endurance { border-left: 2px solid #eab308; color: #fde047; background: rgba(234, 179, 8, 0.08); }
.contrib-chip.chip-vo2max, .contrib-chip.chip-speed { border-left: 2px solid #f97316; color: #fdba74; background: rgba(249, 115, 22, 0.08); }
.contrib-chip.chip-anaerobic, .contrib-chip.chip-sprint { border-left: 2px solid #ef4444; color: #fca5a5; background: rgba(239, 68, 68, 0.08); }
.contrib-chip.chip-omitted {
  opacity: 0.55;
  text-decoration: line-through;
  border-style: dashed;
  border-left-color: #ef4444 !important;
  color: #94a3b8 !important;
}
.contrib-chip.chip-omitted:hover {
  opacity: 0.9;
}

.category-desc-footer {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 10px;
  margin-top: auto;
}

/* Category Impact Badges */
.impact-tags-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.cat-impact-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* 1. Aerobic (Easy): Green */
.cat-impact-badge.aerobic,
.cat-impact-badge.Aerobic,
.cat-impact-badge.AEROBIC,
.cat-impact-badge.base,
.cat-impact-badge.Base,
.badge-aerobic {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
}

/* 2. Threshold / LAT: Yellow */
.cat-impact-badge.lat,
.cat-impact-badge.LAT,
.cat-impact-badge.threshold,
.cat-impact-badge.Threshold,
.cat-impact-badge.THRESHOLD,
.cat-impact-badge.endurance,
.cat-impact-badge.Endurance,
.badge-lat,
.badge-threshold {
  background: rgba(234, 179, 8, 0.18) !important;
  color: #eab308 !important;
  border: 1px solid rgba(234, 179, 8, 0.45) !important;
}

/* 3. VO2max (Interval): Orange */
.cat-impact-badge.vo2max,
.cat-impact-badge.VO2max,
.cat-impact-badge.VO2MAX,
.cat-impact-badge.speed,
.cat-impact-badge.Speed,
.badge-vo2max {
  background: rgba(249, 115, 22, 0.18) !important;
  color: #f97316 !important;
  border: 1px solid rgba(249, 115, 22, 0.45) !important;
}

/* 4. Anaerobic (Repetition): Red */
.cat-impact-badge.anaerobic,
.cat-impact-badge.Anaerobic,
.cat-impact-badge.ANAEROBIC,
.cat-impact-badge.sprint,
.cat-impact-badge.Sprint,
.badge-anaerobic {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

/* 🏁 Race & Time-Trial Milestone Badges */
.race-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.16)) !important;
  color: #fde68a !important;
  border: 1px solid rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.22) !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  white-space: nowrap;
}

.race-badge-sm {
  font-size: 10px !important;
  padding: 2px 6px !important;
}

/* Modal Race Toggle Switch Component */
.race-switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.race-switch-control:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.08);
}
.race-switch-control.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}
.race-switch-title {
  font-size: 11.5px;
  font-weight: 700;
  font-family: Outfit, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.race-switch-control.active .race-switch-title {
  color: #fde68a;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
.race-switch-track {
  position: relative;
  width: 32px;
  height: 18px;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.race-switch-control.active .race-switch-track,
.race-switch-track input:checked ~ .race-switch-thumb {
  /* Handled below */
}
.race-switch-track input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}
.race-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background-color: #94a3b8;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.race-switch-track input:checked + .race-switch-thumb,
.race-switch-control.active .race-switch-thumb {
  left: 16px;
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.race-switch-control.active .race-switch-track,
.race-switch-track:has(input:checked) {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

/* Modal Omit / Exclude Toggle Switch Component */
.omit-switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.omit-switch-control:hover {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.08);
}
.omit-switch-control.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}
.omit-switch-title {
  font-size: 11.5px;
  font-weight: 700;
  font-family: Outfit, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.omit-switch-control.active .omit-switch-title {
  color: #fca5a5;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}
.omit-switch-track {
  position: relative;
  width: 32px;
  height: 18px;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.omit-switch-track input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}
.omit-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background-color: #94a3b8;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.omit-switch-track input:checked + .omit-switch-thumb,
.omit-switch-control.active .omit-switch-thumb {
  left: 16px;
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.omit-switch-control.active .omit-switch-track,
.omit-switch-track:has(input:checked) {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

/* Modal Comments & Purpose Box */
.modal-comments-box {
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s ease;
}
.modal-comments-box:focus-within {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}
.modal-comments-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  padding: 8px 10px;
  resize: vertical;
  min-height: 48px;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}
.modal-comments-textarea:focus {
  border-color: #38bdf8;
  background: rgba(0, 0, 0, 0.5);
}

/* 🤖 AI / LLM Assessment Badges & Cards */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.16)) !important;
  color: #e9d5ff !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.18) !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap;
  cursor: help;
}

.ai-badge-sm {
  font-size: 10px !important;
  padding: 2px 6px !important;
}

.modal-ai-assessment-box {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.4), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.08);
  transition: all 0.2s ease;
}
.modal-ai-assessment-box:hover {
  border-color: rgba(168, 85, 247, 0.5);
}

.ai-header-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-status-tag {
  font-size: 11px;
  color: var(--text-muted) !important;
  font-weight: 500;
}

.modal-ai-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.45);
  transition: all 0.2s ease;
}

.modal-ai-cat-badge.cat-aerobic   { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.45); color: #10b981; }
.modal-ai-cat-badge.cat-lat,
.modal-ai-cat-badge.cat-threshold { background: rgba(234, 179, 8, 0.15);   border-color: rgba(234, 179, 8, 0.45);   color: #eab308; }
.modal-ai-cat-badge.cat-vo2max    { background: rgba(249, 115, 22, 0.15);  border-color: rgba(249, 115, 22, 0.45);  color: #f97316; }
.modal-ai-cat-badge.cat-anaerobic { background: rgba(239, 68, 68, 0.15);   border-color: rgba(239, 68, 68, 0.45);   color: #ef4444; }

.modal-ai-reason-box {
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid #a855f7;
  border-radius: 0 6px 6px 0;
  padding: 8px 10px;
}

.modal-ai-reason-text {
  margin: 0;
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.45;
  font-style: normal;
}

.btn-ai-apply {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(99, 102, 241, 0.35));
  color: #f3e8ff;
  border: 1px solid rgba(168, 85, 247, 0.6);
  border-radius: 6px;
}
.btn-ai-apply:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.55), rgba(99, 102, 241, 0.55));
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.btn-ai-classify {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-ai-classify:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: #fff;
}
.btn-ai-classify.loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

/* 🛑 Real-time Stressor-Specific Stop & Productivity Detector Styles */
.modal-stop-detector-box {
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.96));
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(248, 113, 113, 0.08);
  transition: all 0.25s ease;
}
.modal-stop-detector-box:hover {
  border-color: rgba(248, 113, 113, 0.55);
}

.modal-stop-detector-box.stop-box-productive {
  border-color: rgba(52, 211, 153, 0.4) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(52, 211, 153, 0.1) !important;
}
.modal-stop-detector-box.stop-box-productive:hover {
  border-color: rgba(52, 211, 153, 0.65) !important;
}

.modal-stop-detector-box.stop-box-soft-prompt {
  border-color: rgba(251, 191, 36, 0.4) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(251, 191, 36, 0.1) !important;
}
.modal-stop-detector-box.stop-box-soft-prompt:hover {
  border-color: rgba(251, 191, 36, 0.65) !important;
}

.modal-stop-detector-box.stop-box-hard-stop {
  border-color: rgba(248, 113, 113, 0.4) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(248, 113, 113, 0.1) !important;
}
.modal-stop-detector-box.stop-box-hard-stop:hover {
  border-color: rgba(248, 113, 113, 0.65) !important;
}

.stop-detector-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stop-detector-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.stop-detector-header-badge {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s ease;
}
.stop-detector-header-badge.badge-productive {
  color: #34d399 !important;
}
.stop-detector-header-badge.badge-soft-prompt {
  color: #fbbf24 !important;
}
.stop-detector-header-badge.badge-hard-stop {
  color: #f87171 !important;
}

.stop-tier-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.3px;
}

.toggle-switch-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 3px 10px;
  user-select: none;
  cursor: pointer;
}

.switch-label-text {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  transition: color 0.2s ease;
  cursor: pointer;
}

.switch-label-text.active {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.toggle-switch-ui {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch-ui input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.toggle-switch-ui input:checked + .toggle-switch-slider {
  background-color: #3b82f6;
}

.toggle-switch-ui input:checked + .toggle-switch-slider:before {
  transform: translateX(16px);
}

.stop-detector-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.stop-stressor-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-stressor-select {
  background: rgba(15, 23, 42, 0.9);
  color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}
.stop-stressor-select:hover {
  border-color: #38bdf8;
}

.stop-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-analyze-stop {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.6);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}
.btn-analyze-stop:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
  background: linear-gradient(135deg, #f87171, #ef4444);
}

.btn-ai-explain-stop {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.btn-ai-explain-stop:hover {
  background: rgba(168, 85, 247, 0.32);
  border-color: rgba(168, 85, 247, 0.7);
  color: #ffffff;
}

.stop-report-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Verdict Banners */
.stop-verdict-banner {
  display: none !important;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}
.verdict-productive {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.verdict-soft-prompt {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.verdict-hard-stop {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}
.verdict-safety-override {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: #c084fc;
}

/* Common AI Action Button Styling */
.btn-ai-action {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.btn-ai-action:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.38), rgba(168, 85, 247, 0.38));
  border-color: rgba(56, 189, 248, 0.65);
  color: #7dd3fc;
  box-shadow: 0 3px 12px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}
.btn-ai-action:active {
  transform: translateY(0);
}

/* Red Accent AI Action Button Styling (Physiological Stop Detector) */
.btn-ai-action-red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.35));
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.btn-ai-action-red:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.38), rgba(220, 38, 38, 0.48));
  border-color: rgba(239, 68, 68, 0.7);
  color: #fca5a5;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}
.btn-ai-action-red:active {
  transform: translateY(0);
}

/* Purple Accent AI Action Button Styling (AI Coach Explanation) */
.btn-ai-action-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(147, 51, 234, 0.35));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.btn-ai-action-purple:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.38), rgba(147, 51, 234, 0.48));
  border-color: rgba(168, 85, 247, 0.7);
  color: #e9d5ff;
  box-shadow: 0 3px 12px rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}
.btn-ai-action-purple:active {
  transform: translateY(0);
}

.btn-ai-action-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.btn-ai-action-emerald:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38), rgba(5, 150, 105, 0.48));
  border-color: rgba(16, 185, 129, 0.7);
  color: #a7f3d0;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}
.btn-ai-action-emerald:active {
  transform: translateY(0);
}

.btn-ai-action-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.btn-ai-action-amber:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(217, 119, 6, 0.48));
  border-color: rgba(245, 158, 11, 0.7);
  color: #fde68a;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}
.btn-ai-action-amber:active {
  transform: translateY(0);
}

.verdict-status-icon {
  font-size: 22px;
  line-height: 1;
}

.verdict-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.verdict-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.verdict-subtitle {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

/* Metrics Grid */
.stop-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.stop-metric-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stop-metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.stop-metric-val {
  font-size: 12.5px;
  font-weight: 800;
  color: #f1f5f9;
}

/* Dual Prompt Cards (Soft Warning Yellow vs Hard Stop Red) */
.stop-prompt-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.soft-prompt-card {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(0, 0, 0, 0.3));
}
.hard-stop-card {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(0, 0, 0, 0.3));
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-card-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.soft-title { color: #fbbf24; }
.hard-title { color: #f87171; }

.prompt-time-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.soft-time-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.hard-time-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.prompt-card-message {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.prompt-card-explanation {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

/* Activity Explorer Productivity Dot Indicator */
.productivity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
  transition: transform 0.15s ease;
  cursor: help;
}
.productivity-dot:hover {
  transform: scale(1.3);
}
.dot-green {
  background-color: #10b981;
  color: rgba(16, 185, 129, 0.7);
}
.dot-yellow {
  background-color: #f59e0b;
  color: rgba(245, 158, 11, 0.75);
}
.dot-red {
  background-color: #ef4444;
  color: rgba(239, 68, 68, 0.8);
}

/* Signals Fusion Grid */
.stop-signals-section {
  display: none !important;
  margin-top: 4px;
  flex-direction: column;
  gap: 6px;
}

.stop-signals-header {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stop-signals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}

.stop-signal-pill {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.stop-signal-pill.triggered {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.signal-name {
  font-weight: 700;
  color: #e2e8f0;
}

.signal-status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}
.signal-status-badge.nominal {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.signal-status-badge.triggered {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* Table Omitted & Comment Indicators */
.omitted-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.comment-badge-preview {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 3px 8px;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
  cursor: pointer;
}
tr.workout-row-omitted {
  opacity: 0.55;
  filter: grayscale(40%);
}
tr.workout-row-omitted:hover {
  opacity: 0.85;
  filter: grayscale(0%);
}

/* ─── X-Axis Mode Toggle (Time / Distance) ─────────────────────────── */
.xaxis-mode-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.xaxis-mode-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}
.xaxis-mode-btn--active {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.22) !important;
  border: 1px solid rgba(56, 189, 248, 0.6) !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35) !important;
}

/* Modal Race Toggle Button (Legacy Support) */
.btn-race-toggle {
  font-size: 12px !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #fde68a !important;
  background: rgba(245, 158, 11, 0.08) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
}
.btn-race-toggle:hover {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: #f59e0b !important;
  color: #fff !important;
}
.btn-race-toggle.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.25)) !important;
  border-color: #f59e0b !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35) !important;
}

/* Collapsible Chart Cards */
.collapsible-chart-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  position: relative;
}
.collapsible-chart-header {
  user-select: none;
}
.collapsible-chart-header:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}
.btn-icon-collapse,
.btn-icon-fullscreen {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}
.collapsible-chart-header:hover .btn-icon-collapse,
.btn-icon-collapse:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}
.btn-icon-fullscreen:hover {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

/* Save Disk Buttons */
.btn-icon-disk {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  margin-left: 6px;
  padding: 0;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.btn-icon-disk:hover {
  transform: translateY(-1px);
}

.btn-disk-cyan {
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: rgba(56, 189, 248, 0.1) !important;
}
.btn-disk-cyan:hover {
  color: #7dd3fc !important;
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3) !important;
}

.btn-disk-purple {
  color: #c084fc !important;
  border-color: rgba(192, 132, 252, 0.35) !important;
  background: rgba(192, 132, 252, 0.1) !important;
}
.btn-disk-purple:hover {
  color: #e9d5ff !important;
  background: rgba(192, 132, 252, 0.22) !important;
  border-color: rgba(192, 132, 252, 0.6) !important;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.3) !important;
}

.btn-disk-emerald {
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  background: rgba(52, 211, 153, 0.1) !important;
}
.btn-disk-emerald:hover {
  color: #6ee7b7 !important;
  background: rgba(52, 211, 153, 0.22) !important;
  border-color: rgba(52, 211, 153, 0.6) !important;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3) !important;
}

#modal-workout-feedback-input:focus {
  border-color: #34d399 !important;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

.btn-saved-feedback {
  animation: diskPulse 0.6s ease !important;
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.8) !important;
  background: rgba(52, 211, 153, 0.2) !important;
}

@keyframes diskPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.chevron-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.collapsed .chevron-icon,
.collapsible-chart-card.collapsed .chevron-icon,
.biometrics-card.collapsed .chevron-icon,
.modal-comments-box.collapsed .chevron-icon,
.modal-stop-detector-box.collapsed .chevron-icon {
  transform: rotate(-90deg) !important;
}
.collapsed .collapsible-section-body,
.collapsed .collapsible-chart-body,
.collapsible-chart-card.collapsed .collapsible-chart-body,
.biometrics-card.collapsed .biometrics-body,
.biometrics-card.collapsed #biometrics-section-body,
.modal-comments-box.collapsed .collapsible-section-body,
.modal-stop-detector-box.collapsed .collapsible-section-body,
.modal-stop-detector-box.collapsed .stop-report-body {
  display: none !important;
}
.collapsible-chart-card.collapsed .chart-subtitle,
.biometrics-card.collapsed .chart-subtitle,
.biometrics-card.collapsed p.chart-subtitle {
  display: none !important;
}
.collapsible-chart-card.collapsed,
.biometrics-card.collapsed {
  padding: 12px 18px !important;
  min-height: auto !important;
  height: auto !important;
}
.collapsible-chart-card.collapsed .chart-card-header {
  padding: 0 !important;
}
.collapsed,
.collapsible-chart-card.collapsed,
.biometrics-card.collapsed,
.modal-comments-box.collapsed,
.modal-stop-detector-box.collapsed {
  opacity: 0.88;
}
.collapsible-section-header:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

/* Fullscreen Expandable Chart View */
.modal-chart-container,
.chart-card .chart-container,
.bio-chart-canvas-wrap {
  cursor: zoom-in;
  transition: transform 0.15s ease;
}

.collapsible-chart-card.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 100000 !important;
  border-radius: 0 !important;
  border: none !important;
  background: #0b0f19 !important;
  padding: 20px 30px !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.95) !important;
  overflow: hidden !important;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.collapsible-chart-card.is-fullscreen:hover {
  transform: none !important;
}

.collapsible-chart-card.is-fullscreen .collapsible-chart-header {
  padding: 0 0 14px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  margin-bottom: 14px !important;
  background: transparent !important;
  cursor: default !important;
}

.collapsible-chart-card.is-fullscreen .collapsible-chart-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

.collapsible-chart-card.is-fullscreen .modal-chart-container,
.collapsible-chart-card.is-fullscreen .chart-container {
  height: calc(100vh - 130px) !important;
  max-height: calc(100vh - 130px) !important;
  flex: 1 !important;
  min-height: 420px !important;
  width: 100% !important;
  cursor: default !important;
}

/* When zone distribution is present, shrink the chart to make room */
#card-hr-chart.is-fullscreen .modal-chart-container {
  height: calc(55vh) !important;
  max-height: calc(55vh) !important;
  flex: none !important;
  min-height: 280px !important;
}

.collapsible-chart-card.is-fullscreen .btn-icon-collapse {
  display: none !important;
}

.collapsible-chart-card.is-fullscreen .btn-icon-fullscreen {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  width: 32px !important;
  height: 32px !important;
}

.collapsible-chart-card.is-fullscreen .btn-icon-fullscreen:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #fff !important;
}

/* Modal Overlay modifications when a chart inside is fullscreen */
.modal-overlay:has(.is-fullscreen),
.modal-overlay.has-fullscreen-chart {
  z-index: 100000 !important;
  padding: 0 !important;
  backdrop-filter: none !important;
}

.modal-overlay:has(.is-fullscreen) .modal-content,
.modal-overlay.has-fullscreen-chart .modal-content {
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #0b0f19 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  transform: none !important;
  animation: none !important;
}

body.chart-fullscreen-active header.app-header,
body:has(.is-fullscreen) header.app-header {
  z-index: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide zone distributions in the normal detail view; only show in fullscreen / zoomed in */
#card-hr-chart .modal-hr-zones-container,
#card-pace-chart .modal-hr-zones-container,
#card-power-chart .modal-hr-zones-container {
  display: none !important;
}
#card-hr-chart.is-fullscreen .modal-hr-zones-container,
#card-pace-chart.is-fullscreen .modal-hr-zones-container,
#card-power-chart.is-fullscreen .modal-hr-zones-container {
  display: block !important;
  margin-top: 16px !important;
  flex-shrink: 0 !important;
}

/* When zone distribution is present, shrink the chart to make room in fullscreen */
#card-pace-chart.is-fullscreen .modal-chart-container,
#card-power-chart.is-fullscreen .modal-chart-container {
  height: calc(55vh) !important;
  max-height: calc(55vh) !important;
  flex: none !important;
  min-height: 280px !important;
}

/* Modal Impact Box */
.modal-category-impact-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

/* Category Selector Pill (in modal impact box header) */
#modal-category-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #cbd5e1;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 24px 4px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  /* Custom arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 6px;
}
#modal-category-select:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.05);
}
#modal-category-select:focus {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}
/* Per-category accent when an override is active */
#modal-category-select.cat-aerobic   { border-color: rgba(16, 185, 129, 0.5);  color: #10b981; }
#modal-category-select.cat-lat,
#modal-category-select.cat-threshold { border-color: rgba(234, 179, 8, 0.5);   color: #eab308; }
#modal-category-select.cat-vo2max    { border-color: rgba(249, 115, 22, 0.5);  color: #f97316; }
#modal-category-select.cat-anaerobic { border-color: rgba(239, 68, 68, 0.5);   color: #ef4444; }

/* "overridden" badge shown when manual override is active */
.category-override-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
  animation: badgePop 0.25s ease;
}
.category-override-badge.hidden { display: none; }

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}


/* Modal HR Zones Section */
.modal-hr-zones-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hr-zones-bar {
  height: 10px;
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.05);
}

.hr-zone-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.hr-zone-seg.z0 { background: #64748b; }
.hr-zone-seg.z1 { background: #a855f7; }
.hr-zone-seg.z2 { background: #3b82f6; }
.hr-zone-seg.zx { background: #67e8f9; }
.hr-zone-seg.z3 { background: #22c55e; }
.hr-zone-seg.zy { background: #86efac; }
.hr-zone-seg.z4 { background: #f97316; }
.hr-zone-seg.z5 { background: #eab308; }

.hr-zone-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .hr-zone-pills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  .hr-zone-pills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hr-zone-pill-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hr-zone-pill-header {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
}

.hr-zone-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hr-zone-dot.z0 { background: #64748b; }
.hr-zone-dot.z1 { background: #a855f7; }
.hr-zone-dot.z2 { background: #3b82f6; }
.hr-zone-dot.zx { background: #67e8f9; }
.hr-zone-dot.z3 { background: #22c55e; }
.hr-zone-dot.zy { background: #86efac; }
.hr-zone-dot.z4 { background: #f97316; }
.hr-zone-dot.z5 { background: #eab308; }

.hr-zone-range {
  font-size: 10px;
  color: var(--text-dim);
}

.hr-zone-time {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.hr-zone-pct {
  font-size: 10px;
  color: var(--text-muted);
}

@media (max-width: 1000px) {
  .hr-zone-pills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  .hr-zone-pills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Zone Breakdown Swiper ───────────────────────────────────────────────── */
.zone-swiper-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: 6px;
}

.zone-swiper-track {
  display: flex;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.zone-swiper-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

.zone-swiper-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
  background: rgba(15, 23, 42, 0.4);
}

.zone-swiper-thead-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.5);
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.zone-swiper-th {
  padding: 5px 8px;
  font-weight: 700;
}

.zone-swiper-th--right {
  text-align: right;
}

.zone-swiper-tfoot-row {
  border-top: 2px solid rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.75);
  font-weight: 700;
}

.zone-swiper-tfoot-row td {
  padding: 6px 8px;
}

/* Three-dot indicator */
.zone-swiper-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.zone-swiper-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.zone-swiper-dot--active {
  background: #38bdf8;
  transform: scale(1.3);
}

/* Tab label row */
.zone-swiper-labels {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 7px;
}

.zone-swiper-label {
  font-size: 10.5px;
  font-weight: 700;
  font-family: Outfit, sans-serif;
  padding: 2px 9px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.zone-swiper-label--active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Visual Analysis Section (Radar & Pace-Duration) */

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-card-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  min-width: 0;
}

.chart-container canvas,
.modal-chart-container canvas {
  max-width: 100% !important;
}

/* Training Recommendations Plan */
.training-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.training-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.training-plan-header h3 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prescription-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.prescription-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prescription-item.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.05);
}

.presc-phase {
  font-size: 11px;
  font-weight: 700;
  color: var(--cat-base);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.presc-title {
  font-size: 15px;
  font-weight: 700;
}

.presc-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.presc-target {
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  padding: 6px 10px;
  border-radius: 6px;
  width: fit-content;
}

/* Activity Explorer Table */
.activities-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.activities-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.activities-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.activity-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 6px 14px;
  transition: all 0.2s ease;
}

.activity-search-box:focus-within {
  border-color: var(--cat-base);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.activity-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.activity-search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  width: 170px;
}

.activity-search-box input::placeholder {
  color: var(--text-muted);
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  color: #fff;
  transform: translateY(-1px);
}

.filter-pill[data-filter="ALL"].active,
.filter-pill[data-filter="ALL"]:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.filter-pill[data-filter="Aerobic"] {
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.filter-pill[data-filter="Aerobic"].active,
.filter-pill[data-filter="Aerobic"]:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.filter-pill[data-filter="LAT"],
.filter-pill[data-filter="Threshold"],
.filter-pill[data-filter="threshold"] {
  border-color: rgba(234, 179, 8, 0.35);
  color: #eab308;
  background: rgba(234, 179, 8, 0.08);
}
.filter-pill[data-filter="LAT"].active,
.filter-pill[data-filter="LAT"]:hover,
.filter-pill[data-filter="Threshold"].active,
.filter-pill[data-filter="Threshold"]:hover,
.filter-pill[data-filter="threshold"].active,
.filter-pill[data-filter="threshold"]:hover {
  background: rgba(234, 179, 8, 0.22);
  border-color: #eab308;
  color: #fff;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.35);
}

.filter-pill[data-filter="VO2max"],
.filter-pill[data-filter="vo2max"] {
  border-color: rgba(249, 115, 22, 0.35);
  color: #f97316;
  background: rgba(249, 115, 22, 0.08);
}
.filter-pill[data-filter="VO2max"].active,
.filter-pill[data-filter="VO2max"]:hover,
.filter-pill[data-filter="vo2max"].active,
.filter-pill[data-filter="vo2max"]:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: #f97316;
  color: #fff;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.35);
}

.filter-pill[data-filter="Anaerobic"],
.filter-pill[data-filter="anaerobic"] {
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.filter-pill[data-filter="Anaerobic"].active,
.filter-pill[data-filter="Anaerobic"]:hover,
.filter-pill[data-filter="anaerobic"].active,
.filter-pill[data-filter="anaerobic"]:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.filter-pill[data-filter="race"],
.filter-pill[data-filter="Race"] {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
}
.filter-pill[data-filter="race"].active,
.filter-pill[data-filter="race"]:hover,
.filter-pill[data-filter="Race"].active,
.filter-pill[data-filter="Race"]:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.2));
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.table-responsive {
  overflow-x: auto;
}

table.activities-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

table.activities-table th {
  padding: 12px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

table.activities-table th:hover {
  color: #fff;
}

table.activities-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

/* Tighten Date & Time and Category Impact columns */
table.activities-table:not(.bio-history-table) th.col-date,
table.activities-table:not(.bio-history-table) td:nth-child(1) {
  width: 120px;
  padding-right: 6px;
  white-space: nowrap;
}

table.activities-table:not(.bio-history-table) th.col-impact,
table.activities-table:not(.bio-history-table) td:nth-child(2) {
  width: 130px;
  padding-left: 6px;
  white-space: nowrap;
}

table.activities-table:not(.bio-history-table) th.col-notes,
table.activities-table:not(.bio-history-table) td:nth-child(10),
table.activities-table:not(.bio-history-table) td.col-notes {
  min-width: 260px;
  max-width: 520px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

table.activities-table:not(.bio-history-table) th.col-source,
table.activities-table:not(.bio-history-table) td:nth-child(11),
table.activities-table:not(.bio-history-table) td.col-source {
  min-width: 140px;
  white-space: nowrap;
}

.source-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.source-badge-pill.source-apple-watch {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.source-badge-pill.source-superfit {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.source-badge-pill.source-web {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

table.activities-table tr.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

table.activities-table tr.clickable-row:hover {
  background: rgba(255, 255, 255, 0.05);
}



.cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.cat-tag.Foundation { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.cat-tag.Tempo { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.cat-tag.Cruise { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.cat-tag.Anaerobic { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.cat-tag.Short { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.cat-tag.Recovery { background: rgba(156, 163, 175, 0.15); color: #d1d5db; }

/* Drag & Drop Upload Target */
.upload-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.03);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--cat-base);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
}

.dropzone-icon svg {
  width: 48px;
  height: 48px;
  stroke: var(--cat-base);
}

.dropzone-text h4 {
  font-size: 16px;
  font-weight: 700;
}

.dropzone-text p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Activity Deep Dive Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #111726;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.modal-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}

/* Modal Navigation Shuttle (Prev / Next) */
.modal-nav-shuttle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 12px;
  transition: all 0.15s ease;
  user-select: none;
}

.modal-nav-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.modal-nav-btn:active:not(:disabled) {
  transform: translateY(0);
}

.modal-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  background: transparent;
  border-color: transparent;
}

.modal-nav-counter {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  padding: 0 6px;
  min-width: 65px;
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 30;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.06);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .modal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.modal-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.modal-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.modal-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-chart-container {
  height: 260px;
  position: relative;
  width: 100%;
}

#plan-detail-chart-section {
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  min-height: 240px;
}

#plan-detail-chart-section .modal-chart-container {
  height: 180px;
  width: 100%;
}

#planDetailWorkoutChart {
  width: 100% !important;
  display: block;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13.5px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 1px solid var(--border-subtle);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 1100px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-diagnosis-card {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .prescription-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
  header.app-header {
    padding: 14px 18px;
  }
  main.dashboard-container {
    padding: 16px 18px 60px;
  }
}

/* ─── Apple Health Import Panel ─────────────────────────────────────────── */
.health-import-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  backdrop-filter: blur(12px);
}

.health-import-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-import-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.health-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  flex-shrink: 0;
}

.health-import-toggle-btn {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}
.health-import-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.health-import-body {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.health-step-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.health-step-num {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ef4444;
  margin-bottom: 4px;
}

.health-step-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
}

.health-step-list {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.7;
  margin: 0 0 14px;
  padding-left: 18px;
}
.health-step-list li { margin-bottom: 2px; }
.health-step-list code {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

.health-xml-dropzone {
  border: 2px dashed rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(239, 68, 68, 0.04);
}
.health-xml-dropzone:hover,
.health-xml-dropzone.drag-over {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}
.health-xml-dropzone strong { font-size: 13.5px; }

.health-run-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.health-filter-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.health-filter-btn.active,
.health-filter-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.health-run-table-wrap {
  max-height: 340px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.health-run-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.health-run-table thead tr {
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1;
}
.health-run-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.health-run-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-main);
}
.health-run-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.health-run-table tbody tr.already-imported td { opacity: 0.45; }

.health-select-all-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}
.health-select-all-btn:hover {
  background: rgba(255,255,255,0.1);
}

.health-import-btn {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
.health-import-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}
.health-import-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   80/20 Intensity Polarization Card Styles
   ───────────────────────────────────────────────────────────────────────────── */
.polarization-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.polarization-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8 0%, #06b6d4 50%, #f97316 80%, #ef4444 100%);
}

.polarization-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.polarization-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pol-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

.polarization-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.polarization-target-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 14px;
}

.polarization-target-tag strong {
  color: #38bdf8;
}

/* Dual Split Bar */
.polarization-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 18px;
}

.polarization-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot-low {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.dot-high {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.group-title {
  font-weight: 600;
  color: var(--text-main);
}

.group-percent {
  font-weight: 800;
  font-size: 14px;
}

.low-group .group-percent {
  color: #38bdf8;
}

.high-group .group-percent {
  color: #f97316;
}

.group-hours {
  color: var(--text-muted);
  font-size: 11.5px;
}

.polarization-progress-track {
  position: relative;
  height: 32px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  overflow: visible;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.polarization-seg-low {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.polarization-seg-high {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #ef4444);
  border-top-right-radius: 7px;
  border-bottom-right-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.seg-label-inside {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  padding: 0 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.polarization-target-marker {
  position: absolute;
  left: 80%;
  top: -6px;
  bottom: -6px;
  width: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.marker-line {
  width: 2px;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 6px #fff, 0 0 12px rgba(255, 255, 255, 0.8);
}

.marker-tag {
  position: absolute;
  top: -18px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Stat Box Grid */
.polarization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pol-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.pol-stat-box:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.pol-stat-box.low-box {
  border-left: 3px solid #38bdf8;
}

.pol-stat-box.high-box {
  border-left: 3px solid #f97316;
}

.pol-stat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.pol-box-tag {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.pol-box-cutoff {
  font-size: 11px;
  color: var(--text-dim);
}

.pol-stat-metric {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.low-box .pol-stat-metric {
  color: #38bdf8;
}

.high-box .pol-stat-metric {
  color: #f97316;
}

.pol-stat-metric .sub-h {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

.pol-stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 7-Zone Mini Distribution Bar */
.pol-zone-detail-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.pol-zone-detail-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pol-zone-chips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.pol-zone-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}

.pol-zone-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.pol-chip-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
}

.pol-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pol-chip-range {
  font-size: 10px;
  color: var(--text-dim);
}

.pol-chip-val {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.pol-chip-pct {
  font-size: 10px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .polarization-grid {
    grid-template-columns: 1fr;
  }
  .pol-zone-chips {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  .pol-zone-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Zone Settings Modal Styling - Unified Vertical Scroll View */
.modal-zones-scroll-body {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.6);
}

.modal-zones-scroll-body::-webkit-scrollbar {
  width: 7px;
}

.modal-zones-scroll-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.modal-zones-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

.modal-zones-scroll-body::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.7);
}

.zone-num-input,
.zone-pace-input,
.power-zone-min,
.power-zone-max {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  transition: all 0.2s ease;
}

.zone-num-input:focus,
.zone-pace-input:focus,
.power-zone-min:focus,
.power-zone-max:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  background: rgba(0, 0, 0, 0.65);
}

.zone-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes runBounce {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(-3px) scale(1.08) rotate(-6deg); }
  70% { transform: translateY(1px) scale(0.96) rotate(4deg); }
}

.run-bounce {
  display: inline-block;
  animation: runBounce 0.4s ease-in-out infinite;
}

/* Import FIT Modal & Dropzone Styles */
.import-dropzone {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.import-dropzone:hover {
  border-color: rgba(56, 189, 248, 0.7) !important;
  background: rgba(15, 23, 42, 0.85) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.import-dropzone.dragover {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.3);
  transform: scale(1.01);
}

.import-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: #e2e8f0;
}


/* ─────────────────────────────────────────────────────────────────────────
   Daily Biometrics & Recovery Readiness Styling
   ───────────────────────────────────────────────────────────────────────── */
.badge-readiness-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-readiness-pill.suppressed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.badge-readiness-pill.moderate {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.biometrics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.biometrics-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.biometrics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

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

@media (max-width: 640px) {
  .biometrics-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.bio-kpi-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.bio-kpi-box:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
}

.bio-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.bio-kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.5px;
}

.bio-kpi-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.bio-kpi-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}




.ai-readiness-layout {
  display: flex;
  gap: 18px;
  align-items: stretch;
  flex-wrap: wrap;
}

.ai-readiness-text-box {
  flex: 1 1 320px;
  min-width: 280px;
  font-size: 13.5px;
  color: #f1f5f9;
  line-height: 1.6;
  white-space: pre-wrap;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hrv4t-gauge-card {
  flex: 0 0 250px;
  min-width: 220px;
  background: radial-gradient(circle at 50% 15%, rgba(30, 58, 138, 0.45), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.hrv4t-gauge-val {
  font-size: 38px;
  font-weight: 800;
  font-family: 'JetBrains Mono', -apple-system, sans-serif;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 3px;
}

.hrv4t-gauge-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.2px;
  margin-bottom: 16px;
}

.hrv4t-gauge-track-wrap {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.hrv4t-gauge-track {
  width: 100%;
  height: 28px;
  border-radius: 14px;
  background: rgba(30, 58, 138, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.3);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.hrv4t-gauge-fill {
  height: 100%;
  border-radius: 14px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.hrv4t-dotted-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 3;
}

.hrv4t-scale-labels {
  position: relative;
  width: 100%;
  height: 18px;
  margin-top: 6px;
}

.hrv4t-scale-marker {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

.hrv4t-raw-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 10px;
}

.bio-table-container {
  margin-top: 8px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
}

.bio-table-scroll-wrap {
  max-height: 440px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.bio-table-scroll-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.bio-table-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.bio-table-scroll-wrap thead th {
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.bio-history-table {
  width: 100%;
  font-size: 12.5px;
}

.bio-history-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
}

.bio-history-table td {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bio-history-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.bio-history-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.09);
}

.bio-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bio-form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #f1f5f9;
  font-family: inherit;
  transition: all 0.15s ease;
  outline: none;
}

.bio-form-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.bio-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.bio-badge-optimal {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.bio-badge-elevated {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.bio-badge-suppressed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ─── Biometric Trends Section Styles ─────────────────────────────────────── */
.bio-trends-section {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.bio-tf-btn, .bio-vm-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bio-tf-btn:hover, .bio-vm-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.bio-tf-btn.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

.bio-vm-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.bio-trends-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 1080px) {
  .bio-trends-grid {
    grid-template-columns: 1fr;
  }
}

.bio-trend-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.bio-trend-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.bio-trend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bio-trend-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.bio-trend-card-sub {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.bio-trend-header-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.bio-chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  height: 250px;
  margin-top: 4px;
}

.bio-chart-canvas-wrap canvas {
  max-width: 100% !important;
}

.bio-trend-card .btn-icon-fullscreen {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.bio-trend-card .btn-icon-fullscreen:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ─── Biometric Chart Fullscreen Zoom Modal (Top-Level Body Fixed) ───────── */
.bio-chart-zoom-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 16px 24px 20px !important;
  box-sizing: border-box !important;
  background: #0b0f19 !important;
  z-index: 1000000 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.95) !important;
}

.bio-zoom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.bio-zoom-close-btn {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.bio-zoom-close-btn:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

.bio-zoom-modal-canvas-wrap {
  flex: 1;
  width: 100% !important;
  height: calc(100vh - 100px) !important;
  min-height: 0 !important;
  position: relative !important;
}

#bioZoomModalChart {
  width: 100% !important;
  height: 100% !important;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ⚡ Adaptive Training Plan Generator & Weakness Diagnostics Card Styles     */
/* ══════════════════════════════════════════════════════════════════════════ */

/* Weakness & Limiting Factor Diagnostics Card (Dynamic Category Themes) */
.weakness-diagnostics-card {
  --w-primary: #f97316;
  --w-accent: #fb923c;
  --w-dark: #ea580c;
  --w-rgb: 249, 115, 22;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(var(--w-rgb), 0.08));
  border: 1px solid rgba(var(--w-rgb), 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(var(--w-rgb), 0.18);
  margin-top: 18px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.weakness-diagnostics-card:hover {
  border-color: rgba(var(--w-rgb), 0.55);
  box-shadow: 0 12px 30px -5px rgba(var(--w-rgb), 0.2), inset 0 1px 0 rgba(var(--w-rgb), 0.28);
}

/* Category Specific Color Themes */
.weakness-diagnostics-card.theme-base {
  --w-primary: #10b981;
  --w-accent: #34d399;
  --w-dark: #059669;
  --w-rgb: 16, 185, 129;
}

.weakness-diagnostics-card.theme-endurance {
  --w-primary: #eab308;
  --w-accent: #fde047;
  --w-dark: #ca8a04;
  --w-rgb: 234, 179, 8;
}

.weakness-diagnostics-card.theme-speed {
  --w-primary: #f97316;
  --w-accent: #fb923c;
  --w-dark: #ea580c;
  --w-rgb: 249, 115, 22;
}

.weakness-diagnostics-card.theme-sprint {
  --w-primary: #ef4444;
  --w-accent: #f87171;
  --w-dark: #dc2626;
  --w-rgb: 239, 68, 68;
}

.weakness-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.weakness-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(var(--w-rgb), 0.15);
  border: 1px solid rgba(var(--w-rgb), 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(var(--w-rgb), 0.2);
  transition: all 0.3s ease;
}

.weakness-badge-icon svg {
  stroke: var(--w-primary);
  transition: stroke 0.3s ease;
}

.weakness-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weakness-content-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 16px;
}

.weakness-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--w-accent, #fb923c);
  display: flex;
  align-items: center;
  gap: 8px;
}

.weakness-desc {
  margin: 0;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Physiological Weakness Diagnostics & Targeted Recommendations */
.weakness-limiter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--w-accent);
  background: rgba(var(--w-rgb), 0.15);
  border: 1px solid rgba(var(--w-rgb), 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.weakness-pillars-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.weakness-pillar-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 68px;
  transition: all 0.2s ease;
}

.weakness-pillar-chip.is-weakness {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.weakness-pillar-chip-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.weakness-pillar-chip.is-weakness .weakness-pillar-chip-label {
  color: #fbbf24;
}

.weakness-pillar-chip-score {
  font-size: 16px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #f8fafc;
}

.weakness-pillar-chip.is-weakness .weakness-pillar-chip-score {
  color: #f59e0b;
}

.weakness-pillar-chip-sub {
  font-size: 9px;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Recommended Workout Types Grid */
.weakness-recommended-workouts {
  margin-top: 16px;
}

.weakness-workouts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.weakness-workouts-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weakness-workout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.weakness-workout-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.weakness-workout-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.weakness-workout-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.weakness-workout-code-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.weakness-workout-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.weakness-workout-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #94a3b8;
}

.weakness-workout-structure {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #a7f3d0;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.weakness-structure-list {
  margin: 6px 0 0 0;
  padding-left: 18px;
  list-style-type: disc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weakness-structure-list li {
  line-height: 1.5;
  color: #e2e8f0;
  font-size: 11.5px;
}

.weakness-structure-list li strong {
  color: var(--w-accent, #fb923c);
  font-weight: 700;
}

.weakness-workout-mechanism {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
}

.weakness-btn-copy-workout {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: auto;
}

.weakness-btn-copy-workout:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
  border-color: #38bdf8;
}

/* AI Deep Weakness Analysis Panel */
.weakness-ai-panel {
  background: linear-gradient(135deg, rgba(var(--w-rgb), 0.08), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(var(--w-rgb), 0.35);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(var(--w-rgb), 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

.weakness-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid rgba(var(--w-rgb), 0.15);
  padding-bottom: 10px;
}

.weakness-ai-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--w-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.weakness-ai-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(var(--w-rgb), 0.15);
  color: var(--w-primary);
  border: 1px solid rgba(var(--w-rgb), 0.3);
  transition: all 0.3s ease;
}

.weakness-ai-diagnosis {
  font-size: 13px;
  line-height: 1.55;
  color: #f1f5f9;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--w-primary);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  transition: border-color 0.3s ease;
}

.weakness-ai-workouts-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-top: 4px;
}

.weakness-ai-roadmap {
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

#btn-analyze-weakness,
.weakness-diagnostics-card .btn-primary {
  background: linear-gradient(135deg, var(--w-primary, #f97316), var(--w-dark, #ea580c)) !important;
  box-shadow: 0 2px 10px rgba(var(--w-rgb, 249, 115, 22), 0.35) !important;
  border: 1px solid rgba(var(--w-rgb, 249, 115, 22), 0.5) !important;
  color: #fff !important;
  transition: all 0.3s ease;
}

#btn-analyze-weakness:hover,
.weakness-diagnostics-card .btn-primary:hover {
  box-shadow: 0 4px 16px rgba(var(--w-rgb, 249, 115, 22), 0.55) !important;
  filter: brightness(1.1);
  transform: translateY(-1px);
}

#btn-analyze-weakness:disabled,
.weakness-diagnostics-card .btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Training Plan Modal Customizations */
.training-plan-modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.4) transparent;
}

.training-plan-modal-content::-webkit-scrollbar {
  width: 6px;
}

.training-plan-modal-content::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.4);
  border-radius: 3px;
}

/* Plan Macrocycle Timeline Bar */
.plan-timeline-bar {
  display: flex;
  width: 100%;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.plan-phase-block {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  transition: filter 0.15s ease, transform 0.15s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 6px;
}

.plan-phase-block:hover {
  filter: brightness(1.18);
  z-index: 2;
}

.plan-phase-block::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}

/* Week Accordion Cards */
.plan-week-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-week-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
}

.plan-week-card.is-open {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.plan-week-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.plan-week-header:hover {
  background: rgba(168, 85, 247, 0.06);
}

.plan-week-card.is-open .plan-week-header {
  background: rgba(168, 85, 247, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.plan-week-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: planSlideIn 0.2s ease-out;
}

@keyframes planSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Session Day Rows */
.plan-session-row {
  display: grid;
  grid-template-columns: 85px minmax(180px, 1fr) 75px 120px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
  transition: background 0.15s ease;
}

.plan-session-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.plan-session-row.is-rest {
  opacity: 0.55;
  background: transparent;
  border-color: transparent;
}

.plan-session-row.is-quality {
  border-left: 3px solid #c084fc;
  background: rgba(168, 85, 247, 0.07);
}

.plan-session-row.is-long-run {
  border-left: 3px solid #38bdf8;
  background: rgba(56, 189, 248, 0.07);
}

.plan-session-day {
  font-weight: 700;
  text-transform: capitalize;
  color: #94a3b8;
  font-size: 11.5px;
}

.plan-session-name {
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-session-dur {
  font-family: monospace;
  font-size: 11.5px;
  color: #cbd5e1;
}

.plan-plan-text-preview {
  font-family: monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-btn-copy-sm {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.plan-btn-copy-sm:hover {
  color: #f8fafc;
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.15);
}

/* Plan Zone Badges */
.plan-zone-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Initial Data Loading Overlay & Spinner */
.initial-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  visibility: visible;
}

.initial-loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.initial-loading-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.15);
  border-radius: 16px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 420px;
  width: 90%;
  gap: 20px;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.spinner-container {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  border-right-color: #c084fc;
  animation: spinnerRotate 0.9s linear infinite;
}

.spinner-core-icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-text-group h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.loading-text-group p {
  margin: 6px 0 0 0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.45;
}

.loading-progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.loading-progress-bar-indeterminate {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #c084fc);
  border-radius: 4px;
  position: absolute;
  animation: progressBarIndeterminate 1.5s ease-in-out infinite;
}

@keyframes spinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes progressBarIndeterminate {
  0% { left: -40%; width: 30%; }
  50% { left: 40%; width: 50%; }
  100% { left: 100%; width: 30%; }
}

@media (max-width: 768px) {
  .plan-session-row {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }
  .plan-session-dur, .plan-session-zones, .plan-plan-text-preview {
    grid-column: 1 / -1;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   MAIN TAB NAVIGATION SYSTEM
   ══════════════════════════════════════════════════════════════════════════ */
.main-tab-nav-container {
  max-width: 1400px;
  margin: 0 auto 20px auto;
  padding: 0 32px;
}

.main-tab-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  overflow-x: auto;
  scrollbar-width: none;
}

.main-tab-nav::-webkit-scrollbar {
  display: none;
}

.main-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.main-tab-btn svg {
  flex-shrink: 0;
  stroke: #cbd5e1;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.main-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
}

.main-tab-btn:hover svg {
  stroke: #f8fafc;
}

.main-tab-btn.active {
  color: #38bdf8;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(14, 165, 233, 0.06));
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 14px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.main-tab-btn.active svg {
  stroke: #38bdf8;
  transform: scale(1.08);
}

.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.main-tab-btn.active .tab-count-badge {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.main-tab-nav-settings-btn {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
}

.main-tab-nav-settings-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
  color: #f8fafc;
}

/* Tab Views Container */
.tab-view-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: tabFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   GOOGLE SIGN-IN AUTH GATE MODAL
   ══════════════════════════════════════════════════════════════════════════ */
.auth-gate-overlay, #auth-gate-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999999 !important;
  background: rgba(8, 11, 18, 0.96) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

.auth-gate-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(145deg, rgba(18, 24, 38, 0.96), rgba(10, 14, 23, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(56, 189, 248, 0.15);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-gate-card::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.auth-gate-logo-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0284c7, #9333ea, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
  margin-bottom: 20px;
}

.auth-gate-logo-badge svg {
  fill: #ffffff;
}

.auth-gate-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.auth-gate-header p {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0 0 24px 0;
  line-height: 1.45;
}

.auth-gate-features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
}

.auth-gate-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.auth-gate-feature-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.auth-feat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.auth-gate-feature-item strong {
  display: block;
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 700;
  margin-bottom: 1px;
}

.auth-gate-feature-item p {
  font-size: 11.5px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
}

.auth-gate-action {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn-auth-gate-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-auth-gate-google:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  box-shadow: 0 6px 25px rgba(255, 255, 255, 0.3);
}

.btn-auth-gate-google:active {
  transform: translateY(0);
}

.auth-gate-disclaimer {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
  padding: 0 10px;
}

@media (max-width: 768px) {
  .main-tab-nav-container {
    padding: 0 16px;
    margin-bottom: 16px;
  }
  .main-tab-btn {
    padding: 8px 14px;
    font-size: 12.5px;
  }
  .auth-gate-card {
    padding: 28px 20px;
  }
}

/* ─── Physiology Charts Section (Very Bottom of Physiology Tab) ─────────── */
.physiology-charts-section {
  margin-top: 24px;
}

.physiology-charts-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  box-shadow: var(--shadow-card, 0 10px 30px -5px rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(12px);
}

.physiology-charts-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.physiology-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.physiology-charts-grid.single-chart {
  grid-template-columns: 1fr;
  max-width: 100%;
}

@media (max-width: 960px) {
  .physiology-charts-grid {
    grid-template-columns: 1fr;
  }
}

.physiology-chart-subcard {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md, 12px);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.physiology-chart-subcard:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
}

.physiology-chart-subcard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.physiology-chart-subcard-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.physiology-chart-subcard-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.physiology-chart-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 3px 9px;
  border-radius: 9999px;
  white-space: nowrap;
}

.physiology-chart-toggle-group {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.physiology-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.physiology-toggle-btn.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
}

.physiology-chart-canvas-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}

.physiology-chart-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 500px) {
  .physiology-chart-legend {
    grid-template-columns: 1fr;
  }
}

.phys-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.phys-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.phys-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phys-legend-label {
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phys-legend-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  margin-left: 8px;
}

/* ─── TAB 5: GOAL & OPTIMAL PHYSIOLOGICAL BALANCE VIEW ─────────────────── */

.goal-config-card,
.goal-optimal-card,
.goal-comparison-card,
.goal-matrix-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.goal-trophy-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.2);
  flex-shrink: 0;
}

.goal-controls-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.goal-selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 320px;
}

.goal-date-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}

.goal-control-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
}

.goal-race-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-race-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #cbd5e1;
}

.goal-race-pill:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  transform: translateY(-1px);
}

.goal-race-pill.active {
  background: rgba(250, 204, 21, 0.12);
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}

.goal-race-pill .pill-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.goal-race-pill .pill-dist {
  font-size: 10.5px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
}

.goal-race-pill.active .pill-dist {
  color: #fef9c3;
}

.goal-date-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.goal-date-input {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.goal-date-input:focus {
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

.goal-countdown-badge {
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
  white-space: nowrap;
}

/* Optimal Visual Cards & Bar */

.goal-active-event-badge {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.goal-focus-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.goal-distribution-bar-section {
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
}

.goal-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.goal-bar-title {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.goal-bar-total {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
}

.goal-distribution-bar {
  display: flex;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.goal-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 24px;
}

.seg-aerobic {
  background: linear-gradient(135deg, #10b981, #059669);
}

.seg-threshold {
  background: linear-gradient(135deg, #eab308, #d97706);
}

.seg-vo2max {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.seg-anaerobic {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* 4 Pillars Grid */

.goal-pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .goal-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .goal-pillars-grid {
    grid-template-columns: 1fr;
  }
}

.goal-pillar-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.goal-pillar-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.goal-pillar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-pillar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.goal-pillar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.goal-pillar-zones {
  font-size: 10.5px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

.goal-pillar-target-val {
  font-size: 30px;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: #f8fafc;
  line-height: 1;
  margin: 4px 0;
}

.goal-pillar-card.theme-base .goal-pillar-target-val { color: #10b981; }
.goal-pillar-card.theme-endurance .goal-pillar-target-val { color: #eab308; }
.goal-pillar-card.theme-speed .goal-pillar-target-val { color: #f97316; }
.goal-pillar-card.theme-sprint .goal-pillar-target-val { color: #ef4444; }

.goal-pillar-role {
  font-size: 11.5px;
  line-height: 1.4;
  color: #94a3b8;
}

/* Comparison Section */

.goal-comp-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  flex-shrink: 0;
}

/* Training Balance Range Toggle (Previous 7 Days vs Selected Range) */
.training-balance-toggle-group {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  user-select: none;
}

.balance-toggle-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  font-family: Outfit, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.balance-toggle-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.balance-toggle-btn.active,
.balance-toggle-btn.balance-toggle-btn--active {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.2) !important;
  border: 1px solid rgba(56, 189, 248, 0.55) !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
}

.goal-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .goal-comparison-grid {
    grid-template-columns: 1fr;
  }
}

.goal-comp-item {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-comp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-comp-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-comp-status {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 8px;
  border-radius: 6px;
}

.goal-comp-status.on-target {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.goal-comp-status.deficit {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.goal-comp-status.surplus {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.goal-comp-bar-track {
  position: relative;
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  overflow: hidden;
}

.goal-comp-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

.goal-comp-markers {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
}

/* Benchmark Matrix Table */

.goal-matrix-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.goal-matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.goal-matrix-table th {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.goal-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 12.5px;
  white-space: nowrap;
}

.goal-matrix-table tr.matrix-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.goal-matrix-table tr.matrix-row:hover {
  background-color: rgba(56, 189, 248, 0.06);
}

.goal-matrix-table tr.matrix-row.active-goal-row {
  background-color: rgba(250, 204, 21, 0.08);
  outline: 1px solid rgba(250, 204, 21, 0.35);
}

.goal-matrix-table td.matrix-cell-active {
  color: #fef08a;
  font-weight: 700;
}

.matrix-btn-select {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-btn-select:hover {
  border-color: #facc15;
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}

.matrix-btn-select.selected {
  border-color: #facc15;
  background: #facc15;
  color: #0f172a;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

/* ─── Targeted Prescription Save Actions ───────────────────────────────────── */

.btn-save-prescription-workout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-save-prescription-workout:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #c084fc;
  color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

.btn-save-prescription-workout.saved {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}

.btn-save-all-prescriptions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save-all-prescriptions:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(56, 189, 248, 0.35));
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}

/* ─── Plan Interactive Spreadsheet Table ───────────────────────────────────── */

.plan-table-responsive-wrapper {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: 640px;
  overflow-y: auto;
}

.plan-interactive-table {
  border-collapse: separate;
  border-spacing: 0;
}

.plan-interactive-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1e293b;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.plan-interactive-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease;
}

.plan-interactive-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

.plan-interactive-table td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.plan-table-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 11.5px;
  padding: 5px 8px;
  transition: all 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.plan-table-input:focus {
  outline: none;
  border-color: #c084fc;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.plan-table-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 6px;
  cursor: pointer;
}

.plan-table-select:focus {
  outline: none;
  border-color: #c084fc;
}

.plan-intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-intent-chip.Aerobic,
.plan-intent-chip.AEROBIC_BASE {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.plan-intent-chip.LAT,
.plan-intent-chip.LAT_THRESHOLD {
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #fb923c;
}

.plan-intent-chip.VO2Max,
.plan-intent-chip.VO2max,
.plan-intent-chip.VO2MAX_SPEED {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.plan-intent-chip.Anaerobic,
.plan-intent-chip.ANAEROBIC {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.plan-intent-chip.AEROBIC_LONG {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.plan-intent-chip.REST_RECOVERY {
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.plan-row-action-btn {
  background: none;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.plan-row-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
}

.plan-row-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ─── Workout Plan Detail Screen & Steps Management ──────────────────────── */

.plan-table-row {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.plan-table-row:hover {
  background: rgba(168, 85, 247, 0.12) !important;
}

.plan-step-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.plan-step-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(20, 29, 52, 0.95);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.step-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.step-idx-badge {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 6px;
  border-radius: 5px;
}

.step-zone-pill {
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.step-role-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.step-dur-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
}

.step-zones-button-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 3px 4px;
}

.btn-zone-toggle {
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-zone-toggle:hover {
  filter: brightness(1.2);
}

.btn-step-reorder {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 9px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.btn-step-reorder:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.5);
  color: #f8fafc;
}

.btn-step-reorder:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}



