/* ============================================
   AA EVERYDAY — UNIFIED DESIGN SYSTEM
   ============================================ */
:root {
  --bg-deep: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-surface: #16213e;
  --accent-warm: #e8a838;
  --accent-warm-soft: rgba(232, 168, 56, 0.15);
  --accent-calm: #4a8fe7;
  --accent-calm-soft: rgba(74, 143, 231, 0.1);
  --accent-hope: #5eead4;
  --accent-hope-soft: rgba(94, 234, 212, 0.1);
  --accent-danger: #ef6461;
  --accent-danger-soft: rgba(239, 100, 97, 0.1);
  --text-primary: #f0ece2;
  --text-secondary: #a8a4b8;
  --text-muted: #6b6880;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(232, 168, 56, 0.08);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-bottom: 160px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

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

a { color: inherit; text-decoration: none; }

/* ============================================
   HEADER
   ============================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 1px 12px rgba(0,0,0,0.15);
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(232,168,56,0.2);
}

.menu-btn, .icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition);
  line-height: 1;
}

.menu-btn { font-size: 22px; }
.icon-btn { font-size: 20px; padding: 8px; border-radius: 10px; }
.menu-btn:hover, .icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.app-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent-warm) 0%, #f0d080 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ============================================
   PAGE TITLE BAR
   ============================================ */
.page-title-bar {
  padding: 20px 20px 8px;
  max-width: 520px;
  margin: 0 auto;
}

.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================
   CONTENT CARDS
   ============================================ */
.content-area {
  padding: 16px;
  max-width: 520px;
  margin: 0 auto;
}

.card {
  display: block;
  background: linear-gradient(160deg, var(--bg-card) 0%, rgba(30,30,52,0.8) 100%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.card-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-calm);
  margin-bottom: 8px;
}

.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.card-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  transition: var(--transition);
}

.card:hover .card-arrow { color: var(--accent-warm); transform: translateY(-50%) translateX(3px); }

/* Numbered card variant */
.card-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-warm-soft);
  color: var(--accent-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.card-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-row .card-content { flex: 1; }

/* ============================================
   DETAIL / READING VIEW
   ============================================ */
.reading-area {
  padding: 24px 20px;
  max-width: 640px;
  margin: 0 auto;
}

.reading-title {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 16px;
  text-align: center;
}

.reading-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-warm);
  text-align: center;
  margin-bottom: 20px;
  padding: 14px 20px;
  background: var(--accent-warm-soft);
  border-radius: var(--radius-md);
}

.reading-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.04);
}

.reading-body p { margin-bottom: 16px; }
.reading-body p:last-child { margin-bottom: 0; }

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
  padding: 0 4px;
  margin-bottom: 14px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), transparent);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-warm), #d4942e);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent-calm-soft);
  border: 1px solid rgba(74, 143, 231, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-calm);
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-ghost {
  display: block;
  width: 100%;
  padding: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  text-align: center;
}

.btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* Focus-visible for keyboard users */
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-ghost:focus-visible, .btn-danger:focus-visible {
  outline: 2px solid var(--accent-warm); outline-offset: 2px;
}
a:focus-visible, .card:focus-visible, .feature-card:focus-visible {
  outline: 2px solid var(--accent-warm); outline-offset: 2px; border-radius: var(--radius-sm);
}

.btn-danger {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent-danger-soft);
  border: 1px solid rgba(239, 100, 97, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-danger);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  text-align: center;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13px;
  display: inline-block;
  width: auto;
}

.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row > * { flex: 1; }

/* ============================================
   FEATURE GRID
   ============================================ */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.feature-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, rgba(30,30,52,0.8) 100%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover::after { opacity: 1; }
.feature-card:nth-child(4n+1)::after { background: linear-gradient(90deg, var(--accent-warm), transparent); }
.feature-card:nth-child(4n+2)::after { background: linear-gradient(90deg, var(--accent-calm), transparent); }
.feature-card:nth-child(4n+3)::after { background: linear-gradient(90deg, var(--accent-danger), transparent); }
.feature-card:nth-child(4n+4)::after { background: linear-gradient(90deg, var(--accent-hope), transparent); }

.feature-card:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.1); transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.25); }

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.feature-icon.warm { background: linear-gradient(135deg, rgba(232,168,56,0.2), rgba(232,168,56,0.08)); }
.feature-icon.calm { background: linear-gradient(135deg, rgba(74,143,231,0.2), rgba(74,143,231,0.08)); }
.feature-icon.hope { background: linear-gradient(135deg, rgba(94,234,212,0.2), rgba(94,234,212,0.08)); }
.feature-icon.rose { background: linear-gradient(135deg, rgba(239,100,97,0.2), rgba(239,100,97,0.08)); }

.feature-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.feature-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.feature-card.full {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

.feature-card.full .feature-text { flex: 1; }

/* Staggered entrance for feature cards */
.feature-grid .feature-card { opacity: 0; animation: cardIn 0.5s ease forwards; }
.feature-grid .feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-grid .feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-grid .feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-grid .feature-card:nth-child(4) { animation-delay: 0.2s; }
.feature-grid .feature-card:nth-child(5) { animation-delay: 0.25s; }
.feature-grid .feature-card:nth-child(6) { animation-delay: 0.3s; }
.feature-grid .feature-card:nth-child(7) { animation-delay: 0.35s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   SOBRIETY HERO
   ============================================ */
.sobriety-hero {
  padding: 32px 24px;
  background: linear-gradient(145deg, #1c2142 0%, #1a1a32 50%, #1e1830 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232, 168, 56, 0.18);
  box-shadow: 0 0 40px rgba(232, 168, 56, 0.06), 0 4px 24px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}

.sobriety-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 168, 56, 0.15) 0%, transparent 65%);
  pointer-events: none;
}

.sobriety-hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 143, 231, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.sobriety-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--accent-warm); margin-bottom: 10px; }
.sobriety-count { font-family: 'DM Serif Display', serif; font-size: 60px; line-height: 1; letter-spacing: -2px; margin-bottom: 4px; background: linear-gradient(135deg, #f0ece2, #e8a838); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sobriety-count span { font-family: 'DM Sans', sans-serif; font-size: 20px; font-weight: 400; letter-spacing: 0; -webkit-text-fill-color: var(--text-secondary); margin-left: 4px; }
.sobriety-detail { font-size: 15px; color: var(--text-secondary); font-weight: 300; }
.sobriety-edit-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* ============================================
   DAILY MESSAGE STRIP
   ============================================ */
.daily-message {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(232,168,56,0.08), rgba(232,168,56,0.03));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(232,168,56,0.12);
  font-size: 15px;
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 24px;
  position: relative;
}

.daily-message::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 48px;
  font-family: 'DM Serif Display', serif;
  color: rgba(232,168,56,0.15);
  line-height: 1;
  font-style: normal;
}

.daily-message-label { font-size: 11px; font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-warm); margin-bottom: 8px; }

/* ============================================
   EMERGENCY BANNER
   ============================================ */
.emergency-banner {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(239,100,97,0.08), rgba(239,100,97,0.03));
  border: 1px solid rgba(239, 100, 97, 0.18);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}

.emergency-banner:hover { background: rgba(239, 100, 97, 0.1); border-color: rgba(239,100,97,0.3); }

.emergency-icon { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; background: linear-gradient(135deg, rgba(239,100,97,0.2), rgba(239,100,97,0.08)); display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 2px 8px rgba(239,100,97,0.1); }
.emergency-title { font-size: 15px; font-weight: 600; color: var(--accent-danger); margin-bottom: 2px; }
.emergency-desc { font-size: 13px; color: var(--text-secondary); }

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-deep);
  border-top: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.2);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 0;
  z-index: 100;
}

/* Extend the nav's clickable/visual area well below to cover 
   the gap between fixed bottom and Safari's address bar */
.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -100px;
  background: var(--bg-deep);
  z-index: -1;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  background: none;
  border: none;
  text-decoration: none;
  position: relative;
}

.nav-item:hover, .nav-item.active { color: var(--accent-warm); }
.nav-item.active { background: var(--accent-warm-soft); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent-warm);
}
.nav-icon { font-size: 22px; line-height: 1; }

/* ============================================
   DRAWER
   ============================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-card);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.drawer-header { padding: 40px 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.drawer-logo { font-family: 'DM Serif Display', serif; font-size: 26px; background: linear-gradient(135deg, var(--accent-warm) 0%, #f0d080 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 6px; }
.drawer-subtitle { font-size: 13px; color: var(--text-muted); }

.drawer-nav { padding: 16px 12px; flex: 1; }

.drawer-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; font-size: 15px; font-weight: 500; transition: var(--transition); }
.drawer-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.drawer-link .link-icon { font-size: 20px; width: 24px; text-align: center; }

.drawer-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 8px 16px; }

.drawer-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.05); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  font-family: 'DM Sans', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-textarea:focus { border-color: var(--accent-warm); background: rgba(232, 168, 56, 0.04); }
.form-input:focus-visible, .form-textarea:focus-visible { box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.2); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

.form-message { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; display: none; }
.form-message.error { background: var(--accent-danger-soft); border: 1px solid rgba(239, 100, 97, 0.2); color: var(--accent-danger); display: block; }
.form-message.success { background: var(--accent-hope-soft); border: 1px solid rgba(94, 234, 212, 0.2); color: var(--accent-hope); display: block; }

/* ============================================
   BOTTOM SHEET
   ============================================ */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: 32px 24px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  z-index: 250;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet-handle { width: 36px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; margin: 0 auto 20px; }

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 400;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(94, 234, 212, 0.2); color: var(--accent-hope); }
.toast.error { border-color: rgba(239, 100, 97, 0.2); color: var(--accent-danger); }

/* ============================================
   VIDEO CARD
   ============================================ */
.video-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  transition: var(--transition);
}

.video-card-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.video-card-header:hover { background: var(--bg-card-hover); }

.video-card-title { font-size: 15px; font-weight: 600; }

.video-card-toggle { font-size: 14px; color: var(--text-muted); transition: var(--transition); }
.video-card.open .video-card-toggle { transform: rotate(180deg); }

.video-card-body {
  display: none;
  padding: 0 20px 20px;
}

.video-card.open .video-card-body { display: block; }

.video-card iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: var(--radius-sm);
}

/* ============================================
   MEETING CARD
   ============================================ */
.meeting-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.meeting-card:hover { border-color: rgba(255,255,255,0.08); }

.meeting-card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }

.meeting-card-detail { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

.meeting-card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ============================================
   JOURNAL ENTRY
   ============================================ */
.journal-entry {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.journal-entry:hover { border-color: rgba(255,255,255,0.08); }

.journal-date { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.journal-content { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ============================================
   IFRAME WRAPPER
   ============================================ */
.iframe-wrapper {
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 80px;
  z-index: 1;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   AUDIO PLAYER
   ============================================ */
.audio-player { margin: 16px 0; text-align: center; }
.audio-player audio { width: 100%; max-width: 400px; border-radius: 8px; }

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
.fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-warm);
  color: #000;
  border: none;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(232, 168, 56, 0.3);
  z-index: 50;
  transition: var(--transition);
  line-height: 1;
}

.fab:hover { transform: scale(1.08); }

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in { animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   MILESTONE CELEBRATION OVERLAY
   ============================================ */
.milestone-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.milestone-overlay.show { opacity: 1; visibility: visible; }

.milestone-card {
  text-align: center;
  padding: 48px 36px;
  max-width: 360px;
  animation: milestoneIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.milestone-chip {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  font-family: 'DM Serif Display', serif;
  border: 4px solid;
  box-shadow: 0 0 60px rgba(232, 168, 56, 0.3);
}

.milestone-chip.white { background: rgba(255,255,255,0.1); border-color: #e8e8e8; color: #e8e8e8; }
.milestone-chip.red { background: rgba(239,100,97,0.15); border-color: #ef6461; color: #ef6461; }
.milestone-chip.blue { background: rgba(74,143,231,0.15); border-color: #4a8fe7; color: #4a8fe7; }
.milestone-chip.green { background: rgba(94,234,212,0.15); border-color: #5eead4; color: #5eead4; }
.milestone-chip.bronze { background: rgba(205,127,50,0.15); border-color: #cd7f32; color: #cd7f32; }
.milestone-chip.purple { background: rgba(168,130,214,0.15); border-color: #a882d6; color: #a882d6; }
.milestone-chip.gold { background: rgba(232,168,56,0.15); border-color: var(--accent-warm); color: var(--accent-warm); }

.milestone-title {
  font-family: 'DM Serif Display', serif;
  font-size: 32px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-warm), #f0d080);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.milestone-msg { font-size: 16px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 24px; }

.confetti-canvas { position: fixed; inset: 0; z-index: 501; pointer-events: none; }

/* ============================================
   MORNING CHECK-IN
   ============================================ */
.checkin-card {
  background: linear-gradient(145deg, #1c2240, #1a1a30);
  border: 1px solid rgba(232,168,56,0.15);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.checkin-prompt { font-family: 'DM Serif Display', serif; font-size: 21px; margin-bottom: 20px; color: var(--text-primary); }

.checkin-options { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.checkin-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  min-width: 72px;
}

.checkin-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); transform: translateY(-2px); }
.checkin-btn.selected { background: var(--accent-warm-soft); border-color: var(--accent-warm); color: var(--accent-warm); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(232,168,56,0.15); }
.checkin-btn .checkin-emoji { font-size: 30px; line-height: 1; }
.checkin-done { text-align: center; padding: 16px; color: var(--text-muted); font-size: 14px; }

/* ============================================
   STREAK COUNTER
   ============================================ */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(232,168,56,0.1);
  border: 1px solid rgba(232,168,56,0.15);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-warm);
}

/* ============================================
   MOOD HISTORY
   ============================================ */
.mood-history {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  overflow-x: auto;
}

.mood-dot {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(255,255,255,0.04);
  position: relative;
}

.mood-dot[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  padding: 0;
}

.theme-toggle::after {
  content: '🌙';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition);
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
.light-mode {
  --bg-deep: #f5f3ee;
  --bg-card: #ffffff;
  --bg-card-hover: #f0ece2;
  --bg-surface: #faf8f4;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #888;
}

/* Header */
.light-mode .app-header { background: rgba(255,255,255,0.9); border-bottom-color: rgba(0,0,0,0.06); box-shadow: 0 1px 12px rgba(0,0,0,0.06); }
.light-mode .app-title { background: linear-gradient(135deg, #8B6914, #a67c1a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.light-mode .menu-btn, .light-mode .icon-btn { color: #555; }
.light-mode .menu-btn:hover, .light-mode .icon-btn:hover { background: rgba(0,0,0,0.06); color: #222; }

/* Bottom nav */
.light-mode .bottom-nav { background: #fff; border-top-color: rgba(0,0,0,0.06); box-shadow: 0 -2px 12px rgba(0,0,0,0.06); }
.light-mode .bottom-nav::before { background: #fff; }
.light-mode .nav-item { color: #888; }
.light-mode .nav-item:hover, .light-mode .nav-item.active { color: #8B6914; }
.light-mode .nav-item.active { background: rgba(139,105,20,0.08); }
.light-mode .nav-item.active::before { background: #8B6914; }

/* Cards & borders */
.light-mode .card, .light-mode .feature-card { background: #fff; border-color: rgba(0,0,0,0.07); }
.light-mode .feature-card:hover { border-color: rgba(0,0,0,0.14); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.light-mode .feature-card::after { opacity: 0.5; }
.light-mode .feature-icon { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.light-mode .feature-icon.warm { background: linear-gradient(135deg, rgba(184,134,11,0.15), rgba(184,134,11,0.05)); }
.light-mode .feature-icon.calm { background: linear-gradient(135deg, rgba(56,120,200,0.15), rgba(56,120,200,0.05)); }
.light-mode .feature-icon.hope { background: linear-gradient(135deg, rgba(56,178,172,0.15), rgba(56,178,172,0.05)); }
.light-mode .feature-icon.rose { background: linear-gradient(135deg, rgba(220,80,75,0.15), rgba(220,80,75,0.05)); }
.light-mode .sobriety-hero { border-color: rgba(184,134,11,0.15); background: linear-gradient(145deg, #fff, #faf8f2); box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 0 30px rgba(184,134,11,0.04); }
.light-mode .sobriety-hero::before { background: radial-gradient(circle, rgba(184,134,11,0.08) 0%, transparent 65%); }
.light-mode .sobriety-hero::after { background: radial-gradient(circle, rgba(56,120,200,0.05) 0%, transparent 65%); }
.light-mode .sobriety-count { background: linear-gradient(135deg, #1a1a2e, #8B6914); -webkit-background-clip: text; background-clip: text; }
.light-mode .daily-message { background: linear-gradient(135deg, rgba(184,134,11,0.06), rgba(184,134,11,0.02)); border-color: rgba(184,134,11,0.12); }
.light-mode .daily-message::before { color: rgba(184,134,11,0.12); }
.light-mode .daily-message-label { color: #8B6914; }
.light-mode .sponsor-card { background: linear-gradient(135deg, rgba(56,120,200,0.06), rgba(56,120,200,0.02)); border-color: rgba(56,120,200,0.12); }
.light-mode .sponsor-avatar { box-shadow: 0 2px 8px rgba(56,120,200,0.08); }
.light-mode .sponsor-action-btn { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #555; }
.light-mode .sponsor-action-btn:hover { background: rgba(56,120,200,0.08); border-color: rgba(56,120,200,0.3); color: #2b6cb0; }
.light-mode .sponsor-edit-btn:hover { background: rgba(0,0,0,0.06); color: #333; }
.light-mode .crisis-btn-call { background: rgba(220,80,75,0.08); color: #c53030; border-color: rgba(220,80,75,0.15); }
.light-mode .crisis-btn-text { background: rgba(56,178,172,0.08); color: #1a7a74; border-color: rgba(56,178,172,0.15); }
.light-mode .section-title::after { background: linear-gradient(90deg, rgba(0,0,0,0.08), transparent); }
.light-mode .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

/* Check-in card — light version */
.light-mode .checkin-card { background: linear-gradient(145deg, #faf8f2, #fff); border-color: rgba(184,134,11,0.12); box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.light-mode .checkin-prompt { color: #1a1a2e; }
.light-mode .checkin-btn { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.1); color: #4a4a5a; }
.light-mode .checkin-btn:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.16); }
.light-mode .checkin-btn.selected { background: rgba(139,105,20,0.1); border-color: #b8860b; color: #8B6914; box-shadow: 0 4px 12px rgba(139,105,20,0.08); }

/* Emergency banner */
.light-mode .emergency-banner { background: linear-gradient(135deg, rgba(220,80,75,0.06), rgba(220,80,75,0.02)); border-color: rgba(220,80,75,0.15); }
.light-mode .emergency-icon { box-shadow: 0 2px 8px rgba(220,80,75,0.06); }

/* Drawer */
.light-mode .drawer { background: #fff; }
.light-mode .drawer-header { border-bottom-color: rgba(0,0,0,0.06); }
.light-mode .drawer-divider { background: rgba(0,0,0,0.06); }
.light-mode .drawer-link:hover, .light-mode .drawer-item:hover { background: rgba(0,0,0,0.04); }
.light-mode .drawer-footer { border-top-color: rgba(0,0,0,0.06); }

/* Forms */
.light-mode .form-input, .light-mode .form-textarea, .light-mode .form-select { background: #f8f6f1; border-color: rgba(0,0,0,0.12); color: #1a1a2e; }
.light-mode .form-input:focus, .light-mode .form-textarea:focus, .light-mode .form-select:focus { border-color: #b8860b; background: #fff; }
.light-mode .form-input::placeholder { color: #aaa; }
.light-mode .form-label { color: #666; }

/* Buttons */
.light-mode .btn-ghost { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #555; }
.light-mode .btn-ghost:hover { background: rgba(0,0,0,0.08); }
.light-mode .btn-secondary { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }

/* Modal & bottom sheet */
.light-mode .modal-panel { background: #fff; border-color: rgba(0,0,0,0.08); }
.light-mode .bottom-sheet { background: #fff; }
.light-mode .bottom-sheet-handle { background: rgba(0,0,0,0.15); }

/* Misc components */
.light-mode .streak-badge { border-color: rgba(0,0,0,0.08); }
.light-mode .mood-history { border-color: rgba(0,0,0,0.06); }
.light-mode .section-title { color: #888; }
.light-mode .toast { background: #fff; border-color: rgba(0,0,0,0.1); color: #1a1a2e; }

/* Theme toggle */
.light-mode .theme-toggle { background: rgba(0,0,0,0.12); }
.light-mode .theme-toggle::after { content: '☀️'; left: 22px; }

.light-mode::before { opacity: 0.015; }

/* ============================================
   EMERGENCY TOOLKIT
   ============================================ */
.breathing-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94,234,212,0.2) 0%, rgba(94,234,212,0.05) 70%);
  border: 2px solid rgba(94,234,212,0.3);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--accent-hope);
  transition: transform 4s ease-in-out;
}

.breathing-circle.inhale { transform: scale(1.3); }
.breathing-circle.exhale { transform: scale(1); }

.crisis-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  color: inherit;
  text-decoration: none;
}

.crisis-action:hover { border-color: rgba(255,255,255,0.1); background: var(--bg-card-hover); }

.crisis-icon {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.crisis-action-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.crisis-action-desc { font-size: 13px; color: var(--text-secondary); }

.crisis-btns { display: flex; gap: 6px; flex-shrink: 0; }
.crisis-btn {
  display: flex; align-items: center; gap: 3px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600; text-decoration: none;
  transition: all 0.25s ease; white-space: nowrap;
}
.crisis-btn-call { background: rgba(239,100,97,0.12); color: var(--accent-danger); border: 1px solid rgba(239,100,97,0.2); }
.crisis-btn-call:hover { background: rgba(239,100,97,0.2); border-color: rgba(239,100,97,0.4); }
.crisis-btn-text { background: rgba(94,234,212,0.12); color: var(--accent-hope); border: 1px solid rgba(94,234,212,0.2); }
.crisis-btn-text:hover { background: rgba(94,234,212,0.2); border-color: rgba(94,234,212,0.4); }

div.crisis-action { cursor: default; }

@media (max-width: 420px) {
  .crisis-action { flex-wrap: wrap; }
  .crisis-btns { width: 100%; margin-top: 4px; }
  .crisis-btn { flex: 1; justify-content: center; }
  .sponsor-actions { gap: 4px; }
  .sponsor-action-btn { padding: 7px 10px; font-size: 11px; }
  .sponsor-action-btn span { font-size: 13px; }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar-container {
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-warm), #f0d080);
  transition: width 0.6s ease;
}

.progress-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============================================
   STEP WORK
   ============================================ */
.step-progress-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.step-pip {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.step-pip.completed { background: var(--accent-warm-soft); border-color: var(--accent-warm); color: var(--accent-warm); }
.step-pip.active { background: var(--accent-calm-soft); border-color: var(--accent-calm); color: var(--accent-calm); }

/* ============================================
   FAVORITE STAR
   ============================================ */
.fav-star {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 22px;
  cursor: pointer;
  filter: grayscale(1) opacity(0.3);
  transition: var(--transition);
  background: none;
  border: none;
  padding: 4px;
}

.fav-star.active { filter: none; }

/* ============================================
   SPONSOR CARD
   ============================================ */
.sponsor-card {
  background: linear-gradient(135deg, rgba(74,143,231,0.08), rgba(74,143,231,0.03));
  border: 1px solid rgba(74,143,231,0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.sponsor-card:hover { border-color: rgba(74,143,231,0.3); box-shadow: 0 4px 16px rgba(74,143,231,0.08); }

.sponsor-avatar {
  width: 46px; height: 46px; min-width: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(74,143,231,0.2), rgba(74,143,231,0.08));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(74,143,231,0.12);
}

.sponsor-name { font-size: 15px; font-weight: 600; }
.sponsor-label { font-size: 12px; color: var(--text-muted); }

.sponsor-actions { display: flex; gap: 6px; align-items: center; }
.sponsor-action-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary); cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600;
  transition: all 0.25s ease; white-space: nowrap;
}
.sponsor-action-btn span { font-size: 14px; }
.sponsor-action-btn:hover { background: var(--accent-calm-soft); border-color: var(--accent-calm); color: var(--accent-calm); }
.sponsor-edit-btn { padding: 8px 10px; font-size: 14px; }
.sponsor-edit-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

/* ============================================
   GRATITUDE PROMPTS
   ============================================ */
.gratitude-prompt {
  background: linear-gradient(145deg, rgba(94,234,212,0.08), rgba(94,234,212,0.02));
  border: 1px solid rgba(94,234,212,0.12);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
}

.gratitude-prompt-label { font-size: 13px; font-weight: 600; color: var(--accent-hope); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.gratitude-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
  transition: var(--transition);
}

.gratitude-input:focus { border-color: var(--accent-hope); }

/* ============================================
   RESPONSIVE
   ============================================ */
/* ============================================
   RESPONSIVE — TABLET (600px+)
   ============================================ */
@media (min-width: 600px) {
  .content-area { max-width: 600px; padding: 24px; }
  .reading-area { max-width: 640px; padding: 20px 24px; }
  
  .feature-grid { gap: 14px; }
  .feature-card { padding: 22px 20px; }
  .feature-card .feature-icon { width: 52px; height: 52px; font-size: 26px; }
  
  .card { padding: 24px; margin-bottom: 14px; }
  .card-title { font-size: 20px; }
  
  .sobriety-hero { padding: 32px 28px; }
  .sobriety-count { font-size: 56px; }
  
  .modal-panel { padding: 36px 32px; max-width: 440px; }
  
  .daily-message { padding: 22px 24px; }
  
  .bottom-nav { gap: 8px; }
  .nav-item { min-width: 72px; }
  
  .cal-panel { width: 380px; padding: 24px; }
  .cal-day { font-size: 15px; }
}

/* ============================================
   RESPONSIVE — SMALL DESKTOP (768px+)
   ============================================ */
@media (min-width: 768px) {
  .content-area { max-width: 680px; padding: 28px 32px; }
  .reading-area { max-width: 700px; font-size: 17px; line-height: 1.8; padding: 24px 32px; }
  
  .app-header { padding: 0 24px; }
  .header-logo { width: 36px; height: 36px; }
  .app-title { font-size: 20px; }
  
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .feature-card.full { grid-column: span 2; }
  .feature-card { padding: 24px; border-radius: var(--radius-md); }
  .feature-card .feature-name { font-size: 16px; }
  .feature-card .feature-desc { font-size: 13px; }
  
  .section-title { font-size: 14px; margin-bottom: 16px; }
  
  .sobriety-hero { padding: 36px 32px; border-radius: var(--radius-lg); }
  .sobriety-count { font-size: 64px; }
  
  .emergency-banner { padding: 20px 24px; }
  
  .btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
    padding: 16px; font-size: 16px; border-radius: 12px;
  }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,168,56,0.2); }
  
  .form-input { padding: 14px 16px; font-size: 16px; }
  
  .nav-item { padding: 8px 20px; }
  .nav-label { font-size: 12px; }
  
  /* Cards with better hover on desktop */
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
  .feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
}

/* ============================================
   RESPONSIVE — DESKTOP (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .content-area { max-width: 740px; padding: 32px 40px; }
  .reading-area { max-width: 760px; font-size: 18px; line-height: 1.85; padding: 28px 40px; }
  .reading-body p { margin-bottom: 20px; }
  
  .app-header {
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 0 0 16px 16px;
  }
  
  .feature-grid { gap: 18px; }
  .feature-card { padding: 28px; }
  .feature-card .feature-icon { width: 56px; height: 56px; font-size: 28px; }
  .feature-card .feature-name { font-size: 17px; }
  
  .sobriety-hero { padding: 40px 36px; }
  .sobriety-count { font-size: 72px; }
  .sobriety-label { font-size: 12px; letter-spacing: 2px; }
  
  .modal-panel { max-width: 480px; padding: 40px 36px; border-radius: var(--radius-lg); }
  
  /* Drawer gets wider on desktop */
  .drawer { width: 320px; }
}

/* ============================================
   RESPONSIVE — WIDE DESKTOP (1440px+)
   ============================================ */
@media (min-width: 1440px) {
  .content-area { max-width: 800px; }
  .reading-area { max-width: 820px; }
}

/* ============================================
   TOUCH TARGET & ACCESSIBILITY
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Mobile touch devices — larger tap targets */
  .btn-primary, .btn-secondary, .btn-ghost, .btn-danger { min-height: 48px; }
  .nav-item { min-height: 48px; }
  .feature-card { min-height: 48px; }
  .cal-day { min-height: 44px; min-width: 44px; }
  .cal-nav { min-width: 44px; min-height: 44px; }
  
  /* Disable hover effects on touch */
  .card:hover { transform: none; box-shadow: none; }
  .feature-card:hover { transform: none; box-shadow: none; }
  .btn-primary:hover { transform: none; box-shadow: none; }
}

/* Active states for touch feedback */
@media (hover: none) {
  .card:active { background: var(--bg-card-hover); }
  .feature-card:active { background: var(--bg-card-hover); transform: scale(0.98); }
  .btn-primary:active { opacity: 0.85; transform: scale(0.98); }
}

/* ============================================
   SAFE AREA — NOTCH / DYNAMIC ISLAND
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .content-area {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .app-header, .bottom-nav, .drawer, .drawer-overlay,
  .theme-toggle, .menu-btn, .icon-btn { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  body::before { display: none; }
  .content-area, .reading-area { max-width: 100%; padding: 0; }
  .card, .feature-card { border: 1px solid #ddd; break-inside: avoid; }
}

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

/* ============================================
   CALENDAR DATE PICKER
   ============================================ */
.cal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.7); display: flex;
  align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.25s ease;
}
.cal-overlay.show { opacity: 1; visibility: visible; }

.cal-panel {
  background: var(--bg-card); border-radius: 20px; width: 320px;
  max-width: 92vw; padding: 20px; border: 1px solid var(--border-subtle);
  transform: scale(0.9); transition: transform 0.25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.cal-overlay.show .cal-panel { transform: scale(1); }

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-title {
  font-family: 'DM Serif Display', serif; font-size: 18px;
  color: var(--text-primary);
}
.cal-nav {
  background: none; border: 1px solid var(--border-subtle);
  color: var(--text-secondary); width: 34px; height: 34px;
  border-radius: 8px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cal-nav:active { background: rgba(232,168,56,0.15); }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 6px;
}
.cal-weekday {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 0;
}

.cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; border: none; background: none;
  font-family: 'DM Sans', sans-serif;
}
.cal-day:hover { background: rgba(232,168,56,0.1); }
.cal-day.today {
  border: 1px solid var(--accent-warm); color: var(--accent-warm);
  font-weight: 600;
}
.cal-day.selected {
  background: var(--accent-warm); color: #0f0f1a; font-weight: 700;
}
.cal-day.other-month { color: var(--text-muted); opacity: 0.3; }
.cal-day.future { opacity: 0.25; pointer-events: none; }
.cal-day:empty { pointer-events: none; }

.cal-footer {
  display: flex; gap: 8px; margin-top: 16px;
  justify-content: flex-end;
}
.cal-footer .cal-today-btn {
  margin-right: auto; background: none; border: none;
  color: var(--accent-hope); font-size: 13px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; padding: 8px 12px;
}
