/* FitPulse PWA Modern Fitness Stylesheet */
:root {
  --bg-main: #0b1120;
  --bg-surface: #131d33;
  --bg-card: #1e293b;
  --bg-card-hover: #27354f;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --primary-dark: #0284c7;
  
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.25);
  --emerald: #10b981;
  --amber: #f59e0b;
  --purple: #a855f7;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 520px; /* Mobile app container */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.6);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(19, 29, 51, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fca5a5;
}

/* Main Views */
.app-main {
  flex: 1;
  padding: 16px 16px 90px 16px; /* Bottom space for nav */
  overflow-y: auto;
}

.view-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* Typography & Headings */
.view-heading {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 6px;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.view-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.subsection-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 20px 0 12px;
  color: var(--text-main);
}

/* Pills & Badges */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill-primary { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.pill-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.pill-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.pill-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.btn-outline:active { background: rgba(56, 189, 248, 0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text-main); }

.btn-danger-outline {
  background: transparent;
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 8px; font-size: 0.72rem; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.1); }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card-headline {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 4px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
}

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

/* 1. Hero Calorie Card */
.hero-calorie-card {
  background: linear-gradient(160deg, #1e293b 0%, #172033 100%);
  position: relative;
  overflow: hidden;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.calorie-visual-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 20px;
  gap: 16px;
}

.circle-progress-box {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.5s ease;
}

.circle-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.circle-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.circle-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.circle-unit {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.calorie-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-stat-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}
.dot-target { background: #64748b; }
.dot-consumed { background: var(--amber); }
.dot-burned { background: var(--rose); }

.stat-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Macros Bar */
.macros-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.macro-cell {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.macro-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
}

.macro-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.macro-ratio {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.fill-rose { background: var(--rose); }
.fill-amber { background: var(--amber); }
.fill-emerald { background: var(--emerald); }

/* Quick Action Tiles */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.action-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.action-tile:active { transform: scale(0.96); background: var(--bg-card-hover); }

.tile-icon {
  font-size: 1.6rem;
}

.tile-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.tile-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

/* Water Hydration Card */
.water-card {
  background: linear-gradient(145deg, #13253b, #19273c);
  border-color: rgba(6, 182, 212, 0.2);
}

.water-amount-badge {
  font-size: 0.9rem;
  font-weight: 700;
  color: #38bdf8;
}

.water-bar-track {
  height: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.water-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.water-quick-buttons {
  display: flex;
  gap: 8px;
}

/* Filter Scroll Pills */
.filter-scroll-wrapper {
  overflow-x: auto;
  margin: 0 -16px 14px -16px;
  padding: 0 16px;
  scrollbar-width: none;
}
.filter-scroll-wrapper::-webkit-scrollbar { display: none; }

.filter-pills {
  display: flex;
  gap: 8px;
  width: max-content;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pill-btn.active {
  background: var(--primary);
  color: #0b1120;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Workout Preset Banners */
.routines-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0 -16px 20px -16px;
  padding: 4px 16px 10px 16px;
  scrollbar-width: none;
}
.routines-strip::-webkit-scrollbar { display: none; }

.routine-banner {
  flex: 0 0 240px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.routine-banner:active { transform: scale(0.98); }

.routine-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.routine-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.routine-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.banner-chest { border-color: rgba(244, 63, 94, 0.3); }
.banner-chest .routine-badge { color: var(--rose); }

.banner-abs { border-color: rgba(16, 185, 129, 0.3); }
.banner-abs .routine-badge { color: var(--emerald); }

/* Exercise Grid Cards */
.exercise-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 8px 16px;
}

.exercise-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.exercise-body-split {
  display: flex;
  padding: 0 16px 14px 16px;
  gap: 14px;
  align-items: center;
}

.exercise-visual-thumb {
  width: 110px;
  height: 95px;
  background: #0f172a;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.exercise-info-col {
  flex: 1;
}

.exercise-meta-row {
  display: flex;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.exercise-tip-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 10px;
}

.exercise-card-actions {
  display: flex;
  gap: 8px;
}

/* Workout Stage Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  background: var(--bg-surface);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 4px;
}

.btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-visual-stage {
  width: 100%;
  height: 200px;
  background: #090e1a;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.player-timer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

.player-countdown {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.player-timer-unit {
  font-size: 0.85rem;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.player-form-cue {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #e2e8f0;
  text-align: center;
  margin-bottom: 20px;
  border-left: 3px solid var(--rose);
}

.player-controls-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.player-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-sound-toggle {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Scanner & Photo Viewport */
.scanner-trigger-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #132b45, #1e293b);
  border: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
}
.scanner-trigger-card:active { transform: scale(0.98); }

.scan-camera-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-text-box {
  flex: 1;
}

.scan-cta-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.scan-cta-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.scanner-viewport {
  width: 100%;
  height: 240px;
  background: #090e1a;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(56, 189, 248, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.scanner-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
}
.scanner-placeholder p {
  margin-top: 10px;
  font-size: 0.85rem;
}

#photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8, 0 0 24px #38bdf8;
  animation: scanLaser 1.5s infinite alternate ease-in-out;
}

@keyframes scanLaser {
  0% { top: 5%; opacity: 0.8; }
  100% { top: 92%; opacity: 0.9; }
}

.scanner-buttons-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.file-input-label {
  width: 100%;
  position: relative;
  overflow: hidden;
}
.file-input-label input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.scan-results-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.results-header {
  margin-bottom: 12px;
}

.match-tag {
  font-size: 0.7rem;
  color: var(--emerald);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#detected-dish-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.portion-selector-row, .meal-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.portion-selector-row select, .meal-target-row select {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.macro-chips-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.macro-chip {
  background: var(--bg-card);
  padding: 8px 6px;
  border-radius: var(--radius-md);
  text-align: center;
}

.chip-val {
  font-size: 1rem;
  font-weight: 800;
  display: block;
}

.chip-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.chip-cal .chip-val { color: var(--primary); }
.chip-pro .chip-val { color: var(--rose); }
.chip-carb .chip-val { color: var(--amber); }
.chip-fat .chip-val { color: var(--emerald); }

.alt-matches-row {
  margin-bottom: 16px;
}
.alt-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}
.alt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alt-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
}
.alt-pill:hover { background: rgba(56, 189, 248, 0.2); border-color: var(--primary); }

/* Search & Food Logging */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.search-input-wrapper input {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.9rem;
}
.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.food-search-results {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.food-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
}
.food-res-name {
  font-size: 0.9rem;
  font-weight: 600;
}
.food-res-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.custom-food-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.custom-food-form {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.2);
  padding: 14px;
  border-radius: var(--radius-md);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.form-group.full-width { grid-column: span 2; }

.form-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.form-group input, .form-group select {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Daily Food Diary */
.daily-diary-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 4px;
}

.diary-total-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.diary-meal-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.meal-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.meal-name {
  font-size: 0.9rem;
  font-weight: 700;
}
.meal-subtotal {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.diary-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.entry-title {
  font-size: 0.85rem;
  font-weight: 600;
}
.entry-macros {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.btn-del-entry {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
}

.empty-meal-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 4px 0;
}

/* Diet Plans Cards */
.meal-plans-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

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

.plan-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.plan-card-macros {
  font-size: 0.8rem;
  color: var(--emerald);
  font-weight: 700;
}

.plan-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.plan-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #cbd5e1;
}

/* Profile & Calc Results */
.calc-results-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.calc-res-item {
  text-align: center;
}
.res-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}
.res-val {
  font-size: 0.95rem;
  font-weight: 800;
}
.calc-res-item.highlight .res-val {
  color: var(--primary);
  font-size: 1.05rem;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  background: rgba(19, 29, 51, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px 14px 12px;
  z-index: 50;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.15s ease;
  padding: 4px 8px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  stroke: var(--primary);
  transform: translateY(-2px);
}

/* Exercise Animated SVGs & Keyframes */
@keyframes pushupMotion {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}
@keyframes squatMotion {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(22px) scaleY(0.78); }
}
@keyframes jumpingJacksMotion {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(2deg); }
}
@keyframes plankPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; filter: drop-shadow(0 0 6px #f43f5e); }
}
@keyframes gluteBridgeMotion {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
@keyframes crunchMotion {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-18deg); }
}

.anim-pushup { animation: pushupMotion 1.8s infinite ease-in-out; transform-origin: center bottom; }
.anim-squat { animation: squatMotion 2s infinite ease-in-out; transform-origin: center bottom; }
.anim-jumping-jacks { animation: jumpingJacksMotion 1.2s infinite ease-in-out; transform-origin: center center; }
.anim-plank { animation: plankPulse 1.6s infinite ease-in-out; }
.anim-bridge { animation: gluteBridgeMotion 2s infinite ease-in-out; transform-origin: center center; }
.anim-crunch { animation: crunchMotion 1.8s infinite ease-in-out; transform-origin: left bottom; }

/* Celebration */
.celebration-sheet {
  text-align: center;
  padding: 30px 20px;
}
.celeb-trophy { font-size: 3.5rem; margin-bottom: 8px; }
.celeb-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.celeb-sub { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; }
.celeb-stats-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 24px;
}
.celeb-stat {
  display: flex;
  flex-direction: column;
}
.c-val { font-size: 1.8rem; font-weight: 900; color: var(--emerald); }
.c-lbl { font-size: 0.75rem; color: var(--text-muted); }

/* 60FPS Biomechanical Canvas & Stage Controls */
.exercise-visual-thumb {
  width: 120px;
  height: 104px;
  background: radial-gradient(circle at 50% 40%, #172542 0%, #090e1a 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.thumb-canvas {
  width: 120px;
  height: 104px;
  display: block;
}

.exercise-visual-stage {
  width: 100%;
  height: 230px;
  background: radial-gradient(circle at 50% 35%, #172542 0%, #090d16 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.75);
}

.stage-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-overlay-top {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.phase-cue-badge {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.muscle-target-badge {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.stage-overlay-bottom {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.btn-stage-ctrl {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-stage-ctrl.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #38bdf8;
}
