@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

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

:root {
  --bg: #0a0a0f;
  --bg-elevated: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1e1e2a;
  --surface: #1c1c28;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(232, 168, 124, 0.2);

  --text: #f0ece6;
  --text-secondary: #9a9aad;
  --text-muted: #5c5c6e;

  --copper: #e8a87c;
  --copper-dim: #c08a60;
  --copper-glow: rgba(232, 168, 124, 0.2);
  --copper-deep: #a06840;

  --phase1: #7ec8d9;
  --phase1-bg: rgba(126, 200, 217, 0.1);
  --phase2: #c89ae8;
  --phase2-bg: rgba(200, 154, 232, 0.1);
  --phase3: #e89a7e;
  --phase3-bg: rgba(232, 154, 126, 0.1);
  --phase4: #8dd9a0;
  --phase4-bg: rgba(141, 217, 160, 0.1);

  --success: #8dd9a0;
  --success-glow: rgba(141, 217, 160, 0.15);
  --warning: #e8c87e;
  --danger: #e87e7e;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(232, 168, 124, 0.04), transparent 70%),
    var(--bg);
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 18px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---- Screens ---- */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
}

.screen.active {
  display: flex;
  animation: screenIn 0.5s var(--ease-out);
}

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

/* ---- Typography ---- */
h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.text-dim { color: var(--text-secondary); }
.text-accent { color: var(--copper); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  min-height: 50px;
  width: 100%;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}

.btn:active {
  transform: scale(0.975);
}

.btn-primary {
  background: linear-gradient(135deg, var(--copper), var(--copper-dim));
  color: #0a0a0f;
  box-shadow: 0 4px 20px var(--copper-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(232, 168, 124, 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.975) translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #6ec488);
  color: #0a0a0f;
  box-shadow: 0 4px 20px var(--success-glow);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  min-height: auto;
}

.btn-ghost:hover {
  color: var(--text-secondary);
}

.btn-sm {
  padding: 12px 16px;
  font-size: 14px;
  min-height: 44px;
}

.btn-danger {
  background: transparent;
  border: 1.5px solid rgba(232, 126, 126, 0.3);
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: rgba(232, 126, 126, 0.05);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  position: relative;
}

/* ---- Onboarding ---- */
#onboarding {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding: 40px 18px;
}

.onboarding-logo {
  font-size: 72px;
  line-height: 1;
  filter: drop-shadow(0 0 30px rgba(232, 168, 124, 0.3));
  animation: floatIn 1s var(--ease-spring);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--text), var(--copper));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: screenIn 0.6s var(--ease-out) 0.1s both;
}

.onboarding-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 300px;
  animation: screenIn 0.6s var(--ease-out) 0.2s both;
}

.onboarding-phases {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  text-align: left;
  animation: screenIn 0.6s var(--ease-out) 0.3s both;
}

.onboarding-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}

.onboarding-phase:hover {
  border-color: var(--border-accent);
}

.onboarding-phase .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  animation: screenIn 0.6s var(--ease-out) 0.4s both;
}

/* ---- Reminder Setup ---- */
.reminder-setup {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  align-items: center;
}

.time-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-picker-row input[type="time"] {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--copper);
  font-size: 18px;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  min-height: 48px;
  transition: border-color 0.3s;
}

.time-picker-row input[type="time"]:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-glow);
}

/* ---- Dashboard ---- */
#dashboard {
  gap: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  animation: screenIn 0.5s var(--ease-out) 0s both;
}

.dash-header-left h1 {
  margin-bottom: 3px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.settings-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  transition: all 0.3s var(--ease-out);
}

.settings-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border-color: var(--border-accent);
  transform: rotate(60deg);
}

/* Today card - hero element */
.dash-today {
  text-align: center;
  padding: 28px 18px 24px;
  position: relative;
  overflow: hidden;
  animation: screenIn 0.5s var(--ease-out) 0.1s both;
}

.dash-today::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 120px;
  background: radial-gradient(ellipse, var(--copper-glow), transparent 70%);
  pointer-events: none;
}

.dash-day-num {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  background: linear-gradient(180deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.dash-phase-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dash-phase-badge.phase-1 { background: var(--phase1-bg); color: var(--phase1); border: 1px solid rgba(126, 200, 217, 0.15); }
.dash-phase-badge.phase-2 { background: var(--phase2-bg); color: var(--phase2); border: 1px solid rgba(200, 154, 232, 0.15); }
.dash-phase-badge.phase-3 { background: var(--phase3-bg); color: var(--phase3); border: 1px solid rgba(232, 154, 126, 0.15); }
.dash-phase-badge.phase-4 { background: var(--phase4-bg); color: var(--phase4); border: 1px solid rgba(141, 217, 160, 0.15); }

.dash-stats {
  display: flex;
  gap: 10px;
  animation: screenIn 0.5s var(--ease-out) 0.2s both;
}

.stat-card {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(180deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* Start routine button - special treatment */
#btn-start-routine {
  animation: screenIn 0.5s var(--ease-out) 0.15s both;
}

/* ---- Notification Banner ---- */
.reminder-banner {
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.06), rgba(200, 154, 232, 0.06));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s var(--ease-out);
  animation: screenIn 0.5s var(--ease-out) 0.05s both;
}

.reminder-banner:hover {
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.1), rgba(200, 154, 232, 0.1));
  border-color: var(--copper);
}

.reminder-banner.hidden {
  display: none;
}

/* ---- Progress Grid ---- */
.progress-section {
  animation: screenIn 0.5s var(--ease-out) 0.3s both;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  animation: screenIn 0.5s var(--ease-out) 0.3s both;
}

.grid-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  position: relative;
  transition: all 0.3s var(--ease-out);
  border: 1px solid transparent;
}

.grid-cell.completed {
  color: rgba(10, 10, 15, 0.9);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.grid-cell.completed.phase-1 {
  background: linear-gradient(135deg, var(--phase1), #5ab0c2);
  border-color: rgba(126, 200, 217, 0.3);
}
.grid-cell.completed.phase-2 {
  background: linear-gradient(135deg, var(--phase2), #a87cc8);
  border-color: rgba(200, 154, 232, 0.3);
}
.grid-cell.completed.phase-3 {
  background: linear-gradient(135deg, var(--phase3), #c87c60);
  border-color: rgba(232, 154, 126, 0.3);
}
.grid-cell.completed.phase-4 {
  background: linear-gradient(135deg, var(--phase4), #6ec488);
  border-color: rgba(141, 217, 160, 0.3);
}

.grid-cell.current {
  border: 1.5px solid var(--copper);
  color: var(--copper);
  background: rgba(232, 168, 124, 0.08);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.grid-cell.future {
  opacity: 0.3;
}

.grid-cell:active {
  transform: scale(0.9);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--copper-glow);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(232, 168, 124, 0.1);
  }
}

/* ---- Routine Player ---- */
#routine {
  gap: 12px;
}

#routine .exercise-card {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#routine .routine-nav {
  flex-shrink: 0;
}

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

.routine-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.routine-back:hover {
  border-color: var(--border-accent);
  color: var(--copper);
}

.routine-progress-bar {
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.routine-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--copper), var(--copper-dim));
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
  box-shadow: 0 0 12px var(--copper-glow);
}

.exercise-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  padding: 16px 16px;
  position: relative;
  overflow-y: auto;
  min-height: 0;
}

.exercise-card::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 150px;
  background: radial-gradient(ellipse, rgba(232, 168, 124, 0.04), transparent 70%);
  pointer-events: none;
}

.exercise-target {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  align-self: center;
  border: 1px solid transparent;
}

.exercise-target.t-spine { background: var(--phase1-bg); color: var(--phase1); border-color: rgba(126,200,217,0.15); }
.exercise-target.hips { background: var(--phase2-bg); color: var(--phase2); border-color: rgba(200,154,232,0.15); }
.exercise-target.shoulders { background: var(--phase3-bg); color: var(--phase3); border-color: rgba(232,154,126,0.15); }
.exercise-target.integration { background: var(--phase4-bg); color: var(--phase4); border-color: rgba(141,217,160,0.15); }
.exercise-target.warmup { background: rgba(232,200,126,0.08); color: var(--warning); border-color: rgba(232,200,126,0.15); }
.exercise-target.cooldown { background: rgba(92,92,110,0.15); color: var(--text-muted); border-color: rgba(92,92,110,0.15); }

.exercise-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.exercise-prescription {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
}

.timer-display {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 6px 0;
  letter-spacing: -3px;
  background: linear-gradient(180deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.3s;
}

.timer-display.resting {
  background: linear-gradient(180deg, var(--warning), #c8a860);
  -webkit-background-clip: text;
  background-clip: text;
}

.btn-extend {
  align-self: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 20px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  letter-spacing: 0.5px;
}

.btn-extend:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.btn-extend:active {
  transform: scale(0.95);
  background: var(--copper-glow);
}

.exercise-cues {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.cue-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.cue-bullet {
  color: var(--copper);
  flex-shrink: 0;
  font-weight: 600;
}

.exercise-sets {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.set-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--text-muted);
  transition: all 0.3s var(--ease-spring);
}

.set-dot.done {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 6px var(--success-glow);
}

.set-dot.active {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-glow);
  transform: scale(1.2);
}

.routine-nav {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: var(--bg);
  flex-shrink: 0;
}

.routine-nav .btn {
  flex: 1;
}

/* ---- Day Complete ---- */
#complete {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding: 40px 18px;
}

.complete-check {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #6ec488);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: #0a0a0f;
  box-shadow:
    0 8px 32px var(--success-glow),
    0 0 0 8px rgba(141, 217, 160, 0.08);
  animation: completePop 0.6s var(--ease-spring);
}

@keyframes completePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#complete h1 {
  animation: screenIn 0.5s var(--ease-out) 0.15s both;
}

.complete-message {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 280px;
  animation: screenIn 0.5s var(--ease-out) 0.25s both;
}

.complete-stats {
  display: flex;
  gap: 32px;
  animation: screenIn 0.5s var(--ease-out) 0.35s both;
}

.complete-stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(180deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.complete-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-top: 2px;
}

#btn-complete-home {
  animation: screenIn 0.5s var(--ease-out) 0.45s both;
}

/* ---- Settings ---- */
#settings {
  gap: 22px;
}

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

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group label {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  padding-left: 2px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}

.settings-row:hover {
  border-color: var(--border-accent);
}

.settings-row span {
  font-size: 14px;
  font-weight: 400;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card-hover);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-secondary);
  top: 2px;
  left: 2px;
  transition: all 0.35s var(--ease-out);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider {
  background: var(--copper);
  border-color: var(--copper);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #0a0a0f;
}

.settings-reset {
  margin-top: auto;
  padding-top: 32px;
}

/* ---- Challenge Complete ---- */
#challenge-complete {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding: 40px 18px;
}

.trophy {
  font-size: 80px;
  animation: completePop 0.6s var(--ease-spring);
  filter: drop-shadow(0 0 40px rgba(232, 200, 126, 0.3));
}

/* ---- Utilities ---- */
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-auto { margin-top: auto; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 0; }

/* ---- Progress section heading ---- */
.progress-heading {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ---- Settings time input ---- */
#setting-time {
  background: transparent !important;
  border: none !important;
  color: var(--copper) !important;
  font-size: 15px !important;
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  text-align: right;
}


/* ---- Exercise List Button ---- */
.routine-list-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.routine-list-btn:hover {
  border-color: var(--border-accent);
  color: var(--copper);
}

/* ---- Demo Link ---- */
.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  color: var(--copper);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(232, 168, 124, 0.08);
  border: 1px solid rgba(232, 168, 124, 0.15);
  transition: all 0.25s var(--ease-out);
  letter-spacing: 0.3px;
}

.demo-link:hover {
  background: rgba(232, 168, 124, 0.15);
  border-color: var(--copper);
}

.demo-link:active {
  transform: scale(0.96);
}

.demo-link.hidden { display: none; }

/* ---- Drawer Overlay ---- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Drawer ---- */
.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 75vh;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.drawer.open {
  transform: translateY(0);
}

.drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 10px auto 0;
  opacity: 0.4;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  flex-shrink: 0;
}

.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.drawer-close:hover {
  background: var(--bg-card);
  color: var(--text-secondary);
}

/* ---- Drawer List ---- */
.drawer-list {
  overflow-y: auto;
  padding: 4px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  -webkit-overflow-scrolling: touch;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  border: 1px solid transparent;
  position: relative;
}

.drawer-item:hover {
  background: var(--bg-card);
}

.drawer-item.active {
  background: rgba(232, 168, 124, 0.08);
  border-color: rgba(232, 168, 124, 0.2);
}

.drawer-item.done {
  opacity: 0.45;
}

.drawer-item-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-item.active .drawer-item-num {
  background: var(--copper);
  color: #0a0a0f;
  border-color: var(--copper);
  box-shadow: 0 0 10px var(--copper-glow);
}

.drawer-item.done .drawer-item-num {
  background: var(--success);
  color: #0a0a0f;
  border-color: var(--success);
}

.drawer-item-info {
  flex: 1;
  min-width: 0;
}

.drawer-item-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item-link {
  color: var(--text);
  text-decoration: none;
  text-decoration-color: var(--copper);
  border-bottom: 1px dashed var(--copper-dim);
  transition: color 0.2s, border-color 0.2s;
}

.drawer-item-link:hover,
.drawer-item-link:active {
  color: var(--copper);
  border-color: var(--copper);
}

.drawer-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-item-target {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.drawer-item-target.t-spine { background: var(--phase1-bg); color: var(--phase1); }
.drawer-item-target.hips { background: var(--phase2-bg); color: var(--phase2); }
.drawer-item-target.shoulders { background: var(--phase3-bg); color: var(--phase3); }
.drawer-item-target.integration { background: var(--phase4-bg); color: var(--phase4); }
.drawer-item-target.warmup { background: rgba(232,200,126,0.08); color: var(--warning); }
.drawer-item-target.cooldown { background: rgba(92,92,110,0.15); color: var(--text-muted); }

/* ---- Selection color ---- */
::selection {
  background: var(--copper-glow);
  color: var(--text);
}
