/* ============================================
   ROUTINI BABY SCHEDULER — Stylesheet
   Brand: Navy #2E2E4F / Gold #F3C220 / Slate #A3C4DB / Cream #F5F5DC
   v3.0 — Timeline UI Overhaul
   v3.1 — Brand alignment: Poppins + hero-matched tokens (commit 00)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

:root {
  --navy: #2E2E4F;
  --navy-light: #3E3E63;
  --navy-deep: #1E1E3A;
  --gold: #F3C220;
  --gold-dim: #CFA12C;
  --gold-pale: rgba(243,194,32,0.14);
  --blue: #A3C4DB;
  --blue-pale: rgba(168,196,214,0.15);
  --cream: #F5F5DC;
  --cream-dark: #E8E8CC;
  --white: #FFFFFF;
  --text: #1C1E2E;
  --text-light: #6B7280;
  --text-muted: #9CA3AF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --card-bg: #FFFFFF;

  --shadow-xs: 0 1px 3px rgba(28,30,46,0.06), 0 1px 2px rgba(28,30,46,0.04);
  --shadow: 0 2px 8px rgba(28,30,46,0.07), 0 1px 3px rgba(28,30,46,0.04);
  --shadow-md: 0 4px 16px rgba(28,30,46,0.09), 0 2px 6px rgba(28,30,46,0.05);
  --shadow-lg: 0 12px 32px rgba(28,30,46,0.12), 0 4px 12px rgba(28,30,46,0.06);
  --shadow-gold: 0 4px 20px rgba(232,184,48,0.28);

  --radius: 18px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --radius-pill: 999px;

  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-height: 64px;
}

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

html, body {
  font-family: var(--font);
  background: #EEEEDE;
  color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior: none;
}

body { padding-top: var(--safe-top); }

#app {
  min-height: 100vh; min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--cream);
  position: relative;
}

.screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}

.screen--navy { background: var(--navy); }
.screen--cream { background: var(--cream); }

/* ============================================
   ICONS
   ============================================ */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
}
.ico svg { width: 100%; height: 100%; }
.ico--sm { width: 18px; height: 18px; }
.ico--tiny { width: 14px; height: 14px; }
.ico--stat { width: 20px; height: 20px; color: var(--text-muted); }
.ico--empty { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 12px; }
.ico--wake { color: var(--gold); }
.ico--nap { color: var(--blue); }
.ico--milk { color: var(--gold-dim); }
.ico--solid { color: #3D6B4E; }
.ico--bedtime { color: var(--navy); }

/* ============================================
   AGE SELECTOR — Carousel
   ============================================ */
.age-screen {
  background: var(--navy);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(168,196,214,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(232,184,48,0.06) 0%, transparent 50%);
  color: var(--white);
  padding: 0 20px calc(40px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden;
}

.age-screen__logo { margin-top: 44px; margin-bottom: 24px; }

.age-screen__prompt {
  color: var(--cream);
  font-size: 20px; font-weight: 800;
  text-align: center; margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.age-screen__name-input {
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px; font-weight: 500;
  padding: 14px 18px;
  width: 100%; max-width: 300px;
  text-align: center;
  margin-bottom: 28px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.age-screen__name-input::placeholder { color: rgba(255,255,255,0.3); }
.age-screen__name-input:focus { border-color: var(--gold); background: rgba(255,255,255,0.1); }

.age-screen__label {
  color: var(--blue);
  font-size: 11px; font-weight: 500;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 16px;
}

/* Carousel */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 12px 0 8px;
}

.carousel-track {
  display: flex;
  gap: 12px;
  padding: 0 calc(50% - 90px);
  will-change: transform;
  touch-action: pan-y;
}

.carousel-card {
  flex-shrink: 0;
  width: 180px;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 10px 10px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1),
              opacity 0.35s ease,
              border-color 0.25s ease,
              background 0.25s ease;
  opacity: 0.4;
  transform: scale(0.85);
  overflow: hidden;
}

.carousel-card--active {
  background: rgba(232,184,48,0.12);
  border-color: var(--gold);
  opacity: 1;
  transform: scale(1);
}

.carousel-card--near {
  opacity: 0.6;
  transform: scale(0.92);
}

.carousel-card__img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 8px;
  pointer-events: none;
}

.carousel-card__label {
  font-size: 17px; font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.carousel-card__hint {
  font-size: 12px; font-weight: 500;
  color: var(--blue);
  opacity: 0.8;
}

.carousel-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--cream);
  transition: background 0.15s, transform 0.15s;
}
.carousel-arrow svg { width: 18px; height: 18px; }
.carousel-arrow:active { background: rgba(255,255,255,0.15); transform: translateY(-50%) scale(0.92); }
.carousel-arrow--left { left: 4px; }
.carousel-arrow--right { right: 4px; }

.carousel-dots {
  display: flex; gap: 6px;
  justify-content: center;
  margin: 12px 0 24px;
}

.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot--active {
  background: var(--gold);
  transform: scale(1.25);
}

.carousel-confirm {
  margin-top: 8px;
}

/* ============================================
   WAKE TIME SCREEN
   ============================================ */
.wake-screen {
  background: var(--navy);
  background-image: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(168,196,214,0.1) 0%, transparent 60%);
  color: var(--white);
  padding: 0 24px calc(40px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1;
}

.wake-screen__title {
  font-size: 24px; font-weight: 800;
  color: var(--gold);
  margin-bottom: 8px; text-align: center;
  letter-spacing: -0.4px; line-height: 1.2;
}

.wake-screen__hint {
  color: var(--blue);
  font-size: 14px; font-weight: 500;
  margin-bottom: 40px; text-align: center;
}

/* ============================================
   DRUM PICKER
   ============================================ */
.drum-picker {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 44px;
  user-select: none; -webkit-user-select: none;
}

.drum-picker__colon {
  color: var(--gold);
  font-size: 28px; font-weight: 700;
  padding-bottom: 2px; flex-shrink: 0;
}

.drum-col {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}

.drum-col__label {
  font-size: 10px; font-weight: 500;
  color: rgba(168,196,214,0.7);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 8px;
}

.drum-viewport {
  position: relative;
  width: 72px; height: 180px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  touch-action: none;
}

.drum-viewport::before, .drum-viewport::after {
  content: '';
  position: absolute; left: 0; right: 0; height: 40px;
  z-index: 10; pointer-events: none;
}
.drum-viewport::before { top: 0; background: linear-gradient(to bottom, rgba(45,48,71,0.95) 0%, rgba(45,48,71,0) 100%); }
.drum-viewport::after { bottom: 0; background: linear-gradient(to top, rgba(45,48,71,0.95) 0%, rgba(45,48,71,0) 100%); }

.drum-viewport__ring {
  position: absolute; left: 6px; right: 6px;
  top: 50%; transform: translateY(-50%);
  height: 44px;
  border-radius: 10px;
  background: rgba(232,184,48,0.1);
  border: 2px solid rgba(232,184,48,0.35);
  pointer-events: none; z-index: 5;
}

.drum-list {
  position: relative; z-index: 2;
  will-change: transform;
  padding: 68px 0;
}

.drum-item {
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font);
  font-size: 24px; font-weight: 500;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.drum-item--selected { color: var(--white); font-size: 26px; }
.drum-item--near { color: rgba(255,255,255,0.6); font-size: 24px; }

.drum-ampm {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 28px;
}

.drum-ampm__opt {
  width: 54px; height: 44px;
  border-radius: var(--radius-xs);
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.35);
  font-family: var(--font);
  font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: flex; align-items: center; justify-content: center;
}

.drum-ampm__opt--active {
  background: rgba(232,184,48,0.15);
  border-color: rgba(232,184,48,0.45);
  color: var(--gold);
}
.drum-ampm__opt:active { transform: scale(0.94); }

/* Modal drum (compact + light theme for white modal sheet) */
.drum-picker--modal { margin-bottom: 0; gap: 4px; }
.drum-picker--modal .drum-viewport {
  width: 64px; height: 156px;
  background: var(--border-light);
  border-color: var(--border);
}
.drum-picker--modal .drum-viewport::before {
  background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
}
.drum-picker--modal .drum-viewport::after {
  background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
}
.drum-picker--modal .drum-viewport__ring {
  background: rgba(232,184,48,0.08);
  border-color: rgba(232,184,48,0.3);
}
.drum-picker--modal .drum-list { padding: 56px 0; }
.drum-picker--modal .drum-item {
  height: 44px; font-size: 20px;
  color: rgba(28,30,46,0.25);
}
.drum-picker--modal .drum-item--selected {
  font-size: 22px;
  color: var(--navy);
}
.drum-picker--modal .drum-item--near {
  color: rgba(28,30,46,0.5);
}
.drum-picker--modal .drum-picker__colon {
  font-size: 24px;
  color: var(--navy);
}
.drum-picker--modal .drum-ampm { margin-top: 18px; }
.drum-picker--modal .drum-ampm__opt {
  width: 46px; height: 44px; font-size: 12px;
  background: var(--border-light);
  border-color: var(--border);
  color: var(--text-muted);
}
.drum-picker--modal .drum-ampm__opt--active {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px; font-weight: 600;
  padding: 16px 48px;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s, box-shadow 0.12s;
  width: 100%; max-width: 300px;
  letter-spacing: -0.2px;
  box-shadow: var(--shadow-gold);
}
.btn-primary:active { transform: scale(0.96); opacity: 0.92; box-shadow: 0 2px 8px rgba(232,184,48,0.2); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn-primary--sm { padding: 10px 20px; font-size: 13px; width: auto; max-width: none; }

.btn-secondary {
  background: var(--border-light);
  color: var(--text);
  border: none; border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px; font-weight: 500;
  padding: 14px 24px;
  cursor: pointer; flex: 1;
  transition: transform 0.12s, background 0.12s;
}
.btn-secondary:active { background: var(--border); transform: scale(0.97); }

.btn-back {
  background: none; border: none;
  color: var(--blue);
  font-family: var(--font);
  font-size: 14px; font-weight: 500;
  cursor: pointer; margin-top: 20px; padding: 10px; opacity: 0.85;
}

/* ============================================
   SCHEDULE SCREEN
   ============================================ */
.schedule-screen {
  background: var(--cream);
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 80px);
}

.schedule-header {
  background: var(--navy);
  color: var(--white);
  padding: 20px 18px 20px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(28,30,46,0.2);
}

.schedule-header__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}

.schedule-header__main {
  flex: 1; min-width: 0;
}

.schedule-header__title {
  font-size: 22px; font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.4px; line-height: 1.15;
  margin-bottom: 10px;
}

.schedule-header__controls {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: var(--white);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.schedule-header__controls:active {
  background: rgba(255,255,255,0.14); transform: scale(0.98);
}

.schedule-header__chip {
  font-weight: 600;
  white-space: nowrap;
}
.schedule-header__chip--wake {
  opacity: 0.85;
  position: relative;
  padding-left: 8px;
}
.schedule-header__chip--wake::before {
  content: "·";
  position: absolute; left: 0;
  opacity: 0.6;
}

/* Legacy class kept for any leftover references — falls back to chip styling */
.schedule-header__age {
  font-size: 13px; color: var(--blue);
  font-weight: 500; margin-top: 4px;
}
.schedule-header__wake-edit {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
}

.schedule-header__btn {
  background: rgba(255,255,255,0.09);
  border: 1.5px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0; margin-top: 2px;
}
.schedule-header__btn:active { background: rgba(255,255,255,0.16); transform: scale(0.96); }

/* Legacy — kept for safety, no longer rendered */
.trial-badge {
  background: var(--gold); color: var(--navy);
  font-size: 10px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
  display: inline-block; margin-left: 8px;
  vertical-align: middle; letter-spacing: 0.3px;
}

/* ============================================
   WELCOME SCREEN (v4.0)
   ============================================ */
.welcome-screen {
  background: var(--navy);
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.welcome-screen__inner {
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; align-items: stretch;
  padding-top: 12px;
}

.welcome-screen__logo {
  display: flex; justify-content: center;
  margin-bottom: 24px;
}

.welcome-screen__title {
  font-size: 26px; font-weight: 800;
  color: var(--white);
  text-align: center;
  letter-spacing: -0.5px; line-height: 1.2;
  margin-bottom: 8px;
}

.welcome-screen__sub {
  font-size: 15px; font-weight: 600;
  color: var(--gold);
  text-align: center;
  margin-bottom: 28px;
}

.welcome-screen__compare {
  background: var(--white);
  border: 1.5px solid rgba(45,48,71,0.08);
  border-radius: 16px;
  padding: 6px 4px;
  margin-bottom: 28px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

.welcome-compare__row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(45,48,71,0.06);
}
.welcome-compare__row:last-child { border-bottom: none; }

.welcome-compare__row--head {
  padding: 10px 10px 12px;
  border-bottom: 1.5px solid rgba(45,48,71,0.1);
}
.welcome-compare__row--head .welcome-compare__cell {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.welcome-compare__cell {
  font-size: 13px;
  text-align: center;
  line-height: 1.3;
}

.welcome-compare__cell--label {
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  padding-right: 6px;
}

.welcome-compare__cell--us {
  color: var(--navy);
  font-weight: 700;
}
.welcome-compare__row--head .welcome-compare__cell--us {
  color: var(--navy);
}

.welcome-compare__cell--them {
  color: rgba(45,48,71,0.55);
  font-weight: 500;
}
.welcome-compare__row--head .welcome-compare__cell--them {
  color: rgba(45,48,71,0.5);
}

.welcome-screen__cta {
  display: block;
  width: 100%;
  margin: 0 auto 12px;
}

.welcome-screen__hint {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  margin-bottom: 24px;
}

/* ============================================
   DAY-EDIT MODAL (v4.0 — combined age + wake)
   ============================================ */
.modal-sheet__subtitle {
  font-size: 13px;
  color: #6B7280;
  text-align: center;
  margin-bottom: 18px;
}

.day-edit-age-wrap {
  position: relative;
  margin-bottom: 4px;
}

.day-edit-age-btn {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--cream);
  border: 1.5px solid rgba(45,48,71,0.12);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 15px; font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.day-edit-age-btn:active {
  background: rgba(232,184,48,0.08);
  border-color: var(--gold);
}

.day-edit-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid rgba(45,48,71,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(45,48,71,0.18);
  z-index: 10;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}
.day-edit-dropdown--open {
  display: block;
}

.day-edit-age-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 14px; font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.1s;
}
.day-edit-age-option:hover, .day-edit-age-option:active {
  background: rgba(232,184,48,0.1);
}
.day-edit-age-option--active {
  background: rgba(232,184,48,0.18);
  font-weight: 700;
  color: var(--navy);
}

/* v3.1 — commit 05: old .timeline / .tl-event / .tl-block / .tl-ww blocks removed.
   Replaced by .v2-* timeline at the bottom of this file.
   Kept: .tl-action-btn (still used in v2 rows). */


/* Action buttons in timeline */
.tl-action-btn {
  background: var(--border-light); border: none;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 11px; font-weight: 500; color: var(--text-light);
  padding: 5px 10px; cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  display: inline-flex; align-items: center; gap: 3px;
}
.tl-action-btn svg { width: 12px; height: 12px; }
.tl-action-btn:active { background: var(--border); transform: scale(0.95); }
.tl-action-btn--skip { color: var(--text-muted); }

/* ============================================
   FLAG BADGES
   ============================================ */
/* v3.1 — commit 04: soften default flag voice
   Default = neutral "note" (guidance). Amber = real warning. */
.flag-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--border-light); color: var(--text-light);
  font-size: 10px; font-weight: 500;
  padding: 3px 9px; border-radius: var(--radius-pill);
  margin-top: 5px; letter-spacing: 0.1px;
}
.flag-badge::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}
.flag-badge--warning {
  background: #FEF3C7; color: #92400E;
}
.flag-badge--warning::before { background: var(--warning); }
/* Backwards-compat alias: keep .flag-badge--danger working for any caller
   still passing that class. Same visual as --warning. */
.flag-badge--danger { background: #FEF3C7; color: #92400E; }
.flag-badge--danger::before { background: var(--warning); }

/* ============================================
   ADD NAP BUTTON
   ============================================ */
.add-nap-btn {
  width: 100%; padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.add-nap-btn:active { border-color: var(--blue); color: var(--navy); background: var(--blue-pale); }

/* ============================================
   SCHEDULE ACTIONS (v4.0 — unified bottom button group)
   ============================================ */
.schedule-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 0;
}

.schedule-action-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.schedule-action-btn span {
  line-height: 1;
}

.schedule-action-btn--secondary {
  background: transparent;
  border: 2px dashed var(--border);
  color: var(--text-muted);
}
.schedule-action-btn--secondary:active {
  border-color: var(--blue);
  color: var(--navy);
  background: var(--blue-pale);
  transform: scale(0.98);
}

.schedule-action-btn--primary {
  background: var(--navy);
  border: 2px solid var(--navy);
  color: var(--gold);
}
.schedule-action-btn--primary:active {
  background: #1F2235;
  transform: scale(0.98);
}

/* ============================================
   SUMMARY BAR
   ============================================ */
.summary-bar {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 16px 16px;
  margin: 12px 12px 0;
  box-shadow: var(--shadow);
}

.summary-bar__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.summary-stat {
  text-align: center;
  background: var(--border-light);
  border-radius: var(--radius-xs);
  padding: 12px 4px 10px;
}

.summary-stat__icon { display: flex; justify-content: center; margin-bottom: 4px; }

.summary-stat__value {
  font-size: 20px; font-weight: 800; color: var(--navy);
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}

.summary-stat__label {
  font-size: 10px; color: var(--text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
}

/* ============================================
   TAB BAR — 4 tabs, anchored
   ============================================ */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + var(--safe-bottom));
  display: flex; align-items: flex-start; justify-content: space-around;
  box-shadow: 0 -2px 16px rgba(28,30,46,0.06);
  z-index: 200;
}

.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius-xs);
  min-width: 56px; font-family: var(--font);
  transition: opacity 0.12s, transform 0.12s;
}
.tab-btn:active { opacity: 0.55; transform: scale(0.92); }

.tab-btn__icon { width: 24px; height: 24px; color: var(--text-muted); flex-shrink: 0; }
.tab-btn__icon svg { width: 100%; height: 100%; }

.tab-btn__label {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.tab-btn--active .tab-btn__icon { color: var(--gold); }
.tab-btn--active .tab-btn__label { color: var(--gold); }

/* ============================================
   DISCLAIMER
   ============================================ */
.disclaimer {
  text-align: center; padding: 14px 20px 20px;
  font-size: 10px; color: var(--text-muted); line-height: 1.6;
  font-weight: 400;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28,30,46,0.55);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.modal-sheet {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  width: 100%; max-width: 430px;
  padding: 0 20px calc(24px + var(--safe-bottom));
  animation: slideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-sheet::before {
  content: '';
  display: block; width: 36px; height: 5px;
  background: #D1D5DB; border-radius: 3px;
  margin: 10px auto 20px;
}

.modal-sheet__title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 22px; text-align: center;
  color: var(--text); letter-spacing: -0.3px;
}

.modal-label {
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 10px; display: block;
}

.modal-sheet__actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-sheet__actions .btn-primary { flex: 1; padding: 14px; max-width: none; }

.modal-drum-wrap { display: flex; justify-content: center; margin-bottom: 4px; }

/* v3.1 — commit 03: inline helpers replacing alert() */
.modal-helper,
.inline-helper {
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
  padding: 10px 12px;
  background: rgba(239,68,68,0.08);
  border-radius: var(--radius-xs);
  margin-top: 14px;
  display: none;
  text-wrap: pretty;
  line-height: 1.4;
}
.modal-helper--visible,
.inline-helper--visible { display: block; }
.inline-helper { margin: 12px 0 0; text-align: center; }

/* ============================================
   PAYWALL
   ============================================ */
.paywall-screen {
  background: var(--navy);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(168,196,214,0.15) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(232,184,48,0.08) 0%, transparent 50%);
  color: var(--white);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px calc(32px + var(--safe-bottom));
  text-align: center;
}

.paywall__title { color: var(--gold); font-size: 28px; font-weight: 800; margin: 20px 0 8px; letter-spacing: -0.5px; }
.paywall__subtitle { color: var(--blue); font-size: 15px; font-weight: 500; line-height: 1.6; max-width: 290px; margin-bottom: 28px; }
.paywall__price { color: var(--gold); font-size: 38px; font-weight: 800; margin-bottom: 4px; letter-spacing: -1px; }
.paywall__price-detail { color: var(--blue); font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.paywall__price-annual { color: rgba(168,196,214,0.7); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.paywall__price-norecur { color: rgba(156,163,175,0.6); font-size: 11px; margin-bottom: 28px; font-style: italic; }

.paywall__features {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 18px 20px;
  width: 100%; max-width: 320px;
  margin-bottom: 28px; text-align: left;
}

.paywall__feature {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; font-size: 14px; font-weight: 500; color: var(--cream);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.paywall__feature:last-child { border-bottom: none; }
.paywall__feature-check { color: var(--success); font-weight: 700; font-size: 16px; }

.paywall__cta {
  background: var(--gold); color: var(--navy);
  border: none; border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px; font-weight: 600;
  padding: 17px 48px;
  cursor: pointer; width: 100%; max-width: 300px;
  transition: transform 0.12s, opacity 0.12s;
  box-shadow: var(--shadow-gold); letter-spacing: -0.2px;
}
.paywall__cta:active { transform: scale(0.97); opacity: 0.9; }
.paywall__cta:disabled { opacity: 0.55; cursor: wait; }

/* ============================================
   HISTORY — Sparklines
   ============================================ */
.history-list {
  padding: 16px 14px calc(var(--tab-height) + var(--safe-bottom) + 24px);
}

.history-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.1s;
  animation: cardIn 0.22s ease both;
}
.history-card:active { transform: scale(0.98); }

.history-card__date {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.history-card__meta {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Sparkline — visual fingerprint */
.sparkline {
  position: relative;
  height: 20px;
  background: var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.sparkline__seg {
  position: absolute;
  top: 2px; bottom: 2px;
  border-radius: 4px;
  min-width: 3px;
}
.sparkline__seg--wake { background: var(--gold); }
.sparkline__seg--nap  { background: var(--blue); }
.sparkline__seg--milk { background: var(--gold-dim); opacity: 0.7; height: 8px; top: 6px; bottom: auto; border-radius: 3px; }
.sparkline__seg--solid { background: #6B9E7A; opacity: 0.85; height: 8px; top: 6px; bottom: auto; border-radius: 3px; }
.sparkline__seg--bed  { background: var(--navy); opacity: 0.6; }

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; color: var(--text-muted); text-align: center;
}
.empty-state__title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty-state__hint { font-size: 13px; font-weight: 600; }

/* ============================================
   SETTINGS
   ============================================ */
.settings-body {
  padding: 20px 16px calc(var(--tab-height) + var(--safe-bottom) + 24px);
  max-width: 420px; margin: 0 auto;
}

.settings-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(0,0,0,0.04);
  display: flex; align-items: center; gap: 14px;
  transition: transform 0.1s;
}
.settings-card:active { transform: scale(0.98); }

.settings-card__icon { flex-shrink: 0; }
.settings-card__icon .ico { width: 24px; height: 24px; color: var(--text-muted); }
.settings-card__info { flex: 1; min-width: 0; }
.settings-card__label { font-size: 14px; font-weight: 600; color: var(--text); }
.settings-card__value { font-size: 13px; font-weight: 500; margin-top: 2px; }
.settings-card__hint { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.settings-footer {
  text-align: center; padding: 32px 0 16px;
  color: var(--text-muted);
}
.settings-footer__version { font-size: 12px; font-weight: 500; margin-top: 10px; }
.settings-footer__tagline { font-size: 12px; font-weight: 600; margin-top: 2px; }
.settings-footer__email {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--blue); text-decoration: none;
  font-size: 13px; font-weight: 500;
  margin-top: 10px;
}

/* ============================================
   HELP SCREEN — Accordion
   ============================================ */
.help-body {
  padding: 16px 14px calc(var(--tab-height) + var(--safe-bottom) + 24px);
}

.help-card {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.help-card__header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.help-card__header:active { background: var(--border-light); }

.help-card__icon { flex-shrink: 0; }
.help-card__icon .ico { width: 22px; height: 22px; color: var(--gold); }

.help-card__q {
  flex: 1;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.help-card__chevron {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.help-card__chevron svg { width: 100%; height: 100%; }

.help-card__answer {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  font-size: 13px; font-weight: 600;
  color: var(--text-light);
  line-height: 1.7;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.help-card--open .help-card__chevron { transform: rotate(90deg); }
.help-card--open .help-card__answer { max-height: 600px; padding: 0 16px 16px; }
.help-card--open { box-shadow: var(--shadow-md); }

.help-contact {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 24px 16px 16px;
  font-size: 13px; font-weight: 500;
}
.help-contact a {
  color: var(--blue); text-decoration: none;
}

/* ============================================
   LOADING
   ============================================ */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes cardIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================
   v2 TIMELINE — UNIFIED ROW
   v3.1 — commit 05: one row format for all event types.
   Replaces .tl-event / .tl-block / .tl-ww below.
   ============================================ */
.v2-tl {
  padding: 12px 14px 8px;
  background: var(--cream);
  flex: 1;
  overflow-y: auto;
}

.v2-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  padding: 6px 0;
  margin-bottom: 2px;
}

.v2-row__time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  padding-top: 12px;
  text-align: right;
}
.v2-row__time-range {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.v2-row__card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-xs);
  min-height: 52px;
}

.v2-row__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  background: var(--border-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.v2-row__icon svg { width: 16px; height: 16px; }

.v2-row--wake .v2-row__icon  { background: #FFF3CC; color: #A77A00; }
.v2-row--milk .v2-row__icon  { background: #FBF1D9; color: #8A6A2E; }
.v2-row--solid .v2-row__icon { background: #DBE8DE; color: #3D6B4E; }
.v2-row--nap .v2-row__icon   { background: #DEEAF2; color: #3E6E87; }
.v2-row--bedtime .v2-row__icon { background: #DFDCEB; color: var(--navy); }

.v2-row__body { flex: 1; min-width: 0; }
.v2-row__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.v2-row__meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.3;
}
.v2-row__dur {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 3px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  align-self: center;
}

.v2-row--nap .v2-row__card {
  background: linear-gradient(180deg, #EEF6FB 0%, #F5FAFD 100%);
  border-color: rgba(163,196,219,0.4);
}
.v2-row--bedtime .v2-row__card {
  background: linear-gradient(180deg, #EBE8F2 0%, #F2F0F7 100%);
  border-color: rgba(46,46,79,0.12);
}

/* commit 07 — dim past + skipped events */
.v2-row--done .v2-row__card {
  opacity: 0.48;
}
.v2-row--done .v2-row__icon {
  background: var(--border-light);
  color: var(--text-muted);
}
/* Strike-through only for user-skipped/auto-skipped events — past events
   use dim alone. Strike-through implies "cancelled" which is wrong for
   events that simply happened already. */
.v2-row--skipped .v2-row__time {
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

/* commit 07.2 — current event (mid-nap, mid-bedtime). Gold outline
   matches the Up Next card palette — the highlighted row is the
   "landing spot" for the countdown. Only applies to range events
   (naps, bedtime); point events flip cleanly future → past. */
.v2-row--current .v2-row__card {
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(243,194,32,0.15);
}

.v2-row__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-self: center;
}

/* Wake window — integrated spine, not a pill */
.v2-ww {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
}
.v2-ww__left {
  height: 16px;
  border-right: 2px dotted rgba(46,46,79,0.18);
}
.v2-ww__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-left: 2px;
}
.v2-ww--flag .v2-ww__label { color: var(--warning); }

/* ============================================
   NOW CARD — v3.1 commit 06
   Pinned inside the navy header. Shows next upcoming event
   with a live countdown.
   ============================================ */
.now-card {
  background: rgba(243,194,32,0.12);
  border: 1px solid rgba(243,194,32,0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.now-card__pill {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.now-card__pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: now-pulse 1.6s ease-in-out infinite;
}
@keyframes now-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.now-card__label {
  font-size: 14px; font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}
.now-card__meta {
  font-size: 12px; font-weight: 500;
  color: var(--blue);
  margin-top: 2px;
}
.now-card__countdown {
  font-size: 22px; font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}
.now-card__countdown-lbl {
  font-size: 9px; font-weight: 600;
  color: var(--blue);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: right;
  margin-top: 4px;
}

/* ============================================
   NOW CARD — DAY-DONE VARIANT (v4.0)
   ============================================ */
.now-card--done {
  /* Override the grid layout since there's no second column anymore */
  grid-template-columns: 1fr;
  text-align: center;
}
.now-card__done-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.now-card--done .now-card__pill {
  /* Stop the pulsing dot at end of day — it's a closing card, not an active alert */
  justify-content: center;
}
.now-card--done .now-card__pill::before {
  animation: none;
  opacity: 0.7;
}
