:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --bg-darker: #090d16;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  
  --border-subtle: #334155;
  --border-highlight: #475569;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
  
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 70px;
  
  --bg-surface-1: #1e293b;
  --bg-surface-2: rgba(255, 255, 255, 0.05);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-darker);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.25s ease, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
}

.brand-text {
  flex-grow: 1;
  overflow: hidden;
  white-space: nowrap;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.sidebar-close-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-item button {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  min-height: 44px;
}

.nav-item button:hover {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

.nav-item.active button {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.05));
  color: var(--accent-green);
  border-left: 3px solid var(--accent-green);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.nav-text {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  background-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  font-weight: 600;
  flex-shrink: 0;
}

.user-snippet {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.2);
}

.user-avatar {
  width: 38px;
  height: 38px;
  background-color: var(--border-highlight);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
  white-space: nowrap;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-vdot {
  font-size: 0.75rem;
  color: var(--accent-green);
  font-weight: 500;
}

/* Main Content Area */
.main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.05), transparent 40%),
              radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.04), transparent 40%);
  position: relative;
}

.top-bar {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar-height);
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.15s ease;
  min-height: 42px;
  min-width: 42px;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.top-bar-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.top-bar-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  min-height: 38px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #10b981, #047857);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border-color: var(--border-highlight);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 34px;
}

/* Tab View Content */
.tab-content {
  padding: 24px 28px;
  display: none;
  max-width: 1300px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

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

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
  width: 100%;
  min-width: 0;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  margin-bottom: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin-bottom: 14px;
}

.chat-card-container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 560px;
  box-sizing: border-box;
}

.chat-persona-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chat-suggested-prompts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

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

.stat-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  font-size: 1.2rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-green { background-color: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.badge-blue { background-color: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.badge-amber { background-color: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.badge-rose { background-color: rgba(244, 63, 94, 0.2); color: var(--accent-rose); }
.badge-purple { background-color: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.badge-cyan { background-color: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }

/* Coach Insights Box */
.coach-insight-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.08);
}

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

.coach-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--accent-cyan);
  color: #0f172a;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.coach-insight-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* Injury Banner */
.injury-banner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.05));
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.injury-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.injury-banner-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.injury-banner-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-rose);
}

.injury-banner-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tables with Touch-Friendly Horizontal Scroll */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.card-table {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 620px;
}

th {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.modal-card, .modal-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: max-width 0.2s ease;
}

/* Wide Modals for Analytics & Workouts on Desktop */
.modal-box-wide, .modal-card-wide, #activityDetailModal .modal-box, #activityDetailModal .modal-card {
  max-width: min(94vw, 1140px);
}

/* Modal Summary Stats Grid */
.modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  margin-bottom: 20px;
}

#mapContainer {
  height: 280px;
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

@media (max-width: 960px) {
  .modal-summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .chart-wrapper {
    height: 270px;
  }
  #mapContainer {
    height: 240px;
  }
}

@media (max-width: 600px) {
  .modal-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .modal-box-wide, .modal-card-wide, #activityDetailModal .modal-box {
    padding: 18px 14px;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: sticky;
  top: -28px;
  background-color: var(--bg-secondary);
  padding-top: 4px;
  padding-bottom: 10px;
  z-index: 10;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  min-height: 42px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-green);
}

/* Section Titles */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Charts */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  margin-bottom: 20px;
}

#mapContainer {
  height: 260px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  overflow: hidden;
}

/* Heart Rate Zones Distribution Bar */
.zone-bar-container {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--border-subtle);
  margin-top: 8px;
}

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

.zone-z1 { background-color: #38bdf8; }
.zone-z2 { background-color: #10b981; }
.zone-z3 { background-color: #f59e0b; }
.zone-z4 { background-color: #f97316; }
.zone-z5 { background-color: #ef4444; }

/* Drag & Drop File Zone */
.dropzone {
  border: 2px dashed var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-green);
  background-color: rgba(16, 185, 129, 0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent-cyan);
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   RESPONSIVE & MOBILE DESIGN SYSTEM
   ========================================================================== */

/* Desktop Collapsed Sidebar Mode (> 900px) */
@media (min-width: 901px) {
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-text,
  body.sidebar-collapsed .nav-badge,
  body.sidebar-collapsed .user-info,
  body.sidebar-collapsed .user-snippet button {
    display: none;
  }
  body.sidebar-collapsed .nav-item button {
    justify-content: center;
    padding: 12px 0;
  }
  body.sidebar-collapsed .user-snippet {
    justify-content: center;
    padding: 12px 0;
  }
}

/* Tablet & Mobile Breakpoint (<= 900px) */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    z-index: 150;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }

  .top-bar {
    padding: 10px 16px;
    min-height: 58px;
  }

  .tab-content {
    padding: 18px 14px;
  }

  .top-bar-btn-desktop {
    display: none !important;
  }

  /* Make Garmin multi-column card span 1 col on mobile */
  [style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }
}

/* Mobile Bottom Navigation Bar Base Styles */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(9, 13, 22, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 85;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mobile-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.mobile-nav-btn.active {
  color: var(--accent-green);
}

.mobile-nav-btn.active .mobile-nav-label {
  color: var(--accent-green);
}

/* Smartphone Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .top-bar {
    padding: 8px 12px;
    min-height: 54px;
    gap: 8px;
  }

  .top-bar-title h2 {
    font-size: 1.0rem;
  }

  .top-bar-title p {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .form-row-3, .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  #chatTab {
    padding: 8px 8px 70px 8px;
  }

  .chat-card-container {
    height: calc(100dvh - 130px);
    min-height: 440px;
    padding: 12px 10px;
  }

  .chat-header-desc {
    display: none;
  }

  .chat-persona-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-top: 8px;
  }

  .chat-persona-btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.76rem !important;
    padding: 5px 10px !important;
  }

  .chat-suggested-prompts {
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-bottom: 8px;
  }

  .chat-suggested-prompts button {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .main-content {
    padding-bottom: 74px;
  }

  .stat-card {
    padding: 16px 14px;
  }

  .stat-card-value {
    font-size: 1.45rem;
  }

  .injury-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }

  .injury-banner-content {
    gap: 10px;
  }

  .modal-card {
    padding: 16px 12px;
    max-height: 94dvh;
    border-radius: var(--radius-lg);
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .weekly-card {
    padding: 12px 10px;
  }

  .weekly-title {
    font-size: 0.88rem;
  }

  .sport-pill {
    font-size: 0.74rem;
    padding: 3px 6px;
  }

  .hr-zone-legend {
    font-size: 0.70rem;
    gap: 6px 8px;
  }
}

/* Small Smartphone Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .top-bar {
    padding: 6px 10px;
  }
  .sidebar-toggle-btn {
    min-height: 38px;
    min-width: 38px;
    font-size: 1.15rem;
    padding: 6px 8px;
  }
  .tab-content {
    padding: 12px 8px;
  }
  .stat-card {
    padding: 14px 10px;
  }
}

/* Weekly Training & HR Zone Distribution Styles */
.weekly-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}

.weekly-card:hover {
  border-color: var(--border-highlight);
}

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

.weekly-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.weekly-sport-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sport-pill {
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.sport-pill strong {
  color: var(--text-primary);
}

.hr-stacked-bar {
  display: flex;
  height: 16px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

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

.hr-seg-z1 { background-color: #38bdf8; }
.hr-seg-z2 { background-color: #10b981; }
.hr-seg-z3 { background-color: #f59e0b; }
.hr-seg-z4 { background-color: #f97316; }
.hr-seg-z5 { background-color: #ef4444; }

.hr-zone-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hr-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Day Selector Chips */
.day-chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.day-chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.day-chip-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.day-chip-btn.active-workout {
  background: rgba(168, 85, 247, 0.18);
  border-color: #c084fc;
  color: #d8b4fe;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.day-chip-btn.active-crosstrain {
  background: rgba(16, 185, 129, 0.18);
  border-color: #34d399;
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.day-chip-btn.active-rest {
  background: rgba(100, 116, 139, 0.25);
  border-color: #94a3b8;
  color: #cbd5e1;
}

/* Wizard Steps & Preview */
.wizard-steps-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.wizard-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.wizard-step-node.active {
  color: var(--accent-cyan);
}

.wizard-step-node.completed {
  color: var(--accent-green);
}

.wizard-step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.wizard-step-node.active .wizard-step-badge {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.wizard-step-node.completed .wizard-step-badge {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.phase-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.phase-card-title {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

/* Macrocycle Multi-Week Schedule Accordion */
.macro-week-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.macro-week-card:hover {
  border-color: var(--border-strong);
}

.macro-week-card.current-week {
  border-left: 4px solid var(--accent-cyan);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.12);
}

.macro-week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
  gap: 12px;
  flex-wrap: wrap;
}

.macro-week-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.macro-week-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.macro-week-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.macro-week-chevron {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
  display: inline-block;
}

.macro-week-card.expanded .macro-week-chevron {
  transform: rotate(180deg);
}

.macro-week-body {
  padding: 0 16px 16px 16px;
  display: none;
}

.macro-week-card.expanded .macro-week-body {
  display: block;
}