/* DASHBOARD v30 — Universal Glass Surfaces | All cards transparent over background art */

/* ── GLOBAL GLASS OVERRIDE ──────────────────────────────────────── */
/* Override --color-surface for the entire app to glass so ALL cards, bubbles,
   inputs, and panels are transparent over the background image. The sidebar
   is excluded (handled separately). */
.dash-main {
  --color-surface: rgba(255,255,255,0.05);
  --color-surface-2: rgba(255,255,255,0.07);
  --color-surface-offset: rgba(255,255,255,0.06);
  --color-surface-raised: rgba(255,255,255,0.06);
  --color-border: rgba(255,255,255,0.10);
  --color-divider: rgba(255,255,255,0.07);
}
/* Cards inside dash-main get backdrop-filter automatically */
.dash-main .card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body {
  display: flex; overflow-x: hidden; background: var(--color-bg);
  /* Safe-area insets for notch/home-bar devices (iOS standalone, iPhone Dynamic Island) */
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  transition: background 1.2s ease;
}

/* ── TIME-OF-DAY BACKGROUNDS ─────────────────────────────────────── */
/* Each class applies a full-viewport fixed photo + dark overlay via pseudo-element on .dash-main */
body.tod-sunrise .dash-main::before,
body.tod-midday  .dash-main::before,
body.tod-golden  .dash-main::before,
body.tod-night   .dash-main::before {
  content: '';
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
  z-index: -1;
  transition: opacity 1.2s ease;
}

/* Sunrise — 5 am–9 am */
body.tod-sunrise .dash-main::before {
  background-image:
    linear-gradient(to bottom, rgba(8,6,18,0.55) 0%, rgba(8,6,18,0.45) 100%),
    url('assets/lumafy_sunrise_hero.jpg');
}

/* Midday — 9 am–4 pm */
body.tod-midday .dash-main::before {
  background-image:
    linear-gradient(to bottom, rgba(4,12,6,0.65) 0%, rgba(4,12,6,0.58) 100%),
    url('assets/lumafy_midday.jpg');
}

/* Golden Hour — 4 pm–7 pm */
body.tod-golden .dash-main::before {
  background-image:
    linear-gradient(to bottom, rgba(15,8,0,0.65) 0%, rgba(15,8,0,0.58) 100%),
    url('assets/lumafy_golden_hour.jpg');
}

/* Night — 7 pm–5 am */
body.tod-night .dash-main::before {
  background-image:
    linear-gradient(to bottom, rgba(2,5,18,0.68) 0%, rgba(2,5,18,0.62) 100%),
    url('assets/lumafy_night.jpg');
}

/* Sidebar stays solid — no photo bleed */
body.tod-sunrise .sidebar,
body.tod-midday  .sidebar,
body.tod-golden  .sidebar,
body.tod-night   .sidebar {
  background: var(--color-surface);
}

/* Tod active: remove default bg color from body so photo shows */
body.tod-sunrise,
body.tod-midday,
body.tod-golden,
body.tod-night {
  background: #080612;
}

/* Cards sit above the pseudo-element — ensure z-index stacking is correct */
body.tod-sunrise .dash-content,
body.tod-midday  .dash-content,
body.tod-golden  .dash-content,
body.tod-night   .dash-content {
  position: relative;
  z-index: 1;
}

/* Greeting card: swap gradient for a frosted glass look on photo backgrounds */
body.tod-sunrise .greeting-card,
body.tod-midday  .greeting-card,
body.tod-golden  .greeting-card,
body.tod-night   .greeting-card {
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 4px 32px rgba(0,0,0,0.35);
}

/* Topbar on photo: semi-transparent so photo bleeds through */
body.tod-sunrise .topbar,
body.tod-midday  .topbar,
body.tod-golden  .topbar,
body.tod-night   .topbar {
  background: rgba(8,6,18,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Bottom nav on photo: same frosted treatment */
body.tod-sunrise .bottom-nav,
body.tod-midday  .bottom-nav,
body.tod-golden  .bottom-nav,
body.tod-night   .bottom-nav {
  background: rgba(8,6,18,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  width: 232px; flex-shrink: 0; height: 100dvh; position: sticky; top: 0;
  background: var(--color-surface); border-right: 1px solid var(--color-divider);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 50;
  transition: left 0.3s var(--ease-out);
}
.sidebar-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-divider); flex-shrink: 0;
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-4) var(--space-3); flex: 1;
}
.sidebar-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0.625rem var(--space-3); border-radius: var(--radius-lg);
  font-size: var(--text-sm); color: var(--color-text-muted);
  transition: all var(--transition); cursor: pointer; width: 100%;
  border: none; background: none; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-link:hover { color: var(--color-text); background: var(--color-surface-offset); }
.sidebar-link.active { color: var(--color-primary); background: var(--color-primary-highlight); font-weight: 600; }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-bottom { padding: var(--space-4) var(--space-3) var(--space-5); border-top: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: var(--space-2); flex-shrink: 0; }
.sidebar-theme { display: flex; align-items: center; gap: var(--space-3); padding: 0.5rem var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); border-radius: var(--radius-md); width: 100%; border: none; background: none; cursor: pointer; transition: all var(--transition); }
.sidebar-theme:hover { color: var(--color-text); background: var(--color-surface-offset); }
.sidebar-divider { height: 1px; background: var(--color-divider); margin: var(--space-1) 0; }
.sidebar-user { display: flex; align-items: center; gap: var(--space-3); padding: 0.625rem var(--space-3); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary), #F4603A);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: var(--text-sm);
}
.user-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.user-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { color: var(--color-text-faint) !important; font-size: var(--text-xs) !important; padding: 0.4rem var(--space-3) !important; }
.sidebar-logout:hover { color: var(--color-error) !important; background: var(--color-error-bg) !important; }

/* ── MAIN ────────────────────────────────────────────────────────── */
.dash-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  min-height: 100dvh; padding-bottom: var(--bottom-nav-height);
  position: relative;
}
@media (min-width: 901px) { .dash-main { padding-bottom: 0; } }

/* ── TOPBAR ──────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface); position: sticky; top: 0; z-index: 30;
  height: 65px;
}
.topbar-left { display: flex; align-items: center; gap: var(--space-4); }
.page-title { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-text); }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); }
.streak-badge {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted);
  background: var(--color-surface-offset); padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full); border: 1px solid var(--color-border);
}

/* ── CONTENT ──────────────────────────────────────────────────────── */
.dash-content { padding: var(--space-6); padding-top: calc(var(--space-6) + env(safe-area-inset-top, 12px)); display: flex; flex-direction: column; gap: var(--space-6); flex: 1; }
.dash-section { display: flex; flex-direction: column; gap: var(--space-4); }
.dash-section-title { font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-text); }

/* ── GREETING ─────────────────────────────────────────────────────── */
.greeting-card { background: linear-gradient(135deg, var(--color-primary) 0%, #F4603A 100%); border: none; box-shadow: var(--shadow-glow); padding-top: var(--space-5); }
.greeting-inner { display: flex; align-items: center; justify-content: center; gap: var(--space-4); }
.greeting-time { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); margin-bottom: var(--space-1); }
/* Greeting fills card top — large, bold, centered */
.greeting-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  word-break: break-word;
  hyphens: none;
  margin: 0;
  text-align: center;
  width: 100%;
}
.greeting-art { font-size: 3rem; flex-shrink: 0; }

/* ── CHECK-IN ──────────────────────────────────────────────────────── */
.checkin-card { display: flex; flex-direction: column; gap: var(--space-5); }
/* FIX: Use justify-content:center + gap so emojis are evenly centered */
.mood-row {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(8px, 4vw, 24px);
  padding: var(--space-3) 0;
}
.mood-btn {
  font-size: 2rem; background: none; border: 2.5px solid transparent;
  border-radius: var(--radius-full); width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease-out); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.mood-btn:hover { transform: scale(1.2); }
.mood-btn:active { transform: scale(1.05); }
.mood-btn.selected { border-color: var(--color-primary); background: var(--color-primary-highlight); transform: scale(1.2); }
.ai-response { background: var(--color-primary-highlight); border-radius: var(--radius-xl); padding: var(--space-4); }
.ai-response-inner { display: flex; align-items: flex-start; gap: var(--space-3); }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); margin-top: 6px; flex-shrink: 0; animation: pulse 2.4s infinite; }
.ai-response p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.65; }
/* FIX: Checkin action buttons — keep them all on one row, wrap cleanly */
.checkin-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
#chatWithCoachBtn {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  height: auto;
  min-height: 36px;
  line-height: 1.3;
  flex-shrink: 1;
  max-width: 100%;
}

/* ── TOOLS GRID ──────────────────────────────────────────────────── */
/* FIX: Ensure tool-card heights match within each row */
.tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); align-items: stretch; }
.tool-card {
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-2xl); padding: var(--space-5);
  cursor: pointer; transition: all var(--transition); text-align: left;
  display: flex; flex-direction: column; gap: var(--space-2);
  -webkit-tap-highlight-color: transparent;
  height: 100%; /* FIX: Stretch to fill grid cell */
}
.tool-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); transform: translateY(-2px); }
.tool-card:active { transform: translateY(0); }
.tool-icon { font-size: 1.75rem; }
.tool-card h4 { font-family: var(--font-display); font-size: var(--text-base); color: var(--color-text); }
.tool-card p { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.55; flex: 1; }
.tool-tag { font-size: var(--text-xs); color: var(--color-accent); font-weight: 600; }
/* Tool cards sit inside the Shine Your Light card — semi-transparent to match dashboard style */
.card .tool-card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.07); }
.card .tool-card:hover { background: rgba(232,130,12,0.12); border-color: var(--color-primary); }

/* ── MOOD WEEK ───────────────────────────────────────────────────── */
/* FIX: Use even padding inside the card so dots don't clip edges */
.mood-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
}
.mood-day { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.mood-day-label { font-size: 10px; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
/* FIX: Mood dots — use fluid sizing so they don't clip on narrow screens */
.mood-day-dot {
  width: clamp(30px, 8vw, 40px);
  height: clamp(30px, 8vw, 40px);
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  transition: all var(--transition);
}
.mood-day-dot.filled { border-color: transparent; background: var(--color-primary-highlight); }
.mood-day-dot.today { box-shadow: 0 0 0 3px var(--color-primary-glow); border-color: var(--color-primary); }
.mood-day-dot.empty { opacity: 0.35; }

/* ── CHAT ────────────────────────────────────────────────────────── */
/* ── CHAT INTRO BANNER ───────────────────────────────────────────── */
/* Coach intro banner — shown at top of chat before messages */
.chat-intro-card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: var(--space-6) var(--space-4);
  margin-bottom: var(--space-2);
}
.chat-intro-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #F4603A);
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: var(--space-3);
  box-shadow: 0 0 24px var(--color-primary-glow);
}
.chat-intro-title {
  font-family: var(--font-display); font-size: var(--text-lg);
  color: var(--color-text); margin-bottom: var(--space-2);
}
.chat-intro-desc {
  font-size: var(--text-sm); color: var(--color-text-muted);
  line-height: 1.6; max-width: 280px;
}

.chatPage { padding: 0 !important; flex: 1; display: flex; flex-direction: column; }
.chat-wrap {
  display: flex; flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (min-width: 901px) { .chat-wrap { flex: 1; } }
.chat-history { flex: 1; overflow-y: auto; padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); scroll-behavior: smooth; }
.chat-bubble { display: flex; align-items: flex-start; gap: var(--space-3); max-width: 78%; }
.chat-bubble.ai { align-self: flex-start; }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--color-primary), #F4603A); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.chat-text { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); border-radius: var(--radius-xl); border-top-left-radius: var(--radius-sm); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-xs); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chat-bubble.user .chat-text { background: rgba(232,130,12,0.28); border-color: rgba(232,130,12,0.45); border-top-right-radius: var(--radius-sm); border-top-left-radius: var(--radius-xl); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chat-bubble.user .chat-text p { color: #fff; }
.chat-text p { font-size: var(--text-sm); color: var(--color-text); line-height: 1.65; }
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-faint); animation: typingDot 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }
.chat-suggestions { display: flex; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-3) var(--space-6); }
.chat-suggestions button {
  font-size: var(--text-xs); color: var(--color-primary);
  background: var(--color-primary-highlight); border: 1px solid var(--color-primary);
  border-radius: var(--radius-full); padding: 0.375rem 0.75rem;
  transition: all var(--transition); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-suggestions button:hover { background: var(--color-primary); color: #fff; }
.chat-input-row { display: flex; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid rgba(255,255,255,0.07); background: rgba(8,6,18,0.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
/* BUG-003: font-size >= 16px prevents iOS auto-zoom when input is focused */
.chat-input { flex: 1; border-radius: var(--radius-full); font-size: max(1rem, 16px); }
.chat-disclaimer { text-align: center; font-size: var(--text-xs); color: var(--color-text-faint); padding: var(--space-2) var(--space-6) var(--space-4); background: rgba(8,6,18,0.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); line-height: 1.5; }
/* BUG-020: Shake animation for empty chat send */
@keyframes chatInputShake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-6px); }
  30%      { transform: translateX(6px); }
  45%      { transform: translateX(-4px); }
  60%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
  90%      { transform: translateX(2px); }
}
.chat-input-shake {
  animation: chatInputShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: var(--color-error, #e55) !important;
}

/* ── JOURNAL ─────────────────────────────────────────────────────── */
.journal-wrap { display: flex; flex-direction: column; gap: var(--space-5); max-width: 720px; }
.journal-prompt-card { background: linear-gradient(135deg, rgba(244,160,58,0.22) 0%, rgba(244,96,58,0.14) 100%); border: 1px solid rgba(244,160,58,0.28); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.journal-prompt-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.55); margin-bottom: var(--space-3); }
.journal-prompt-text { font-family: var(--font-display); font-size: var(--text-xl); color: #fff; line-height: 1.35; }
.journal-textarea { width: 100%; border: none; background: transparent; resize: none; font-size: var(--text-base); color: var(--color-text); line-height: 1.75; font-family: var(--font-body); padding: 0; outline: none; min-height: 200px; }
.journal-footer { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-4); border-top: 1px solid var(--color-divider); margin-top: var(--space-4); flex-wrap: wrap; gap: var(--space-3); }
.journal-actions { display: flex; gap: var(--space-3); }
.word-count { font-size: var(--text-xs); color: var(--color-text-faint); }
.journal-reflection { border-left: 3px solid var(--color-primary); padding-left: var(--space-5); }
.journal-reflection-label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary); margin-bottom: var(--space-3); }
.journal-reflection p { font-size: var(--text-base); color: var(--color-text-muted); line-height: 1.75; font-style: italic; }

/* ── BREATHE v2 — State-based entry, immersive orb, audio ───────── */

/* All breathe screens share this base */
.breathe-state-screen,
.breathe-sigh-hero,
.breathe-player-screen,
.breathe-manual-screen {
  display: flex; flex-direction: column; align-items: center;
  max-width: 100%; margin: 0 auto; width: 100%;
  gap: var(--space-5); padding-bottom: var(--space-8);
}

/* Hero badge */
.breathe-hero-badge {
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-primary); border: 1px solid var(--color-primary);
  border-radius: 100px; padding: 4px 12px; font-weight: 600;
}

/* State selector */
.breathe-state-title {
  font-family: var(--font-display); font-size: var(--text-xl);
  color: var(--color-text); text-align: center; line-height: 1.3; margin: 0;
}
.breathe-state-sub {
  font-size: var(--text-sm); color: var(--color-text-muted);
  text-align: center; margin: 0;
}
.breathe-states {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4); width: 100%;
}
.breathe-state-btn {
  background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-xl); padding: var(--space-5) var(--space-3);
  cursor: pointer; transition: all 0.2s ease;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  -webkit-tap-highlight-color: transparent;
}
.breathe-state-btn:hover, .breathe-state-btn:active {
  border-color: var(--color-primary);
  background: rgba(232,130,12,0.14);
  transform: translateY(-2px);
}
.breathe-state-icon { font-size: 2.4rem; }
.breathe-state-label {
  font-size: 0.82rem; font-weight: 600; color: var(--color-text);
  text-align: center; line-height: 1.2;
}
.breathe-manual-link {
  font-size: var(--text-sm); color: var(--color-text-muted);
  background: none; border: none; cursor: pointer;
  text-decoration: underline; padding: var(--space-2);
  -webkit-tap-highlight-color: transparent;
}

/* Physiological Sigh hero */
.breathe-sigh-title {
  font-family: var(--font-display); font-size: var(--text-xl);
  color: var(--color-text); text-align: center; line-height: 1.3; margin: 0;
}
.breathe-sigh-body {
  font-size: var(--text-sm); color: var(--color-text-muted);
  line-height: 1.65; text-align: center; margin: 0;
}
.breathe-sigh-steps {
  display: flex; flex-direction: column; gap: var(--space-3); width: 100%;
}
.breathe-sigh-step {
  display: flex; align-items: flex-start; gap: var(--space-3);
  background: rgba(255,255,255,0.05); border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.09);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--color-text); line-height: 1.5;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sigh-step-num {
  background: var(--color-primary); color: #fff;
  border-radius: 50%; width: 22px; height: 22px; min-width: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
}
.breathe-sigh-science {
  font-size: 0.72rem; color: var(--color-text-muted); text-align: center;
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.05); border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.09); border-left: 2px solid var(--color-primary);
  line-height: 1.5; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.breathe-sigh-actions { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); width: 100%; }

/* Player screen */
.breathe-back-btn {
  align-self: flex-start; background: none; border: none;
  color: var(--color-text-muted); font-size: var(--text-sm);
  cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent;
}

/* Immersive orb */
.breathe-orb-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 240px; height: 240px;
}
.breathe-orb {
  --orb-color-1: #8b5cf6;
  --orb-color-2: #6d28d9;
  position: relative; width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--orb-color-1), var(--orb-color-2));
  box-shadow:
    0 0 40px color-mix(in srgb, var(--orb-color-1) 40%, transparent),
    0 0 80px color-mix(in srgb, var(--orb-color-2) 20%, transparent);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1),
              filter 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; align-items: center; justify-content: center;
}
.breathe-orb-inner {
  width: 70%; height: 70%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25), transparent 70%);
  pointer-events: none;
}
.breathe-orb-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--orb-color-1) 30%, transparent);
  animation: orbRingPulse 4s ease-in-out infinite;
  pointer-events: none;
}
.breathe-orb-ring-1 { width: 190px; height: 190px; animation-delay: 0s; }
.breathe-orb-ring-2 { width: 210px; height: 210px; animation-delay: 0.8s; opacity: 0.6; }
.breathe-orb-ring-3 { width: 230px; height: 230px; animation-delay: 1.6s; opacity: 0.3; }

@keyframes orbRingPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.15; }
}

/* Phase display */
.breathe-phase-display {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.breathe-phase-label {
  font-family: var(--font-display); font-size: var(--text-lg);
  color: var(--color-text); font-style: italic;
}
.breathe-phase-count {
  font-size: 2.8rem; font-family: var(--font-display);
  color: var(--color-primary); line-height: 1; font-weight: 700;
}

/* Technique info */
.breathe-technique-info { text-align: center; max-width: 340px; }
.breathe-tech-name {
  font-family: var(--font-display); font-size: var(--text-base);
  color: var(--color-text); font-weight: 600; margin-bottom: var(--space-1);
}
.breathe-tech-desc {
  font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.55;
}

/* Player controls */
.breathe-player-controls {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3); width: 100%;
}
.breathe-start-btn { max-width: 240px; }
.breathe-cycles { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Post-session science card */
.breathe-science-card {
  background: rgba(255,255,255,0.05); border-radius: var(--radius-xl);
  padding: var(--space-5); text-align: center; width: 100%;
  border: 1px solid rgba(255,255,255,0.09);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.breathe-science-icon { font-size: 2rem; }
.breathe-science-text {
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.65;
}

/* Manual selector */
.breathe-manual-title {
  font-family: var(--font-display); font-size: var(--text-lg);
  color: var(--color-text); margin: 0; align-self: flex-start;
}
.breathe-manual-options { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; }
.breathe-manual-opt {
  background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-xl); padding: var(--space-4) var(--space-5);
  cursor: pointer; transition: all 0.2s ease;
  text-align: left; -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; gap: 4px;
}
.breathe-manual-opt:hover, .breathe-manual-opt:active {
  border-color: var(--color-primary); background: var(--color-primary-highlight);
}
.breathe-manual-name {
  font-size: var(--text-base); font-weight: 600; color: var(--color-text);
}
.breathe-manual-meta {
  font-size: var(--text-xs); color: var(--color-text-muted);
}

/* ── PROGRESS ────────────────────────────────────────────────────── */
.progress-section { display: flex; flex-direction: column; gap: var(--space-6); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); align-items: stretch; }
/* FIX: Stat cards — equal height + vertically centered content */
.stat-card {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2); padding: var(--space-6) var(--space-4);
  height: 100%;
}
.stat-icon { font-size: 1.75rem; }
.stat-value { font-family: var(--font-display); font-size: 2rem; color: var(--color-text); line-height: 1; }
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mood-chart { display: flex; align-items: flex-end; gap: var(--space-2); height: 80px; }
.mood-bar { flex: 1; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--color-primary); opacity: 0.7; transition: opacity var(--transition), height 0.5s var(--ease-out); min-height: 4px; }
.mood-bar.today { opacity: 1; box-shadow: 0 0 12px var(--color-primary-glow); }
/* BUG-012: Empty bars show at 20% min-height with muted dashed style so chart isn’t blank */
.mood-bar.empty {
  opacity: 0.25;
  min-height: 20%;
  background: transparent;
  border: 1.5px dashed var(--color-border);
  border-bottom: none;
}
.mood-chart-labels { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.mood-chart-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--color-text-faint); text-transform: uppercase; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.profile-item { display: flex; flex-direction: column; gap: var(--space-1); }
.profile-label { font-size: var(--text-xs); color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.profile-value { font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
/* BUG-004: Profile empty CTA */
.profile-empty-cta {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.profile-empty-text {
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.65;
}

/* ── MOBILE NAV TOGGLE ───────────────────────────────────────────── */
/* Hidden always — bottom nav replaces it on mobile, sidebar handles desktop */
.mobile-nav-toggle {
  display: none !important;
}

/* BUG-002 + BUG-014: Topbar theme toggle button */
.topbar-theme-btn {
  display: none; /* hidden on desktop — sidebar has the toggle */
  align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-offset);
  color: var(--color-text); /* BUG-014: full opacity — clearly visible */
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.topbar-theme-btn:hover {
  background: var(--color-primary-highlight);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
/* BUG-014: Sidebar theme toggle — show current mode icon at full opacity */
.sidebar-theme svg { opacity: 1; }

.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 49; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.sidebar-overlay.active { display: block; }

/* ── BOTTOM NAV ──────────────────────────────────────────────────── */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height); z-index: 100;
  background: color-mix(in srgb, var(--color-surface) 95%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-divider);
  justify-content: space-around; align-items: center;
  padding: 0 var(--space-2);
  /* Account for iPhone home bar */
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 4px);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; padding: var(--space-2) 0; color: var(--color-text-faint);
  font-size: 10px; font-weight: 600; transition: all var(--transition);
  cursor: pointer; border: none; background: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item svg { transition: all var(--transition); }
.bottom-nav-item.active { color: var(--color-primary); }
.bottom-nav-item.active svg { filter: drop-shadow(0 0 6px var(--color-primary-glow)); }
.bottom-nav-item:hover { color: var(--color-primary); }

/* ── INSTALL SHEET ──────────────────────────────────────────────── */
.install-sheet {
  position: fixed;
  /* On mobile: above the bottom nav */
  bottom: calc(var(--bottom-nav-height) + var(--space-3));
  left: var(--space-3); right: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 110; /* above bottom nav (100) and sidebar overlay (49) */
  overflow: hidden;
  animation: slideUpIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Desktop: bottom-right card */
@media (min-width: 901px) {
  .install-sheet {
    bottom: var(--space-6); left: auto;
    right: var(--space-6); width: 340px;
  }
}
.install-sheet-inner { padding: var(--space-4); }

/* Banner row */
.install-banner {
  display: flex; align-items: center;
  justify-content: space-between; gap: var(--space-3);
}
.install-banner-left {
  display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0;
}
.install-app-icon { border-radius: var(--radius-md); flex-shrink: 0; }
.install-banner-text {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.install-banner-text strong {
  font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text);
  /* Allow text to wrap naturally — never truncate */
  white-space: normal;
  line-height: 1.35;
}
.install-banner-text span {
  font-size: var(--text-xs); color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
.install-banner-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.install-dismiss-btn { color: var(--color-text-faint) !important; min-width: 36px; min-height: 36px; }
/* Ensure icon size is at least 44x44 touch target on mobile */
@media (max-width: 900px) {
  .install-dismiss-btn { min-width: 44px; min-height: 44px; }
  .install-banner-actions .btn-primary { min-height: 38px; padding: 0.45rem 0.9rem; }
}

/* iOS step list */
.install-ios-steps {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.install-steps-title {
  font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text); margin-bottom: var(--space-3);
}
.install-steps-list {
  list-style: none; display: flex; flex-direction: column; gap: var(--space-3);
}
.install-steps-list li {
  display: flex; align-items: flex-start; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5;
}
.step-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-primary-highlight); color: var(--color-primary);
  font-size: var(--text-xs); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.install-steps-list strong { color: var(--color-text); }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; top: 0; height: 100dvh; box-shadow: var(--shadow-xl); }
  .sidebar.open { left: 0; }
  .bottom-nav { display: flex; }
  /* BUG-002: Show theme toggle in topbar on mobile */
  .topbar-theme-btn { display: flex; }
  /* Topbar: centered content, consistent side padding */
  .topbar { padding-left: var(--space-5); padding-right: var(--space-5); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  /* Breathe: keep 3-col horizontal, just tighten gap */
  .breathe-options { gap: var(--space-2); flex-direction: row; }
  .breathe-option { padding: var(--space-3) var(--space-2); }
  .breathe-opt-icon { font-size: 1.25rem; margin-bottom: var(--space-1); }
  .breathe-opt-name { font-size: var(--text-sm); }
  .breathe-opt-desc { font-size: 0.65rem; }
  .chat-history, .chat-input-row, .chat-suggestions, .chat-disclaimer { padding-inline: var(--space-4); }
}
@media (max-width: 600px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  /* CRITICAL: Do NOT stack breathe options — keep 3-col row */
  .breathe-options { flex-direction: row; gap: var(--space-1); }
  .breathe-option { padding: var(--space-2) var(--space-1); }
  .breathe-opt-name { font-size: 0.7rem; }
  .breathe-opt-desc { font-size: 0.6rem; }
  .breathe-opt-icon { font-size: 1.1rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .greeting-art { font-size: 2rem; flex-shrink: 0; min-width: 40px; text-align: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  /* FIX: Section padding symmetry on small screens */
  .dash-content { padding: var(--space-4); gap: var(--space-5); }
  /* FIX: Checkin actions — stack neatly on very small screens */
  .checkin-actions { gap: var(--space-2); }
  .checkin-actions .btn-sm { flex: 1; min-width: 0; text-align: center; }
  /* FIX: Mood week card padding — prevent dot edge clipping */
  .mood-week-grid { padding: var(--space-2) var(--space-1); gap: var(--space-1); }
}

/* ── DAILY VIDEO SECTION v2 ─────────────────────────────────────── */
.video-section {
  margin-top: var(--space-8);
  /* Extra bottom padding on mobile: account for nav (68px) + install sheet (~110px) + breathing room */
  padding-bottom: calc(var(--space-4) + 120px);
}
@media (min-width: 901px) {
  .video-section { padding-bottom: var(--space-4); }
}
/* BUG-006: Reduce top margin on typical 1280px laptop screens to avoid large empty gap */
@media (min-width: 901px) and (max-width: 1400px) {
  .video-section { margin-top: var(--space-6); }
}
.video-section-header {
  margin-bottom: var(--space-3);
}
.video-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: 2px;
}
.video-section-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-height: 1.2em;
}
/* Filter pills */
.video-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  padding-right: var(--space-6);  /* prevent last pill from being cut off on mobile */
  margin-bottom: var(--space-4);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.video-filter-row::-webkit-scrollbar { display: none; }
.video-filter-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.video-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.video-filter-btn:not(.active):hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

/* Locked / empty state */
.video-locked-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}
.video-locked-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-surface-2, #1e1a35);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
}
.video-locked-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 260px;
}

/* Video card stack */
.video-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.video-card {
  display: block;               /* <a> tags are inline by default — force block */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  text-decoration: none;        /* strip underline from <a> */
  color: inherit;               /* strip default link blue */
}
.video-card:hover,
.video-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232,130,12,0.18);
}
.video-card:active {
  transform: scale(0.985);
}

/* Thumbnail area */
.video-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 52.5%;           /* 16:9 ratio */
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.video-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.video-card:hover .video-thumb-img {
  transform: scale(1.03);
}
/* Full-bleed dark gradient so text is always readable */
.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11,9,22,0.85) 0%,
    rgba(11,9,22,0.15) 50%,
    transparent 100%
  );
  pointer-events: none;
}

/* "Watch on YouTube" pill — bottom-center of thumbnail */
.video-play-pill {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(232,130,12,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(232,130,12,0.5);
  transition: background 0.15s;
}
.video-card:hover .video-play-pill,
.video-card:active .video-play-pill {
  background: rgba(114,82,220,0.97);
}

/* Duration badge — top-right corner */
.video-dur-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
}

/* Guru pill — top-left corner */
.video-guru-pill {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.video-guru-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--guru-color, #9c82f0);
  flex-shrink: 0;
}

/* Card body text */
.video-card-body {
  padding: 14px 16px 16px;
}
.video-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 4px;
}
.video-card-topic {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.video-card-quote {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.6;
  border-left: 2.5px solid var(--guru-color, var(--color-primary));
  padding-left: 10px;
  margin: 0;
}

/* Desktop: 2-col grid when space allows */
@media (min-width: 700px) {
  .video-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}
@media (min-width: 1100px) {
  .video-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── AI Coach — Suggestion Cards ────────────────────────────────── */
.suggestion-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  max-width: 100%;
}

.coach-suggestion-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xl);
  background: rgba(91, 63, 196, 0.12);
  border: 1px solid rgba(91, 63, 196, 0.28);
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  text-align: left;
}

.coach-suggestion-card:hover,
.coach-suggestion-card:active {
  background: rgba(91, 63, 196, 0.22);
  transform: translateY(-1px);
}

.suggestion-bubble.used .coach-suggestion-card {
  opacity: 0.5;
  pointer-events: none;
}

.csc-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.csc-body {
  flex: 1;
  min-width: 0;
}

.csc-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 2px;
}

.csc-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.45;
}

.csc-action {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Multi-paragraph AI messages */
.chat-bubble.ai .chat-text p + p {
  margin-top: 0.5rem;
}

/* ── Subscription Paywall Overlay ─────────────────────────────────── */
#mf-paywall {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(11, 9, 22, 0.96);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.paywall-card {
  background: rgba(8,6,18,0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px; width: 100%;
  text-align: center;
}
.paywall-logo { margin-bottom: 20px; }
.paywall-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 24px; font-weight: 400;
  color: #e8e4f8; margin-bottom: 10px;
}
.paywall-card > p {
  color: #8b85aa; font-size: 14px;
  line-height: 1.6; margin-bottom: 28px;
}
.paywall-plans { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.paywall-plan-btn {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.paywall-plan-btn:hover { border-color: #E8820C; background: rgba(232,130,12,0.08); }
.paywall-plan-annual { border-color: #E8820C; background: rgba(232,130,12,0.1); }
.plan-badge {
  position: absolute; top: -10px; right: 16px;
  background: #E8820C; color: white;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 10px;
}
.plan-name { font-size: 15px; font-weight: 600; color: #e8e4f8; }
.plan-price { font-size: 28px; font-weight: 700; color: #e8e4f8; }
.plan-price small { font-size: 14px; font-weight: 400; color: #8b85aa; }
.plan-sub { font-size: 12px; color: #8b85aa; }
.paywall-fine { font-size: 12px; color: #8b85aa; margin-top: 4px; }

/* Trial banner */
#trialBanner {
  display: none;
  background: rgba(251,191,36,0.15);
  border-bottom: 1px solid rgba(251,191,36,0.3);
  color: #fbbf24;
  font-size: 13px; font-weight: 500;
  text-align: center; padding: 8px 16px;
}

/* ── Profile Section ──────────────────────────────────────────────── */
/* Let profile-wrap own all layout — strip dash-content defaults for this section */
#section-profile.dash-content {
  padding: 0;
  gap: 0;
  align-items: stretch;
}

.profile-wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
}

.profile-card {
  padding: 1.5rem;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.profile-avatar-tappable {
  cursor: pointer;
}

.profile-avatar-tappable:active {
  opacity: 0.85;
  transform: scale(0.97);
  transition: transform 0.1s;
}

.avatar-camera-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-avatar-tappable:hover .avatar-camera-overlay,
.profile-avatar-tappable:active .avatar-camera-overlay {
  opacity: 1;
}

/* Always show camera hint on mobile (no hover state) */
@media (hover: none) {
  .avatar-camera-overlay {
    opacity: 1;
    background: rgba(0,0,0,0.3);
  }
}

.avatar-upload-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(8,6,18,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-upload-spinner::after {
  content: '';
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,170,40,0.3);
  border-top-color: #FFAA28;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.profile-identity {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.profile-email {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.profile-stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary-light);
  line-height: 1;
}

.profile-stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Billing & FAQ cards */
.profile-section-card {
  padding: 1.25rem 1.5rem;
  overflow: hidden;
}

.profile-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 1rem 0;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.profile-info-row:last-of-type {
  border-bottom: none;
}

.profile-info-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.profile-info-val {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.profile-billing-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.profile-billing-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.profile-action-btn {
  width: 100%;
  justify-content: center;
  gap: 0.5rem;
  display: flex;
  align-items: center;
}

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 0.9rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.15s;
}

.faq-q:hover {
  color: var(--color-primary-light);
}

.faq-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  padding-bottom: 1rem;
  display: none;
}

.faq-item.open .faq-a {
  display: block;
}

/* ── Journal Mode Toggle ─────────────────────────────────────────── */
.journal-mode-toggle {
  display: flex;
  gap: 8px;
  background: var(--color-surface-raised);
  border-radius: 14px;
  padding: 5px;
  border: 1px solid var(--color-divider);
}
.journal-mode-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-body);
}
.journal-mode-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,130,12,0.35);
}

/* ── Past Entries List ───────────────────────────────────────────── */
.journal-past-card {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-divider);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease;
  margin-bottom: 12px;
}
.journal-past-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.journal-past-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.journal-past-date {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.journal-past-tags {
  display: flex;
  gap: 6px;
}
.journal-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(232,130,12,0.15);
  color: var(--color-primary);
  letter-spacing: 0.02em;
}
.journal-past-preview {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}
.journal-empty-state {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: 40px 20px;
  line-height: 1.7;
}

/* ── Entry Detail View ───────────────────────────────────────────── */
.journal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  padding: 0;
  font-family: var(--font-body);
}
.journal-back-btn:hover { opacity: 0.75; }
.journal-entry-date {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.journal-entry-mode {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 16px;
}
.journal-entry-prompt {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.5);
  font-style: italic;
  margin-bottom: 16px;
  line-height: 1.6;
  border-left: 2px solid var(--color-primary);
  padding-left: 12px;
}
.journal-entry-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.85;
  margin: 0;
}
.journal-entry-divider {
  border: none;
  border-top: 1px solid var(--color-divider);
  margin: 24px 0;
}

/* -- Streak Hero Card -------------------------------------------------------- */
.streak-hero-card {
  padding: 20px 20px 16px;
  background: linear-gradient(135deg, rgba(232,130,12,0.18) 0%, rgba(232,130,12,0.1) 100%);
  border: 1px solid rgba(232,130,12,0.25);
}
.streak-hero-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.streak-hero-flame {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(251,146,60,0.5));
}
.streak-hero-info {
  flex: 1;
}
.streak-hero-number {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -2px;
}
.streak-hero-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.streak-hero-right {
  text-align: right;
}
.streak-hero-stat {
  font-size: 0.875rem;
  font-weight: 600;
  color: #F9A56D;
}
.streak-hero-best {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-top: 3px;
}
.streak-hero-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}
.streak-hero-fill {
  height: 100%;
  background: linear-gradient(90deg, #E8820C, #F9A56D);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}
.streak-hero-caption {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* -- Weekly Insights Card ---------------------------------------------------- */
.insights-card { padding: 20px; }
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.insight-stat {
  text-align: center;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.insight-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}
.insight-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.insight-sub {
  font-size: 0.7rem;
  color: #F9A56D;
  margin-top: 3px;
}
.insights-mood-bar { margin-bottom: 14px; }
.insights-bar-inner {
  display: flex;
  align-items: flex-end;
  height: 70px;
  padding: 0 4px;
}
.insights-summary {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
  line-height: 1.5;
}

/* ── WEEKLY INSIGHTS — Mini Bar Chart ─────────────────────────────────────── */
.insights-mood-bar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
  margin-bottom: 14px;
  padding: 0 2px;
}
.insights-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.insights-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.insights-bar-fill {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s cubic-bezier(0.16,1,0.3,1);
}
.mood-bar-1 { background: #ef4444; }
.mood-bar-2 { background: #f97316; }
.mood-bar-3 { background: #eab308; }
.mood-bar-4 { background: #22c55e; }
.mood-bar-5 { background: #8b5cf6; }
.mood-bar-empty { background: rgba(255,255,255,0.07); }
.insights-bar-day {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── STREAK HERO — Milestone Glows ──────────────────────────────────────────── */
.streak-hero-card.streak-milestone-7 { box-shadow: 0 0 24px rgba(232,130,12,0.18); }
.streak-hero-card.streak-milestone-14 { box-shadow: 0 0 32px rgba(249,165,109,0.25); border-color: rgba(249,165,109,0.2); }
.streak-hero-card.streak-milestone-30 {
  box-shadow: 0 0 40px rgba(251,191,36,0.22);
  border-color: rgba(251,191,36,0.18);
}
.streak-hero-card.streak-milestone-30 .streak-hero-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ── SOS FLOATING ACTION BUTTON ─────────────────────────────────────────────── */
.sos-fab {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E8820C, #F9A56D);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232,130,12,0.45), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s var(--ease-out), opacity 0.25s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.sos-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(232,130,12,0.55); }
.sos-fab:active { transform: scale(0.95); }
.sos-fab-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: -2px;
}
.sos-fab.sos-fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
@media (min-width: 768px) {
  .sos-fab {
    bottom: 24px;
    right: 24px;
  }
}

/* ── SOS MODAL ───────────────────────────────────────────────────────────────── */
.sos-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 500px) {
  .sos-modal { align-items: center; }
}
.sos-modal.hidden { display: none; }
.sos-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}
.sos-modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 40px;
  border: 1px solid var(--color-divider);
  text-align: center;
}
@media (min-width: 500px) {
  .sos-modal-card { border-radius: 20px; padding-bottom: 28px; }
}
.sos-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-offset);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background 0.15s;
}
.sos-close-btn:hover { background: var(--color-divider); }
.sos-header { margin-bottom: 20px; }
.sos-icon { font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.sos-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}
.sos-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}
.sos-circle-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0 20px;
}
.sos-circle {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1s ease;
}
.sos-ring-svg { position: absolute; inset: 0; }
.sos-ring-track { stroke: rgba(255,255,255,0.06); }
.sos-ring-progress {
  stroke: #F9A56D;
  transition: stroke-dashoffset 1s linear;
}
.sos-circle-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.sos-phase-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}
.sos-count-text {
  font-size: 2rem;
  font-weight: 800;
  color: #F9A56D;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sos-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sos-start-btn { min-width: 120px; }
.sos-tip {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
  transition: opacity 0.3s;
}

/* ── JOURNAL — Coach Response Card  (Feature 3) ──────────────────────────── */
.journal-coach-card {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, rgba(232,130,12,0.08) 0%, rgba(249,165,109,0.04) 100%);
  border: 1px solid rgba(232,130,12,0.18);
  border-radius: var(--radius-xl);
  animation: slideUpFade 0.4s var(--ease-out) both;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.journal-coach-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.journal-coach-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E8820C, #F9A56D);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.journal-coach-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #F9A56D;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.journal-coach-text {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0 0 0;
}

/* ── TRIAL BANNERS ───────────────────────────────────────────────────────────── */
.trial-banner {
  background: rgba(232,130,12,0.12);
  border-bottom: 1px solid rgba(232,130,12,0.2);
  padding: 8px 20px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.trial-expired-banner {
  background: rgba(239,68,68,0.12);
  border-bottom: 1px solid rgba(239,68,68,0.2);
  padding: 10px 20px;
  font-size: 0.82rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── MOOD WEEK GRID tweaks ───────────────────────────────────────────────────── */
.mood-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: var(--space-3) var(--space-2);
}
.mood-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  border-radius: 10px;
  transition: background 0.15s;
}
.mood-week-day.today {
  background: rgba(232,130,12,0.12);
}
.mood-week-emoji { font-size: 1.3rem; line-height: 1; }
.mood-week-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mood-week-day.today .mood-week-label { color: #F9A56D; font-weight: 600; }

/* ── CANCEL SURVEY GATE MODAL ────────────────────────────────────────────────── */
.cancel-survey-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 500px) {
  .cancel-survey-modal { align-items: center; }
}
.cancel-survey-modal.hidden { display: none; }
.cancel-survey-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
}
.cancel-survey-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 36px;
  border: 1px solid var(--color-divider);
  max-height: 90vh;
  overflow-y: auto;
}
@media (min-width: 500px) {
  .cancel-survey-card { border-radius: 20px; padding-bottom: 28px; }
}
.cancel-survey-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-surface-offset);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background 0.15s;
  font-size: 1.1rem;
  line-height: 1;
}
.cancel-survey-close:hover { background: var(--color-divider); }
.cancel-survey-header { margin-bottom: 20px; }
.cancel-survey-icon { font-size: 2rem; margin-bottom: 6px; }
.cancel-survey-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}
.cancel-survey-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}
.cancel-survey-step { display: none; }
.cancel-survey-step.active { display: block; }
.cancel-survey-question {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 14px;
}
/* Reason option tiles */
.cancel-reason-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.cancel-reason-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface-offset);
  color: var(--color-text);
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cancel-reason-btn:hover,
.cancel-reason-btn.selected {
  border-color: #E8820C;
  background: rgba(232,130,12,0.10);
}
/* Follow-up inputs */
.cancel-followup-wrap { margin-bottom: 20px; }
.cancel-followup-wrap label {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.cancel-price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cancel-price-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface-offset);
  color: var(--color-text);
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.cancel-price-btn:hover,
.cancel-price-btn.selected {
  border-color: #E8820C;
  background: rgba(232,130,12,0.10);
}
.cancel-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cancel-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface-offset);
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 0.86rem;
  color: var(--color-text);
}
.cancel-checkbox-item:hover { border-color: #E8820C; }
.cancel-checkbox-item input[type="checkbox"] { accent-color: #E8820C; width: 16px; height: 16px; }
.cancel-checkbox-item.selected { border-color: #E8820C; background: rgba(232,130,12,0.10); }
.cancel-radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cancel-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface-offset);
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 0.86rem;
  color: var(--color-text);
}
.cancel-radio-item:hover { border-color: #E8820C; }
.cancel-radio-item.selected { border-color: #E8820C; background: rgba(232,130,12,0.10); }
.cancel-radio-item input[type="radio"] { accent-color: #E8820C; width: 16px; height: 16px; }
.cancel-open-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--color-surface-offset);
  border: 1.5px solid var(--color-divider);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--color-text);
  font-size: 0.86rem;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cancel-open-textarea:focus { outline: none; border-color: #E8820C; }
/* CTA buttons */
.cancel-survey-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.cancel-submit-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: #E8820C;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.cancel-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cancel-submit-btn:not(:disabled):hover { background: #6b4fd8; }
.cancel-skip-link {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.55;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  text-decoration: underline;
  transition: opacity 0.15s;
}
.cancel-skip-link:hover { opacity: 0.85; }
.cancel-step-indicator {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 16px;
}

/* ── CHAT HISTORY DIVIDER ──────────────────────────────────────────────────── */
.chat-history-divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.5;
  padding: 6px 0 10px;
  letter-spacing: 0.02em;
  user-select: none;
}

/* ── PROFILE — COACH STYLE PERSONALITY PICKER ─────────────────────────────── */
.personality-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.personality-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface-offset);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  text-align: center;
}

.personality-tile:hover {
  border-color: rgba(232,130,12,0.5);
  background: rgba(232,130,12,0.07);
}

.personality-tile.active {
  border-color: #E8820C;
  background: rgba(232,130,12,0.13);
}

.personality-tile:active { transform: scale(0.97); }

.personality-tile-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.personality-tile-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
}

.personality-tile-desc {
  font-size: 0.71rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.personality-tile.active .personality-tile-name { color: #F9A56D; }
.personality-tile.active .personality-tile-desc { color: var(--color-text-muted); }

.personality-saved-msg {
  font-size: 0.78rem;
  color: #6ee7b7;
  margin: 4px 0 0;
  text-align: center;
}

/* ── iOS Install Guide (Profile card) ─────────────────────────────── */
.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ios-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ios-step-body {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.ios-step-body strong { color: var(--color-text); }
.ios-install-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--color-text-faint);
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

/* ─────────────────────────────────────────────────────────────────
   ROI BOOSTER BANNERS — Coach intro, Meet coach nudge
───────────────────────────────────────────────────────────────── */
.coach-intro-banner {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: linear-gradient(135deg, #1e1540 0%, #2a1f55 100%);
  border: 1px solid rgba(232,130,12,0.35);
  border-radius: 18px;
  padding: 16px;
  z-index: 9000;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.coach-intro-banner.cib-visible { bottom: 24px; }
.meet-coach-nudge { border-color: rgba(52,211,153,0.35); }
.meet-coach-nudge .cib-btn { background: #34d399; color: #0d1117; }
.cib-inner { display: flex; align-items: center; gap: 12px; }
.cib-avatar { font-size: 28px; flex-shrink: 0; }
.cib-text { flex: 1; min-width: 0; }
.cib-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.cib-body { font-size: 12px; color: #a89ec0; line-height: 1.45; }
.cib-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #E8820C, #F9A56D);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cib-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #5a5070;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────
   SOS LOW MOOD CARD
───────────────────────────────────────────────────────────────── */
.sos-lowmood-card {
  background: rgba(14,165,233,0.08);
  border: 1px solid rgba(14,165,233,0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sos-lowmood-card.slmc-visible { opacity: 1; transform: translateY(0); }
.slmc-inner { display: flex; align-items: center; gap: 12px; }
.slmc-icon { font-size: 24px; flex-shrink: 0; }
.slmc-text { flex: 1; min-width: 0; }
.slmc-title { font-size: 13px; font-weight: 700; color: #7dd3fc; margin-bottom: 3px; }
.slmc-body { font-size: 12px; color: #94a3b8; line-height: 1.45; }
.slmc-btn {
  flex-shrink: 0;
  background: rgba(14,165,233,0.2);
  border: 1px solid rgba(14,165,233,0.4);
  color: #7dd3fc;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.slmc-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #4a5568;
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}

/* ─────────────────────────────────────────────────────────────────
   PROFILE — Notifications Card
───────────────────────────────────────────────────────────────── */
.notif-status-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notif-status-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.notif-status-text {
  flex: 1;
  min-width: 0;
}
.notif-status-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
  white-space: nowrap;
}
.notif-status-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.notif-status-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── ANNUAL UPGRADE BANNER (ROI #1) ─────────────────────────────────────── */
.annual-upgrade-banner {
  background: linear-gradient(135deg, #2a1f55 0%, #1e1540 100%);
  border: 1px solid rgba(249,165,109,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px 0;
  animation: slideDown 0.3s ease;
}
.annual-upgrade-banner .banner-text { flex: 1; font-size: 14px; color: #e8e4f0; font-weight: 500; }
.annual-upgrade-banner .banner-text span { color: #F9A56D; font-weight: 600; }
.annual-upgrade-banner .btn-upgrade-now { background: #E8820C; color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.annual-upgrade-banner .btn-dismiss { background: none; border: none; color: #5a5275; cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1; }
.annual-upgrade-banner .btn-dismiss:hover { color: #9990b8; }

/* ─────────────────────────────────────────────────────────────────
   DAILY FUEL — Multi-format stack (Watch / Read / Try / Reflect)
───────────────────────────────────────────────────────────────── */
.fuel-stack {
  margin-top: 8px;
}
.fuel-stack.hidden { display: none; }

/* Tab bar */
.fuel-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.fuel-tab {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 4px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.fuel-tab:hover {
  background: rgba(232,130,12,0.15);
  color: #c4b5fd;
  border-color: rgba(232,130,12,0.3);
}
.fuel-tab.active {
  background: rgba(232,130,12,0.25);
  border-color: rgba(232,130,12,0.6);
  color: #e9d5ff;
}

/* Panels */
.fuel-panel { display: block; }
.fuel-panel.hidden { display: none; }

/* ── Watch panel — reuses existing .video-card styles ── */
#fuelPanelWatch .fuel-video-wrap {
  border-radius: 12px;
  overflow: hidden;
}

/* ── Read panel — article card ── */
.fuel-article-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}
.fuel-article-card:hover { border-color: rgba(232,130,12,0.35); }
.fuel-article-source {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #F9A56D;
}
.fuel-article-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f0f8;
  line-height: 1.4;
  margin: 0;
}
.fuel-article-blurb {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}
.fuel-article-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #F9A56D;
  text-decoration: none;
  margin-top: 2px;
}
.fuel-article-link:hover { color: #c4b5fd; }
.fuel-article-link svg { flex-shrink: 0; }

/* ── Try panel — exercise card ── */
.fuel-exercise-card {
  background: linear-gradient(135deg, rgba(232,130,12,0.12) 0%, rgba(14,165,233,0.08) 100%);
  border: 1px solid rgba(232,130,12,0.25);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fuel-exercise-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fuel-exercise-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}
.fuel-exercise-meta { flex: 1; min-width: 0; }
.fuel-exercise-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 3px;
}
.fuel-exercise-name {
  font-size: 15px;
  font-weight: 700;
  color: #f1f0f8;
  margin: 0;
}
.fuel-exercise-duration {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.fuel-exercise-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fuel-exercise-steps li {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
}
.fuel-exercise-steps li::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  font-size: 11px;
  font-weight: 700;
  color: #F9A56D;
  top: 1px;
}
.fuel-exercise-why {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
  margin: 0;
}

/* ── Reflect panel — prompt card ── */
.fuel-prompt-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fuel-prompt-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #F9A56D;
}
.fuel-prompt-text {
  font-size: 16px;
  font-weight: 600;
  color: #f1f0f8;
  line-height: 1.5;
  font-style: italic;
  margin: 0;
}
.fuel-prompt-textarea {
  width: 100%;
  min-height: 90px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #e2e0ef;
  font-size: 14px;
  line-height: 1.55;
  padding: 12px 14px;
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.fuel-prompt-textarea:focus {
  outline: none;
  border-color: rgba(232,130,12,0.5);
}
.fuel-prompt-textarea::placeholder { color: #4a5568; }
.fuel-prompt-save {
  align-self: flex-end;
  background: rgba(232,130,12,0.2);
  border: 1px solid rgba(232,130,12,0.4);
  color: #c4b5fd;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.fuel-prompt-save:hover { background: rgba(232,130,12,0.35); }


/* ══════════════════════════════════════════════════════════════════
   TOD GLASS OVERRIDES
   When a time-of-day background is active, override opaque surfaces
   to semi-transparent glass so the photo shows through every card.
   ══════════════════════════════════════════════════════════════════ */

body.tod-sunrise,
body.tod-midday,
body.tod-golden,
body.tod-night {

  /* ── Chat bubbles (AI side) ─────────────────────────── */
  .chat-text {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.10);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ── Chat input bar + disclaimer ────────────────────── */
  .chat-input-row,
  .chat-disclaimer {
    background: rgba(8,6,18,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* ── Tool cards (standalone, outside Shine Your Light) ─ */
  .tool-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }
  .tool-card:hover {
    background: rgba(232,130,12,0.12);
    border-color: rgba(232,130,12,0.40);
  }

  /* ── Breathe — state selector buttons ──────────────── */
  .breathe-state-btn {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
  }
  .breathe-state-btn:hover,
  .breathe-state-btn:active {
    background: rgba(232,130,12,0.14);
  }

  /* ── Breathe — sigh steps & science card ────────────── */
  .breathe-sigh-step,
  .breathe-sigh-science,
  .breathe-science-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }

  /* ── Breathe — manual exercise options ──────────────── */
  .breathe-manual-opt {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
  }
  .breathe-manual-opt:hover,
  .breathe-manual-opt:active {
    background: rgba(232,130,12,0.12);
  }

  /* ── Progress — stat cards ───────────────────────────── */
  .stats-grid .card,
  .stat-card.card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ── Daily Fuel — video cards ────────────────────────── */
  .video-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }
  .video-card:hover {
    background: rgba(255,255,255,0.08);
  }

  /* ── Install sheet ───────────────────────────────────── */
  .install-sheet {
    background: rgba(8,6,18,0.80);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255,255,255,0.10);
  }

  /* ── Modal boxes (generic) ───────────────────────────── */
  .modal-box {
    background: rgba(8,6,18,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255,255,255,0.10);
  }

  /* ── SOS modal card ──────────────────────────────────── */
  .sos-modal-card {
    background: rgba(8,6,18,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255,255,255,0.10);
  }
  .sos-close-btn {
    background: rgba(255,255,255,0.08);
  }
  .sos-close-btn:hover {
    background: rgba(255,255,255,0.14);
  }

  /* ── Cancel survey card ──────────────────────────────── */
  .cancel-survey-card {
    background: rgba(8,6,18,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255,255,255,0.10);
  }
  .cancel-survey-close {
    background: rgba(255,255,255,0.08);
  }
  .cancel-survey-close:hover {
    background: rgba(255,255,255,0.14);
  }
  .cancel-checkbox-item,
  .cancel-radio-item {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
  }
  .cancel-checkbox-item:hover,
  .cancel-radio-item:hover {
    border-color: rgba(232,130,12,0.35);
    background: rgba(232,130,12,0.06);
  }

  /* ── Paywall card ────────────────────────────────────── */
  .paywall-card {
    background: rgba(8,6,18,0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(255,255,255,0.10);
  }
  .paywall-plan-btn {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
  }
  .paywall-plan-annual {
    background: rgba(232,130,12,0.12);
    border-color: rgba(232,130,12,0.35);
  }

  /* ── Profile cards ────────────────────────────────────── */
  .profile-card,
  .profile-section-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ── Journal cards ────────────────────────────────────── */
  .journal-prompt-card {
    background: linear-gradient(135deg, rgba(244,160,58,0.22) 0%, rgba(244,96,58,0.14) 100%);
    border: 1px solid rgba(244,160,58,0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  /* ── Journal mode toggle + past entry cards ─────────── */
  .journal-mode-toggle {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }
  .journal-past-card {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
  }
  .journal-past-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(232,130,12,0.35);
  }

  /* ── Recovery modal content area ────────────────────── */
  .recovery-modal-card,
  #recoveryEditModal .modal-box {
    background: rgba(8,6,18,0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(80,220,180,0.20);
  }

  /* ── Insights card ───────────────────────────────────── */
  .insights-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ── Weekly mood grid cells ───────────────────────────── */
  .week-day-cell {
    background: rgba(255,255,255,0.04);
  }

  /* ── Page header (topbar) ────────────────────────────── */
  .page-header {
    background: rgba(8,6,18,0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: rgba(255,255,255,0.06);
  }

  /* ── Generic .card inside sections (not overridden above) */
  .dash-section > .card:not([style*="background"]) {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* ── Bottom nav ──────────────────────────────────────── */
  .bottom-nav {
    background: rgba(8,6,18,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top-color: rgba(255,255,255,0.07);
  }

}
/* ═══════════════════════════════ END TOD GLASS OVERRIDES ═════════ */

/* ═══════════════════════════════ NOTIFICATION PREFERENCES ════════ */

/* Divider line inside notif card */
.notif-prefs-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 18px 0 16px;
}

/* Section heading */
.notif-prefs-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted, rgba(255,255,255,0.4));
  margin: 0 0 14px;
}

/* Each pref row: label + toggle */
.notif-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.notif-pref-row:last-of-type {
  border-bottom: none;
}

.notif-pref-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding-right: 16px;
}
.notif-pref-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.notif-pref-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.42);
  line-height: 1.4;
}

/* Toggle switch */
.notif-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.notif-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 26px;
  transition: background 0.25s;
}
.notif-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.notif-toggle-switch input:checked + .notif-toggle-slider {
  background: #FFAA28;
}
.notif-toggle-switch input:checked + .notif-toggle-slider::before {
  transform: translateX(18px);
}

/* DND time pickers */
.notif-dnd-times {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notif-dnd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-dnd-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  min-width: 40px;
}
.notif-time-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  outline: none;
  width: 120px;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.notif-time-input:focus {
  border-color: rgba(255,170,40,0.5);
  background: rgba(255,170,40,0.08);
}

/* Saved confirmation message */
.notif-prefs-save-msg {
  font-size: 0.75rem;
  color: #50dcb4;
  margin: 10px 0 0;
  text-align: right;
  font-weight: 600;
}

/* ═════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════ CHAT AVATARS ════════════════════════════ */

/* Coach avatar — Lumafy AI icon, no gradient background */
.chat-avatar-coach {
  background: none !important;
  padding: 0;
  overflow: hidden;
}

/* User avatar — their photo or amber initial */
.chat-avatar-user {
  background: linear-gradient(135deg, #FFAA28, #F4603A);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-avatar-initial {
  font-size: 13px;
  font-weight: 700;
  color: #080612;
  line-height: 1;
}

/* ═════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════ COACH LONG-PRESS MENU ═══════════════════ */

.coach-ctx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,6,18,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.coach-ctx-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #13101f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  padding: 8px 0 32px;
  max-width: 480px;
  margin: 0 auto;
  animation: slideUp 0.22s ease;
}

/* Quoted preview of the message */
.coach-ctx-preview {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coach-ctx-actions {
  padding: 8px 12px 0;
}

.coach-ctx-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.coach-ctx-btn:active,
.coach-ctx-btn:hover {
  background: rgba(255,255,255,0.06);
}
.coach-ctx-btn svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.coach-ctx-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 6px 0;
}

.coach-ctx-feedback-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 10px 10px 6px;
  margin: 0;
}

.coach-ctx-feedback-row {
  display: flex;
  gap: 10px;
  padding: 4px 6px 6px;
}

.coach-ctx-feedback-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.coach-ctx-feedback-btn:active,
.coach-ctx-feedback-btn:hover {
  background: rgba(255,170,40,0.12);
  border-color: rgba(255,170,40,0.3);
  color: #FFAA28;
}
.coach-ctx-feedback-btn.selected-up {
  background: rgba(80,220,180,0.15);
  border-color: rgba(80,220,180,0.4);
  color: #50dcb4;
}
.coach-ctx-feedback-btn.selected-down {
  background: rgba(255,100,80,0.12);
  border-color: rgba(255,100,80,0.3);
  color: #ff6450;
}

/* ═════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════ CHAT TOPBAR ═════════════════════════════ */

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}

.chat-topbar-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.01em;
}

.chat-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-clear-btn:hover,
.chat-clear-btn:active {
  border-color: rgba(255,100,80,0.4);
  color: rgba(255,100,80,0.8);
  background: rgba(255,100,80,0.06);
}
.chat-clear-btn svg {
  flex-shrink: 0;
}

/* ═════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════ JOURNAL SEARCH + FILTER ════════════════ */

.journal-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.journal-search-icon {
  flex-shrink: 0;
  opacity: 0.4;
}
.journal-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.9rem;
  caret-color: #FFAA28;
  min-width: 0;
}
.journal-search-input::placeholder {
  color: rgba(255,255,255,0.3);
}
/* Hide browser default clear button on search inputs */
.journal-search-input::-webkit-search-cancel-button { display: none; }
.journal-search-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.journal-search-clear:hover { color: rgba(255,255,255,0.8); }

/* Mood filter chips */
.journal-mood-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.journal-mood-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.journal-mood-chip:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
.journal-mood-chip.active {
  background: rgba(255,170,40,0.15);
  border-color: rgba(255,170,40,0.45);
  color: #FFAA28;
}
/* Emoji chips slightly larger font */
.journal-mood-chip[data-mood="1"],
.journal-mood-chip[data-mood="2"],
.journal-mood-chip[data-mood="3"],
.journal-mood-chip[data-mood="4"],
.journal-mood-chip[data-mood="5"] {
  font-size: 1.1rem;
  padding: 4px 12px;
}

/* Filter result count */
.journal-filter-count {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin: 0 0 10px 2px;
  font-weight: 500;
}

/* Search highlight */
mark.journal-highlight {
  background: rgba(255,170,40,0.3);
  color: #FFAA28;
  border-radius: 3px;
  padding: 0 1px;
}

/* ═════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════ PROGRESS INSIGHTS ══════════════════════ */

.progress-insights-card {
  border: 1px solid rgba(255,170,40,0.18) !important;
  background: linear-gradient(135deg, rgba(255,170,40,0.06) 0%, rgba(8,6,18,0.0) 100%) !important;
}

.progress-insights-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.progress-insights-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFAA28;
}

.progress-insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.5;
}

.progress-insight-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFAA28;
  flex-shrink: 0;
  margin-top: 7px;
}

/* ═════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════ JOURNAL PHOTO ATTACHMENTS ════════════════════ */

/* Footer left: word count + attach button side by side */
.journal-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Camera icon attach button */
.journal-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.journal-attach-btn:hover { background: rgba(255,170,40,0.14); color: #FFAA28; }
.journal-attach-btn input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

/* Staged photo strip below textarea */
.journal-photo-strip {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 4px;
}
.journal-photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.journal-photo-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.journal-photo-remove {
  position: absolute;
  top: 3px; right: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.72);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.journal-photo-remove:hover { background: rgba(220,50,50,0.85); }

/* Toast for photo validation messages */
.journal-photo-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30,24,50,0.96);
  border: 1px solid rgba(255,170,40,0.3);
  color: #FFAA28;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}
.journal-photo-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Thumbnail row on past entry cards */
.journal-past-photos {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.journal-past-photo-thumb {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.journal-past-photo-more {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  margin-left: 2px;
}

/* Photo grid in entry detail view */
.journal-photo-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.journal-photo-grid-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: opacity 0.15s;
}
.journal-photo-grid-item:hover { opacity: 0.85; }
.journal-photo-grid-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

@media (max-width: 480px) {
  .journal-photo-thumb { width: 60px; height: 60px; }
  .journal-photo-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RECOVERY MODE — PIECE 1+2
   Craving / Sponsor Contact Styles
   Recovery color: teal #50DCB4
═══════════════════════════════════════════════════════════════════════════════ */

/* ── "I Need Support" pulsing button ──────────────────────────────────────── */
.craving-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: rgba(80, 220, 180, 0.14);
  border: 1.5px solid rgba(80, 220, 180, 0.45);
  border-radius: 13px;
  color: #50DCB4;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  overflow: visible;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 10px;
}
.craving-btn:active {
  background: rgba(80, 220, 180, 0.22);
  border-color: rgba(80, 220, 180, 0.7);
}

/* Pulse ring animation */
.craving-btn-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  border: 2px solid rgba(80, 220, 180, 0.45);
  animation: cravingPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes cravingPulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  70%  { transform: scale(1.06); opacity: 0; }
  100% { transform: scale(1.06); opacity: 0; }
}

/* ── Craving bottom sheet overlay ─────────────────────────────────────────── */
.craving-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10010;
  align-items: flex-end;
  justify-content: center;
}
.craving-sheet.open {
  display: flex;
}

.craving-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.craving-sheet-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: #0e0a1e;
  border-top: 1.5px solid rgba(80, 220, 180, 0.22);
  border-radius: 24px 24px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  animation: sheetSlideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.craving-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 12px auto 0;
}

.craving-sheet-header {
  padding: 18px 22px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.craving-sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #50DCB4;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.craving-sheet-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.4;
}

/* ── Action rows ──────────────────────────────────────────────────────────── */
.craving-action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.craving-action-row:active {
  background: rgba(255, 255, 255, 0.05);
}
.craving-action-row + .craving-action-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Disabled row (no sponsor saved) */
.craving-row-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Row icons */
.craving-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.craving-icon-call  { background: rgba(80, 220, 180, 0.15); }
.craving-icon-text  { background: rgba(80, 180, 220, 0.15); }
.craving-icon-coach { background: rgba(255, 170, 40,  0.15); }
.craving-icon-988   { background: rgba(220, 60,  60,  0.13); }

/* Row text block */
.craving-action-text { flex: 1; min-width: 0; }
.craving-action-label {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.craving-action-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 988 row distinct styling */
.craving-row-988 .craving-action-label { color: rgba(220, 100, 100, 0.95); }
.craving-row-988 .craving-action-sub   { color: rgba(220, 100, 100, 0.5); }
.craving-row-988 .craving-action-arrow { stroke: rgba(220, 100, 100, 0.6); }

/* Arrow chevron */
.craving-action-arrow {
  color: rgba(255, 255, 255, 0.25);
  stroke: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* ── Close button ─────────────────────────────────────────────────────────── */
.craving-sheet-close {
  display: block;
  width: calc(100% - 44px);
  margin: 12px 22px 16px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.craving-sheet-close:active {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

/* ── Craving opener chat bubble ───────────────────────────────────────────── */
.craving-opener-bubble {
  border-left: 3px solid #50DCB4;
  background: rgba(80, 220, 180, 0.06);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   RECOVERY MODE — PIECE 3+4
   Milestone Coach Delivery Message + Share Button
═══════════════════════════════════════════════════════════════════════════════ */

/* Coach personal message inside milestone modal */
.smm-coach-msg {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  background: rgba(255, 170, 40, 0.07);
  border-left: 2px solid rgba(255, 170, 40, 0.35);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 0 0 18px;
  text-align: left;
  display: none; /* shown via JS when content is set */
}
.smm-coach-msg.visible { display: block; }

/* Share milestone button */
.smm-share-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 13px 20px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.smm-share-btn:active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.smm-share-btn::before {
  content: '↗';
  font-size: 15px;
  opacity: 0.7;
}

/* Milestone tier color overrides (visual distinction per milestone) */
#streakMilestoneModal[data-days="3"]  .smm-inner { border-color: rgba(80, 220, 180, 0.35); }
#streakMilestoneModal[data-days="7"]  .smm-inner { border-color: rgba(255, 170, 40,  0.50); box-shadow: 0 0 60px rgba(255,170,40,0.18), 0 24px 48px rgba(0,0,0,0.6); }
#streakMilestoneModal[data-days="14"] .smm-inner { border-color: rgba(100, 180, 255, 0.40); }
#streakMilestoneModal[data-days="21"] .smm-inner { border-color: rgba(180, 120, 255, 0.40); }
#streakMilestoneModal[data-days="30"] .smm-inner { border-color: rgba(255, 215, 0,   0.50); box-shadow: 0 0 80px rgba(255,215,0,0.15), 0 24px 48px rgba(0,0,0,0.6); }
#streakMilestoneModal[data-days="60"] .smm-inner { border-color: rgba(255, 140, 50,  0.50); }
#streakMilestoneModal[data-days="90"] .smm-inner { border-color: rgba(255, 100, 80,  0.40); }
#streakMilestoneModal[data-days="180"] .smm-inner { border-color: rgba(200, 80, 220, 0.45); box-shadow: 0 0 80px rgba(200,80,220,0.12), 0 24px 48px rgba(0,0,0,0.6); }
#streakMilestoneModal[data-days="365"] .smm-inner {
  border-color: rgba(255, 220, 40, 0.65);
  box-shadow: 0 0 100px rgba(255,220,40,0.22), 0 0 40px rgba(255,170,40,0.18), 0 24px 48px rgba(0,0,0,0.7);
}

