/* ═══════════════════════════════════════════════════════════════
   HerRelief — Premium Period Tracker CSS
   Mobile-first, max-width 480px
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  --primary:       #b75c3d;
  --primary-dark:  #9a4a30;
  --primary-light: #f5cdc4;
  --secondary:     #d89588;
  --secondary-dark:#b75c3d;
  --accent:        #f5cdc4;
  --accent-light:  #fbe5e0;
  --bg:            #f7f2ed;
  --card:          #ffffff;
  --text:          #4a2818;
  --text-muted:    #8a7a6e;
  --text-light:    #b8a99c;
  --border:        rgba(183,92,61,0.10);
  --shadow-sm:     0 1px 4px rgba(183,92,61,0.06);
  --shadow-md:     0 4px 16px rgba(183,92,61,0.08);
  --shadow-lg:     0 8px 32px rgba(183,92,61,0.10);
  --shadow-pink:   0 4px 20px rgba(216,149,136,0.20);
  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-full:   999px;
  --nav-height:    72px;
  --header-height: 64px;
  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce:        0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  --serif:         'Playfair Display', 'Cormorant Garamond', Georgia, serif;

  /* Period phases */
  --period-color:    #d89588;
  --period-bg:       rgba(216,149,136,0.18);
  --fertile-color:   #c98c6e;
  --fertile-bg:      rgba(201,140,110,0.15);
  --ovulation-color: #b75c3d;
  --ovulation-bg:    rgba(183,92,61,0.12);
  --logged-color:    #8a7a6e;
  --logged-bg:       rgba(138,122,110,0.15);
}

/* ─── DARK MODE ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:       #e08568;
  --primary-dark:  #b75c3d;
  --primary-light: #6b3a2a;
  --secondary:     #d89588;
  --secondary-dark:#b75c3d;
  --accent:        #4a2818;
  --accent-light:  #3a1e12;
  --bg:            #1a0f0a;
  --card:          #2a1810;
  --text:          #f5e8dc;
  --text-muted:    #b8a99c;
  --text-light:    #8a7a6e;
  --border:        rgba(224,133,104,0.18);
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.35);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.55);
  --shadow-pink:   0 4px 20px rgba(216,149,136,0.15);
  --period-color:  #e8a89b;
  --period-bg:     rgba(216,149,136,0.22);
  --fertile-color: #e0a888;
  --fertile-bg:    rgba(201,140,110,0.20);
  --ovulation-color:#e08568;
  --ovulation-bg:  rgba(224,133,104,0.18);
  --logged-color:  #b8a99c;
  --logged-bg:     rgba(138,122,110,0.20);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .onboarding-wrap { background: var(--bg); }
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .modal { background: var(--card); }
[data-theme="dark"] .bottom-nav { background: rgba(26,15,10,0.95); border-top-color: var(--border); }
[data-theme="dark"] .sidebar-nav { background: #150a05; }
[data-theme="dark"] .app-header { background: rgba(26,15,10,0.92); border-bottom-color: var(--border); }
[data-theme="dark"] .symptom-quick-card { background: var(--accent); color: var(--primary); }
[data-theme="dark"] .symptom-quick-card svg { stroke: var(--primary); }
[data-theme="dark"] .cycle-ring-svg .day-num,
[data-theme="dark"] .cycle-ring-svg .center-day,
[data-theme="dark"] .cycle-ring-svg .center-phase { fill: var(--primary); }
[data-theme="dark"] .cycle-ring-svg .dot { fill: var(--primary-light); }
[data-theme="dark"] .cycle-ring-svg .period-arc { stroke: var(--secondary); }
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card { background: var(--card); border-color: var(--border); }

/* ─── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── LAYOUT WRAPPER ─────────────────────────────────────────── */
.screen {
  display: none !important;
  min-height: 100dvh;
}
.screen.active { display: block !important; }
#screen-auth.active { display: block !important; }
#screen-auth.active .auth-page { display: grid; }
#screen-app.active { display: flex !important; }

/* ─── TYPOGRAPHY UTILITIES ───────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.highlight-text { color: var(--primary); font-weight: 600; }

/* ─── CARD ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px;
  border: 1px solid var(--border);
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  border: 2px solid transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(139,92,246,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(139,92,246,0.5); transform: translateY(-1px); }

.btn-pink {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: white;
  box-shadow: var(--shadow-pink);
  padding: 10px 18px;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: rgba(139,92,246,0.05); }

.btn-outline-danger {
  background: transparent;
  color: #EF4444;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
}

.btn-danger {
  background: #EF4444;
  color: white;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font-weight: 600;
}

.btn-full { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--primary); font-size: 13px; font-weight: 500; cursor: pointer; }

/* ─── ICON BUTTON ────────────────────────────────────────────── */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: rgba(139,92,246,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  transition: background var(--transition);
  position: relative;
}
.icon-btn:hover { background: rgba(139,92,246,0.15); }

/* ─── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: rgba(139,92,246,0.03);
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: rgba(139,92,246,0.03);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  resize: none;
  min-height: 100px;
  transition: border-color var(--transition);
}
.form-textarea:focus { outline: none; border-color: var(--primary); }

/* ─── SLIDER ─────────────────────────────────────────────────── */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.slider-label { font-size: 12px; color: var(--text-muted); min-width: 24px; text-align: center; }

.slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary) var(--fill-pct, 50%), rgba(139,92,246,0.15) var(--fill-pct, 50%));
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 2.5px solid var(--primary);
  box-shadow: 0 2px 8px rgba(139,92,246,0.3);
  cursor: pointer;
  transition: transform var(--bounce);
}
.slider::-webkit-slider-thumb:active { transform: scale(1.2); }

/* ─── CHIPS ──────────────────────────────────────────────────── */
.cycle-chips, .period-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--transition);
}
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(139,92,246,0.35);
}

/* ─── PRIVACY NOTE ───────────────────────────────────────────── */
.privacy-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 12px;
}
.privacy-note a { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING SCREEN
   ═══════════════════════════════════════════════════════════════ */
#screen-onboarding {
  background: var(--bg);
  min-height: 100dvh;
  overflow-y: auto;
}

.onboarding-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* Hero section */
.onboarding-hero {
  text-align: center;
  padding: 40px 0 24px;
}

.logo-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.logo-text {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.onboarding-illustration {
  margin: 0 auto 24px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.onboarding-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.onboarding-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Onboarding form */
.onboarding-form {
  margin-top: 8px;
  padding: 28px 24px;
}

.onboarding-step { display: none; }
.onboarding-step.active { display: block; }

.step-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════ */
#screen-app {
  display: none;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}
#screen-app.active { display: flex; }

.status-spacer {
  height: env(safe-area-inset-top, 0px);
  min-height: 4px;
}

/* ─── APP HEADER ─────────────────────────────────────────────── */
.app-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
}
.header-greeting { font-size: 11px; color: var(--text-light); font-weight: 500; }
.header-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--secondary);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--bg);
}

/* ─── APP MAIN ───────────────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-height) + 12px);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ─── TAB PANELS ─────────────────────────────────────────────── */
.tab-panel {
  display: none !important;
  padding: 0 16px 16px;
  animation: fadeSlideUp 0.3s ease forwards;
}
.tab-panel.active { display: block !important; }

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

/* ─── BOTTOM NAV ─────────────────────────────────────────────── */
.bottom-nav {
  height: var(--nav-height);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(139,92,246,0.08);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  color: var(--text-light);
  transition: all var(--transition);
  min-height: 56px;
}
.nav-btn:active { transform: scale(0.93); }
.nav-btn.active { color: var(--primary); }
.nav-btn.active .nav-icon svg { stroke: var(--primary); }
.nav-icon { transition: transform var(--bounce); }
.nav-btn.active .nav-icon { transform: scale(1.1); }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }

/* Center FAB nav button */
.nav-btn-center {
  flex: 0 0 56px;
  margin-bottom: 16px;
}
.nav-icon-center {
  width: 52px; height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(139,92,246,0.45);
  transition: transform var(--bounce), box-shadow var(--transition);
}
.nav-btn-center:active .nav-icon-center { transform: scale(0.93); }
.nav-btn-center.active .nav-icon-center {
  box-shadow: 0 6px 20px rgba(236,72,153,0.5);
}
.nav-btn-center .nav-label { color: var(--primary); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD TAB
   ═══════════════════════════════════════════════════════════════ */

/* Hero card */
/* Cycle ring card (new — replaces gradient hero) */
.hero-card {
  margin: 12px 0 20px;
  border-radius: var(--radius-lg);
  padding: 28px 16px 36px;
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--bg);
  box-shadow: none;
  border: none;
}
.hero-card-bg { display: none; }
.hero-card-content,
.hero-label, .hero-countdown, .hero-date, .hero-phase-badge,
.countdown-number, .countdown-unit,
.hero-ring, .ring-label { display: none; }
.cycle-ring-wrap {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
}
.cycle-ring-svg {
  width: 100%;
  height: auto;
  display: block;
}
.cycle-ring-svg text { font-family: var(--serif); }
.cycle-ring-svg .day-num { fill: var(--primary); font-size: 14px; }
.cycle-ring-svg .dot { fill: var(--primary-light); }
.cycle-ring-svg .today-dot { fill: var(--primary); }
.cycle-ring-svg .today-num { fill: #fff; font-size: 16px; font-weight: 600; }
.cycle-ring-svg .center-day { fill: var(--primary); font-size: 18px; letter-spacing: 0.02em; }
.cycle-ring-svg .center-phase { fill: var(--primary); font-size: 36px; font-weight: 500; letter-spacing: -0.01em; }
.cycle-ring-svg .period-arc {
  stroke: var(--accent);
  stroke-width: 24;
  fill: none;
  stroke-linecap: round;
  opacity: 0.95;
}
.cycle-ring-svg .comet-trail {
  stroke: var(--primary);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  opacity: 0.85;
}
.cycle-ring-svg .center-bloom {
  stroke: var(--primary);
  stroke-width: 1.5;
  fill: none;
}

/* Symptom quick row (new) */
.symptom-quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 12px 0 20px;
}
.symptom-quick-row .quick-title {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--primary);
  margin: 0 0 4px;
  font-weight: 500;
}
.symptom-quick-card {
  background: var(--accent);
  border: none;
  border-radius: 18px;
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--primary);
  font-family: var(--serif);
  font-size: 15px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.symptom-quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.symptom-quick-card:active { transform: translateY(0); }
.symptom-quick-card.pressed {
  transform: scale(0.96);
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.symptom-quick-card svg {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.stat-icon { font-size: 18px; margin-bottom: 4px; }
.stat-value { font-size: 18px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 10px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* Info card (fertile window) */
.info-card { margin-bottom: 16px; }
.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.info-icon { font-size: 20px; }
.info-card-header h3 { flex: 1; font-size: 15px; font-weight: 600; }
.info-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}
.fertile-range { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.fertile-bar {
  height: 6px;
  background: rgba(139,92,246,0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}
.fertile-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
  width: 0%;
}
.info-note { font-size: 12px; color: var(--text-muted); }

/* Insight card */
.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(183,92,61,0.06), rgba(216,149,136,0.04));
  border: 1px solid rgba(183,92,61,0.12);
}
.insight-emoji {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.insight-emoji svg { width: 32px; height: 32px; display: block; }
.insight-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.insight-content p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* Reorder card */
.reorder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(236,72,153,0.06), rgba(244,114,182,0.04));
  border: 1px solid rgba(236,72,153,0.15);
}
.reorder-left { display: flex; align-items: center; gap: 12px; }
.reorder-icon { font-size: 28px; }
.reorder-left h4 { font-size: 14px; font-weight: 600; color: var(--text); }
.reorder-left p { font-size: 12px; color: var(--text-muted); }

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  margin-top: 4px;
}
.section-header h3 { font-size: 16px; font-weight: 700; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 10px;
}

/* Recent logs */
.recent-logs { margin-bottom: 12px; }
.empty-state-mini {
  text-align: center;
  padding: 24px 16px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  color: var(--text-muted);
  display: flex; flex-direction: column; gap: 8px;
}

.log-item {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.log-item-date { font-size: 13px; font-weight: 600; min-width: 80px; }
.log-item-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.log-tag {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════
   CALENDAR TAB
   ═══════════════════════════════════════════════════════════════ */
.calendar-wrap {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}

.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: rgba(139,92,246,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  transition: background var(--transition), transform var(--bounce);
}
.cal-nav-btn:active { transform: scale(0.9); }

.cal-month-year {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.calendar-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.calendar-dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
}
.cal-day:active { transform: scale(0.9); }
.cal-day.empty { cursor: default; }
.cal-day.today {
  font-weight: 700;
  color: var(--primary);
}
.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: var(--radius-full);
  background: var(--primary);
}
.cal-day.other-month { color: var(--text-light); opacity: 0.5; }

/* Phase backgrounds */
.cal-day.period {
  background: var(--period-bg);
  color: var(--period-color);
  font-weight: 600;
}
.cal-day.period::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 7px; height: 7px;
  border-radius: var(--radius-full);
  background: var(--period-color);
  opacity: 0.8;
}
.cal-day.fertile {
  background: var(--fertile-bg);
  color: var(--fertile-color);
  font-weight: 500;
}
.cal-day.ovulation {
  background: var(--ovulation-bg);
  color: var(--ovulation-color);
  font-weight: 700;
  border: 1.5px solid rgba(16,185,129,0.3);
}
.cal-day.logged::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 5px; height: 5px;
  border-radius: var(--radius-full);
  background: var(--logged-color);
}
.cal-day.selected {
  background: var(--primary);
  color: white !important;
  box-shadow: 0 2px 8px rgba(139,92,246,0.4);
}

/* Cal legend */
.cal-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.legend-dot.period { background: var(--period-color); }
.legend-dot.fertile { background: var(--fertile-color); }
.legend-dot.ovulation { background: var(--ovulation-color); }
.legend-dot.logged { background: var(--logged-color); }

/* Day detail panel */
.day-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74,40,24,0.40);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.day-detail-overlay.open { display: flex; }

.day-detail-panel {
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 20px 32px;
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.32s cubic-bezier(0.34, 1.12, 0.64, 1) forwards;
  position: relative;
}

/* Generic modal close button — shared across day-detail and any future modals */
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  z-index: 5;
}
.modal-close-btn:hover {
  background: rgba(183,92,61,0.10);
  color: var(--primary);
}
.modal-close-btn:active { transform: scale(0.92); }
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.panel-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 0 auto 20px;
}
.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.day-detail-header h3 { font-size: 17px; font-weight: 700; }
.day-type-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.day-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}
.day-badge-icon svg { width: 14px; height: 14px; display: block; }
.day-symptoms-list { margin-bottom: 16px; min-height: 60px; }
.empty-detail { font-size: 13px; color: var(--text-muted); text-align: center; padding: 16px 0; }

/* ─── Rich day-detail layout ────────────────────────────────────────────── */
.day-detail-panel { background: var(--card); }
.day-detail-header h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
}
.day-type-badge {
  background: var(--accent-light);
  color: var(--primary);
}

.dd-section {
  padding: 14px 0;
  border-top: 1px solid var(--primary-light);
}
.dd-section:first-child {
  border-top: none;
  padding-top: 6px;
}
.dd-blurb p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}
.dd-section-title {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 10px;
}
.dd-rows {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dd-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: baseline;
  gap: 12px;
  margin: 0;
}
.dd-row-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
}
.dd-row-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.dd-row-empty { color: var(--text-light); font-weight: 400; }

.dd-tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dd-tips-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.dd-tips-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.65;
}

@media (max-width: 360px) {
  .dd-row { grid-template-columns: 78px 1fr; gap: 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   LOG TAB
   ═══════════════════════════════════════════════════════════════ */
.log-header { padding: 16px 0 8px; }
.log-header h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.log-date { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.symptom-card { margin-bottom: 12px; }
.symptom-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.symptom-icon { font-size: 20px; }
.symptom-title h3 { font-size: 15px; font-weight: 600; }

/* Sym chips */
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.sym-chip {
  padding: 9px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--bounce);
}
.sym-chip:active { transform: scale(0.95); }
.sym-chip.selected {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(139,92,246,0.35);
}

/* Cramp scale */
.cramp-scale { display: flex; gap: 6px; }
.cramp-btn {
  flex: 1;
  padding: 12px 4px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all var(--bounce);
  background: transparent;
}
.cramp-btn:active { transform: scale(0.93); }
.cramp-btn.selected {
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(236,72,153,0.08));
  border-color: var(--primary);
}
.cramp-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  transition: color var(--transition);
}
.cramp-btn.selected .cramp-num { color: var(--primary); }
.cramp-label { font-size: 9px; color: var(--text-muted); font-weight: 500; text-align: center; }

/* Mood grid */
.mood-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood-btn {
  padding: 12px 4px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all var(--bounce);
  background: transparent;
}
.mood-btn:active { transform: scale(0.93); }
.mood-btn.selected {
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(236,72,153,0.08));
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(139,92,246,0.2);
}
.mood-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--primary);
}
.mood-emoji svg { width: 26px; height: 26px; display: block; }
.mood-btn.selected .mood-emoji { color: var(--primary-dark); }
.mood-label { font-size: 10px; color: var(--text-muted); font-weight: 500; text-align: center; }

/* Tag grid (other symptoms) */
.tag-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-btn {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--bounce);
}
.tag-btn.selected {
  background: rgba(139,92,246,0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.save-btn {
  margin-top: 8px;
  margin-bottom: 8px;
}

.save-feedback {
  display: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #10B981;
  padding: 12px;
  background: rgba(16,185,129,0.08);
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease;
}
.save-feedback.visible { display: block; }

/* ═══════════════════════════════════════════════════════════════
   PROFILE TAB
   ═══════════════════════════════════════════════════════════════ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  margin-bottom: 8px;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-info h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.profile-info p { font-size: 12px; color: var(--text-muted); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.stats-grid-item {
  text-align: center;
  padding: 16px 8px;
}
.sgrid-val { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.sgrid-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Cycle history */
.cycle-history { margin-bottom: 8px; }
.cycle-history-item {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cycle-history-item-left { }
.cycle-history-item-date { font-size: 14px; font-weight: 600; color: var(--text); }
.cycle-history-item-len { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cycle-history-item-right { text-align: right; }
.cycle-history-item-days { font-size: 18px; font-weight: 700; color: var(--primary); }
.cycle-history-item-unit { font-size: 11px; color: var(--text-muted); }

/* Settings */
.settings-list { margin-bottom: 16px; }
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 14px 16px;
}
.settings-icon { font-size: 20px; flex-shrink: 0; }
.settings-info { flex: 1; }
.settings-info span { display: block; font-size: 14px; font-weight: 500; }
.settings-sub { font-size: 12px !important; color: var(--text-muted) !important; font-weight: 400 !important; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #D1D5DB;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 20px; height: 20px;
  background: var(--card);
  border-radius: var(--radius-full);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Danger zone */
.danger-zone {
  display: flex;
  justify-content: center;
  margin: 24px 0 12px;
}
.app-version {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 8px;
}
.app-version a { color: var(--primary); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-emoji { font-size: 40px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31,18,53,0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  animation: scaleIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (up to 767px stays exactly as designed)
   ═══════════════════════════════════════════════════════════════ */

/* Sidebar nav hidden on mobile */
.sidebar-nav { display: none; }
.app-content-wrap { display: contents; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET / DESKTOP (min-width: 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* ── Body & root layout ─────────────────────────────────────── */
  body {
    background: var(--bg);
    min-height: 100dvh;
    overflow-x: hidden;
  }

  /* ── Onboarding — centered card with max-width ──────────────── */
  #screen-onboarding {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 40px 24px;
  }

  .onboarding-wrap {
    max-width: 900px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 48px;
    align-items: center;
    padding: 0;
  }

  .onboarding-hero {
    text-align: left;
    padding: 0;
  }

  .logo-lockup {
    justify-content: flex-start;
  }

  .onboarding-illustration {
    margin: 0 0 32px 0;
  }

  .onboarding-sub {
    max-width: 380px;
    margin: 0;
    font-size: 16px;
  }

  .onboarding-title {
    font-size: 42px;
  }

  .onboarding-form {
    padding: 36px 32px;
  }

  /* ── App shell — sidebar layout ─────────────────────────────── */
  #screen-app.active {
    display: flex;
    flex-direction: row;
    max-width: none;
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg);
  }

  /* ── Sidebar navigation ─────────────────────────────────────── */
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 240px;
    min-width: 240px;
    background: var(--card);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 20px rgba(139,92,246,0.08);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    padding: 28px 16px 24px;
    gap: 0;
    overflow-y: auto;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    margin-bottom: 36px;
  }

  .sidebar-logo-icon {
    width: 30px;
    height: 30px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
  }

  .sidebar-logo-text {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: -0.01em;
    line-height: 1;
  }

  .sidebar-nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
  }

  .sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    text-align: left;
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
  }

  .sidebar-nav-btn:hover {
    background: rgba(139,92,246,0.07);
    color: var(--primary);
  }

  .sidebar-nav-btn.active {
    background: rgba(139,92,246,0.1);
    color: var(--primary);
    font-weight: 600;
  }

  .sidebar-nav-btn.active .sidebar-nav-icon svg {
    stroke: var(--primary);
  }

  .sidebar-nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Log button in sidebar — special gradient style */
  .sidebar-nav-btn-log {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
    margin-top: 8px;
    box-shadow: 0 4px 15px rgba(139,92,246,0.35);
  }

  .sidebar-nav-btn-log:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139,92,246,0.45);
  }

  .sidebar-nav-btn-log .sidebar-nav-icon svg {
    stroke: white !important;
  }

  .sidebar-nav-btn-log.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white !important;
  }

  .sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
  }

  .sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
  }

  .sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .sidebar-user-email {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ── Hide bottom nav on desktop ─────────────────────────────── */
  .bottom-nav {
    display: none !important;
  }

  /* ── App content area shifts right of sidebar ───────────────── */
  .app-content-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: 240px;
    min-height: 100dvh;
    background: var(--bg);
    width: calc(100% - 240px);
    max-width: none;
  }

  /* ── Status spacer — not needed on desktop ──────────────────── */
  .status-spacer {
    display: none;
  }

  /* ── App header on desktop ──────────────────────────────────── */
  .app-header {
    padding: 0 32px;
    height: 72px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  /* ── App main — no bottom padding needed (no bottom nav) ─────── */
  .app-main {
    padding-bottom: 40px;
    overflow-y: auto;
  }

  /* ── Tab panels — wider padding, centered with generous max-width ── */
  .tab-panel {
    padding: 28px 40px 40px;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
  }

  /* ── Dashboard — multi-column grid ─────────────────────────── */

  /* Hero card — taller and more spacious */
  .hero-card {
    min-height: 200px;
    padding: 32px 36px;
    margin: 0 0 20px;
    border-radius: var(--radius-lg);
  }

  .countdown-number {
    font-size: 72px;
  }

  .countdown-unit {
    font-size: 22px;
  }

  .hero-ring {
    width: 150px;
    height: 150px;
  }

  .hero-ring svg {
    width: 150px;
    height: 150px;
  }

  /* Stats row — more spacing */
  .stats-row {
    gap: 14px;
    margin-bottom: 20px;
  }

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

  .stat-icon { font-size: 22px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  /* Dashboard cards in a 2-col grid below the hero */
  #tab-dashboard .info-card,
  #tab-dashboard .insight-card,
  #tab-dashboard .reorder-card {
    margin-bottom: 16px;
  }

  /* Two-column layout for info/insight cards */
  .dashboard-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }

  /* Wrap fertile + insight cards in a grid via CSS */
  #fertile-card {
    margin-bottom: 0;
  }

  #insight-card {
    margin-bottom: 0;
  }

  /* Use adjacent sibling / auto-flow trick — wrap both in a container */
  /* We use a CSS grid on the parent section rather than touching HTML */
  #tab-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-content: start;
  }

  /* Hero spans full width */
  #tab-dashboard .hero-card {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  /* Stats row spans full width */
  #tab-dashboard .stats-row {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  /* Section header spans full width */
  #tab-dashboard .section-header {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  /* Recent logs list spans full width */
  #tab-dashboard .recent-logs {
    grid-column: 1 / -1;
  }

  /* Reorder card spans full width */
  #tab-dashboard .reorder-card {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  /* Fertile and insight side by side */
  #tab-dashboard .info-card {
    margin-bottom: 0;
  }

  #tab-dashboard .insight-card {
    margin-bottom: 0;
  }

  /* ── Calendar — larger cells ────────────────────────────────── */
  .calendar-wrap {
    padding: 24px 20px;
  }

  .cal-month-year {
    font-size: 22px;
  }

  .cal-nav-btn {
    width: 44px;
    height: 44px;
  }

  .calendar-dow span {
    font-size: 13px;
    padding: 8px 0;
  }

  .calendar-grid {
    gap: 4px;
  }

  .cal-day {
    min-height: 60px;
    font-size: 15px;
    border-radius: 10px;
    padding: 4px 2px;
    justify-content: flex-start;
    padding-top: 10px;
  }

  .cal-day.today::after {
    bottom: 6px;
    width: 5px;
    height: 5px;
  }

  .cal-day.period::before {
    top: 8px;
    width: 8px;
    height: 8px;
  }

  .cal-legend {
    grid-template-columns: repeat(4, 1fr);
    padding: 16px 20px;
    margin-bottom: 16px;
  }

  /* Day detail panel — centered modal on desktop, not full bottom sheet */
  .day-detail-overlay {
    align-items: center;
    justify-content: center;
  }

  .day-detail-panel {
    border-radius: var(--radius-lg);
    padding: 28px 32px 36px;
    max-width: 480px;
    width: 90%;
    animation: scaleIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }

  .panel-handle {
    display: none;
  }

  /* ── Log tab — 2-column layout ──────────────────────────────── */
  .log-header {
    padding: 8px 0 16px;
  }

  .log-header h2 {
    font-size: 28px;
  }

  /* Flow + Cramps side by side, Mood + Bloating side by side */
  #tab-log {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-content: start;
  }

  #tab-log .log-header {
    grid-column: 1 / -1;
  }

  /* Flow and Cramps on left column */
  #tab-log .symptom-card:nth-of-type(1) { /* flow */
    grid-column: 1;
  }
  #tab-log .symptom-card:nth-of-type(2) { /* cramps */
    grid-column: 2;
  }
  #tab-log .symptom-card:nth-of-type(3) { /* mood */
    grid-column: 1;
  }
  #tab-log .symptom-card:nth-of-type(4) { /* bloating */
    grid-column: 2;
  }
  /* Other symptoms and notes span full width */
  #tab-log .symptom-card:nth-of-type(5),
  #tab-log .symptom-card:nth-of-type(6) {
    grid-column: 1 / -1;
  }

  #tab-log .save-btn {
    grid-column: 1 / -1;
  }

  #tab-log .save-feedback {
    grid-column: 1 / -1;
  }

  .symptom-card {
    margin-bottom: 0;
  }

  .mood-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* ── Profile — 4-column stats grid ─────────────────────────── */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px;
  }

  .stats-grid-item {
    padding: 20px 12px;
  }

  .sgrid-val {
    font-size: 26px;
  }

  .profile-header {
    padding: 20px 24px;
    margin-top: 0;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
  }

  .profile-info h3 {
    font-size: 17px;
  }

  /* Cycle history as a table-like layout */
  .cycle-history-item {
    padding: 16px 20px;
  }

  .cycle-history-item-date {
    font-size: 15px;
  }

  .cycle-history-item-days {
    font-size: 22px;
  }

  /* Settings list */
  .settings-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }

  .settings-item {
    margin-bottom: 0;
  }

  /* Toast — above content, not above nav */
  .toast {
    bottom: 32px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — LARGE DESKTOP (min-width: 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

  /* Wider sidebar */
  .sidebar-nav {
    width: 260px;
    min-width: 260px;
  }

  .app-content-wrap {
    margin-left: 260px;
    width: calc(100% - 260px);
    max-width: none;
  }

  /* Calendar — even taller cells */
  .cal-day {
    min-height: 72px;
    font-size: 16px;
  }

  /* Dashboard — 3 stat cards get wider */
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-card {
    padding: 24px 20px;
  }

  .stat-value { font-size: 24px; }

  /* Hero card larger */
  .hero-card {
    min-height: 220px;
    padding: 40px 48px;
  }

  .countdown-number {
    font-size: 80px;
  }

  .hero-ring {
    width: 170px;
    height: 170px;
  }

  .hero-ring svg {
    width: 170px;
    height: 170px;
  }

  /* Tab panels — more generous padding, centered */
  .tab-panel {
    padding: 36px 56px 56px;
    max-width: 1240px;
  }

  .app-header {
    padding: 0 48px;
  }

  /* Symptom logger — bigger cramp scale */
  .cramp-btn {
    padding: 16px 8px;
  }

  .cramp-num {
    font-size: 20px;
  }
}

/* ─── MISC UTILS ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

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

.shimmer {
  background: linear-gradient(90deg, rgba(139,92,246,0.05) 25%, rgba(139,92,246,0.1) 50%, rgba(139,92,246,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Input date native */
input[type="date"] { color-scheme: light; }

/* ═══════════════════════════════════════════════════════════════
   FEATURE CARDS — Phase Tips, Water, Sleep, Journal,
   PMS Alert, Prep Checklist, Patterns, Graph, Doctor, Share
   ═══════════════════════════════════════════════════════════════ */

/* ─── PHASE TIPS CARD ───────────────────────────────────────── */
.tips-card {
  margin-bottom: 16px;
}
.tips-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tips-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.tips-phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
.tips-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Tips carousel (Task 9) */
.tips-carousel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tips-stage {
  min-height: 56px;
  display: flex;
  align-items: flex-start;
  transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}
.tips-stage.tips-fading { opacity: 0; }
.tips-current {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--primary-light);
}
.tips-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tips-nav {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--bounce);
  flex-shrink: 0;
}
.tips-nav:hover { background: var(--primary-light); }
.tips-nav:active { transform: scale(0.92); }
.tips-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.tips-dot-mark {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all var(--transition);
}
.tips-dot-mark.active {
  width: 18px;
  background: var(--primary);
}

/* ─── WATER INTAKE CARD ──────────────────────────────────────── */
.water-card {
  margin-bottom: 16px;
}
.water-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.water-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.water-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(139,92,246,0.08);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.water-glasses {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.water-glass {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.water-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
  transform: scale(0);
  transition: transform var(--bounce);
}
.water-glass.filled {
  border-color: #3B82F6;
}
.water-glass.filled::after {
  transform: scale(1);
}
.water-glass:active { transform: scale(0.9); }

/* ─── SLEEP LOGGER ───────────────────────────────────────────── */
.sleep-row {
  margin-bottom: 12px;
}
.sleep-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}
.sleep-quality-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sleep-quality-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sleep-quality-chips {
  display: flex;
  gap: 6px;
}

/* ─── MOOD JOURNAL ───────────────────────────────────────────── */
.journal-input-wrap {
  position: relative;
  margin-bottom: 14px;
}
.journal-input {
  padding-right: 44px;
  font-size: 14px;
}
.journal-char-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-light);
  pointer-events: none;
}
.journal-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.journal-entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.journal-entry:last-child { border-bottom: none; }
.journal-entry-date {
  font-size: 11px;
  color: var(--text-light);
  min-width: 52px;
  font-weight: 500;
  padding-top: 1px;
}
.journal-entry-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── PMS ALERT CARD ─────────────────────────────────────────── */
.pms-alert-card {
  border-left: 3px solid #F59E0B;
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(252,211,77,0.04));
  margin-bottom: 12px;
}
.pms-alert-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pms-alert-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.pms-alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(245,158,11,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D97706;
}
.pms-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(245,158,11,0.15);
  color: #D97706;
}
.pms-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 4px;
}
.pms-history {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ─── PERIOD PREP CHECKLIST ──────────────────────────────────── */
.prep-card {
  margin-bottom: 12px;
  border-left: 3px solid var(--secondary);
}
.prep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.prep-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.prep-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--secondary-dark);
}
.prep-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prep-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  border: 1.5px solid var(--border);
}
.prep-item:hover { background: rgba(139,92,246,0.04); }
.prep-item.done {
  opacity: 0.55;
}
.prep-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  background: var(--card);
}
.prep-item.done .prep-checkbox {
  background: var(--secondary);
  border-color: var(--secondary);
}
.prep-checkbox-tick {
  display: none;
  width: 10px;
  height: 10px;
  position: relative;
}
.prep-checkbox-tick::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 4px;
  width: 3px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-2px);
}
.prep-item.done .prep-checkbox-tick { display: block; }
.prep-item-text {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.prep-item.done .prep-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.prep-done {
  font-size: 13px;
  color: #059669;
  font-weight: 600;
  text-align: center;
  padding: 8px 0;
}

/* ─── PAIN PATTERNS / YOUR PATTERNS ─────────────────────────── */
.patterns-card {
  margin-bottom: 12px;
}
.patterns-empty {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  padding: 8px 0;
}
.patterns-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pattern-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pattern-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  flex-shrink: 0;
}
.pattern-label {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.pattern-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.pattern-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  margin-top: 12px;
}
.pattern-section-title:first-child { margin-top: 0; }
.symptom-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.symptom-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
}
.symptom-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(139,92,246,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.symptom-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.symptom-bar-count {
  font-size: 11px;
  color: var(--text-light);
  min-width: 20px;
  text-align: right;
}

/* ─── CYCLE LENGTH GRAPH ─────────────────────────────────────── */
.graph-card {
  margin-bottom: 12px;
  overflow: hidden;
}
.cycle-graph-svg {
  width: 100%;
  display: block;
}

/* ─── PROFILE ACTION BUTTONS ─────────────────────────────────── */
.profile-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.profile-action-btn {
  flex: 1;
  min-width: 130px;
  font-size: 13px;
  padding: 12px 16px;
  gap: 6px;
}

/* ─── DOCTOR REPORT MODAL ────────────────────────────────────── */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.report-modal-overlay.open {
  display: flex;
}
.report-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.report-modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.report-modal p.report-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.report-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: rgba(139,92,246,0.02);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text);
  resize: vertical;
  line-height: 1.7;
  margin-bottom: 14px;
}
.report-textarea:focus { outline: none; border-color: var(--primary); }
.report-actions {
  display: flex;
  gap: 10px;
}

/* ─── PARTNER SHARE MODAL ────────────────────────────────────── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.share-modal-overlay.open {
  display: flex;
}
.share-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.share-modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.share-modal p.share-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.55;
}
.share-link-box {
  background: rgba(139,92,246,0.05);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 14px;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}
.share-actions {
  display: flex;
  gap: 10px;
}

/* ─── DOCTOR REPORT PRE / SHARE LINK ────────────────────────── */
.doctor-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.doctor-modal-inner {
  max-width: 480px;
  width: 100%;
  margin: 24px;
}
.doctor-report-body {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.doctor-report-pre {
  background: rgba(139,92,246,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.share-link-wrap {
  margin-bottom: 16px;
}
.share-link-input {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

/* ─── DESKTOP: full-width for new feature cards in dashboard ─── */
@media (min-width: 768px) {
  #tab-dashboard .tips-card,
  #tab-dashboard .water-card,
  #tab-dashboard .pms-alert-card,
  #tab-dashboard .prep-card {
    grid-column: 1 / -1;
  }

  /* Sleep + Journal side by side in log tab */
  #tab-log #sleep-card,
  #tab-log #journal-card {
    grid-column: 1 / -1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOMENT #1 — STREAK CHIP + LOG-SAVE CELEBRATION
   ═══════════════════════════════════════════════════════════════ */

/* ─── STREAK CHIP (always visible in header) ───────────────── */
/* Legacy floating header chip — kept hidden for JS compatibility */
.streak-chip[hidden],
#streak-chip { display: none !important; }

/* ─── Inline streak indicator (sits next to greeting) ──────────────────── */
.streak-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  margin-left: 8px;
  background: var(--accent-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.01em;
  vertical-align: middle;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition);
}
.streak-inline[hidden] { display: none; }
.streak-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
}
.streak-inline-icon svg { width: 100%; height: 100%; }
.streak-inline-count {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.streak-inline-label {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.85;
}
.streak-inline.is-grace {
  background: var(--accent-light);
  color: var(--text-muted);
  opacity: 0.85;
}

.header-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}
.header-line .header-name { margin: 0; }

/* Number-pop animation when the count increments on save */
@keyframes streakPop {
  0%   { transform: scale(1);   }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1);   }
}
.streak-inline.is-bumping .streak-inline-count {
  display: inline-block;
  animation: streakPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Dashboard streak milestone card ──────────────────────────────────── */
.streak-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 0 0 14px;
  box-shadow: 0 4px 14px rgba(74, 40, 24, 0.06);
  position: relative;
  overflow: hidden;
  animation: celebPopIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.streak-card[hidden] { display: none; }
.streak-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 205, 196, 0.30), rgba(245, 205, 196, 0) 60%);
  pointer-events: none;
}
.streak-card-emblem {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 10px rgba(183, 92, 61, 0.18));
}
.streak-card-emblem svg { width: 100%; height: 100%; }
.streak-card-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.streak-card-num-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}
.streak-card-num {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.streak-card-unit {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary);
  text-transform: uppercase;
}
.streak-card-headline {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.005em;
}
.streak-card-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}
@keyframes streakNumPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.streak-card.is-bumping .streak-card-num {
  display: inline-block;
  animation: streakNumPulse 0.9s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .streak-card,
  .streak-card.is-bumping .streak-card-num,
  .streak-inline.is-bumping .streak-inline-count {
    animation: none !important;
  }
}

/* ─── CELEBRATION OVERLAY ───────────────────────────────────── */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Hidden by default — JS removes hidden attr */
}
.celebration[hidden] { display: none; }
.celebration-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74, 40, 24, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: celebFadeIn 0.25s ease-out;
}
@keyframes celebFadeIn { from { opacity: 0; } to { opacity: 1; } }

.celebration-card {
  position: relative;
  max-width: 380px;
  width: 100%;
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 36px 28px 24px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(74, 40, 24, 0.30), 0 4px 12px rgba(74, 40, 24, 0.10);
  animation: celebPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
@keyframes celebPopIn {
  0%   { opacity: 0; transform: translateY(30px) scale(0.92); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.celebration-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  z-index: 2;
}
.celebration-close:hover {
  background: rgba(183, 92, 61, 0.10);
  color: var(--primary);
}

/* Sparkle decorations — subtle, only 4 so it doesn't feel like slot-machine spam */
.celebration-sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: celebSparkle 1.6s ease-out forwards;
}
.celebration-sparkle-1 { top: 24px; left: 30px;  background: var(--primary); animation-delay: 0.15s; }
.celebration-sparkle-2 { top: 54px; right: 42px; background: var(--primary-light); animation-delay: 0.30s; }
.celebration-sparkle-3 { bottom: 80px; left: 24px; background: var(--primary); animation-delay: 0.45s; width: 7px; height: 7px; }
.celebration-sparkle-4 { bottom: 110px; right: 28px; background: var(--primary-light); animation-delay: 0.60s; width: 12px; height: 12px; }
@keyframes celebSparkle {
  0%   { opacity: 0; transform: scale(0) translateY(0); }
  40%  { opacity: 1; transform: scale(1.2) translateY(-6px); }
  100% { opacity: 0; transform: scale(0.6) translateY(-18px); }
}

/* Character — terracotta lotus emblem injected by JS */
.celebration-character {
  margin: 0 auto 12px;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.celebration-character svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 18px rgba(183, 92, 61, 0.20));
  animation: celebBob 2.4s ease-in-out infinite;
}
@keyframes celebBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Big streak number */
.celebration-streak {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 14px;
}
.celebration-streak-num {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.celebration-streak-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.celebration-title {
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.celebration-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 18px;
  padding: 0 8px;
}

/* Contextual belt CTA — only appears on period / high-cramp days */
.celebration-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  margin: 0 0 18px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.celebration-tip[hidden] { display: none; }
.celebration-tip-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: var(--card);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.celebration-tip-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.celebration-tip-text strong {
  color: var(--primary);
  font-weight: 700;
}

.celebration-done {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--card);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 6px 18px rgba(183, 92, 61, 0.30);
}
.celebration-done:hover { transform: translateY(-1px); background: var(--primary-dark); box-shadow: 0 8px 22px rgba(183, 92, 61, 0.40); }
.celebration-done:active { transform: scale(0.98); }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .celebration-card,
  .celebration-character svg,
  .celebration-sparkle {
    animation: none !important;
  }
}

/* Dark mode */
[data-theme="dark"] .celebration-card {
  background: var(--card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.60), 0 4px 12px rgba(0, 0, 0, 0.40);
}
[data-theme="dark"] .celebration-backdrop { background: rgba(0, 0, 0, 0.70); }
[data-theme="dark"] .celebration-tip {
  background: var(--accent-light);
  border-color: var(--border);
}

/* Tighter spacing on small phones (iPhone SE etc) */
@media (max-width: 360px) {
  .celebration-card { padding: 28px 20px 20px; }
  .celebration-character { width: 96px; height: 96px; }
  .celebration-streak-num { font-size: 54px; }
  .celebration-title { font-size: 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   REDESIGN OVERRIDES — cream + terracotta + serif
   ═══════════════════════════════════════════════════════════════ */
body { background: var(--bg); }
.app-header,
.tab-panel,
.app-main { background: var(--bg); }

.app-header .header-name,
.tab-panel h1,
.tab-panel h2,
.tab-panel h3,
.tab-panel h4,
.section-header h3,
.cal-month-year,
.celebration-title { font-family: var(--serif); font-weight: 500; letter-spacing: -0.005em; }

/* Header — cleaner, light cream */
.app-header {
  background: var(--bg);
  border-bottom: 1px solid rgba(183,92,61,0.06);
  box-shadow: none;
}
.header-greeting { color: var(--text-muted); }
.header-name { color: var(--primary); }
.header-avatar { background: var(--accent); }

/* Bottom nav — cream w/ terracotta active */
.bottom-nav {
  background: var(--card);
  border-top: 1px solid rgba(183,92,61,0.08);
  box-shadow: 0 -2px 12px rgba(183,92,61,0.04);
}
.nav-btn { color: var(--text-muted); }
.nav-btn.active { color: var(--primary); }
.nav-btn .nav-label { font-family: var(--serif); }
.nav-btn-center .nav-icon-center {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  box-shadow: 0 6px 18px rgba(183,92,61,0.30);
}

/* Cards — softer shadow, ivory surface */
.card {
  background: var(--card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
}
.stat-icon svg { stroke: var(--primary) !important; }
.stat-value { color: var(--primary); font-family: var(--serif); }

/* Buttons — terracotta default */
.btn-pink, .btn-primary, .auth-submit {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* Misc — sidebar, links, badges inherit via vars; nothing else needed */
.btn-link { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   UNIFIED MODAL POP-IN ANIMATION (Task 4)
   ═══════════════════════════════════════════════════════════════ */
@keyframes modal-pop-in {
  0%   { opacity: 0; transform: scale(0.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay.open .modal,
.modal-overlay.open .modal.card,
.day-detail-overlay.open .day-detail-panel,
.celebration:not([hidden]) .celebration-card,
.report-modal-overlay.open .report-modal,
.share-modal-overlay.open .share-modal {
  animation: modal-pop-in 280ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Reduced-motion guard */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay.open .modal,
  .modal-overlay.open .modal.card,
  .day-detail-overlay.open .day-detail-panel,
  .celebration:not([hidden]) .celebration-card,
  .report-modal-overlay.open .report-modal,
  .share-modal-overlay.open .share-modal {
    animation: none !important;
  }
}
