:root,
[data-theme="earth-green"] {
  --background: hsl(42, 56%, 93%);
  --foreground: hsl(9, 28%, 19%);
  --primary: hsl(122, 34%, 36%);
  --primary-fg: hsl(0, 0%, 100%);
  --secondary: hsl(18, 20%, 52%);
  --accent: hsl(90, 37%, 83%);
  --muted: hsl(14, 23%, 40%);
  --card: hsl(43, 100%, 99%);
  --border: hsl(35, 18%, 84%);
  --primary-h: 122, 34%, 36%;
  --secondary-h: 18, 20%, 52%;
  --accent-h: 90, 37%, 83%;
  --muted-h: 14, 23%, 40%;
  --foreground-h: 9, 28%, 19%;
  --background-h: 42, 56%, 93%;
  --border-h: 35, 18%, 84%;
  --skin: hsl(28, 35%, 72%);
  --hair: hsl(15, 20%, 30%);
  --cloth: hsl(130, 18%, 40%);
  --cloth-alt: hsl(125, 22%, 36%);
  --wood: hsl(40, 25%, 46%);
  --warm-glow: hsl(100, 40%, 58%);
  --accent-dark: hsl(120, 28%, 38%);
  --accent-mid: hsl(110, 30%, 52%);
  --accent-deep: hsl(105, 28%, 45%);
  --bg-warm: hsl(44, 50%, 88%);
  --bg-glow: hsl(48, 55%, 82%);
  --border-soft: hsl(130, 15%, 62%);
  --window-pane: hsl(50, 45%, 87%);
  --window-pane-light: hsl(48, 40%, 88%);
  --curtain: hsl(120, 10%, 68%);
  --pot: hsl(18, 28%, 50%);
  --pot-dark: hsl(18, 28%, 45%);
  --saucer: hsl(45, 35%, 90%);
  --cup-border: hsl(35, 18%, 68%);
  --steam: hsl(120, 10%, 65%);
}

[data-theme="sand-stone"] {
  --background: hsl(34, 29%, 91%);
  --foreground: hsl(22, 41%, 16%);
  --primary: hsl(20, 38%, 30%);
  --primary-fg: hsl(0, 0%, 100%);
  --secondary: hsl(22, 28%, 59%);
  --accent: hsl(85, 29%, 70%);
  --muted: hsl(15, 23%, 40%);
  --card: hsl(30, 50%, 97%);
  --border: hsl(20, 15%, 85%);
  --primary-h: 20, 38%, 30%;
  --secondary-h: 22, 28%, 59%;
  --accent-h: 85, 29%, 70%;
  --muted-h: 15, 23%, 40%;
  --foreground-h: 22, 41%, 16%;
  --background-h: 34, 29%, 91%;
  --border-h: 20, 15%, 85%;
  --skin: hsl(30, 40%, 75%);
  --hair: hsl(20, 35%, 35%);
  --cloth: hsl(20, 35%, 48%);
  --cloth-alt: hsl(20, 38%, 42%);
  --wood: hsl(22, 30%, 52%);
  --warm-glow: hsl(30, 80%, 62%);
  --accent-dark: hsl(85, 35%, 45%);
  --accent-mid: hsl(85, 29%, 60%);
  --accent-deep: hsl(85, 29%, 55%);
  --bg-warm: hsl(30, 40%, 87%);
  --bg-glow: hsl(38, 65%, 82%);
  --border-soft: hsl(22, 25%, 68%);
  --window-pane: hsl(40, 55%, 87%);
  --window-pane-light: hsl(38, 50%, 88%);
  --curtain: hsl(22, 20%, 75%);
  --pot: hsl(15, 35%, 55%);
  --pot-dark: hsl(15, 35%, 50%);
  --saucer: hsl(30, 40%, 93%);
  --cup-border: hsl(22, 25%, 72%);
  --steam: hsl(22, 20%, 70%);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--background);
  color: var(--foreground);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.phone-frame {
  width: 390px; height: 844px; margin: 20px auto;
  border-radius: 40px; border: 8px solid #2a2a2a;
  background: var(--background); overflow: hidden;
  position: relative; box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

.desktop-hint {
  text-align: center; padding: 10px;
  font-family: 'Nunito', sans-serif; font-size: 12px; color: #999;
}

/* ════════════════════════════════
   PHASE CONTAINER
════════════════════════════════ */

.phase {
  position: absolute; inset: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.phase.hidden {
  opacity: 0; pointer-events: none;
  transform: translateY(20px);
}
.phase.exiting {
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.phase.visible {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}
.phone-frame.transitioning .phase { pointer-events: none !important; }

/* ════════════════════════════════
   PHASE 0 — LOGIN SCREEN
════════════════════════════════ */

.login-screen {
  width: 100%; height: 100%; display: flex;
  flex-direction: column; align-items: center;
  justify-content: center; padding-top: 60px;
  overflow: hidden; background: var(--background);
  padding: 24px;
}

.login-center {
  display: flex; flex-direction: column;
  align-items: center; margin-bottom: 80px;
}

.login-logo {
  font-size: 42px; font-weight: 800;
  color: var(--primary); letter-spacing: -0.5px;
}

.login-actions {
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column;
  gap: 10px;
}

.login-action-btn {
  width: 100%; display: flex; align-items: center;
  justify-content: center; gap: 10px;
  padding: 14px 16px; border-radius: 14px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
  border: none; outline: none;
}
.login-action-btn:active { transform: scale(0.97); }

.login-google-btn {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px hsla(var(--primary-h), 0.3);
}

.login-phone-btn {
  background: var(--card); color: var(--primary);
  border: 2px solid hsla(var(--primary-h), 0.2);
}
.login-phone-btn:hover { border-color: hsla(var(--primary-h), 0.4); }

.login-btn-icon {
  width: 20px; height: 20px; flex-shrink: 0;
}

.login-guest-link {
  margin-top: 6px; text-align: center;
  font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: color 0.2s ease;
}
.login-guest-link:hover { color: var(--primary); }

.login-footer {
  position: absolute; bottom: 20px; left: 0; right: 0;
  text-align: center;
}

.login-privacy {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; font-size: 10px;
  color: hsla(var(--muted-h), 0.55);
}

.login-lock-icon {
  width: 12px; height: 12px; flex-shrink: 0;
}

/* ════════════════════════════════
   PHASE 1 — ONBOARDING SLIDES
════════════════════════════════ */

.onboarding {
  width: 100%; height: 100%; display: flex;
  flex-direction: column; position: relative;
  overflow: hidden; touch-action: pan-y;
}

.slides {
  flex: 1; display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.slides.dragging { transition: none; }

.slide {
  min-width: 100%; height: 100%;
  display: flex; flex-direction: column;
}

.dots { display: flex; justify-content: center; gap: 8px; padding: 16px 0; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); opacity: 0.2; transition: all 0.3s ease;
}
.dot.active { opacity: 1; width: 24px; border-radius: 4px; }

.footer {
  flex-shrink: 0; padding: 8px 32px 40px;
  display: flex; flex-direction: column; gap: 12px;
}

.btn-primary {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  background: var(--primary); color: var(--primary-fg);
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { transform: scale(0.96); }

/* Screen 1 — Cozy Room */
.screen-1 {
  align-items: center; text-align: center;
  justify-content: center;
}

.scene-container {
  width: 100%; position: relative;
  opacity: 0; transform: translateY(12px) scale(0.97);
  animation: sceneIn 1s 0.2s ease forwards;
  margin-bottom: 28px;
}
.scene-container svg { width: 100%; height: auto; display: block; }

.scene-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 100px;
  background: linear-gradient(to bottom, transparent, var(--background));
  pointer-events: none;
}

.screen-1 .mission {
  font-size: 17px; font-weight: 600; line-height: 1.65;
  color: var(--foreground); max-width: 300px;
  padding: 0 32px;
  opacity: 0; transform: translateY(16px);
  animation: fadeUp 0.8s 0.8s ease forwards;
}
.screen-1 .mission .kaho-name { color: var(--primary); font-weight: 800; }
.screen-1 .mission em { font-style: normal; color: var(--primary); font-weight: 700; }

.screen-1 .cta-line {
  font-size: 19px; font-weight: 700; color: var(--primary);
  margin-top: 36px; padding: 0 32px;
  opacity: 0; transform: translateY(12px);
  animation: fadeUp 0.7s 1.3s ease forwards;
}

.steam { opacity: 0; animation: steamRise 3s ease-in-out infinite; }
.steam-1 { animation-delay: 0s; }
.steam-2 { animation-delay: 1s; }
.steam-3 { animation-delay: 2s; }
.window-glow { animation: glowPulse 5s ease-in-out infinite; }

/* Screen 2 — Engagement modes */
.screen-2 {
  align-items: center; text-align: center;
  padding: 0 24px; justify-content: center;
}

.screen-2 .headline {
  font-size: 21px; font-weight: 800; color: var(--foreground);
  letter-spacing: -0.3px; margin-bottom: 28px; line-height: 1.35;
  opacity: 0; transform: translateY(16px);
}
.screen-2.visible .headline { animation: fadeUp 0.7s 0.1s ease forwards; }

.mode-sections { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.mode-section {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; border-radius: 16px;
  border: 1px solid hsla(var(--primary-h), 0.12);
  background: hsla(var(--primary-h), 0.04);
  opacity: 0; transform: translateY(30px); text-align: left;
  position: relative; overflow: hidden;
  min-height: 96px;
}

.mode-illust {
  width: 88px; height: 76px; flex-shrink: 0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: hsla(var(--primary-h), 0.15);
}
.mode-illust svg { width: 100%; height: 100%; }
.mode-section:nth-child(3) .mode-illust svg {
  width: 44px; height: 44px;
  stroke: hsla(var(--foreground-h), 0.6);
}

.mode-text {
  display: flex; flex-direction: column; gap: 3px;
}
.mode-keyword {
  font-size: 15px; font-weight: 800; line-height: 1.3;
  letter-spacing: -0.01em; color: var(--primary);
}
.mode-desc {
  font-size: 12px; font-weight: 500; color: var(--muted);
  line-height: 1.4;
}

.screen-2.visible .mode-section:nth-child(1) { animation: cardRise 0.6s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.screen-2.visible .mode-section:nth-child(2) { animation: cardRise 0.6s 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.screen-2.visible .mode-section:nth-child(3) { animation: cardRise 0.6s 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

.screen-2.visible .mode-section:nth-child(1) .mode-illust svg { animation: gentleFloat 4s 1.2s ease-in-out infinite; }
.screen-2.visible .mode-section:nth-child(2) .mode-illust svg { animation: gentleTilt 5s 1.4s ease-in-out infinite; }
.screen-2.visible .mode-section:nth-child(3) .mode-illust svg { animation: gentlePulse 6s 1.6s ease-in-out infinite; }

/* Screen 3 — Safety & Trust */
.screen-3 {
  align-items: stretch; text-align: left;
  padding: 0 24px; justify-content: center;
  overflow-y: auto;
}

.screen-3 .headline {
  font-size: 22px; font-weight: 800; color: var(--foreground);
  letter-spacing: -0.3px; margin-bottom: 24px;
  width: 100%; text-align: center;
  opacity: 0; transform: translateY(16px);
}
.screen-3.visible .headline { animation: fadeUp 0.7s 0.1s ease forwards; }

.trust-points { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.trust-point {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border-radius: 12px; padding: 14px;
  opacity: 0; transform: translateY(20px);
  cursor: pointer; user-select: none;
}

.trust-icon {
  width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
}
.trust-icon svg { width: 100%; height: 100%; }
.trust-content { flex: 1; }

.trust-content .trust-label {
  font-size: 14.5px; font-weight: 700; color: var(--foreground);
  line-height: 1.3; display: flex; align-items: center; justify-content: space-between;
}
.trust-chevron {
  font-size: 13px; color: var(--muted);
  transition: opacity 0.2s ease; display: inline-flex;
  align-items: center; justify-content: center;
  width: 16px; height: 16px; flex-shrink: 0;
}
.trust-content .trust-desc {
  font-size: 11.5px; font-weight: 500; color: var(--muted); line-height: 1.5;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}
.trust-point.expanded .trust-desc {
  max-height: 120px; opacity: 1; margin-top: 6px;
}

.screen-3.visible .trust-point:nth-child(1) { animation: fadeUp 0.5s 0.15s ease forwards; }
.screen-3.visible .trust-point:nth-child(2) { animation: fadeUp 0.5s 0.3s ease forwards; }
.screen-3.visible .trust-point:nth-child(3) { animation: fadeUp 0.5s 0.45s ease forwards; }
.screen-3.visible .trust-point:nth-child(4) { animation: fadeUp 0.5s 0.6s ease forwards; }

/* ════════════════════════════════
   PHASE 2 — MOOD CHECK-IN
════════════════════════════════ */

.mood-page {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  padding: 0 28px;
  justify-content: center; align-items: center;
  overflow-y: auto; position: relative;
}
.mood-back-btn {
  position: absolute; top: 16px; left: 20px;
  width: 32px; height: 32px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s ease;
}
.mood-back-btn:active { box-shadow: 0 0 0 rgba(0,0,0,0); }
.mood-back-btn svg { width: 16px; height: 16px; }

.prompt { text-align: center; margin-bottom: 20px; }

.prompt h1 {
  font-size: 24px; font-weight: 800;
  color: var(--foreground); letter-spacing: -0.3px;
  opacity: 0; transform: translateY(16px);
}
.prompt p {
  font-size: 14px; font-weight: 600;
  color: var(--muted); margin-top: 8px;
  opacity: 0; transform: translateY(12px);
}

.mood-page.visible .prompt h1 { animation: fadeUp 0.7s 0.1s ease forwards; }
.mood-page.visible .prompt p { animation: fadeUp 0.6s 0.3s ease forwards; }

.mood-cards {
  display: flex; flex-direction: column;
  gap: 8px; width: 100%;
}

.mood-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; width: 100%;
  background: var(--card); border-radius: 16px;
  border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.3s ease;
  opacity: 0; transform: translateY(24px);
  font-family: inherit; text-align: left; outline: none;
}

.mood-card:active { transform: scale(0.97) !important; }

.mood-card.selected {
  border-color: var(--mood-color) !important;
  background: var(--mood-bg) !important;
  transform: scale(1.02) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
  opacity: 1 !important;
}

.mood-card.faded {
  opacity: 0.3 !important;
  transform: scale(0.97) !important;
}

.mood-emoji { font-size: 28px; line-height: 1; flex-shrink: 0; }
.mood-info { flex: 1; }
.mood-label { font-size: 16px; font-weight: 700; color: var(--foreground); line-height: 1.2; }
.mood-desc { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.4; margin-top: 2px; }

.mood-page.visible .mood-card:nth-child(1) { animation: fadeUp 0.45s 0.1s ease forwards; }
.mood-page.visible .mood-card:nth-child(2) { animation: fadeUp 0.45s 0.16s ease forwards; }
.mood-page.visible .mood-card:nth-child(3) { animation: fadeUp 0.45s 0.22s ease forwards; }
.mood-page.visible .mood-card:nth-child(4) { animation: fadeUp 0.45s 0.28s ease forwards; }
.mood-page.visible .mood-card:nth-child(5) { animation: fadeUp 0.45s 0.34s ease forwards; }
.mood-page.visible .mood-card:nth-child(6) { animation: fadeUp 0.45s 0.40s ease forwards; }

.acknowledgment { text-align: center; margin-top: 16px; height: 32px; }

.ack-text {
  font-size: 15px; font-weight: 700; color: var(--primary);
  opacity: 0; transform: translateY(8px) scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ack-text.visible { opacity: 1; transform: translateY(0) scale(1); }

/* Mood card colors per theme */
:root .mood-card[data-mood="great"],
[data-theme="earth-green"] .mood-card[data-mood="great"]   { --mood-color: hsl(100, 50%, 45%); --mood-bg: hsl(105, 40%, 93%); }
:root .mood-card[data-mood="good"],
[data-theme="earth-green"] .mood-card[data-mood="good"]    { --mood-color: hsl(80, 42%, 50%);  --mood-bg: hsl(85, 35%, 93%); }
:root .mood-card[data-mood="okay"],
[data-theme="earth-green"] .mood-card[data-mood="okay"]    { --mood-color: hsl(50, 25%, 52%);  --mood-bg: hsl(55, 22%, 93%); }
:root .mood-card[data-mood="low"],
[data-theme="earth-green"] .mood-card[data-mood="low"]     { --mood-color: hsl(35, 25%, 48%);  --mood-bg: hsl(40, 20%, 92%); }
:root .mood-card[data-mood="struggling"],
[data-theme="earth-green"] .mood-card[data-mood="struggling"] { --mood-color: hsl(20, 28%, 42%); --mood-bg: hsl(25, 20%, 91%); }
:root .mood-card[data-mood="notsure"],
[data-theme="earth-green"] .mood-card[data-mood="notsure"] { --mood-color: hsl(65, 15%, 50%);  --mood-bg: hsl(70, 12%, 93%); }

[data-theme="sand-stone"] .mood-card[data-mood="great"]      { --mood-color: hsl(30, 80%, 62%); --mood-bg: hsl(33, 70%, 94%); }
[data-theme="sand-stone"] .mood-card[data-mood="good"]       { --mood-color: hsl(42, 70%, 58%); --mood-bg: hsl(46, 65%, 94%); }
[data-theme="sand-stone"] .mood-card[data-mood="okay"]       { --mood-color: hsl(22, 20%, 65%); --mood-bg: hsl(30, 20%, 94%); }
[data-theme="sand-stone"] .mood-card[data-mood="low"]        { --mood-color: hsl(15, 25%, 55%); --mood-bg: hsl(20, 20%, 93%); }
[data-theme="sand-stone"] .mood-card[data-mood="struggling"] { --mood-color: hsl(10, 30%, 48%); --mood-bg: hsl(15, 22%, 92%); }
[data-theme="sand-stone"] .mood-card[data-mood="notsure"]    { --mood-color: hsl(22, 20%, 55%); --mood-bg: hsl(30, 15%, 93%); }

/* ════════════════════════════════
   PHASE 3 — HOME SCREEN
════════════════════════════════ */

.home-layout {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--background);
}

.home-content {
  flex: 1; display: flex; flex-direction: column;
  overflow-y: auto; padding: 24px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.home-content::-webkit-scrollbar { display: none; }

/* Greeting */

/* CTA buttons */
.home-cta {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 16px 24px;
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--card);
  font-family: inherit; font-weight: 700;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  outline: none;
}
.home-cta:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.home-cta:active { transform: scale(0.97); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.home-cta-primary {
  background: var(--primary);
  border-color: hsla(var(--primary-h), 0.8);
}
.home-cta-primary:hover { background: hsla(var(--primary-h), 0.9); }
.home-cta-primary .cta-label { color: #fff; }
.home-cta-primary .cta-chevron { stroke: rgba(255,255,255,0.4); }
.home-cta-primary .cta-icon-circle { background: rgba(255,255,255,0.15); }
.home-cta-primary .cta-icon-circle svg { stroke: #fff; }

.home-cta-secondary .cta-label { color: var(--foreground); }
.home-cta-secondary .cta-chevron { stroke: hsla(var(--muted-h), 0.5); }
.home-cta-secondary:hover { background: hsla(var(--muted-h), 0.08); }

.home-cta.cta-pulse {
  animation: ctaPulse 0.75s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 hsla(var(--primary-h), 0.35); }
  50%      { box-shadow: 0 0 0 8px hsla(var(--primary-h), 0); }
}
.cta-expand-overlay {
  position: absolute;
  z-index: 200;
  background: var(--primary);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-left { display: flex; align-items: center; gap: 12px; }

/* Icon circle */
.cta-icon-circle {
  width: 40px; height: 40px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.cta-icon-circle svg { width: 20px; height: 20px; }
.cta-svg-slot { width: 100%; height: 100%; display: flex !important; align-items: center; justify-content: center; }
.cta-svg-slot > svg { width: 30px !important; height: 30px !important; }


.cta-icon-journal { background: hsla(var(--secondary-h), 0.2); }
.cta-icon-journal svg { stroke: var(--secondary); }

.cta-icon-mindful { background: hsla(var(--accent-h), 0.35); }
.cta-icon-mindful svg { stroke: hsla(var(--foreground-h), 0.6); }
.cta-icon-mindful .cta-svg-slot > svg { width: 28px !important; height: 28px !important; }

.cta-text { display: flex; flex-direction: column; align-items: flex-start; }
.cta-label { font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; }
.cta-subtitle { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; line-height: 1; }
.has-new-dot {
  position: relative;
}
.has-new-dot::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: hsla(var(--primary-h), 0.45);
  position: absolute; top: -2px; right: -2px;
}
.cta-chevron { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Narrative variant ── */

.home-variant-narrative.visible .home-ambient      { animation: fadeUp 0.8s 0.05s ease forwards; }
.home-variant-narrative.visible .nar-greeting      { animation: cardRise 0.5s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.home-variant-narrative.visible .greeting-pills    { animation: cardRise 0.45s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; opacity: 0; transform: translateY(12px); }
.home-variant-narrative.visible .home-cta:nth-child(1) { animation: cardRise 0.45s 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.home-variant-narrative.visible .home-cta:nth-child(2) { animation: cardRise 0.45s 0.40s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.home-variant-narrative.visible .home-cta:nth-child(3) { animation: cardRise 0.45s 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Ambient time-of-day visual */
.home-ambient {
  position: relative; flex-shrink: 0;
  width: calc(100% + 48px); margin: -24px -24px 0 -24px;
  height: 220px; overflow: hidden;
  opacity: 0; transform: translateY(16px);
}
.home-ambient::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 160px; z-index: 2;
  background: linear-gradient(to bottom, transparent 0%, var(--background) 75%);
  pointer-events: none;
}
.ambient-orb {
  position: absolute; inset: -40px;
  filter: blur(70px); opacity: 0.5;
  border-radius: 0;
}
.ambient-scene {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
}
.ambient-scene svg { width: 100%; height: 100%; display: block; }

[data-time="morning"] .ambient-orb {
  background: radial-gradient(circle, hsl(40, 90%, 70%), hsl(50, 80%, 88%));
}
[data-time="afternoon"] .ambient-orb {
  background: radial-gradient(circle, hsl(48, 80%, 72%), hsl(55, 65%, 88%));
}
[data-time="evening"] .ambient-orb {
  background: radial-gradient(circle, hsl(25, 75%, 72%), hsl(35, 60%, 85%));
}
[data-time="night"] .ambient-orb {
  background: radial-gradient(circle, hsl(230, 25%, 70%), hsl(245, 20%, 82%));
}

.mobile-time-wrapper {
  display: none; position: absolute; top: 12px; left: 12px; z-index: 20;
}
.mobile-pill-wrapper {
  display: none; position: absolute; top: 12px; right: 12px; z-index: 20;
}
.mobile-pill-trigger {
  width: 36px; height: 36px; border-radius: 50%;
  background: hsla(var(--primary-h), 0.12); border: 1px solid hsla(var(--primary-h), 0.2);
  cursor: pointer; outline: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s ease;
}
.mobile-pill-trigger:active { transform: scale(0.92); }
.mobile-pill-dropdown {
  position: absolute; top: 42px; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; gap: 2px;
}
.mobile-pill-dropdown.hidden { display: none; }
.mobile-pill-btn {
  padding: 8px 10px; border-radius: 8px; border: none;
  background: none; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--foreground); cursor: pointer; outline: none;
  text-align: left; transition: background 0.15s ease;
}
.mobile-pill-btn:active { background: hsla(var(--primary-h), 0.08); }
.mobile-pill-btn.active {
  background: hsla(var(--primary-h), 0.12); color: var(--primary);
}
.mobile-time-trigger {
  width: 36px; height: 36px; border-radius: 50%;
  background: hsla(var(--primary-h), 0.12); border: 1px solid hsla(var(--primary-h), 0.2);
  font-size: 16px; cursor: pointer; outline: none;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s ease;
}
.mobile-time-trigger:active { transform: scale(0.92); }
.mobile-time-dropdown {
  position: absolute; top: 42px; left: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; gap: 2px;
}
.mobile-time-dropdown.hidden { display: none; }
.mobile-time-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; border: none;
  background: none; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--foreground); cursor: pointer; outline: none;
  transition: background 0.15s ease;
}
.mobile-time-btn:active { background: hsla(var(--primary-h), 0.08); }
.mobile-time-btn.active {
  background: hsla(var(--primary-h), 0.12); color: var(--primary);
}

.nar-greeting {
  margin-top: 8px; position: relative; z-index: 3;
  margin-bottom: 24px; padding: 0 8px;
  opacity: 0; transform: translateY(16px);
}
.greeting-name {
  font-size: 28px; font-weight: 800; letter-spacing: -0.3px;
  color: var(--foreground); margin-bottom: 10px;
}

.greeting-pills {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.greeting-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  border-radius: 9999px; padding: 5px 12px;
  border: none; outline: none;
}
.mood-pill {
  background: var(--card); border: 1px solid var(--border);
  color: var(--foreground); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mood-pill:active { transform: scale(0.96); box-shadow: 0 0 0 rgba(0,0,0,0); }
.streak-pill {
  background: hsla(var(--primary-h), 0.08);
  color: var(--primary); font-weight: 700;
  cursor: pointer; border: none; outline: none;
  transition: transform 0.15s ease;
}
.streak-pill:active { transform: scale(0.96); }
.streak-pill-icon { width: 12px; height: 12px; color: var(--primary); }

.nar-actions {
  display: flex; flex-direction: column; gap: 16px;
  padding: 0 8px; margin-top: 16px;
}
.nar-actions .home-cta {
  opacity: 0; transform: translateY(12px);
}
/* Notification pill — compact, accent-bar differentiated from CTAs */
.notify-pill {
  margin: 0 8px; margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px 11px 0;
  border-radius: 9999px; border: none;
  cursor: pointer; overflow: hidden;
  font-family: inherit;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.notify-pill.visible { opacity: 1; transform: translateY(0); }
.notify-pill:active { transform: scale(0.97); }

.notify-accent {
  width: 3.5px; align-self: stretch; border-radius: 2px; flex-shrink: 0;
}
.notify-icon { width: 16px; height: 16px; flex-shrink: 0; }
.notify-label {
  font-size: 12.5px; font-weight: 600; flex: 1; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Per-type theming — chat summary (primary) */
[data-notify-type="chat-summary"] { background: hsla(142, 50%, 38%, 0.16); color: #1b4d36; }
[data-notify-type="chat-summary"] .notify-accent { background: hsl(142, 55%, 35%); }
[data-notify-type="chat-summary"] .notify-icon { color: hsl(142, 55%, 35%); }

/* journal summary (amber/gold) */
[data-notify-type="journal-summary"] { background: hsla(38, 80%, 42%, 0.16); color: #6b4507; }
[data-notify-type="journal-summary"] .notify-accent { background: hsl(38, 80%, 38%); }
[data-notify-type="journal-summary"] .notify-icon { color: hsl(38, 80%, 38%); }

/* mindfulness rec (teal) */
[data-notify-type="mindful-rec"] { background: hsla(174, 55%, 32%, 0.16); color: #0f4f42; }
[data-notify-type="mindful-rec"] .notify-accent { background: hsl(174, 60%, 30%); }
[data-notify-type="mindful-rec"] .notify-icon { color: hsl(174, 60%, 30%); }

/* journaling rec (rose/coral) */
[data-notify-type="journal-rec"] { background: hsla(350, 60%, 45%, 0.16); color: #7a2038; }
[data-notify-type="journal-rec"] .notify-accent { background: hsl(350, 60%, 40%); }
[data-notify-type="journal-rec"] .notify-icon { color: hsl(350, 60%, 40%); }

/* Sand & Stone theme overrides */
[data-theme="sand-stone"] [data-notify-type="chat-summary"] { background: hsla(142, 45%, 35%, 0.18); color: #265c3f; }
[data-theme="sand-stone"] [data-notify-type="journal-summary"] { background: hsla(38, 70%, 38%, 0.18); color: #6b4507; }
[data-theme="sand-stone"] [data-notify-type="mindful-rec"] { background: hsla(174, 50%, 30%, 0.18); color: #1a5f50; }
[data-theme="sand-stone"] [data-notify-type="journal-rec"] { background: hsla(350, 55%, 42%, 0.18); color: #8a2a45; }


/* Home chat bar */
.home-chat-bar {
  padding: 0; margin-bottom: 4px;
}
.home-chat-row {
  display: flex; align-items: center; gap: 8px;
  border-radius: 9999px; border: 1px solid hsla(var(--border-h), 0.5);
  background: var(--card); padding: 6px 6px 6px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  cursor: pointer;
}
.home-chat-placeholder {
  flex: 1; font-family: inherit; font-size: 12px; font-weight: 500;
  color: hsla(var(--muted-h), 0.4); padding: 8px 0;
}
.home-chat-send {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
  transition: transform 0.15s ease;
}
.home-chat-send:active { transform: scale(0.95); }
.home-chat-send svg { width: 16px; height: 16px; }

/* Bottom nav — mirrors BottomNav.tsx: flex-shrink-0 border-t border-border bg-card */
.bottom-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: inherit; font-size: 10px; font-weight: 700;
  color: hsla(var(--muted-h), 0.6); background: none; border: none;
  cursor: pointer; outline: none; padding: 0;
  transition: color 0.2s ease; position: relative;
}
.nav-item.has-dot::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: hsla(var(--primary-h), 0.45); position: absolute;
  top: -1px; right: 50%; transform: translateX(16px);
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 24px; height: 24px; }

/* Toast notifications */
.toast-container {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%);
  z-index: 500; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.toast {
  padding: 8px 18px; border-radius: 9999px;
  background: var(--foreground); color: var(--background);
  font-family: inherit; font-size: 12px; font-weight: 600;
  white-space: nowrap;
  opacity: 0; transform: translateY(8px);
  animation: toastIn 0.3s ease forwards, toastOut 0.3s 1.6s ease forwards;
}
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

/* ── Keyframes ── */

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes cardRise { to { opacity: 1; transform: translateY(0); } }
@keyframes sceneIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes voicePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

@keyframes steamRise {
  0% { opacity: 0; transform: translateY(0) scaleX(1); }
  20% { opacity: 0.4; }
  60% { opacity: 0.15; }
  100% { opacity: 0; transform: translateY(-18px) scaleX(1.5); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.5; }
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes gentleTilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(2deg); }
  75% { transform: rotate(-2deg); }
}
@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ════════════════════════════════
   SHARED — Page header (Chat, Journal, Mindfulness)
   Mirrors Chat.tsx / Journal.tsx / Mindfulness.tsx headers
════════════════════════════════ */

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; background: var(--background);
  flex-shrink: 0; z-index: 20;
}
.page-header-left {
  display: flex; align-items: center; gap: 12px;
}
.back-btn {
  width: 32px; height: 32px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); flex-shrink: 0;
  transition: box-shadow 0.15s ease;
}
.back-btn:active { box-shadow: 0 0 0 rgba(0,0,0,0); }
.back-btn svg { width: 16px; height: 16px; }

.page-title { font-size: 12px; font-weight: 700; color: var(--foreground); }
.page-title-large { font-size: 18px; font-weight: 800; color: var(--foreground); line-height: 1.2; }
.page-subtitle { font-size: 11px; color: var(--muted); margin-top: 2px; }
.page-header-right { width: 32px; }

/* ════════════════════════════════
   PHASE 4 — CHAT PAGE
   Mirrors Chat.tsx
════════════════════════════════ */

.chat-layout {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--background);
}

.chat-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px 20px 72px; display: flex; flex-direction: column; gap: 20px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chat-messages::-webkit-scrollbar { display: none; }

.chat-timestamp {
  text-align: center;
}
.chat-timestamp span {
  display: inline-block; padding: 4px 12px;
  border-radius: 9999px; border: 1px solid var(--border);
  background: var(--background);
  font-size: 9px; font-weight: 500; color: var(--muted);
}

.chat-bubble-ai {
  padding: 4px 4px 8px; font-size: 15px;
  line-height: 1.6; color: var(--foreground);
  opacity: 0; transform: translateY(8px);
  animation: fadeUp 0.4s ease forwards;
}

.chat-bubble-user {
  display: flex; justify-content: flex-end;
  opacity: 0; transform: translateY(8px);
  animation: fadeUp 0.3s ease forwards;
}
.chat-bubble-user-inner {
  max-width: 78%; padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--primary); color: #fff;
  font-size: 15px; line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.typing-indicator {
  display: flex; align-items: center; gap: 4px; padding: 8px 4px;
}
.typing-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: hsla(var(--muted-h), 0.4);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Structured input cards within chat */
.chat-input-card {
  background: transparent; border-radius: 16px;
  border: none; padding: 12px 4px;
  margin-top: 4px;
  opacity: 0; transform: translateY(8px);
  animation: fadeUp 0.4s ease forwards;
}

.chat-name-input {
  width: 100%; padding: 10px 14px; border-radius: 20px;
  border: 1px solid hsla(var(--border-h), 0.5); background: var(--card);
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--foreground); outline: none;
  transition: border-color 0.2s ease;
}
.chat-name-input::placeholder { color: hsla(var(--muted-h), 0.5); }
.chat-name-input:focus { border-color: hsla(var(--primary-h), 0.3); }

.chat-submit-row {
  display: flex; justify-content: flex-end; margin-top: 12px;
}
.chat-submit-btn {
  padding: 9px 22px; border-radius: 9999px; border: none;
  background: var(--primary); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
}
.chat-submit-btn:active { transform: scale(0.95); }
.chat-submit-btn:disabled { opacity: 0.35; cursor: default; }

/* Age wheel */
.age-wheel-wrap {
  position: relative; overflow: hidden;
  border-radius: 20px; background: var(--card);
  height: 40px; border: 1px solid hsla(var(--border-h), 0.5);
}
.age-wheel-scroll {
  display: flex; align-items: center; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -ms-overflow-style: none; scrollbar-width: none;
}
.age-wheel-scroll::-webkit-scrollbar { display: none; }
.age-wheel-item {
  flex-shrink: 0; width: 38px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: center; font-family: inherit;
}
.age-wheel-item.active {
  font-size: 15px; font-weight: 800; color: var(--foreground);
}
.age-wheel-item.near {
  font-size: 12px; font-weight: 600; color: hsla(var(--muted-h), 0.5);
}
.age-wheel-item.far {
  font-size: 10px; font-weight: 500; color: hsla(var(--muted-h), 0.2);
}
.age-wheel-center {
  position: absolute; top: 6px; bottom: 6px;
  left: 50%; width: 38px; transform: translateX(-50%);
  border-radius: 10px;
  background: hsla(var(--primary-h), 0.08);
  pointer-events: none; z-index: 1;
}
.age-wheel-fade-l {
  position: absolute; inset: 0; right: auto; width: 24px; z-index: 2;
  background: linear-gradient(to right, var(--card), transparent);
  pointer-events: none; border-radius: 20px 0 0 20px;
}
.age-wheel-fade-r {
  position: absolute; inset: 0; left: auto; width: 24px; z-index: 2;
  background: linear-gradient(to left, var(--card), transparent);
  pointer-events: none; border-radius: 0 20px 20px 0;
}

/* Gender pills */
.gender-pills {
  display: flex; gap: 6px; padding: 0;
}
.gender-pill {
  flex: 1; padding: 10px 8px; border-radius: 20px;
  border: 1px solid hsla(var(--border-h), 0.5);
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--muted); background: var(--card);
  cursor: pointer; transition: all 0.2s ease; outline: none;
}
.gender-pill.selected {
  background: var(--primary); color: #fff; border-color: var(--primary);
  font-weight: 700;
}

/* Chat input bar */
.chat-input-bar {
  flex-shrink: 0; padding: 10px 16px; background: var(--background); z-index: 20;
}
.chat-input-row {
  display: flex; align-items: center; gap: 8px;
  border-radius: 9999px; border: 1px solid hsla(var(--border-h), 0.5);
  background: var(--card); padding: 6px 6px 6px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.chat-text-input {
  flex: 1; border: none; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--foreground); outline: none; padding: 8px 0;
}
.chat-text-input::placeholder { color: hsla(var(--muted-h), 0.4); }
.chat-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.15s ease;
}
.chat-send-btn:active { transform: scale(0.95); }
.chat-send-btn:disabled { opacity: 0.4; }
.chat-send-btn svg { width: 16px; height: 16px; }

.chat-voice-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: hsla(var(--accent-h), 0.3); border: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s ease;
}
.chat-voice-btn:active { transform: scale(0.95); }
.chat-voice-btn:hover { background: hsla(var(--accent-h), 0.5); }
.chat-voice-btn svg { width: 20px; height: 20px; }
.chat-voice-btn.recording {
  background: hsla(0, 70%, 55%, 0.15); color: hsl(0, 70%, 55%);
  animation: voicePulse 1.5s ease-in-out infinite;
}

/* ════════════════════════════════
   INTRO PAGES (Journal + Mindfulness)
════════════════════════════════ */

.intro-layout {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--background);
}
.intro-content {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 32px; text-align: center;
}
.intro-icon {
  width: 80px; height: 80px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.intro-icon svg { width: 40px; height: 40px; }
.intro-icon-journal { background: hsla(var(--secondary-h), 0.15); }
.intro-icon-journal svg { stroke: var(--secondary); }
.intro-icon-mindful { background: hsla(var(--accent-h), 0.2); }
.intro-icon-mindful svg { stroke: hsla(var(--foreground-h), 0.6); }

.intro-illust {
  width: 240px; height: 200px; margin-bottom: 24px;
  opacity: 0; transform: translateY(16px) scale(0.95);
  animation: sceneIn 0.8s 0.2s ease forwards;
}
.intro-illust svg { width: 100%; height: 100%; }

.intro-title {
  font-size: 22px; font-weight: 800; color: var(--foreground);
  letter-spacing: -0.3px; margin-bottom: 12px;
}
.intro-desc {
  font-size: 14px; font-weight: 500; color: var(--muted);
  line-height: 1.6; max-width: 280px;
}
.intro-footer {
  flex-shrink: 0; padding: 8px 32px 40px;
}

/* ════════════════════════════════
   JOURNAL PAGE
   Mirrors Journal.tsx
════════════════════════════════ */

.journal-layout {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--background);
}
.journal-scroll {
  flex: 1; overflow-y: auto; padding: 16px 20px 24px;
}
.journal-cards { display: flex; flex-direction: column; gap: 16px; }

.journal-card {
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--card); padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.journal-card-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px;
}
.journal-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.journal-prompt {
  font-size: 13px; font-weight: 700; color: var(--foreground); line-height: 1.4;
}
.journal-textarea {
  width: 100%; min-height: 80px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--background); resize: none;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: var(--foreground); line-height: 1.6; outline: none;
}
.journal-textarea::placeholder { color: hsla(var(--muted-h), 0.4); }
.journal-textarea:focus { border-color: hsla(var(--primary-h), 0.3); }

.journal-input-row { display: flex; gap: 8px; }
.journal-input-row .journal-textarea { flex: 1; }

.journal-actions-col {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 8px; padding-top: 4px;
}
.journal-voice-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: hsla(var(--accent-h), 0.2); border: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s ease;
}
.journal-voice-btn:active { transform: scale(0.95); }
.journal-voice-btn:hover { background: hsla(var(--accent-h), 0.3); }
.journal-voice-btn svg { width: 20px; height: 20px; }
.journal-voice-btn.recording {
  background: hsla(0, 70%, 55%, 0.2); color: hsl(0, 70%, 55%);
  animation: voicePulse 1.5s ease-in-out infinite;
}


/* Journal save & completion */
.journal-save-wrap { padding: 8px 0 16px; flex-shrink: 0; }
.journal-save-btn { width: 100%; }
.journal-save-btn:disabled { opacity: 0.35; cursor: default; }

.journal-complete-overlay {
  position: absolute; inset: 0; z-index: 100;
  background: hsla(var(--background-h), 0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.journal-complete-overlay.visible { opacity: 1; pointer-events: auto; }

.jc-tick-wrap {
  width: 96px; height: 96px;
  transform: scale(.6); opacity: 0;
  transition: all .5s .1s cubic-bezier(.34,1.56,.64,1);
}
.journal-complete-overlay.visible .jc-tick-wrap { transform: scale(1); opacity: 1; }
.jc-tick-svg { width: 100%; height: 100%; }
.jc-check-path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.journal-complete-overlay.visible .jc-check-path { animation: checkDraw .6s .4s ease forwards; }
@keyframes checkDraw { to { stroke-dashoffset: 0; } }

/* ════════════════════════════════
   MINDFULNESS PAGE
   Mirrors Mindfulness.tsx
════════════════════════════════ */

.mindful-layout {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--background);
}
.mindful-scroll {
  flex: 1; overflow-y: auto;
}

.mindful-featured {
  margin: 16px 20px 12px; padding: 16px;
  border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, hsla(var(--primary-h), 0.12), hsla(var(--accent-h), 0.1), hsla(var(--primary-h), 0.04));
}
.mindful-featured::before {
  content: ''; position: absolute; bottom: -16px; right: -16px;
  width: 96px; height: 96px; border-radius: 50%;
  background: hsla(var(--primary-h), 0.10);
  pointer-events: none;
}
.mindful-featured::after {
  content: ''; position: absolute; top: 8px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: hsla(var(--accent-h), 0.10);
  pointer-events: none;
}
.mindful-featured-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--primary);
}
.mindful-featured-title {
  margin-top: 6px; font-size: 14px; font-weight: 700;
  color: var(--foreground); line-height: 1.3;
}
.mindful-featured-desc {
  margin-top: 4px; font-size: 10px; color: var(--muted); line-height: 1.5;
}
.mindful-featured-row {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
}
.mindful-begin-btn {
  padding: 6px 16px; border-radius: 9999px; border: none;
  background: var(--primary); color: #fff;
  font-family: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mindful-begin-btn:active { transform: scale(0.95); }
.mindful-begin-btn svg { width: 14px; height: 14px; }
.mindful-duration { font-size: 10px; font-weight: 500; color: var(--muted); }

.cat-pills {
  display: flex; gap: 6px; padding: 0 20px 12px;
  overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
  mask-image: linear-gradient(to right, black 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 82%, transparent 100%);
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; padding: 6px 12px; border-radius: 9999px;
  font-family: inherit; font-size: 10px; font-weight: 700;
  cursor: pointer; outline: none; border: 1px solid var(--border);
  background: var(--card); color: var(--muted);
  transition: all 0.2s ease;
}
.cat-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── Theme + variant toggle bars ── */
/* ═══ Side control panels ═══ */
.side-controls {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 200;
  font-family: 'Nunito', sans-serif;
}
.side-panel {
  position: absolute; pointer-events: auto;
}
.left-panel {
  left: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 16px;
}
.side-group {
  display: flex; flex-direction: column; gap: 5px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-radius: 10px; padding: 10px; border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.scene-toggle {
  max-height: 70vh; overflow-y: auto;
}
.side-group.hidden { display: none; }
.side-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: #888; margin-bottom: 2px;
}
.side-btn {
  padding: 5px 14px; border-radius: 6px; border: 1px solid #ccc;
  background: #fff; font-family: inherit; font-size: 10px; font-weight: 700;
  color: #666; cursor: pointer; transition: all 0.15s ease; text-align: left;
  white-space: nowrap;
}
.side-btn:hover { border-color: #999; }
.side-btn:disabled {
  opacity: 0.4; cursor: not-allowed; pointer-events: none;
}
.side-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
@media (max-width: 680px) {
  .side-controls { display: none; }
}

@media (max-width: 430px) {
  body {
    overflow: auto; background: #1a1a1a;
    display: flex; justify-content: center; align-items: flex-start;
    min-height: 100vh; min-height: 100dvh; padding: 16px 12px;
  }
  .desktop-hint { display: none; }
  .phone-frame {
    width: 100%; max-width: 390px;
    height: auto; min-height: 780px;
    aspect-ratio: 390 / 844;
    margin: 0 auto; border: 6px solid #2a2a2a;
    border-radius: 32px; box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  }
  .side-controls { display: none; }
  .mobile-time-wrapper { display: block; }
  .mobile-pill-wrapper { display: block; }
}

/* SVG slot — transparent wrapper for dynamically loaded SVGs */
.svg-slot { display: contents; }
.svg-slot > svg { width: 100%; height: 100%; }

/* ════════════════════════════════
   Mindfulness cards — horizontal list (matches frontend-app)
════════════════════════════════ */
.vd-list {
  display: flex; flex-direction: column;
  gap: 8px; padding: 4px 20px 24px;
}

.vd-card {
  display: flex; flex-direction: row; align-items: center;
  gap: 12px; padding: 12px 14px;
  border-radius: 14px; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-family: inherit; cursor: pointer; outline: none;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.vd-card:hover { border-color: hsla(var(--primary-h), 0.15); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.vd-card:active { transform: scale(0.98); }

.vd-icon {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.vd-icon svg { width: 24px; height: 24px; }
[data-svg-style="geometry"] .vd-icon svg,
[data-svg-style="silhouette"] .vd-icon svg,
[data-svg-style="abstract"] .vd-icon svg {
  width: 36px; height: 36px;
}
.vd-icon-breathing { background: hsla(var(--primary-h), 0.10); color: var(--primary); }
.vd-icon-grounding { background: hsla(var(--secondary-h), 0.15); color: var(--secondary); }
.vd-icon-relaxation { background: hsla(var(--accent-h), 0.18); color: var(--accent-dark); }
.vd-icon-meditation { background: hsla(var(--secondary-h), 0.12); color: var(--secondary); }

.vd-body { flex: 1; min-width: 0; }
.vd-title {
  font-size: 12px; font-weight: 700; color: var(--foreground);
  line-height: 1.3;
}
.vd-desc {
  font-size: 10px; color: var(--muted); line-height: 1.4;
  margin-top: 2px;
}
.vd-meta { margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.vd-dot { color: var(--muted); font-size: 10px; line-height: 1; }
.vd-time { font-size: 9px; color: var(--muted); font-weight: 500; }

.vd-play {
  width: 20px; height: 20px; min-width: 20px;
  color: var(--primary); flex-shrink: 0;
}

.vd-tag {
  display: inline-block; font-size: 8px; font-weight: 600;
  letter-spacing: 0.01em;
  padding: 1px 5px; border-radius: 9999px;
}
.vd-tag-breathing { color: var(--primary); background: hsla(var(--primary-h), 0.12); }
.vd-tag-grounding { color: var(--secondary); background: hsla(var(--secondary-h), 0.12); }
.vd-tag-relaxation { color: var(--accent-dark); background: hsla(var(--accent-h), 0.15); }
.vd-tag-meditation { color: var(--secondary); background: hsla(var(--secondary-h), 0.12); }

/* ════════════════════════════════
   JOURNEY PAGE — mirrors Journey.tsx
════════════════════════════════ */
.journey-layout {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  overflow: hidden; background: var(--background);
}
.journey-header {
  flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 24px 20px 12px;
}
.journey-title { font-size: 18px; font-weight: 800; color: var(--foreground); }
.journey-streak { display: flex; align-items: center; gap: 6px; }
.journey-streak-icon { width: 16px; height: 16px; color: var(--primary); }
.journey-streak-info { display: flex; flex-direction: column; line-height: 1; }
.journey-streak-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.journey-streak-count { font-size: 14px; font-weight: 800; color: var(--foreground); }
.journey-streak-unit { font-size: 10px; font-weight: 600; color: var(--muted); }
.journey-scroll {
  flex: 1; overflow-y: auto; padding: 8px 16px 24px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.journey-scroll::-webkit-scrollbar { display: none; }
.journey-timeline { position: relative; }
.timeline-line {
  position: absolute; left: 37px; top: 0; bottom: 0;
  width: 2px; border-radius: 1px; background: hsla(var(--primary-h), .15);
}
.timeline-row { position: relative; display: flex; gap: 8px; margin-bottom: 10px; }
.timeline-row-day-last { margin-bottom: 22px; }
.timeline-date {
  width: 28px; flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; text-align: center;
}
.timeline-today-badge {
  white-space: nowrap; border-radius: 5px; border: 1px solid var(--border);
  background: var(--card); padding: 1px 4px; margin-bottom: 3px;
  font-size: 6px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.timeline-month { font-size: 9px; font-weight: 700; color: var(--muted); }
.timeline-day { font-size: 13px; font-weight: 800; color: var(--foreground); line-height: 1; }
.timeline-mood { font-size: 14px; margin-top: 3px; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 7px; border: 1.5px solid var(--background);
  background: hsla(var(--primary-h), .3); z-index: 2;
}
.timeline-dot.active { background: var(--primary); }
.timeline-card {
  flex: 1; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); padding: 8px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03); margin-top: -2px;
}
.timeline-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.timeline-tag {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 9999px;
  background: hsla(var(--primary-h), .1); padding: 3px 8px;
  font-size: 10px; font-weight: 700; color: var(--primary);
}
.tag-icon { width: 11px; height: 11px; flex-shrink: 0; }
.timeline-tag.tag-journal { background: hsla(var(--accent-h), .2); color: var(--accent-dark, var(--accent)); }
.timeline-tag.tag-mindfulness { background: hsla(var(--secondary-h), .15); color: var(--secondary); }
.timeline-tag.tag-summary { background: hsla(35, 60%, 55%, .15); color: hsl(35, 55%, 40%); }
.timeline-time { font-size: 9px; color: var(--muted); }
.timeline-summary {
  font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--foreground);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.timeline-summary.expanded {
  -webkit-line-clamp: unset; display: block;
}
.timeline-card-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.timeline-more-btn {
  border: none; background: none; padding: 2px 0;
  min-height: 24px;
  display: inline-flex; align-items: center; gap: 2px;
  font-family: inherit; font-size: 9px; font-weight: 600;
  color: hsla(var(--primary-h), .7); cursor: pointer;
}
.timeline-more-btn:hover { color: var(--primary); }
.timeline-more-btn svg {
  width: 11px; height: 11px; transition: transform .2s ease;
}
.timeline-more-btn.expanded svg { transform: rotate(180deg); }
.timeline-view-btn {
  border: none; background: none; padding: 2px 0;
  min-height: 24px;
  font-family: inherit; font-size: 9px; font-weight: 600;
  color: hsla(var(--primary-h), .7); cursor: pointer;
  margin-left: auto;
}
.timeline-view-btn:hover { color: var(--primary); }

/* ════════════════════════════════
   PROFILE PAGE
════════════════════════════════ */
.profile-layout {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  overflow: hidden; background: var(--background);
}
.profile-header {
  flex-shrink: 0; padding: 24px 20px 12px;
}
.profile-title { font-size: 18px; font-weight: 800; color: var(--foreground); }

.profile-scroll {
  flex: 1; overflow-y: auto; padding: 8px 20px 24px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.profile-scroll::-webkit-scrollbar { display: none; }

.profile-avatar-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 24px; gap: 10px;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: hsla(var(--muted-h), 0.12);
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar svg { width: 32px; height: 32px; color: var(--muted); }
.profile-name {
  font-size: 16px; font-weight: 700; color: var(--foreground);
}

/* Sign-in card (inline on profile) */
.profile-login-card {
  border-radius: 14px; overflow: hidden;
  padding: 16px;
  margin-bottom: 20px;
}
.login-card-msg {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  line-height: 1.4; text-align: center; margin: 0 0 14px;
}
.login-card-buttons {
  display: flex; flex-direction: column; gap: 8px;
}
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 16px; border-radius: 10px;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; border: none; outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.login-btn:active { transform: scale(0.97); }
.login-btn-icon { width: 18px; height: 18px; flex-shrink: 0; }
.login-btn-google {
  background: hsla(var(--primary-h), 0.15); color: var(--foreground);
  border: 1px solid hsla(var(--primary-h), 0.3);
}
.login-btn-phone {
  background: hsla(var(--primary-h), 0.15); color: var(--foreground);
  border: 1px solid hsla(var(--primary-h), 0.3);
}
.login-btn-phone .login-btn-icon { color: var(--primary); }

/* Settings sections */
.profile-section { margin-bottom: 16px; }
.profile-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: hsla(var(--muted-h), 0.5);
  margin-bottom: 6px; padding: 0 4px;
}
.profile-options {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.profile-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid hsla(var(--muted-h), 0.08);
}
.profile-option-last,
.profile-option:last-child { border-bottom: none; }
.profile-option-left {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.profile-option-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-option-icon svg { width: 16px; height: 16px; }
.profile-option-icon-primary { background: hsla(var(--primary-h), 0.1); }
.profile-option-icon-primary svg { color: var(--primary); }
.profile-option-icon-secondary { background: hsla(var(--secondary-h), 0.15); }
.profile-option-icon-secondary svg { color: var(--secondary); }
.profile-option-icon-accent { background: hsla(var(--accent-h), 0.2); }
.profile-option-icon-accent svg { color: var(--muted); }
.profile-option-icon-green { background: rgba(34,197,94,0.1); }
.profile-option-icon-green svg { color: #16a34a; }

.profile-option-text { display: flex; flex-direction: column; min-width: 0; }
.profile-option-title {
  font-size: 12px; font-weight: 700; color: var(--foreground);
}
.profile-option-sub {
  font-size: 10px; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-option-chevron {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: hsla(var(--muted-h), 0.4);
}

.profile-footer {
  text-align: center; font-size: 9px; font-weight: 500;
  color: hsla(var(--muted-h), 0.4); padding: 16px 0 8px;
}
