@import url('tokens.generated.css');

/* PHNX PT — Mythic Terminal Design System v1.0
   Hades 2 × Neo-Oriental Tattoo × Cyberpunk HUD
   ================================================
   Core design tokens (--bg-*, --flame*, --gold*, --text-*, nutrition,
   training, wellness, system, --border*, --font-mono) now come from
   tokens.generated.css (single source of truth: design-system/tokens.json).
   Props kept below are webapp-local and NOT provided by the generated file. */

:root {
  /* Legacy/local aliases not in the generated token set */
  --accent:         #D4AF37;
  --bg:             #0D0D0F;
  --text:           #F5F5F7;

  /* Tab Accents (semantic color per surface) */
  --accent-dashboard: #FF6B2B;
  --accent-nutrition: #22C55E;
  --accent-training:  #3B82F6;
  --accent-more:      #FFB347;

  /* Semantic glow variants (for multi-color cards) */
  --glow-flame:     rgba(255, 107, 43, 0.10);
  --glow-green:     rgba(34, 197, 94, 0.10);
  --glow-blue:      rgba(59, 130, 246, 0.10);
  --glow-gold:      rgba(255, 179, 71, 0.10);
  --glow-purple:    rgba(168, 85, 247, 0.10);
  --glow-red:       rgba(239, 68, 68, 0.10);
  --glow-cyan:      rgba(6, 182, 212, 0.10);
  --glow-indigo:    rgba(99, 102, 241, 0.10);

  /* Fonts — --font-body is the webapp-local body alias (generated file
     exposes --font-sans); keep to preserve every existing consumer. */
  --font-body:      'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing — webapp-local scale (md/lg/xl differ from generated; keeping
     preserves live spacing values — no visual change). */
  --space-xs:       4px;
  --space-sm:       8px;
  --space-md:       16px;
  --space-lg:       24px;
  --space-xl:       32px;
}

/* ========== RESET & BASE ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
  /* Surgical Terminal grid underlay */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
}

/* Utility classes */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 0;
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* ========== SCREENS ========== */
.screen {
  display: none;
  padding: 0 var(--space-md) 20px;
  animation: fadeIn 0.25s ease;
}
.screen.active { display: block; }
/* Main screen uses strip layout — no padding, overflow hidden, full viewport height */
#main.screen { padding: 0; overflow: hidden; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }

/* ========== LOADING — Terminal Skeleton ========== */
#loading {
  display: none;
  flex-direction: column;
  padding: var(--space-md);
  padding-top: var(--space-xl);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--bg-primary);
}
#loading.active { display: flex; }

.skeleton-container { display: flex; flex-direction: column; gap: 12px; }

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 12px;
  background: var(--bg-elevated);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.skeleton-line.tall { height: 32px; }
.skeleton-line.w30 { width: 30%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w100 { width: 100%; }
.skeleton-greeting { height: 20px; width: 55%; margin-bottom: 4px; }

/* Terminal scan-line shimmer — multi-color sweep */
.skeleton-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,107,43,0.06), rgba(34,197,94,0.04), rgba(59,130,246,0.04), transparent);
  animation: scanline 1.4s ease-in-out infinite;
}
@keyframes scanline { to { left: 100%; } }

/* Legacy spinner (kept for fallback) */
.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--bg-elevated);
  border-top-color: var(--flame);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== GREETING HEADER ========== */
.greeting-header {
  padding: var(--space-md) 0 var(--space-sm);
}
.greeting-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.greeting-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.surface-intro {
  padding: var(--space-md) 0 var(--space-sm);
}

.surface-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--tab-accent, var(--text-tertiary));
  text-transform: uppercase;
  margin-bottom: 6px;
}

.surface-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
}

.surface-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== CARDS (Mythic Terminal) ========== */
/* ============================================
   SURGICAL TERMINAL CARD SYSTEM
   Gradient borders, inner radial lift, etched edges.
   Uses ::before pseudo-element for gradient border
   since border-image doesn't respect border-radius.
   ============================================ */
.card {
  position: relative;
  padding: var(--space-md);
  margin-bottom: 10px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.015), transparent 60%),
    var(--bg-card);
  border: none;
  border-radius: 10px;
  transition: all 0.15s ease;
  z-index: 0;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 43, 0.25) 0%,
    rgba(168, 85, 247, 0.15) 40%,
    rgba(59, 130, 246, 0.10) 70%,
    rgba(255, 255, 255, 0.04) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}
.card:last-child { margin-bottom: 0; }

/* Card hierarchy tiers */
.card.card-hero {
  background:
    radial-gradient(ellipse at top right, rgba(255, 107, 43, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(168, 85, 247, 0.05), transparent 50%),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.02), transparent 60%),
    var(--bg-card);
  box-shadow: 0 4px 24px rgba(255, 107, 43, 0.06), 0 0 0 0 transparent;
}
.card.card-hero::before {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 43, 0.40) 0%,
    rgba(255, 179, 71, 0.20) 25%,
    rgba(168, 85, 247, 0.20) 50%,
    rgba(59, 130, 246, 0.15) 75%,
    rgba(255, 255, 255, 0.06) 100%
  );
}
.card.card-recessed {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.008), transparent 60%),
    var(--bg-secondary);
}
.card.card-recessed::before {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}

/* Interactive card press state */
.card[onclick],
.card .training-section-header {
  -webkit-tap-highlight-color: transparent;
}
.card[onclick]:active {
  transform: scale(0.985);
  background: var(--bg-elevated);
}

/* Hand-etched dividers — Surgical Terminal style */
.card-group-divider {
  height: 1px;
  margin: 14px 0 10px;
  background: linear-gradient(90deg,
    rgba(255, 107, 43, 0.30) 0%,
    rgba(168, 85, 247, 0.15) 35%,
    rgba(59, 130, 246, 0.10) 60%,
    transparent 100%
  );
}

/* Generic etched line — reusable */
.etched-line {
  height: 1px;
  background: linear-gradient(90deg,
    rgba(255, 107, 43, 0.20) 0%,
    rgba(168, 85, 247, 0.10) 50%,
    transparent 100%
  );
  margin: 10px 0;
}

/* Etched section labels — Surgical Terminal aesthetic */
.card-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
  background-image: linear-gradient(90deg,
    rgba(255, 107, 43, 0.20) 0%,
    rgba(168, 85, 247, 0.12) 50%,
    transparent 100%
  );
  background-size: 100% 1px;
  background-position: bottom left;
  background-repeat: no-repeat;
}

.card-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 12px;
  text-align: center;
}

.surface-section {
  margin-top: 28px;
  padding-top: 4px;
}

/* Surface section headings — etched gradient underline */
.surface-section-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--tab-accent, var(--text-secondary));
  text-transform: uppercase;
  margin: 0 0 10px;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background-image: linear-gradient(90deg,
    rgba(255, 107, 43, 0.18) 0%,
    rgba(168, 85, 247, 0.10) 50%,
    transparent 100%
  );
  background-size: 100% 1px;
  background-position: bottom left;
  background-repeat: no-repeat;
}

.surface-section-heading::after {
  content: '▾';
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.3s ease;
}

.surface-section.collapsed .surface-section-heading::after {
  transform: rotate(-90deg);
}

.surface-section-body {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  max-height: 5000px;
  opacity: 1;
}

.surface-section.collapsed .surface-section-body {
  max-height: 0;
  opacity: 0;
}

.surface-section-copy {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.more-jump-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.more-jump-rail::-webkit-scrollbar {
  display: none;
}

.more-jump-btn {
  position: relative;
  flex: 0 0 auto;
  border: none;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.02), transparent 60%),
    var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 0;
}
.more-jump-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.20) 0%, rgba(255, 255, 255, 0.06) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

.more-jump-btn:hover,
.more-jump-btn:active {
  color: var(--gold);
  background: rgba(255, 179, 71, 0.06);
}
.more-jump-btn:hover::before,
.more-jump-btn:active::before {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.40) 0%, rgba(168, 85, 247, 0.15) 100%);
}

.more-review-grid,
.more-ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* More tab inner tiles — gradient border with accent top edge */
.more-review-item,
.more-ops-item {
  position: relative;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background:
    radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.015), transparent 60%),
    var(--bg-secondary);
  z-index: 0;
}
.more-review-item::before,
.more-ops-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1px;
  background: linear-gradient(
    180deg,
    var(--item-color, rgba(255, 255, 255, 0.08)) 0%,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(255, 255, 255, 0.02) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* Semantic review item colors */
.item-sessions  { --item-color: var(--volume); }
.item-nutrition { --item-color: var(--protein); }
.item-streak    { --item-color: var(--gold); }
.item-weight    { --item-color: var(--text-primary); }
.item-cardio    { --item-color: var(--cardio); }
.item-sleep     { --item-color: var(--sleep); }

.more-review-label,
.more-ops-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.more-review-value,
.more-ops-value {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.more-review-note {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.more-ops-actions {
  margin-top: 12px;
}

.chart-insight {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

/* ========== DASHBOARD ========== */
.dashboard-mission-card {
  background:
    radial-gradient(ellipse at top right, rgba(255, 107, 43, 0.10), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(168, 85, 247, 0.06), transparent 50%),
    radial-gradient(ellipse at top left, rgba(59, 130, 246, 0.04), transparent 40%),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.02), transparent 60%),
    var(--bg-card);
}

.dashboard-mission-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--flame);
  line-height: 1;
  margin-bottom: 8px;
}

/* Semantic mission value coloring — JS adds these classes */
.dashboard-mission-value.color-fuel    { color: var(--cal); }
.dashboard-mission-value.color-session { color: var(--volume); }
.dashboard-mission-value.color-streak  { color: var(--gold); }
.dashboard-mission-value.color-recovery { color: var(--recovery); }

.dashboard-mission-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dashboard-mission-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  z-index: 0;
}
.dashboard-mission-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

.dashboard-mission-chip.strong { color: var(--flame); }
.dashboard-mission-chip.strong::before { background: linear-gradient(135deg, rgba(255,107,43,0.40) 0%, rgba(255,107,43,0.10) 100%); }

/* Semantic chip colors — accent gradient borders */
.dashboard-mission-chip.chip-fuel    { color: var(--cal); }
.dashboard-mission-chip.chip-fuel::before    { background: linear-gradient(135deg, rgba(255,107,43,0.30) 0%, rgba(255,107,43,0.06) 100%); }
.dashboard-mission-chip.chip-session { color: var(--volume); }
.dashboard-mission-chip.chip-session::before { background: linear-gradient(135deg, rgba(59,130,246,0.30) 0%, rgba(59,130,246,0.06) 100%); }
.dashboard-mission-chip.chip-streak  { color: var(--gold); }
.dashboard-mission-chip.chip-streak::before  { background: linear-gradient(135deg, rgba(255,179,71,0.30) 0%, rgba(255,179,71,0.06) 100%); }
.dashboard-mission-chip.chip-meals   { color: var(--protein); }
.dashboard-mission-chip.chip-meals::before   { background: linear-gradient(135deg, rgba(34,197,94,0.30) 0%, rgba(34,197,94,0.06) 100%); }
.dashboard-mission-chip.chip-cardio  { color: var(--cardio); }
.dashboard-mission-chip.chip-cardio::before  { background: linear-gradient(135deg, rgba(6,182,212,0.30) 0%, rgba(6,182,212,0.06) 100%); }

.dashboard-mission-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.dashboard-mission-subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-mission-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dashboard-status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Inner tiles: individual accent glow borders */
.dashboard-status-segment {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background:
    radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.015), transparent 60%),
    var(--bg-secondary);
  border-radius: 6px;
  min-width: 0;
  z-index: 0;
}
.dashboard-status-segment::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    var(--segment-color, rgba(255, 255, 255, 0.08)) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

/* Semantic status segment colors */
.dashboard-status-segment.seg-sessions  { --segment-color: var(--volume); }
.dashboard-status-segment.seg-nutrition { --segment-color: var(--protein); }
.dashboard-status-segment.seg-streak    { --segment-color: var(--gold); }
.dashboard-status-segment.seg-package   { --segment-color: var(--flame); }
.dashboard-status-segment.seg-cardio    { --segment-color: var(--cardio); }
.dashboard-status-segment.seg-sleep     { --segment-color: var(--sleep); }
.dashboard-status-segment.seg-weight    { --segment-color: var(--text-primary); }

.dashboard-status-key {
  font-size: 14px;
  line-height: 1;
}

.dashboard-status-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.dashboard-status-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.dashboard-package-alert {
  border-color: rgba(255, 179, 71, 0.35);
}

.dashboard-package-alert-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ========== NUTRITION HERO CARD ========== */
.nutrition-card {
  text-align: center;
  background:
    radial-gradient(ellipse at top right, rgba(34, 197, 94, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(168, 85, 247, 0.05), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(251, 191, 36, 0.04), transparent 40%),
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.015), transparent 60%),
    var(--bg-card);
}
.nutrition-card::before {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.30) 0%,
    rgba(168, 85, 247, 0.15) 40%,
    rgba(251, 191, 36, 0.10) 70%,
    rgba(255, 255, 255, 0.04) 100%
  ) !important;
}

.nutrition-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.nutrition-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.nutrition-chip.strong {
  border-color: rgba(255, 107, 43, 0.35);
  color: var(--cal);
}

.nutrition-chip.chip-meals {
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--protein);
}

.nutrition-chip.chip-target {
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--carbs);
}

.nutrition-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.kcal-remaining {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--cal);
  line-height: 1;
  margin-bottom: 4px;
}

.kcal-remaining.under {
  color: var(--cal);
}

.kcal-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* Main calorie progress bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  background: var(--cal);
}

.progress-pct {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

/* Individual macro bars */
.macro-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.macro-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.macro-bar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.macro-bar-label.protein { color: var(--protein); }
.macro-bar-label.carbs   { color: var(--carbs); }
.macro-bar-label.fat     { color: var(--fat); }

.macro-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.macro-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.macro-bar-fill.protein { background: var(--protein); }
.macro-bar-fill.carbs   { background: var(--carbs); }
.macro-bar-fill.fat     { background: var(--fat); }

.macro-bar-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.meals-logged {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-top: 12px;
  letter-spacing: 0.5px;
}

.nutrition-status-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.nutrition-insight-panel {
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-left: 2px solid var(--protein);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.04), transparent 60%),
    var(--bg-secondary);
  border-radius: 0 6px 6px 0;
  text-align: left;
}

.nutrition-insight-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.nutrition-insight-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.nutrition-ledger-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  line-height: 1.5;
}

.nutrition-day-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.nutrition-meal-item {
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 2px solid var(--cal);
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  padding: 10px 12px;
}

.nutrition-meal-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.nutrition-meal-type {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--cal);
}

.nutrition-meal-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nutrition-meal-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.meal-delete-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}

.meal-delete-btn:hover {
  color: #e74c3c;
  border-color: rgba(231,76,60,0.3);
  background: rgba(231,76,60,0.08);
}

.meal-delete-btn:active {
  background: rgba(231,76,60,0.15);
}

.meal-edit-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}

.meal-edit-btn:hover {
  color: var(--tab-accent, var(--cal));
  border-color: rgba(255,107,43,0.3);
  background: rgba(255,107,43,0.08);
}

.nutrition-meal-item.editing {
  border-color: rgba(255,107,43,0.2);
}

.meal-edit-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.meal-edit-desc-row {
  margin-bottom: 8px;
}

.meal-edit-desc-row label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.meal-edit-desc {
  width: 100%;
  box-sizing: border-box;
}

.meal-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.meal-edit-field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}

.meal-edit-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 8px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.meal-edit-input:focus {
  outline: none;
  border-color: var(--tab-accent, var(--cal));
}

.meal-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.meal-edit-cancel, .meal-edit-save {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.meal-edit-cancel {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.meal-edit-cancel:hover {
  background: rgba(255,255,255,0.1);
}

.meal-edit-save {
  background: var(--tab-accent, var(--cal));
  color: #0a0a0f;
  font-weight: 600;
}

.meal-edit-save:hover {
  opacity: 0.85;
}

.meal-edit-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nutrition-meal-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.nutrition-meal-macros {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.nutrition-meal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.nutrition-meal-kcal {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--cal);
}

.nutrition-meal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nutrition-meal-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.nutrition-meal-tag.protein { color: var(--protein); background: rgba(34, 197, 94, 0.10); }
.nutrition-meal-tag.carbs   { color: var(--carbs); background: rgba(251, 191, 36, 0.10); }
.nutrition-meal-tag.fat     { color: var(--fat); background: rgba(168, 85, 247, 0.10); }



/* ========== SESSIONS & THIS WEEK ========== */
.sessions-summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
}

.stat-emoji { font-size: 20px; }

.next-session {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--flame-glow);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.session-list { margin-bottom: 12px; }

.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.session-row:last-child { border-bottom: none; }

.session-date-block {
  min-width: 40px;
  text-align: center;
}

.sday {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.snum {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--volume);
}

.session-info { flex: 1; }

.stime {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.slabel {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
}

.session-cancel-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.session-cancel-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ========== STREAKS ========== */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.streak-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.streak-emoji { font-size: 18px; margin-bottom: 6px; }

.streak-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--flame);
  margin-bottom: 2px;
}

/* Semantic streak colors — each streak type has its god-color */
.streak-item.streak-checkin .streak-val  { color: var(--flame); }
.streak-item.streak-nutrition .streak-val { color: var(--protein); }
.streak-item.streak-training .streak-val  { color: var(--volume); }

.streak-item.streak-checkin  { border-color: rgba(255, 107, 43, 0.20); }
.streak-item.streak-nutrition { border-color: rgba(34, 197, 94, 0.20); }
.streak-item.streak-training  { border-color: rgba(59, 130, 246, 0.20); }

.streak-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== PACKAGES LIST (Home) ========== */
.package-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.package-row:last-child { border-bottom: none; }

.pkg-name {
  font-size: 13px;
  color: var(--text-primary);
}

.pkg-count {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.pkg-count.low { color: var(--danger); }

.system-card-hint {
  text-align: left;
}

/* ========== SYSTEM STATUS BAR ========== */
.system-status-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  margin-top: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.status-dot.offline { background: var(--danger); }
.status-dot.syncing { background: var(--info); animation: pulse 1.5s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ========== BUTTONS ========== */
/* Surgical Terminal button system */
.btn-accent {
  display: inline-block;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--flame) 0%, var(--flame-bright) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  box-shadow: 0 2px 12px rgba(255, 107, 43, 0.20);
}
.btn-accent:hover {
  background: linear-gradient(135deg, var(--flame-bright) 0%, var(--gold) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 43, 0.30);
}
.btn-accent:active {
  background: var(--flame-deep);
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(255, 107, 43, 0.15);
}

/* Ghost button with gradient border */
.btn-ghost {
  position: relative;
  display: inline-block;
  padding: 10px 16px;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.02), transparent 60%),
    var(--bg-elevated);
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
  z-index: 0;
}
.btn-ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 43, 0.18) 0%,
    rgba(255, 255, 255, 0.06) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}
.btn-ghost:hover { color: var(--flame); }
.btn-ghost:hover::before {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 43, 0.35) 0%,
    rgba(168, 85, 247, 0.15) 100%
  );
}

.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-full { width: 100%; padding: 12px; margin-top: 12px; }

.btn-back {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}
.btn-back:hover { color: var(--flame); }

.secondary-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.secondary-actions .btn-ghost { flex: 1; min-width: 120px; }

/* ========== MAKEUP ========== */
.makeup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.makeup-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ========== HEADER ========== */
.header { padding: var(--space-md) 0; margin-bottom: var(--space-md); }
.header.compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: var(--space-md);
}
.header.compact h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* ========== TAB BAR (Mythic Terminal) ========== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #0C0C0F;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-around;
  height: 72px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  transition: color 0.2s ease;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.2px;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}

.tab-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

/* Default active = flame */
.tab-item.active {
  color: var(--accent-dashboard);
}
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 0 0 2px 2px;
}
.tab-item.active svg {
  stroke-width: 2.2;
}
/* Per-tab active colors */
.tab-bar[data-active-tab="tabNutrition"] .tab-item.active { color: var(--accent-nutrition); }
.tab-bar[data-active-tab="tabTraining"]  .tab-item.active { color: var(--accent-training); }
.tab-bar[data-active-tab="tabMore"]      .tab-item.active { color: var(--accent-more); }

/* ═══ TAB PANEL STRIP — horizontal layout for swipe navigation ═══ */
.tab-panel-strip {
  display: flex;
  width: 400%;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.tab-panel-strip.swiping {
  transition: none; /* disable transition during finger-following */
}
.tab-content {
  width: 25%;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px));
  padding: 0 var(--space-md) 20px;
  box-sizing: border-box;
}
/* Remove legacy display toggle — strip handles visibility */
@media (prefers-reduced-motion: reduce) {
  .tab-panel-strip { transition: none; }
}

/* Per-tab accent color — cascade via CSS custom property */
#tabDashboard { --tab-accent: var(--accent-dashboard); --tab-accent-glow: rgba(255, 107, 43, 0.08); }
#tabNutrition { --tab-accent: var(--accent-nutrition); --tab-accent-glow: rgba(34, 197, 94, 0.08); }
#tabTraining  { --tab-accent: var(--accent-training);  --tab-accent-glow: rgba(59, 130, 246, 0.08); }
#tabMore      { --tab-accent: var(--accent-more);      --tab-accent-glow: rgba(255, 179, 71, 0.08); }

/* ========== CHARTS (Progress) ========== */
.chart-container {
  height: 200px;
  margin-bottom: 12px;
  position: relative;
}
.chart-container canvas { max-height: 200px; }

.empty-state {
  text-align: center;
  padding: 24px var(--space-md);
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ========== PROFILE (Account) ========== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-md);
}

.phoenix-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--flame), var(--gold), var(--flame-deep));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(255, 107, 43, 0.3), 0 0 32px rgba(255, 179, 71, 0.15);
}

.profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-subtitle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--flame);
  letter-spacing: 1px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: var(--space-md);
}

.profile-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.profile-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.profile-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}

.profile-value.cal     { color: var(--cal); }
.profile-value.protein { color: var(--protein); }
.profile-value.carbs   { color: var(--carbs); }
.profile-value.fat     { color: var(--fat); }

.profile-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.profile-goal {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.profile-goal:empty { display: none; }

/* Profile card top bar — label + edit toggle */
.profile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-card-top .card-label { margin-bottom: 0; }

.profile-edit-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 13px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}

.profile-edit-toggle:hover {
  color: var(--gold);
  border-color: rgba(255, 179, 71, 0.3);
  background: rgba(255, 179, 71, 0.08);
}

.profile-edit-toggle.active {
  color: var(--gold);
  border-color: rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.12);
}

/* Profile edit form */
.profile-edit-field {
  margin-bottom: 10px;
}

.profile-edit-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.profile-edit-field label.label-cal     { color: var(--cal); }
.profile-edit-field label.label-protein { color: var(--protein); }
.profile-edit-field label.label-carbs   { color: var(--carbs); }
.profile-edit-field label.label-fat     { color: var(--fat); }

.profile-edit-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.profile-edit-input:focus {
  outline: none;
  border-color: var(--gold);
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-edit-grid .profile-edit-field { margin-bottom: 0; }

.profile-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ========== BOOKING & DATES ========== */
.date-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: var(--space-sm) 0;
  margin-bottom: 12px;
  scroll-behavior: smooth;
}
.date-selector::-webkit-scrollbar { height: 3px; }
.date-selector::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 2px; }
.date-selector::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 2px; }

.date-option {
  min-width: 76px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 12px;
}
.date-option.selected {
  background: var(--flame);
  border-color: var(--flame);
  color: white;
}
.date-option-day, .date-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
  color: inherit;
}

/* ========== TIME GRID ========== */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.time-option, .time-slot {
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
.time-option:hover, .time-slot:hover { border-color: var(--flame); color: var(--flame); }
.time-option.selected, .time-slot.selected { background: var(--flame); border-color: var(--flame); color: white; }
.time-slot.disabled { opacity: 0.3; cursor: not-allowed; }

/* Booking hint prompt */
.booking-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: var(--space-md) 0;
  letter-spacing: 0.01em;
}

/* Slot loading spinner */
.loading-slots {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0;
}
.spinner-small {
  width: 22px;
  height: 22px;
  border: 2px solid var(--bg-elevated);
  border-top-color: var(--flame);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== CONFIRMATION ========== */
.confirmation-box {
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin-bottom: var(--space-md);
}

.confirm-date {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 4px;
}
.confirm-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--flame);
  font-size: 20px;
  margin-bottom: 4px;
}
.confirm-type {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========== PACKAGES GRID ========== */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: var(--space-md);
}

.package-card {
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.package-card:hover { border-color: var(--flame); transform: translateY(-2px); }
.package-card.popular { border-color: var(--flame); background: var(--flame-glow); }

.popular-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--flame);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.package-header h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0; }

.price {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--flame);
}

.per-session { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.savings { font-size: 12px; color: var(--success); font-weight: 600; }

/* ========== PAYMENT ========== */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 14px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}
.payment-option:hover { border-color: var(--text-tertiary); }

.payment-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--flame);
  flex-shrink: 0;
}

.payment-details { flex: 1; }
.payment-details strong { display: block; font-size: 14px; color: var(--text-primary); margin-bottom: 2px; }
.payment-details small { font-size: 12px; color: var(--text-tertiary); }

.instructions { list-style: none; padding: 0; margin-bottom: 12px; }
.instructions li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.instructions li strong { color: var(--text-primary); }

/* ========== SUCCESS ========== */
.success-animation { text-align: center; padding: 40px 20px 20px; }

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--flame), var(--gold), var(--flame-deep));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 24px rgba(255, 107, 43, 0.4), 0 0 48px rgba(255, 179, 71, 0.15);
}
@keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#successTitle { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
#successMessage { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* ========== PR LIST ========== */
.pr-list { margin-bottom: 12px; }

.pr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.pr-row:last-child { border-bottom: none; }

.pr-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  min-width: 20px;
}
.pr-exercise { color: var(--text-primary); font-weight: 500; flex: 1; }
.pr-weight {
  font-family: var(--font-mono);
  color: var(--strength);
  font-weight: 700;
}

/* ========== SVG ICON SYSTEM ========== */
/* Inline SVG icons inherit color from parent. Use color utilities to tint. */
.icon-xs svg { width: 14px; height: 14px; }
.icon-sm svg { width: 16px; height: 16px; }
.icon-md svg { width: 20px; height: 20px; }
.icon-lg svg { width: 24px; height: 24px; }
.icon-xl svg { width: 32px; height: 32px; }

.icon-flame    { color: var(--flame); }
.icon-success  { color: var(--success); }
.icon-volume   { color: var(--volume); }
.icon-cardio   { color: var(--cardio); }
.icon-recovery { color: var(--recovery); }
.icon-muted    { color: var(--text-tertiary); }
.icon-danger   { color: var(--danger); }
.icon-gold     { color: var(--gold); }

/* ========== TODAY CARD COMPLETION BANNER ========== */
.today-completion-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.today-completion-banner.all-done {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.today-completion-banner.partial-done {
  background: rgba(251, 191, 36, 0.08);
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.15);
}
.today-completion-banner svg {
  flex-shrink: 0;
}

/* Per-activity done indicator in Today card */
.training-activity-row .activity-done-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--success);
}
.training-activity-row .activity-done-badge.missed {
  color: var(--text-tertiary);
  opacity: 0.5;
}
.training-activity-row.is-completed .training-activity-title {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Strava activity pace + HR chips */
.strava-activity-pace {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--cardio);
  white-space: nowrap;
}
.strava-activity-hr {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.strava-activity-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

/* ========== TRAINING TAB ========== */
.training-empty-state { text-align: center; padding: 32px var(--space-md); }
.training-empty-icon { font-size: 40px; margin-bottom: 12px; }
.training-empty-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.training-empty-text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.empty-state-cta { display: inline-block; margin-top: 16px; padding: 10px 20px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-family: var(--font-mono); font-size: 14px; font-weight: 600; cursor: pointer; }
.empty-state-cta:active { opacity: 0.8; }

.training-today-header {
  padding: 2px 0 4px;
}

.training-today-day {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tab-accent, var(--text-tertiary));
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 6px;
}

.training-today-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.training-today-subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.training-today-activities {
  margin-top: 10px;
}

.training-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.training-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}

.training-activity-row:first-child {
  border-top: 1px solid var(--border-subtle);
}

.training-activity-emoji {
  font-size: 18px;
  line-height: 1;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.training-activity-copy {
  flex: 1;
  min-width: 0;
}

.training-activity-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.training-activity-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.training-activity-structure {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent);
  line-height: 1.45;
}
/* Collapsed by default in today card; tap row to expand */
.training-activity-row.collapsible .training-activity-structure {
  display: none;
}
.training-activity-row.collapsible.expanded .training-activity-structure {
  display: block;
}
.training-activity-row.collapsible {
  cursor: pointer;
}
/* Small expand hint chevron on collapsible rows */
.training-activity-expand-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
  transition: transform 0.2s ease;
  display: inline-block;
}
.training-activity-row.expanded .training-activity-expand-hint {
  transform: rotate(90deg);
}

.training-today-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Weekly Calendar Strip */
.weekly-calendar-strip {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 8px;
}

.weekly-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  background: var(--bg-secondary);
  min-width: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.weekly-day:hover { background: var(--bg-elevated); }

/* Schedule swap — long-press drag states */
.weekly-day.swap-source {
  opacity: 0.3;
  transform: scale(0.92);
}
.weekly-day.swap-target {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.weekly-day.swap-hover {
  box-shadow: 0 0 0 2px var(--flame), 0 0 16px rgba(255, 107, 43, 0.3);
  transform: scale(1.06);
  background: var(--bg-elevated);
}
.schedule-swap-ghost {
  opacity: 0.9;
  transform: scale(1.12);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--flame);
  transition: none !important;
  background: var(--bg-card) !important;
}

.weekly-day.is-today {
  box-shadow: 0 0 0 2px var(--volume), 0 0 12px rgba(59, 130, 246, 0.25);
  background: var(--bg-elevated);
}

/* Completed day — green glow (all activities done) */
.weekly-day.completed {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}
.weekly-day.is-today.completed {
  box-shadow: 0 0 0 2px var(--volume), 0 0 12px rgba(59, 130, 246, 0.25), inset 0 0 8px rgba(34, 197, 94, 0.1);
}

/* Partial day — amber glow (some activities done) */
.weekly-day.partial {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}
.weekly-day.is-today.partial {
  box-shadow: 0 0 0 2px var(--volume), 0 0 12px rgba(59, 130, 246, 0.25), inset 0 0 8px rgba(251, 191, 36, 0.1);
}

/* Per-icon green tick for completed activities */
.weekly-day-icon.icon-done::after {
  content: '\2713';
  position: absolute;
  bottom: -2px;
  right: -4px;
  font-size: 10px;
  color: var(--success);
  font-weight: bold;
}

/* Per-icon faded state for missed activities */
.weekly-day-icon.icon-missed {
  opacity: 0.35;
}

/* Missed day — all activities missed */
.weekly-day.missed {
  opacity: 0.4;
}

.weekly-day.missed .weekly-day-label,
.weekly-day.missed .weekly-day-sub {
  text-decoration: line-through;
}

.weekly-day-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weekly-day-icon {
  font-size: 20px;
  position: relative;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weekly-day-icon-sub {
  font-size: 14px;
  margin-top: -2px;
  opacity: 0.85;
}

/* SVG icon inside weekly day */
.weekly-day-icon svg {
  width: 20px;
  height: 20px;
}
.weekly-day-icon-sub svg {
  width: 14px;
  height: 14px;
}

.weekly-day-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.weekly-day-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-tertiary);
}

.weekly-detail-panel {
  margin-top: 12px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.04), transparent 60%),
    var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--volume);
}

.weekly-detail-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--volume);
  margin-bottom: 6px;
}

.weekly-detail-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.weekly-detail-section {
  padding: 4px 0;
}

.weekly-detail-divider {
  height: 1px;
  background: var(--bg-elevated);
  margin: 8px 0;
}

/* ═══ PROGRAM BADGE — compact, always-visible program context ═══ */
.training-program-badge {
  margin: 12px 0 6px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border-left: 3px solid var(--flame);
  position: relative;
}
.training-program-badge-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.training-program-badge-info { flex: 1; min-width: 0; }
.training-program-badge-label {
  font-size: 9px !important;
  letter-spacing: 2px;
  color: var(--flame) !important;
  margin-bottom: 0 !important;
  opacity: 0.7;
}
.training-badge-block {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
  margin-bottom: 1px;
}
.training-badge-split {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.training-badge-progress {
  min-width: 90px;
  text-align: right;
}
.training-badge-week {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.progress-bar-sm {
  height: 4px !important;
}

/* ═══ TRAINING ZONES — visual grouping with color accents ═══ */
.training-zone {
  margin-top: 8px;
}
.training-zone-ref {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.training-zone-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  padding-left: 2px;
}

/* Zone color accents — left border stripe for instant recognition */
.training-zone-card {
  border-left-width: 3px;
  border-left-style: solid;
  border-left-color: transparent;
}
.training-zone-card.zone-lifting {
  border-left-color: var(--volume);
}
.training-zone-card.zone-cardio {
  border-left-color: var(--cardio);
}
.training-zone-card.zone-ref {
  border-left-color: rgba(255, 255, 255, 0.06);
  background: var(--bg-secondary);
}
.training-zone-card.zone-ref .card-label {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ═══ Legacy compat ═══ */
.training-program-header { margin-bottom: 8px; }

.training-block-name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.training-split-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.training-week-text {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.training-next-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.training-next-name { font-size: 15px; font-weight: 600; color: var(--volume); }
.training-next-ago { font-size: 11px; font-family: var(--font-mono); color: var(--text-tertiary); }

.training-exercise-list { margin-bottom: 14px; }

.training-exercise-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.training-exercise-row:last-child { border-bottom: none; }
.training-exercise-row.has-detail { padding: 10px 0; }

.training-exercise-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.training-exercise-idx {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  width: 16px;
  text-align: right;
  flex-shrink: 0;
}

.training-exercise-name {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}

.training-exercise-detail {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--volume);
  white-space: nowrap;
}

/* Exercise tags (rest, set type, intensity) */
.ex-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding-left: 24px;
}
.ex-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.ex-tag-rest { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }
.ex-tag-type { background: rgba(168, 85, 247, 0.12); color: #c4b5fd; }
.ex-tag-intensity { background: rgba(249, 115, 22, 0.12); color: #fdba74; }

/* Exercise-level coaching notes */
.ex-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  padding-left: 24px;
  line-height: 1.4;
  font-style: italic;
}

/* Routine-level coaching notes */
.training-routine-notes {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  border-radius: 6px;
  border-left: 2px solid var(--volume);
  line-height: 1.45;
}

/* Local routine dot (programme loaded, no Hevy sync) */
.training-routine-dot.local { background: var(--volume); box-shadow: 0 0 6px rgba(59, 130, 246, 0.3); }

.training-hevy-link {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 4px;
}

.training-routine-list { display: flex; flex-direction: column; gap: 2px; }

.training-routine-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.training-routine-row:last-child { border-bottom: none; }

.training-routine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}
.training-routine-dot.done { background: var(--success); box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.training-routine-dot.not-done { background: var(--bg-elevated); }

.training-routine-info { flex: 1; min-width: 0; }
.training-routine-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.training-routine-meta { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }

.training-routine-chevron { color: var(--text-tertiary); font-size: 14px; margin-left: 8px; }

.training-routine-expand {
  display: none;
  padding: 8px 0 4px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.training-routine-expand.open { display: block; }
.training-routine-expand .training-exercise-row { padding: 6px 0; }
.training-routine-expand .training-exercise-name { font-size: 12px; }
.training-routine-expand .training-exercise-detail { font-size: 11px; }
.training-routine-expand .ex-tags { padding-left: 24px; }
.training-routine-expand .ex-note { padding-left: 24px; }

/* ========== CARDIO PLAN ========== */
.cardio-plan-days { margin-top: 8px; }
.cardio-day-row {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
}
.cardio-day-row:last-child { border-bottom: none; }
.cardio-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  min-width: 32px;
  padding-top: 2px;
}
.cardio-day-activities { flex: 1; }
.cardio-activity {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.cardio-activity:last-child { margin-bottom: 0; }
.cardio-activity-emoji { font-size: 13px; }
.cardio-activity-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.cardio-activity-detail {
  font-size: 11px;
  color: var(--text-muted);
}
.cardio-activity-structure {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
  padding-left: 20px;
}
.cardio-plan-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cardio-fit-buttons {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cardio-fit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cardio-fit-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== WORKOUT DETAIL PANEL (inline session breakdown) ========== */
.workout-detail-panel {
  display: none;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 6px;
  margin-bottom: 6px;
  border-left: 2px solid var(--cardio);
  animation: wdSlideIn 0.2s ease;
}
.workout-detail-panel.open { display: block; }
@keyframes wdSlideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.cardio-fit-btn.active {
  background: var(--bg-elevated);
  border-color: var(--cardio);
  color: var(--cardio);
}
.wd-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 13px;
  margin-left: 2px;
}
.cardio-fit-btn.active .wd-chevron { transform: rotate(90deg); }

.wd-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cardio);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.wd-structure {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.wd-step {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.wd-step:last-child { border-bottom: none; }
.wd-step-num {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  color: var(--cardio);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 6px;
}
.wd-export-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wd-export-btn:active {
  color: var(--cardio);
  border-color: var(--cardio);
}

/* ========== CARDIO COMPLIANCE ========== */
.cardio-compliance {
  display: flex;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 10px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}
.cardio-compliance-stat {
  flex: 1;
  text-align: center;
}
.cardio-compliance-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.cardio-compliance-values {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}
.cardio-compliance-values .actual { color: var(--accent); }
.cardio-compliance-values .separator { color: var(--text-muted); font-weight: 400; }

/* ========== PACE ZONES REFERENCE ========== */
.pace-zones-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.pace-zone-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.pace-zone-row:last-child { border-bottom: none; }
.pace-zone-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.pace-zone-info { flex: 1; min-width: 0; }
.pace-zone-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.pace-zone-pace {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.pace-zone-rpe {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ========== PROGRAM SECTIONS (Warm-Up, Correctives, Cool-Down) ========== */
.training-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0;
  margin: -4px 0;
  user-select: none;
  gap: 12px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.training-section-header:active {
  background: rgba(255, 255, 255, 0.03);
}
.training-section-header > div:first-child { min-width: 0; flex: 1; }
.training-section-header .card-label { margin-bottom: 0; }
.training-section-chevron {
  font-size: 16px;
  color: var(--tab-accent, var(--text-muted));
  transition: transform 0.25s ease, background 0.2s ease;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tab-accent-glow, rgba(255, 255, 255, 0.04));
}
.training-section-body {
  display: none;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 10px;
}
.training-section-body.open { display: block; }

.training-detail-summary {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.training-exercise-notes {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0 6px 8px;
  font-style: italic;
}

.training-inline-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.training-inline-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.training-inline-group-correctives {
  border-left: 3px solid var(--gold);
  padding-left: 10px;
}

/* Correctives card — amber styling */
.correctives-card {
  border-left: 3px solid var(--gold);
}
.correctives-card .card-label {
  color: var(--gold);
}

/* Methodology badge — color by type */
.training-methodology {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}
.training-methodology.meth-strength  { color: var(--strength); }
.training-methodology.meth-hypertrophy { color: var(--volume); }
.training-methodology.meth-endurance { color: var(--cardio); }
.training-methodology.meth-recovery  { color: var(--recovery); }

/* ========== NOTIFICATION SETTINGS ========== */
/* Strava Connect */
.strava-connect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.strava-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.strava-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.strava-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.strava-status {
  font-size: 11px;
  font-family: var(--font-mono);
}

.btn-strava {
  background: #FC4C02;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-mono);
}

.btn-strava:hover { background: #e04400; }

.btn-strava.connected {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
}

.strava-account-summary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.strava-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.strava-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.strava-panel-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.strava-chip {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(252, 76, 2, 0.12);
  color: #FC4C02;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.strava-weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.strava-summary-stat {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.strava-summary-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.strava-summary-value {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}

.strava-panel-note {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.strava-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.strava-activity-list.compact {
  gap: 6px;
}

.strava-activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.strava-activity-list.compact .strava-activity-row {
  padding: 8px 10px;
}

.strava-activity-main {
  min-width: 0;
  flex: 1;
}

.strava-activity-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.strava-activity-meta {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-mono);
  line-height: 1.4;
}

.strava-activity-value {
  flex-shrink: 0;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.notif-group { margin-bottom: 16px; }
.notif-group:last-child { margin-bottom: 0; }
.notif-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: opacity 0.2s;
}
.notif-row:last-child { border-bottom: none; }
.notif-sub { padding-left: 16px; font-size: 13px; color: var(--text-secondary); }
.notif-sub.disabled { opacity: 0.35; pointer-events: none; }
.notif-row input[type="checkbox"] { display: none; }

.toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  background: var(--bg-elevated, #1E1E22);
  border: 1px solid var(--border);
  border-radius: 13px;
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.toggle-knob {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--text-tertiary);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.25s ease;
}
.notif-row input:checked ~ .toggle-track {
  background: var(--flame);
  border-color: var(--flame);
}
.notif-row input:checked ~ .toggle-track .toggle-knob {
  left: 22px;
  background: #fff;
}
.notif-saved {
  text-align: center;
  font-size: 12px;
  color: var(--flame);
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 8px;
  font-family: var(--font-mono);
}
.notif-saved.show { opacity: 1; }

/* ========== CARD-LEVEL SKELETON LOADING ========== */
.skeleton-card-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-md);
}
.skeleton-card-inline .skeleton-line {
  height: 12px;
  background: var(--bg-elevated);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.skeleton-card-inline .skeleton-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,107,43,0.06), rgba(34,197,94,0.04), transparent);
  animation: scanline 1.4s ease-in-out infinite;
}
.skeleton-card-inline .skeleton-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.skeleton-card-inline .skeleton-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.06), rgba(168,85,247,0.04), transparent);
  animation: scanline 1.4s ease-in-out infinite;
}
.skeleton-card-inline .skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}
.skeleton-card-inline .skeleton-circle::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,179,71,0.06), rgba(255,107,43,0.04), transparent);
  animation: scanline 1.4s ease-in-out infinite;
}

/* Fade-in transition for content replacing skeletons */
.fade-in {
  animation: fadeInContent 0.2s ease-out;
}
@keyframes fadeInContent {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  #app { max-width: 100%; }
  .tab-bar { max-width: 100%; }
}
@media (max-height: 600px) {
  .chart-container { height: 150px; }
}

/* ========== WEEKLY NUTRITION LOG — Day Cards ========== */
.weekly-day-card {
  background: #1A1A1F;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.weekly-day-card.is-today {
  border-color: rgba(255, 107, 43, 0.25);
}

.weekly-day-card.is-expanded {
  border-color: rgba(255, 107, 43, 0.15);
}

/* Header (always visible — tap to toggle) */
.weekly-day-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.weekly-day-header:active {
  background: rgba(255, 255, 255, 0.02);
}

.weekly-day-date {
  min-width: 64px;
}

.weekly-day-name {
  font-size: 13px;
  font-weight: 500;
  color: #F5F5F7;
}

.weekly-day-card.is-today .weekly-day-name {
  color: #FF6B2B;
}

.weekly-day-datenum {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #6B7280;
}

/* Mini macro summary in header */
.weekly-day-summary {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weekly-day-kcal {
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: #FF6B2B;
  min-width: 56px;
}

.weekly-day-macros-mini {
  display: flex;
  gap: 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}

.weekly-day-macros-mini .wm-p { color: #22C55E; }
.weekly-day-macros-mini .wm-c { color: #FBBF24; }
.weekly-day-macros-mini .wm-f { color: #A855F7; }

.weekly-day-meals-count {
  font-size: 11px;
  color: #6B7280;
  white-space: nowrap;
}

/* Progress ring / percentage */
.weekly-day-pct {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  min-width: 32px;
  text-align: right;
}

.weekly-day-pct.pct-under { color: #6B7280; }
.weekly-day-pct.pct-good { color: #22C55E; }

/* Chevron */
.weekly-day-chevron {
  font-size: 12px;
  color: #6B7280;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.weekly-day-card.is-expanded .weekly-day-chevron {
  transform: rotate(180deg);
}

/* Mini progress bar in header */
.weekly-day-bar {
  height: 3px;
  background: #242429;
  border-radius: 2px;
  margin: 0 14px;
}

.weekly-day-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.weekly-day-bar-fill.bar-cal { background: #FF6B2B; }

/* Expanded meal list */
.weekly-day-body {
  display: none;
  padding: 0 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.weekly-day-card.is-expanded .weekly-day-body {
  display: block;
}

/* Day totals row */
.weekly-day-totals {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.weekly-day-total-item {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.weekly-day-total-item .wdt-label {
  color: #6B7280;
  margin-right: 3px;
}

.weekly-day-total-item.tot-cal .wdt-value { color: #FF6B2B; }
.weekly-day-total-item.tot-p .wdt-value { color: #22C55E; }
.weekly-day-total-item.tot-c .wdt-value { color: #FBBF24; }
.weekly-day-total-item.tot-f .wdt-value { color: #A855F7; }

/* Individual meal rows in expanded view */
.weekly-meal-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* When weekly-meal-row is a swipe wrapper, the flex layout moves to .swipe-meal-inner */
.weekly-meal-row:not(.swipe-meal-wrapper) {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  gap: 8px;
}

.weekly-meal-row:last-child {
  border-bottom: none;
}

.weekly-meal-time {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #6B7280;
  min-width: 40px;
  flex-shrink: 0;
}

.weekly-meal-info {
  flex: 1;
  min-width: 0;
}

.weekly-meal-desc {
  font-size: 13px;
  color: #A1A1AA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weekly-meal-macros {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}

.weekly-meal-macros .wm-kcal { color: #FF6B2B; }
.weekly-meal-macros .wm-p { color: rgba(34, 197, 94, 0.7); }
.weekly-meal-macros .wm-c { color: rgba(251, 191, 36, 0.7); }
.weekly-meal-macros .wm-f { color: rgba(168, 85, 247, 0.7); }

/* Empty day state */
.weekly-day-empty {
  padding: 10px 0;
  font-size: 13px;
  color: #6B7280;
  font-style: italic;
}

/* No data for entire week */
.weekly-nutrition-empty {
  text-align: center;
  padding: 20px 0;
  color: #6B7280;
  font-size: 13px;
}

/* ============================================
   SWIPE-TO-DELETE + LONG-PRESS-DRAG
   Touch interactions for meal management
   ============================================ */

/* Swipe wrapper: clips the delete zone behind the meal row */
.swipe-meal-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

/* The inner content that slides */
.swipe-meal-inner {
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease;
  background: var(--bg-secondary, #141417);
  will-change: transform;
}

/* Today's ledger meals: inner background matches the card */
.swipe-meal-wrapper:not(.weekly-meal-row) .swipe-meal-inner {
  background: var(--bg-card, #1A1A1F);
}

.swipe-meal-inner.swiping {
  transition: none;
}

/* Red delete zone hidden behind the swipe */
.swipe-delete-zone {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #7f1d1d, #dc2626);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.15s;
}

.swipe-meal-wrapper.swipe-active .swipe-delete-zone {
  opacity: 1;
}

.swipe-delete-zone .swipe-delete-icon {
  font-size: 18px;
  margin-right: 4px;
}

/* Threshold indicator: turns brighter when past delete threshold */
.swipe-meal-wrapper.swipe-past-threshold .swipe-delete-zone {
  background: linear-gradient(90deg, #991b1b, #ef4444);
}

/* Long-press drag ghost */
.drag-ghost {
  position: fixed;
  z-index: 9999;
  padding: 8px 14px;
  background: rgba(26, 26, 31, 0.95);
  border: 1px solid rgba(255, 107, 43, 0.5);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cal);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: scale(1.05);
  transition: box-shadow 0.15s;
}

/* Drop zone highlight on day headers */
.weekly-day-card.drop-target {
  border-color: rgba(255, 107, 43, 0.5) !important;
  background: rgba(255, 107, 43, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 107, 43, 0.3);
}

.weekly-day-card.drop-target .weekly-day-header {
  background: rgba(255, 107, 43, 0.08);
}

/* Today's meal ledger: also a drop target */
#nutritionMealList.drop-target {
  background: rgba(255, 107, 43, 0.04);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 107, 43, 0.25);
}

/* Meal being dragged gets dimmed */
.swipe-meal-wrapper.is-dragging {
  opacity: 0.3;
  transform: scale(0.95);
}

/* Visual hint on long-press */
.swipe-meal-wrapper.long-press-active .swipe-meal-inner {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(255, 107, 43, 0.2);
  border-radius: 4px;
}

/* Weekly meal rows: need swipe + drag support too */
.weekly-meal-row.swipe-meal-wrapper {
  overflow: hidden;
  border-radius: 0;
}

.weekly-meal-row .swipe-meal-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  background: var(--bg-card, #1A1A1F);
}

/* Inherit font sizes — don't let wrapper change anything */
.weekly-meal-row .swipe-meal-inner .weekly-meal-time,
.weekly-meal-row .swipe-meal-inner .weekly-meal-desc,
.weekly-meal-row .swipe-meal-inner .weekly-meal-macros {
  font-size: inherit;
}

.weekly-meal-row .swipe-delete-zone {
  width: 70px;
  border-radius: 0;
}

/* ── Undo-delete toast ───────────────────────── */
.undo-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(30, 30, 36, 0.96);
  border: 1px solid rgba(255, 107, 43, 0.3);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  max-width: calc(100vw - 32px);
}

.undo-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.undo-toast-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.undo-toast-btn {
  background: none;
  border: none;
  color: var(--cal, #FF6B2B);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.undo-toast-btn:active {
  opacity: 0.6;
}

/* ============================================
   MYTHIC TERMINAL — Progress chart card treatment
   Flame accent border + gradient top-line glow
   ============================================ */
.card-mythic {
  border-left: 3px solid rgba(255, 107, 43, 0.5);
  position: relative;
  overflow: hidden;
}

.card-mythic::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, #FF6B2B 0%, transparent 60%);
  opacity: 0.4;
}

/* ============================================
   VIEW TRANSITIONS
   ============================================ */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: ease;
}
::view-transition-old(root) {
  animation-name: vt-fade-out;
}
::view-transition-new(root) {
  animation-name: vt-fade-in;
}
@keyframes vt-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================
   PULL-TO-REFRESH
   ============================================ */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 999;
  transform: translateY(-60px);
}
.ptr-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(255, 107, 43, 0.2);
  border-top-color: var(--flame);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
}
.ptr-spinner.visible {
  opacity: 1;
}
.ptr-spinner.refreshing {
  animation: ptr-spin 0.7s linear infinite;
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   SAVED MEALS / QUICK LOG
   ============================================ */

/* Bookmark button on logged meals */
.meal-bookmark-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 13px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}
.meal-bookmark-btn:hover,
.meal-bookmark-btn.saved {
  color: #EF4444;
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
}

/* Quick Log rail (horizontal scroll) */
.quick-log-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-log-rail::-webkit-scrollbar { display: none; }

.quick-log-empty {
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 8px 0;
}

/* Quick Log chip */
.quick-log-chip {
  flex: 0 0 auto;
  min-width: 120px;
  max-width: 160px;
  background: var(--bg-elevated, #242429);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
  position: relative;
}
.quick-log-chip:active {
  transform: scale(0.96);
  background: var(--bg-input, #2A2A30);
}
.quick-log-chip.ql-logging {
  opacity: 0.6;
  pointer-events: none;
}
.quick-log-chip.ql-logged {
  border-color: var(--success, #22C55E);
  background: rgba(34,197,94,0.08);
}

.ql-chip-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 4px;
}
.ql-chip-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #F5F5F7);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ql-chip-delete {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 10px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
.ql-chip-delete:hover {
  opacity: 1;
  color: var(--danger, #EF4444);
}

.ql-chip-macros {
  display: flex;
  gap: 4px;
  align-items: baseline;
  flex-wrap: wrap;
}
.ql-chip-cal {
  font-size: 13px;
  font-weight: 700;
  color: var(--cal, #FF6B2B);
  font-family: 'JetBrains Mono', monospace;
}
.ql-chip-cal::after {
  content: 'kcal';
  font-size: 8px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 1px;
}
.ql-chip-macro {
  font-size: 9px;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

/* Suggestions section */
.quick-log-suggest-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 8px 0 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.quick-log-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ql-suggest-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}
.ql-suggest-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ql-suggest-count {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}
.ql-suggest-save {
  background: rgba(255,107,43,0.1);
  border: 1px solid rgba(255,107,43,0.2);
  border-radius: 4px;
  color: var(--flame, #FF6B2B);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ql-suggest-save:hover {
  background: rgba(255,107,43,0.18);
  border-color: rgba(255,107,43,0.4);
}
.ql-suggest-save.saved {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.2);
  color: var(--success, #22C55E);
}

/* ============================================
   LIVING UI — Hades 2 "Nothing Is Static"
   Particle canvas, pulse animations, parallax,
   card shimmer, animated charts.
   ============================================ */

/* --- Pulse / Breathing Animations --- */

/* CTA buttons: slow flame pulse */
.btn-accent {
  animation: btnPulse 3.5s ease-in-out infinite;
}
.btn-accent:active {
  animation: none; /* kill pulse on press */
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 43, 0); }
  50%      { box-shadow: 0 0 16px 2px rgba(255, 107, 43, 0.18); }
}

/* Phoenix badge / flame icons: ember glow */
.phoenix-badge,
.icon-flame,
[style*="color:var(--flame)"] > svg,
.seg-streak .dashboard-status-key {
  animation: emberGlow 4s ease-in-out infinite;
}

@keyframes emberGlow {
  0%, 100% { filter: drop-shadow(0 0 0px transparent); }
  50%      { filter: drop-shadow(0 0 6px rgba(255, 107, 43, 0.4)); }
}

/* Stat numbers: subtle brightness pulse */
.kcal-remaining,
.stat-value.mono {
  animation: statBreathe 5s ease-in-out infinite;
}

@keyframes statBreathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.88; }
}

/* --- Card Border Shimmer (Surgical Terminal) --- */

/* Hero cards: slow shadow glow pulse */
.card.card-hero {
  animation: heroShimmer 6s ease-in-out infinite;
}

@keyframes heroShimmer {
  0%, 100% {
    box-shadow: 0 4px 24px rgba(255, 107, 43, 0.06);
  }
  50% {
    box-shadow: 0 4px 32px rgba(255, 107, 43, 0.12),
                0 0 40px rgba(168, 85, 247, 0.04);
  }
}

/* Standard cards: gradient border opacity drift */
.card:not(.card-hero):not(.card-recessed)::before {
  animation: borderGradientDrift 8s ease-in-out infinite;
}

@keyframes borderGradientDrift {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* --- Scroll-Driven Parallax Reveal --- */

/* Initial state: cards start slightly below and transparent */
.card,
.surface-intro,
.greeting-header,
.training-section-header {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Revealed state: scrolled into view */
.phnx-revealed {
  opacity: 1 !important;
  /* transform is set dynamically by JS parallax, so we just ensure opacity */
}

/* Loading screen elements should always be visible */
#loading .skeleton-container,
#loading .skeleton-card,
#loading .skeleton-line {
  opacity: 1;
  transform: none;
}

/* Tab bar and onboarding should not be affected */
.tab-bar,
.tab-item,
#onboarding,
.onboarding-screen {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* --- Animated Chart Transitions --- */

/* Progress bars: smooth fill from 0 */
.progress-bar,
.macro-bar-fill,
.training-week-bar-fill {
  will-change: width;
}

/* Stat number count-up targets */
.kcal-remaining,
.stat-value.mono,
.dashboard-status-value,
.strava-stat-value {
  will-change: contents;
}

/* --- Reduce Motion Preference --- */
@media (prefers-reduced-motion: reduce) {
  .btn-accent,
  .phoenix-badge,
  .icon-flame,
  .kcal-remaining,
  .stat-value.mono,
  .card.card-hero,
  .card:not(.card-hero):not(.card-recessed),
  .card:not(.card-hero):not(.card-recessed)::before {
    animation: none !important;
  }

  .card,
  .surface-intro,
  .greeting-header,
  .training-section-header {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

}

/* ─────────────────────────────────────────────────────────────────
   PROGRAM PHASE CARD (PR 3.5)
   Compact Simple-mode readiness panel at the top of the Training tab.
   Traffic light (circle) + phase label + one-line headline + sub-copy.
   Hidden via inline style when no active mesocycle (client-side logic).
───────────────────────────────────────────────────────────────── */
.program-phase-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin: 0 0 16px 0;
  background: var(--bg-card, #1A1A1F);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.phase-traffic-light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.phase-traffic-light[data-state="green"]   { background: #22C55E; color: #22C55E; }
.phase-traffic-light[data-state="yellow"]  { background: #FBBF24; color: #FBBF24; }
.phase-traffic-light[data-state="red"]     { background: #EF4444; color: #EF4444; }
.phase-traffic-light[data-state="unknown"] { background: #6B7280; color: #6B7280; box-shadow: none; }

.phase-content { flex: 1; min-width: 0; }

.phase-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, rgba(255, 255, 255, 0.55));
  margin-bottom: 4px;
}

.phase-headline {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, rgba(255, 255, 255, 0.9));
  margin-bottom: 2px;
  line-height: 1.25;
}

.phase-sub {
  font-size: 12px;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
  line-height: 1.35;
}

/* ============================================
   MEAL LOGGER — FAB + Modal
   ============================================ */

/* Floating Action Button */
.meal-fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--flame);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 107, 43, 0.4);
  z-index: 100;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.meal-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(255, 107, 43, 0.3);
}

/* Modal Overlay */
.meal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.meal-modal {
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.meal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.meal-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.meal-modal-close, .meal-modal-back {
  background: none;
  border: none;
  color: var(--text-secondary, rgba(255,255,255,0.6));
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}
.meal-modal-body {
  padding: 16px 20px 24px;
}
.meal-modal-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* Input method chooser */
.meal-input-options {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.meal-input-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-primary, #fff);
  font-size: 13px;
  -webkit-tap-highlight-color: transparent;
}
.meal-input-option:active {
  background: var(--bg-input);
  border-color: var(--flame);
}
.meal-input-icon {
  color: var(--flame);
}

/* Photo-first hero (decision 13): the camera is the default, everything else is secondary */
.meal-hero-camera {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 16px;
  background: var(--flame-glow, rgba(255,107,43,0.15));
  border: 1px solid rgba(255,107,43,0.35);
  border-radius: 14px;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s;
}
.meal-hero-camera:active {
  background: rgba(255,107,43,0.25);
  border-color: var(--flame);
}
.meal-hero-camera-icon {
  color: var(--flame);
  flex-shrink: 0;
}
.meal-hero-camera-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meal-hero-camera-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.meal-hero-camera-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.meal-secondary-options {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.meal-input-option-sm {
  flex: 1;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
}

/* Shame-free 3-tap floor */
.meal-day-signal {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.meal-day-signal-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.meal-day-signal-options {
  display: flex;
  gap: 8px;
}
.meal-day-signal-btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  color: var(--text-primary, #fff);
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s;
}
.meal-day-signal-btn:active,
.meal-day-signal-btn.sending {
  background: var(--bg-input);
  border-color: var(--flame);
}
.meal-day-signal-btn:disabled {
  opacity: 0.6;
}

/* Text input step */
.meal-text-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-primary, #fff);
  font-size: 15px;
  padding: 12px;
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
}
.meal-text-input:focus {
  outline: none;
  border-color: var(--flame);
}
.meal-analyze-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--flame);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.meal-analyze-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading step */
.meal-loading-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 20px;
}
.meal-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
}
.meal-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--flame);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.meal-loading-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Confirmation step */
.meal-confirm-card {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}
.meal-confirm-desc {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.meal-confirm-items {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 8px;
}

.meal-confirm-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}

.meal-confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.meal-btn-confirm {
  flex: 2;
  padding: 12px;
  background: var(--protein);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.meal-btn-edit {
  flex: 1;
  padding: 12px;
  background: var(--bg-elevated);
  color: var(--flame);
  border: 1px solid var(--flame);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.meal-btn-cancel {
  flex: 1;
  padding: 12px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
}
.meal-btn-confirm:disabled, .meal-btn-edit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Correction panel */
.meal-correction-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.meal-correction-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.meal-correction-chip {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.meal-correction-chip:active {
  background: var(--flame-glow);
  border-color: var(--flame);
}
.meal-correction-custom {
  display: flex;
  gap: 8px;
}
.meal-correction-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  font-family: inherit;
}
.meal-correction-input:focus {
  outline: none;
  border-color: var(--flame);
}
.meal-correction-send {
  padding: 8px 14px;
  background: var(--flame);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.meal-correction-send:disabled {
  opacity: 0.5;
}

/* Success step */
.meal-success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
}
.meal-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--protein);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.3s ease;
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.meal-success-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.meal-success-summary {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================
   DAILY CHECK-IN CARD
   ============================================ */
.checkin-card {
  border-left: 3px solid var(--gold);
}
.checkin-card .card-label {
  color: var(--gold);
}
.checkin-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.checkin-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.checkin-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  min-width: 52px;
}
.checkin-btn:active {
  transform: scale(0.95);
}
.checkin-btn.selected {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
}
.checkin-emoji {
  font-size: 20px;
  line-height: 1;
}
.checkin-lbl {
  font-size: 10px;
  white-space: nowrap;
}
.checkin-btn-sm {
  flex-direction: row;
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 8px 10px;
  min-width: 44px;
  justify-content: center;
}
.checkin-sleep-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.checkin-weight-quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.checkin-weight-quick .checkin-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 0 0 auto;
  min-width: 54px;
  padding: 8px 6px;
  flex-direction: row;
  justify-content: center;
}
.checkin-weight-manual {
  display: flex;
  align-items: center;
  gap: 6px;
}
.checkin-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
}
.checkin-input:focus {
  border-color: var(--gold);
}
.checkin-unit {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.checkin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 8px;
}
.checkin-skip {
  font-size: 13px;
  padding: 6px 12px;
}
.checkin-progress-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.checkin-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.checkin-dot.active {
  background: var(--gold);
}
.checkin-dot.done {
  background: var(--text-secondary);
}
.checkin-submit {
  font-size: 13px;
  padding: 8px 16px;
}
.checkin-done-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}
.checkin-done-icon {
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
}
.checkin-result-header {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}
.checkin-result-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.checkin-result-summary .checkin-summary-line {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.checkin-result-summary .checkin-summary-line:last-child {
  border-bottom: none;
}
.checkin-result-insight {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid var(--gold);
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.checkin-result-insight::before {
  content: '\1F4A1 ';
}

/* Weigh-in reveal — trend first, raw daily number small + muted (decision 13) */
.checkin-weight-reveal {
  margin: 12px 0;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.checkin-trend-headline {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.checkin-trend-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}
.checkin-trend-raw {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 10px;
}

/* ============================================
   DAILY ACTIONS STRIP
   ============================================ */
.daily-actions-strip {
  margin: 0 0 12px 0;
  padding: 14px 16px 12px;
  background:
    radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.015), transparent 60%),
    var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.daily-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.daily-actions-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.daily-actions-streak {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--flame);
}
.daily-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.daily-action-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.daily-action-pill:active {
  transform: scale(0.96);
}
.daily-action-icon {
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.daily-action-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  white-space: nowrap;
}
/* Completed state */
.daily-action-pill.done {
  border-color: var(--flame);
  background: rgba(255, 107, 53, 0.06);
}
.daily-action-pill.done .daily-action-icon {
  opacity: 1;
}
.daily-action-pill.done .daily-action-text {
  color: var(--flame);
  font-weight: 600;
}
/* Partial state for meals (some logged but not target) */
.daily-action-pill.partial {
  border-color: rgba(255, 107, 53, 0.3);
  background: rgba(255, 107, 53, 0.03);
}
.daily-action-pill.partial .daily-action-text {
  color: var(--text-primary);
}
/* Rest day — dim the workout pill */
.daily-action-pill.rest-day {
  opacity: 0.35;
  pointer-events: none;
}
.daily-action-pill.rest-day .daily-action-text {
  color: var(--text-muted);
}
/* Progress bar */
.daily-actions-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.daily-actions-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.daily-actions-bar-fill {
  height: 100%;
  background: var(--flame);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.daily-actions-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}
/* Full compliance — celebrate */
.daily-actions-strip.all-done .daily-actions-bar-fill {
  background: linear-gradient(90deg, var(--flame), var(--protein));
}
.daily-actions-strip.all-done .daily-actions-pct {
  color: var(--flame);
}
.daily-actions-strip.all-done .daily-actions-label {
  color: var(--flame);
}

/* ============================================
   PROGRESS PHOTOS
   ============================================ */
.progress-photos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.progress-photos-filter {
  display: flex;
  gap: 4px;
}
.progress-filter-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.progress-filter-btn.active {
  background: rgba(255, 107, 43, 0.12);
  border-color: var(--flame);
  color: var(--flame);
}
.progress-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.progress-photo-thumb {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: transform 0.15s ease;
}
.progress-photo-thumb:active {
  transform: scale(0.96);
}
.progress-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.progress-photo-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text-primary);
}
.progress-photo-date {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text-secondary);
}

/* Upload modal */
.photo-upload-preview {
  margin-bottom: 12px;
  cursor: pointer;
}
.photo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.photo-option-group {
  margin-bottom: 10px;
}
.photo-option-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.photo-option-btns {
  display: flex;
  gap: 6px;
}
.photo-option-btns .step-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
}
.photo-option-btns .step-btn.selected {
  background: rgba(255, 107, 43, 0.12);
  border-color: var(--flame);
  color: var(--flame);
}

/* Photo viewer modal */
.modal-photo-viewer {
  max-width: 400px;
}
.photo-viewer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

/* ============================================
   WORKOUT LOGGER
   ============================================ */

/* FAB Button */
.workout-logger-fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent, #D4AF37);
  color: #000;
  border: none;
  border-radius: 28px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(212,175,55,0.4);
  z-index: 200;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.workout-logger-fab:active {
  transform: scale(0.95);
}
.workout-logger-fab svg {
  flex-shrink: 0;
}

/* Non-blocking toast notifications */
.phnx-toast {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: top 0.3s ease, opacity 0.3s ease;
  max-width: 90vw;
  text-align: center;
}
.phnx-toast-show { top: 20px; }
.phnx-toast-hide { top: -60px; opacity: 0; }
.phnx-toast-error { border-color: var(--danger); color: var(--danger); }
.phnx-toast-success { border-color: var(--accent); color: var(--accent); }

/* Coaching Feed */
.cf-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cf-item:last-child { border-bottom: none; }
.cf-item.cf-warning { background: rgba(255,170,0,0.05); border-radius: 8px; padding: 10px; margin: 0 -8px; }
.cf-item.cf-critical { background: rgba(255,60,60,0.05); border-radius: 8px; padding: 10px; margin: 0 -8px; }
.cf-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-size: 14px;
}
.cf-content { flex: 1; min-width: 0; }
.cf-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}
.cf-message {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  /* The feed now renders the coach's OWN approved text (final_text), which is
     multi-line — every queueAction site builds it with [...].join('\n'). The
     old source was single-line formatter output, so this rule never needed it.
     Without pre-wrap a coach's deliberately-spaced note collapses into one
     run-on paragraph on the client's phone: their words, their name, their
     formatting silently discarded. */
  white-space: pre-wrap;
}
.cf-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* Full-screen overlay */
.workout-logger-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.wl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.wl-header-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}
.wl-header-btn:active {
  background: var(--surface-hover);
}
.wl-header-btn-finish {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  padding: 8px 16px;
}
.wl-header-center {
  text-align: center;
  flex: 1;
}
.wl-session-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.wl-timer {
  font-size: 13px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-top: 2px;
}

/* Body */
.wl-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 100px;
  -webkit-overflow-scrolling: touch;
}

/* Exercise Card */
.wl-exercise-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}
.wl-exercise-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.wl-exercise-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.wl-exercise-muscle {
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
}
.wl-exercise-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
  opacity: 0.6;
}
.wl-exercise-remove:active {
  opacity: 1;
  color: var(--danger, #e74c3c);
}

/* Set rows */
.wl-sets-container {
  padding: 0 14px 12px;
}
.wl-set-header {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 60px 36px;
  gap: 8px;
  padding: 8px 0 4px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wl-set-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 60px 36px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.wl-set-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}
.wl-set-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  color: var(--text);
  text-align: center;
  width: 100%;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
}
.wl-set-input:focus {
  border-color: var(--accent);
  outline: none;
}
.wl-set-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.wl-set-done {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.wl-set-done.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.wl-set-done.checked svg {
  stroke: #000;
}
.wl-set-done svg {
  stroke: var(--text-muted);
}
.wl-add-set-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}
.wl-add-set-btn:active {
  background: var(--surface-hover);
}

/* Add Exercise button */
.wl-add-exercise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.wl-add-exercise-btn:active {
  background: var(--surface-hover);
}

/* Empty state */
.wl-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.wl-empty-icon {
  opacity: 0.3;
  margin-bottom: 12px;
}
.wl-empty-text {
  font-size: 14px;
}

/* Footer */
.wl-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.wl-discard-btn {
  width: 100%;
  padding: 12px;
  background: none;
  border: 1px solid var(--danger, #e74c3c);
  border-radius: 10px;
  color: var(--danger, #e74c3c);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.wl-discard-btn:active {
  background: rgba(231,76,60,0.1);
}

/* Exercise Picker */
.wl-picker-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 1100;
  display: flex;
  flex-direction: column;
}
.wl-picker {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.wl-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.wl-picker-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.wl-picker-search {
  padding: 12px 16px 8px;
}
.wl-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  -webkit-appearance: none;
}
.wl-search-input:focus {
  border-color: var(--accent);
  outline: none;
}
.wl-picker-filters {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wl-picker-filters::-webkit-scrollbar { display: none; }
.wl-filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.wl-filter-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.wl-picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}
.wl-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.wl-picker-item:active {
  opacity: 0.7;
}
.wl-picker-item-name {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}
.wl-picker-item-muscle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}
.wl-picker-item-add {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.wl-custom-exercise {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.wl-custom-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
}
.wl-custom-add-btn {
  padding: 10px 16px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* Workout Complete */
.wl-complete-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wl-complete-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  width: 100%;
  max-width: 360px;
}
.wl-complete-icon {
  margin-bottom: 16px;
}
.wl-complete-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}
.wl-complete-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.wl-stat {
  text-align: center;
}
.wl-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}
.wl-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.wl-complete-rpe {
  margin-bottom: 24px;
}
.wl-complete-rpe-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.wl-rpe-scale {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.wl-rpe-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.wl-rpe-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.wl-rpe-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 16px;
}
.wl-save-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.wl-save-btn:active {
  opacity: 0.9;
}
.wl-save-btn:disabled {
  opacity: 0.5;
}

/* ============================================
   WORKOUT HISTORY
   ============================================ */
.wh-session {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.wh-session:last-child {
  border-bottom: none;
}
.wh-session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
}
.wh-session-info {
  flex: 1;
}
.wh-session-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.wh-session-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wh-session-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 12px;
}
.wh-stat {
  text-align: center;
}
.wh-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.wh-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.wh-exercises {
  margin-top: 8px;
  padding-left: 0;
  display: none;
}
.wh-exercises.open {
  display: block;
}
.wh-exercise-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wh-exercise-row:last-child {
  border-bottom: none;
}
.wh-exercise-name {
  color: var(--text);
  font-weight: 500;
  flex: 1;
}
.wh-exercise-detail {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: 8px;
  white-space: nowrap;
}
.wh-session-chevron {
  color: var(--text-muted);
  font-size: 18px;
  transition: transform 0.2s;
  margin-left: 8px;
  margin-top: 2px;
}
.wh-session-chevron.open {
  transform: rotate(90deg);
}
.wh-load-more-btn {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.wh-load-more-btn:active {
  background: var(--surface-hover);
}
.wh-session-rpe {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(212,175,55,0.15);
  color: var(--accent);
}
.wh-session-type-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ========== ROUTINE TEMPLATE CARDS ========== */
.routine-templates-container {
  padding: 0 16px;
  margin-bottom: 16px;
}
.routine-template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.routine-template-card.routine-today,
.routine-template-card.routine-template-today {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(212,175,55,0.12), inset 0 0 0 1px rgba(212,175,55,0.08);
}
.routine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.routine-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.routine-today-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg-primary);
}
.routine-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.routine-exercises-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.routine-exercise-preview {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 3px 8px;
  border-radius: 6px;
}
.routine-exercise-more {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 3px 8px;
  font-weight: 600;
}
.routine-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(212,175,55,0.12);
  color: var(--accent);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.routine-start-btn:active {
  background: rgba(212,175,55,0.22);
}
.routine-today .routine-start-btn {
  background: var(--accent);
  color: var(--bg-primary);
}
.routine-today .routine-start-btn:active {
  background: var(--gold-muted);
}

/* ========== WORKOUT LOGGER TARGET BAR ========== */
.wl-target-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin: 0 -2px 8px;
  border-radius: 8px;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.10);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.wl-target-sep {
  color: var(--text-tertiary);
  font-weight: 400;
}
.wl-target-tempo {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--volume);
  background: rgba(59,130,246,0.10);
  padding: 1px 5px;
  border-radius: 4px;
}
.wl-target-prev {
  color: var(--text-tertiary);
  font-style: italic;
  font-weight: 500;
}
.wl-target-coach {
  color: var(--flame, #FF6B2B);
  font-weight: 600;
}
.wl-target-notes {
  padding: 6px 10px;
  margin: -4px -2px 8px;
  border-radius: 0 0 8px 8px;
  background: rgba(255,179,71,0.06);
  border: 1px solid rgba(255,179,71,0.08);
  border-top: none;
  font-size: 11px;
  color: var(--gold);
  line-height: 1.4;
}

/* ========== REST COUNTDOWN TIMER ========== */
.wl-rest-timer-bar {
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.wl-rest-timer-inner {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
.wl-rest-timer-progress {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  width: 0%;
  transition: width 1s linear;
}
.wl-rest-timer-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.wl-rest-timer-skip {
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wl-rest-timer-skip:active {
  background: rgba(255,255,255,0.14);
}
.wl-rest-done {
  color: var(--success);
  animation: restPulse 0.6s ease-in-out;
}
@keyframes restPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ========== EXERCISE ACTIONS (swap, warmup, remove) ========== */
.wl-exercise-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.wl-exercise-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wl-exercise-action-btn:active {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
}

/* ========== WARMUP SET STYLING ========== */
.wl-set-warmup {
  opacity: 0.55;
}
.wl-set-warmup .wl-set-num {
  color: var(--gold-muted);
  font-size: 10px;
  font-weight: 800;
}
.wl-set-warmup .wl-set-input {
  background: rgba(255,179,71,0.04);
  border-color: rgba(255,179,71,0.08);
}

/* ========== SUPERSET GROUPING ========== */
.wl-superset-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--recovery);
}
.wl-superset-card {
  border-left: 3px solid var(--recovery);
  margin-left: 4px;
}
.wl-ss-first {
  border-radius: 12px 12px 2px 2px;
  margin-bottom: 2px;
}
.wl-ss-last {
  border-radius: 2px 2px 12px 12px;
  margin-bottom: 12px;
}
.wl-ss-first.wl-ss-last {
  border-radius: 12px;
}
.wl-superset-card:not(.wl-ss-first):not(.wl-ss-last) {
  border-radius: 2px;
  margin-bottom: 2px;
}
.wl-ss-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(139,92,246,0.15);
  color: var(--recovery);
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-right: 4px;
}

/* ── Warm-Up Section ── */
.wl-warmup-section {
  background: rgba(255,170,51,0.06);
  border: 1px solid rgba(255,170,51,0.15);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.wl-warmup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.wl-warmup-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wl-warmup-item:last-child { border-bottom: none; }
.wl-warmup-item.wl-item-done { opacity: 0.4; }
.wl-warmup-item.wl-item-done .wl-warmup-name {
  text-decoration: line-through;
}
.wl-warmup-corrective {
  border-left: 3px solid var(--recovery);
  padding-left: 10px;
  margin-left: 2px;
}
.wl-warmup-check,
.wl-cooldown-check {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}
.wl-warmup-check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.wl-cooldown-check.checked {
  background: var(--info);
  border-color: var(--info);
  color: #000;
}
.wl-warmup-info,
.wl-cooldown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wl-warmup-name,
.wl-cooldown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.wl-warmup-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wl-warmup-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--accent);
  opacity: 0.8;
}
.wl-warmup-dur,
.wl-cooldown-dur {
  font-size: 11px;
  color: var(--text-secondary);
}
.wl-warmup-notes,
.wl-cooldown-notes {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  font-style: italic;
}

/* ── Cool-Down Section ── */
.wl-cooldown-section {
  background: rgba(96,165,250,0.06);
  border: 1px solid rgba(96,165,250,0.15);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.wl-cooldown-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--info);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.wl-cooldown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wl-cooldown-item:last-child { border-bottom: none; }
.wl-cooldown-item.wl-item-done { opacity: 0.4; }
.wl-cooldown-item.wl-item-done .wl-cooldown-name {
  text-decoration: line-through;
}

/* ============================================================================
   IN-SESSION LOGGER (decision 19) — gesture-driven, offline-first, dark-only.
   Faithful port of design/mythic-terminal/screens/in-session-logger.html.
   Scoped to .isl-root so its local Mythic-Terminal tokens never leak.
   ============================================================================ */
.isl-root {
  --void:#0D0D0F; --card:#17171C; --card2:#1E1E24; --elev:#26262C; --input:#2A2A30;
  --tx1:#F5F5F7; --tx2:#A1A1AA; --tx3:#6B7280;
  --hair:rgba(255,255,255,.07); --hair2:rgba(255,255,255,.18);
  --flame:#FF6B2B; --flame-br:#FF8C42; --gold:#FFB347; --ok:#22C55E; --warn:#FBBF24;
  --danger:#EF4444; --blue:#3B82F6;
  --recTint:rgba(255,107,43,.06); --doneBg:rgba(34,197,94,.10); --shadow:0 18px 50px rgba(0,0,0,.5);
  position:fixed; inset:0; z-index:1000; display:flex; flex-direction:column;
  background:var(--void);
  background-image:radial-gradient(ellipse at 72% -8%, rgba(255,107,43,.10), transparent 55%);
  color:var(--tx1);
  font-family:'DM Sans','Inter',-apple-system,BlinkMacSystemFont,sans-serif;
}
.isl-root .mono { font-family:'JetBrains Mono','SF Mono',monospace; }
.isl-root button { font-family:inherit; -webkit-tap-highlight-color:transparent; }
.isl-root .scr::-webkit-scrollbar { width:0; }

/* Header */
.isl-header {
  flex:none; padding:calc(env(safe-area-inset-top, 0px) + 14px) 14px 12px;
  background:linear-gradient(180deg, rgba(255,107,43,.12), transparent);
  border-bottom:1px solid var(--hair);
}
.isl-header-top { display:flex; align-items:center; gap:10px; }
.isl-icon-btn {
  flex:none; width:34px; height:34px; border-radius:9px; background:var(--card);
  border:1px solid var(--hair); color:var(--tx2); display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.isl-avatar {
  flex:none; width:38px; height:38px; border-radius:11px;
  background:linear-gradient(135deg,var(--flame-br),var(--flame));
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:12px;
}
.isl-header-id { flex:1; min-width:0; }
.isl-client-name { font-size:17px; font-weight:700; letter-spacing:-.3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.isl-meso { font-size:10.5px; color:var(--tx2); }
.isl-meso b { color:var(--flame); font-weight:600; }
.isl-header-timer { font-size:13px; font-weight:600; color:var(--tx2); flex:none; }
.isl-next-btn {
  flex:none; display:flex; align-items:center; gap:6px; background:var(--card);
  border:1px solid var(--hair); border-radius:10px; padding:5px 8px; cursor:pointer;
  color:var(--tx1); font-size:10.5px; font-weight:600;
}
.isl-next-btn .isl-next-time { font-size:8px; color:var(--tx3); letter-spacing:1px; display:block; }
.isl-finish-btn {
  flex:none; padding:8px 13px; border:none; border-radius:10px; background:var(--flame);
  color:#fff; font-size:12px; font-weight:700; cursor:pointer;
}
.isl-chips { display:flex; gap:6px; margin-top:11px; flex-wrap:wrap; }
.isl-chip {
  font-family:'JetBrains Mono',monospace; font-size:9.5px; color:var(--tx2);
  background:var(--card); border:1px solid var(--hair); border-radius:6px; padding:4px 8px;
}
.isl-chip.accent { color:var(--flame); background:var(--recTint); border-color:rgba(255,107,43,.25); }
.isl-progress { display:flex; align-items:center; gap:9px; margin-top:11px; }
.isl-progress-track { flex:1; height:5px; border-radius:3px; background:var(--elev); overflow:hidden; }
.isl-progress-fill { height:100%; width:0; background:linear-gradient(90deg,var(--flame),var(--gold)); border-radius:3px; transition:width .35s cubic-bezier(.2,.8,.2,1); }
.isl-progress-label { font-size:10px; color:var(--tx2); flex:none; }

/* Banner (offline / syncing) */
.isl-banner { margin:10px 14px 0; display:flex; align-items:center; gap:9px; border-radius:11px; padding:9px 11px; }
.isl-banner.offline { background:rgba(251,191,36,.10); border:1px solid rgba(251,191,36,.32); }
.isl-banner.syncing { background:rgba(34,197,94,.10); border:1px solid rgba(34,197,94,.32); }
.isl-banner .mono { font-size:10.5px; color:var(--tx2); flex:1; }
.isl-banner .isl-banner-count { font-size:10px; flex:none; }
.isl-banner.offline .isl-banner-count { color:var(--warn); }
.isl-dot { width:8px; height:8px; border-radius:50%; flex:none; }
.isl-dot.warn { background:var(--warn); animation:isl-pulse 2s infinite; }
.isl-spin { width:13px; height:13px; border:2px solid rgba(34,197,94,.3); border-top-color:var(--ok); border-radius:50%; animation:isl-spin .7s linear infinite; flex:none; }
@keyframes isl-pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }
@keyframes isl-spin { to { transform:rotate(360deg); } }
@keyframes isl-up { from { transform:translateY(100%);} to { transform:translateY(0);} }
/* Reduced motion: animations AND transitions collapse to instant inside the logger —
   the !important transition-duration also overrides JS-inline gesture snapbacks. */
@media (prefers-reduced-motion: reduce){ .isl-root * { animation-duration:.001ms !important; transition-duration:.001ms !important; } }

/* Body + list */
.isl-body { flex:1; overflow:auto; padding:12px 12px 130px; -webkit-overflow-scrolling:touch; }
.isl-list { position:relative; }
.isl-dropline { position:absolute; height:3px; background:var(--flame); border-radius:2px; opacity:0; pointer-events:none; z-index:70; box-shadow:0 0 10px var(--flame); transition:opacity .12s; }

.isl-block { margin-bottom:14px; }
.isl-superset { border:1px solid rgba(255,107,43,.20); border-radius:18px; padding:8px; background:var(--recTint); }
.isl-superset-head { display:flex; align-items:center; gap:8px; padding:2px 4px 8px; }
.isl-superset-label { font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700; letter-spacing:1.5px; color:var(--flame); }
.isl-superset-note { font-family:'JetBrains Mono',monospace; font-size:9.5px; color:var(--tx3); }
.isl-superset-slots { display:flex; flex-direction:column; gap:8px; }

/* Slot card */
.isl-slot { background:var(--card); border:1px solid var(--hair); border-radius:16px; padding:12px 12px 6px; position:relative; overflow:hidden; }
.isl-slot.hero { border-color:rgba(255,107,43,.32); }
.isl-slot.compact { border-radius:14px; padding:11px 11px 6px; }
.isl-slot-glow { position:absolute; top:-34px; right:-34px; width:110px; height:110px; background:radial-gradient(circle,var(--flame),transparent 70%); opacity:.10; pointer-events:none; }
.isl-slot-head { display:flex; align-items:center; gap:8px; position:relative; }
.isl-grip { flex:none; width:24px; height:34px; display:flex; align-items:center; justify-content:center; background:none; border:none; cursor:grab; color:var(--tx3); touch-action:none; padding:0; }
.isl-superset .isl-grip.block-grip { color:var(--flame); }
.isl-slot-tap { flex:1; min-width:0; touch-action:pan-y; cursor:grab; }
.isl-slot-namerow { display:flex; align-items:center; gap:7px; }
.isl-slot-pos { font-family:'JetBrains Mono',monospace; font-size:9.5px; font-weight:700; color:#fff; background:var(--flame); border-radius:5px; padding:2px 5px; flex:none; }
.isl-slot-name { font-size:15px; font-weight:600; color:var(--tx1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.isl-badge { font-family:'JetBrains Mono',monospace; font-size:8.5px; border-radius:4px; padding:1px 5px; flex:none; }
.isl-badge.main { color:var(--flame); border:1px solid rgba(255,107,43,.4); }
.isl-badge.swapped { color:var(--flame); border:1px solid var(--flame); }
.isl-slot-meta { font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--tx3); margin-top:2px; }
.isl-swap-btn { flex:none; width:34px; height:34px; border-radius:9px; background:var(--elev); border:1px solid var(--hair); color:var(--tx2); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.isl-lasttarget { display:flex; align-items:center; gap:8px; margin:10px 0 0; padding-left:32px; }
.isl-slot.compact .isl-lasttarget { padding-left:30px; }
.isl-last { font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--tx3); }
.isl-last b { color:var(--tx2); font-weight:600; }
.isl-target { margin-left:auto; font-family:'JetBrains Mono',monospace; font-size:10.5px; color:var(--tx2); background:var(--elev); border:1px solid var(--hair); border-radius:6px; padding:3px 8px; }
.isl-target b { color:var(--tx1); }
.isl-receipt { display:flex; align-items:center; gap:8px; background:var(--recTint); border-left:2px solid var(--flame); border-radius:0 7px 7px 0; padding:7px 9px; margin:8px 0 0 32px; }
.isl-slot.compact .isl-receipt { margin-left:30px; padding:6px 9px; }
.isl-receipt-mark { font-family:'JetBrains Mono',monospace; color:var(--flame); font-size:11px; flex:none; }
.isl-receipt-text { font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--tx2); line-height:1.4; flex:1; }
.isl-receipt-text b { color:var(--tx1); font-weight:600; }

/* Set rows */
.isl-sets { margin-top:5px; position:relative; }
.isl-set { margin-top:8px; }
.isl-set-wrap { position:relative; border-radius:12px; overflow:hidden; }
.isl-set-fill { position:absolute; inset:0; background:var(--ok); opacity:0; display:flex; align-items:center; gap:8px; padding-left:16px; color:#fff; pointer-events:none; }
.isl-set-fill .mono { font-size:11px; font-weight:600; }
/* done-state settle (craft-as-feedback, decision 17 §4): the .done class toggles on
   LIVE rows (islMarkRowDone), so these transitions fire exactly at the moment of value
   and never replay on renderISL rebuilds (CSS transitions don't run on insertion). */
.isl-set-row { position:relative; display:flex; align-items:center; gap:10px; padding:8px 12px; min-height:52px; background:var(--card2); border:1px solid var(--hair); border-radius:12px; touch-action:pan-y; cursor:grab; transition:background-color .2s cubic-bezier(.2,.8,.2,1); }
.isl-set-row.done { background:var(--doneBg); }
.isl-check { flex:none; width:32px; height:32px; border-radius:50%; border:1.8px solid var(--hair2); background:transparent; display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0; transition:transform .1s, background-color .12s cubic-bezier(.2,.8,.2,1), border-color .12s cubic-bezier(.2,.8,.2,1); }
.isl-check:active { transform:scale(.92); }
.isl-check.done { border-color:var(--ok); background:var(--ok); }
.isl-val { transition:color .2s cubic-bezier(.2,.8,.2,1); }
.isl-set-n { font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--tx3); width:12px; flex:none; }
.isl-set-prev { font-family:'JetBrains Mono',monospace; font-size:10.5px; color:var(--tx3); flex:none; }
.isl-set-vals { margin-left:auto; display:flex; align-items:center; gap:10px; }
.isl-set-kg { font-family:'JetBrains Mono',monospace; font-size:19px; font-weight:700; }
.isl-set-unit { font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--tx3); }
.isl-set-x { font-family:'JetBrains Mono',monospace; color:var(--tx3); font-size:12px; }
.isl-set-reps { font-family:'JetBrains Mono',monospace; font-size:19px; font-weight:700; min-width:22px; text-align:right; }
.isl-val-todo { color:var(--tx1); }
.isl-val-done { color:var(--tx2); }

/* Inline editor */
.isl-editor { display:flex; align-items:center; gap:8px; margin-top:6px; padding:8px 9px; background:var(--elev); border:1px solid var(--hair); border-radius:12px; flex-wrap:wrap; }
.isl-editor-label { font-family:'JetBrains Mono',monospace; font-size:9px; letter-spacing:1px; color:var(--tx3); }
.isl-stepper { display:flex; align-items:center; gap:3px; }
.isl-step-btn { width:32px; height:32px; border-radius:8px; border:1px solid var(--hair); background:var(--card); color:var(--tx1); font-size:16px; cursor:pointer; font-family:'JetBrains Mono',monospace; }
.isl-step-val { font-family:'JetBrains Mono',monospace; font-size:13px; font-weight:700; color:var(--tx1); min-width:46px; text-align:center; }
.isl-step-val span { font-size:8.5px; color:var(--tx3); }
.isl-editor-log { margin-left:auto; padding:9px 14px; border:none; border-radius:9px; background:var(--flame); color:#fff; font-size:11px; font-weight:600; cursor:pointer; font-family:'JetBrains Mono',monospace; }

/* Add / footer */
.isl-add-btn { width:100%; margin-top:4px; padding:13px; border:1px dashed var(--hair2); border-radius:14px; background:none; color:var(--tx3); font-size:11.5px; cursor:pointer; }
.isl-empty { text-align:center; padding:40px 20px; }
.isl-empty-text { color:var(--tx2); font-size:14px; }
.isl-footer { flex:none; padding:10px 14px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top:1px solid var(--hair); background:var(--void); }
.isl-discard-btn { width:100%; padding:11px; border:1px solid var(--hair); border-radius:11px; background:none; color:var(--tx3); font-size:12px; cursor:pointer; }

/* Rest timer */
.isl-rest { position:absolute; left:0; right:0; bottom:calc(env(safe-area-inset-bottom, 0px) + 60px); z-index:45; padding:12px; pointer-events:none; }
/* isl-rest-in: mounted ONCE per rest (islRenderRest; ticks only update text/arc) —
   a near-imperceptible rise so the overlay doesn't pop into existence mid-set. */
.isl-rest-card { background:var(--card); border:1px solid rgba(255,107,43,.32); border-radius:14px; padding:10px 12px; box-shadow:var(--shadow); display:flex; align-items:center; gap:12px; pointer-events:auto; animation:isl-rest-in .2s cubic-bezier(.2,.8,.2,1); }
@keyframes isl-rest-in { from { opacity:0; transform:translateY(8px); } }
.isl-rest-ring { position:relative; width:40px; height:40px; flex:none; }
.isl-rest-info { flex:1; min-width:0; }
.isl-rest-label { font-family:'JetBrains Mono',monospace; font-size:8.5px; letter-spacing:1.5px; color:var(--flame); }
.isl-rest-time { font-family:'JetBrains Mono',monospace; font-size:21px; font-weight:700; color:var(--tx1); line-height:1.05; }
.isl-rest-name { font-family:'JetBrains Mono',monospace; font-size:9.5px; color:var(--tx3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.isl-rest-btn { flex:none; padding:9px 11px; border-radius:9px; font-size:11px; font-weight:600; cursor:pointer; font-family:'JetBrains Mono',monospace; }
.isl-rest-btn.ghost { border:1px solid var(--hair); background:var(--elev); color:var(--tx2); }
.isl-rest-btn.solid { border:none; background:var(--flame); color:#fff; }

/* Bottom sheets (swap / launcher) */
.isl-sheet-scrim { position:absolute; inset:0; z-index:60; background:rgba(0,0,0,.6); display:flex; align-items:flex-end; }
.isl-sheet { width:100%; background:var(--card); border-top:1px solid rgba(255,107,43,.3); border-radius:20px 20px 0 0; padding:12px 14px calc(env(safe-area-inset-bottom, 0px) + 26px); box-shadow:var(--shadow); animation:isl-up .28s cubic-bezier(.22,1,.36,1); max-height:82%; overflow:auto; }
.isl-sheet-grip { width:36px; height:4px; border-radius:2px; background:var(--hair2); margin:0 auto 14px; }
.isl-sheet-kick { font-family:'JetBrains Mono',monospace; font-size:10px; letter-spacing:2px; color:var(--flame); }
.isl-sheet-title { font-size:16px; font-weight:700; margin:5px 0 2px; }
.isl-sheet-sub { font-family:'JetBrains Mono',monospace; font-size:10.5px; color:var(--tx3); margin-bottom:13px; }
.isl-swap-list { display:flex; flex-direction:column; gap:8px; }
.isl-swap-opt { text-align:left; display:flex; align-items:center; gap:11px; background:var(--card2); border:1px solid var(--hair); border-radius:12px; padding:11px 12px; cursor:pointer; }
.isl-swap-opt.current { border-color:var(--flame); }
.isl-swap-opt-main { flex:1; min-width:0; }
.isl-swap-opt-name { font-size:14px; font-weight:600; color:var(--tx1); }
.isl-swap-opt-why { font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--tx3); margin-top:2px; }
.isl-swap-opt-equip { flex:none; font-family:'JetBrains Mono',monospace; font-size:9.5px; color:var(--tx2); background:var(--elev); border-radius:5px; padding:3px 8px; }
.isl-swap-cur-tag { font-family:'JetBrains Mono',monospace; font-size:8px; color:var(--flame); border:1px solid var(--flame); border-radius:4px; padding:1px 4px; margin-left:6px; }
.isl-sheet-carry { display:flex; align-items:center; gap:8px; margin-top:13px; padding-top:11px; border-top:1px solid var(--hair); }
.isl-sheet-carry .mono { font-size:10px; color:var(--tx3); }

/* v2 gestures (field test 2026-07-15): menu button, delete fills, add-set, undo */
.isl-menu-btn { flex:none; width:34px; height:34px; border-radius:9px; background:var(--elev); border:1px solid var(--hair); color:var(--tx2); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.isl-set-fill-del { position:absolute; inset:0; background:var(--danger, #ef4444); opacity:0; display:flex; align-items:center; justify-content:flex-end; gap:8px; padding-right:16px; color:#fff; pointer-events:none; }
.isl-set-fill-del .mono { font-size:11px; font-weight:600; }
.isl-addset-btn { width:100%; margin:8px 0 6px; padding:10px; border:1px dashed var(--hair2); border-radius:11px; background:none; color:var(--tx2); font-size:11px; cursor:pointer; }
.isl-addset-btn:active { color:var(--flame); border-color:var(--flame); }
.isl-slot.compact .isl-addset-btn { margin-left:0; }
.isl-last-via { font-family:'JetBrains Mono',monospace; font-size:9.5px; color:var(--tx3); }
.isl-step-input { width:52px; background:var(--card); border:1px solid var(--hair); border-radius:7px; color:var(--tx1); font-family:'JetBrains Mono',monospace; font-size:13px; font-weight:700; text-align:center; padding:5px 2px; -moz-appearance:textfield; appearance:textfield; }
.isl-step-input::-webkit-outer-spin-button, .isl-step-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.isl-step-input:focus { outline:none; border-color:var(--flame); }
.isl-menu-opt { text-align:left; display:flex; align-items:center; gap:12px; background:var(--card2); border:1px solid var(--hair); border-radius:12px; padding:13px 12px; cursor:pointer; color:var(--tx1); width:100%; }
.isl-menu-opt.danger { color:var(--danger, #ef4444); border-color:rgba(239,68,68,.28); }
.isl-menu-ic { flex:none; width:28px; height:28px; display:flex; align-items:center; justify-content:center; color:inherit; }
.isl-menu-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.isl-menu-name { font-size:14px; font-weight:600; color:inherit; }
.isl-menu-sub { font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--tx3); }
.isl-undo-toast { position:absolute; left:14px; right:14px; bottom:calc(env(safe-area-inset-bottom, 0px) + 68px); z-index:55; display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--hair2); border-radius:13px; padding:12px 14px; box-shadow:var(--shadow); animation:isl-up .22s cubic-bezier(.22,1,.36,1); }
.isl-undo-toast .mono { flex:1; font-size:11.5px; color:var(--tx1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.isl-undo-toast.hide { opacity:0; transform:translateY(12px); transition:opacity .2s cubic-bezier(.2,.8,.2,1), transform .2s cubic-bezier(.2,.8,.2,1); pointer-events:none; } /* exits the edge it entered from (isl-up) · invisible must not be tappable (review F6) */
.pdpa-consent-skip { display:block; width:100%; margin-top:10px; background:none; border:none; color:var(--tx3, #9ca3af); font-size:12px; text-decoration:underline; cursor:pointer; padding:6px; }
.isl-undo-btn { flex:none; border:none; background:none; color:var(--flame); font-size:12px; font-weight:700; letter-spacing:1px; cursor:pointer; padding:4px 6px; }

/* Consent gate — ONE boot-time card (PDPA + analytics opt-in) */
.pdpa-consent-overlay { position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.72); display:flex; align-items:center; justify-content:center; padding:20px; }
.pdpa-consent-card { width:100%; max-width:400px; background:var(--card, #16181d); border:1px solid rgba(255,107,43,.3); border-radius:18px; padding:22px 20px; box-shadow:var(--shadow, 0 18px 50px rgba(0,0,0,.5)); }
.pdpa-consent-card h3 { font-size:17px; font-weight:700; color:var(--tx1, #f2f3f5); margin:0 0 10px; }
.pdpa-consent-card p { font-size:13.5px; line-height:1.55; color:var(--tx2, #b6bac2); margin:0 0 10px; }
.pdpa-consent-card a { color:var(--flame, #ff6b2b); }
.pdpa-consent-btn { width:100%; margin-top:12px; padding:13px; border:none; border-radius:12px; background:var(--flame, #ff6b2b); color:#fff; font-size:14px; font-weight:700; cursor:pointer; }
.pdpa-consent-btn:disabled { opacity:.6; cursor:wait; }
.consent-toggle-row { display:flex; align-items:flex-start; gap:10px; margin:12px 0 2px; padding:11px 12px; background:var(--card2, #1b1e24); border:1px solid var(--hair, rgba(255,255,255,.07)); border-radius:12px; cursor:pointer; }
.consent-toggle-row input { flex:none; width:18px; height:18px; margin-top:1px; accent-color:var(--flame, #ff6b2b); }
.consent-toggle-row span { font-size:12px; line-height:1.5; color:var(--tx2, #b6bac2); }

/* Launcher (next-client handoff) */
.isl-launch-stats { display:flex; gap:8px; margin-bottom:12px; }
.isl-launch-stat { flex:1; background:var(--card2); border:1px solid var(--hair); border-radius:11px; padding:11px; }
.isl-launch-stat .v { font-family:'JetBrains Mono',monospace; font-size:19px; font-weight:700; }
.isl-launch-stat .l { font-family:'JetBrains Mono',monospace; font-size:9px; color:var(--tx3); margin-top:2px; }
.isl-launch-next { background:var(--card2); border:1px solid rgba(255,107,43,.22); border-radius:14px; padding:13px; margin-bottom:12px; }
.isl-launch-client { display:flex; align-items:center; gap:11px; }
.isl-launch-start { width:100%; padding:14px; border:none; border-radius:13px; background:var(--flame); color:#fff; font-size:14px; font-weight:700; cursor:pointer; font-family:'JetBrains Mono',monospace; }
.isl-launch-cancel { width:100%; margin-top:8px; padding:11px; border:1px solid var(--hair); border-radius:12px; background:none; color:var(--tx2); font-size:12px; cursor:pointer; }
.isl-launch-flag { font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--warn); margin-top:10px; line-height:1.5; }
