/* ===== DESIGN TOKEN DEFAULTS ===== */
:root {
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.5rem;    /* 24px */
  --space-6: 2rem;      /* 32px */
  --space-8: 3rem;      /* 48px */
  --space-16: 6rem;     /* 96px */
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.375rem;  /* 22px */
}

/* ===== APP SHELL — DASHBOARD LAYOUT ===== */
html, body { height: 100%; overflow: hidden; margin: 0; max-width: 100vw; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100dvh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-row: 1 / -1;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 50;
}

.sidebar-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sidebar-close { display: none; position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%); }

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-primary);
}

.logo-bg { color: var(--color-primary); }
.logo-icon { width: 36px; height: 33px; flex-shrink: 0; object-fit: contain; }
.logo-icon-dark { display: none; }
[data-theme="dark"] .logo-icon-light { display: none; }
[data-theme="dark"] .logo-icon-dark { display: block; }

.logo-full { height: 35px; width: auto; max-width: none; object-fit: contain; flex-shrink: 0; }
@media (max-width: 768px) { .logo-full { height: 30px; } }

.logo-text {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--color-text);
  transform: translateY(1px);
}

/* --- Nav group expand/collapse --- */
.nav-group { margin-top: var(--space-1); }
.nav-group:first-child { margin-top: 0; }

.nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  padding: var(--space-2) var(--space-4) var(--space-1);
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
  text-align: left;
}
.nav-group-label:hover { color: var(--color-text-muted); }
.nav-group-label span { flex: 1; }

.nav-group-icon {
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.2s;
  flex-shrink: 0;
}
.nav-group-label:hover .nav-group-icon { opacity: 0.7; }

.nav-group-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}
.nav-group.collapsed .nav-group-list {
  max-height: 0;
  opacity: 0;
  
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-1) var(--space-3);
  overflow-y: auto;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  width: 100%;
  text-align: left;
  transition: all var(--transition-interactive);
  cursor: pointer;
}

.nav-item i { width: 17px; height: 17px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 500;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.user-plan { font-size: var(--text-xs); color: var(--color-text-faint); }

.theme-toggle, .theme-toggle-topbar {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.theme-toggle:hover, .theme-toggle-topbar:hover { background: var(--color-surface-offset); color: var(--color-text); }
.theme-toggle i, .theme-toggle-topbar i { width: 18px; height: 18px; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* ===== MOBILE SIDEBAR ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.4);
  z-index: 40;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
  min-height: 56px;
  overflow: visible;
}

.hamburger { display: none; }

.top-bar-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.top-bar-actions { display: flex; gap: var(--space-2); align-items: center; }

.ai-status-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-success-highlight);
  color: var(--color-success);
}

.ai-dot {
  width: 7px; height: 7px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  position: relative;
  transition: all var(--transition-interactive);
}
.icon-btn:hover { background: var(--color-surface-offset); color: var(--color-text); }
.icon-btn i { width: 20px; height: 20px; }

.notification-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--color-error);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
}

/* Contextual Tooltip (F24) */
.contextual-tooltip {
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.tooltip-content { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-xs); }
.tooltip-close { color: var(--color-text-inverse); }

.content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

/* ===== SECTIONS ===== */
.section { display: none; }
.section.section-active { display: block; flex: 1; }

.section-inner {
  padding: var(--space-6);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-title-row h1 {
  font-size: var(--text-xl);
  font-weight: 600;
}

.section-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 65ch;
}

/* ===== WELCOME BANNER ===== */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.welcome-text h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.welcome-text p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.milestone-badges { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.badge-earned,
.badge-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  /* no fixed width/height — let it flow naturally */
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}
.badge-earned > i,
.badge-locked > i {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge-earned > i {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}
.badge-locked > i {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
}
.badge-earned > .badge-label,
.badge-locked > .badge-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  line-height: 1;
}
.badge-locked > .badge-label { opacity: 0.5; }

.stat-ring { position: relative; width: 110px; height: 110px; }
.stat-ring svg { width: 100%; height: 100%; }
.stat-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

/* ===== SPOTLIGHT CAROUSEL ===== */
.spotlight-carousel {
  position: relative;
  min-width: 220px;
  max-width: 240px;
  flex-shrink: 0;
  overflow: hidden;
}
.spotlight-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
  will-change: transform;
}
.spotlight-card {
  position: relative;
  min-width: 100%;
  background: linear-gradient(145deg, rgba(91,156,245,0.08), rgba(96,212,232,0.04), rgba(167,139,250,0.06));
  border: 1px solid rgba(91,156,245,0.15);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}
.spotlight-card:hover {
  border-color: rgba(91,156,245,0.35);
  box-shadow: inset 0 0 20px rgba(91,156,245,0.08), 0 0 0 1px rgba(91,156,245,0.1);
}
/* Shared glow */
.wan-glow {
  position: absolute;
  top: -30%; left: -20%; width: 140%; height: 100%;
  background: radial-gradient(ellipse at 50% 0%, rgba(91,156,245,0.12) 0%, rgba(96,212,232,0.06) 40%, transparent 70%);
  pointer-events: none;
  animation: wanGlowPulse 4s ease-in-out infinite;
}
@keyframes wanGlowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
/* AI Advisor orb */
.wan-orb {
  position: relative; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: #5b9cf5; z-index: 1;
}
.wan-orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(91,156,245,0.3), rgba(96,212,232,0.2), rgba(167,139,250,0.25), rgba(91,156,245,0.3));
  animation: wanOrbSpin 6s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}
@keyframes wanOrbSpin { to { transform: rotate(360deg); } }
.wan-orb::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: rgba(91,156,245,0.08); animation: wanOrbBreath 3s ease-in-out infinite;
}
@keyframes wanOrbBreath {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}
.wan-orb i, .wan-orb svg { position: relative; z-index: 1; filter: drop-shadow(0 0 6px rgba(91,156,245,0.4)); }
/* Shared spotlight elements */
.spotlight-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.4); z-index: 1;
}
.spotlight-main {
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.75);
  font-style: italic; line-height: 1.4; min-height: 38px;
  display: flex; align-items: center; z-index: 1; transition: opacity 0.3s;
}
.spotlight-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  font-size: 12px; font-weight: 600; color: #5b9cf5;
  z-index: 1; transition: gap 0.3s cubic-bezier(0.16,1,0.3,1);
}
.spotlight-card:hover .spotlight-cta { gap: 10px; }
/* Spotlight icon (non-AI cards) */
.spotlight-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; z-index: 1;
}
.draw-icon { background: rgba(91,156,245,0.12); color: #5b9cf5; }
.deadline-icon { background: rgba(245,158,11,0.12); color: #f59e0b; }
.insight-icon { background: rgba(167,139,250,0.12); color: #a78bfa; }
/* Draw tracker card */
.spotlight-draw {
  display: flex; align-items: center; gap: 14px; z-index: 1; margin: 2px 0;
}
.draw-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.draw-num { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.draw-unit { font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 500; }
.draw-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.1); }
.draw-date { font-size: 10.5px; color: rgba(255,255,255,0.45); z-index: 1; }
.draw-delta { z-index: 1; }
.draw-delta-badge {
  display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px;
}
.draw-delta-badge.down { background: rgba(34,197,94,0.12); color: #4cc882; }
.draw-delta-badge.up { background: rgba(245,158,11,0.12); color: #f59e0b; }
/* Countdown card */
.countdown-display { z-index: 1; display: flex; align-items: baseline; gap: 6px; }
.countdown-num { font-size: 36px; font-weight: 700; color: #f59e0b; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-unit { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.45); }
.countdown-desc { font-size: 12px; color: rgba(255,255,255,0.6); z-index: 1; line-height: 1.4; }
/* Insight card */
.insight-text {
  font-size: 12.5px; color: rgba(255,255,255,0.7); line-height: 1.5; z-index: 1;
}
.insight-text strong { color: #a78bfa; font-weight: 700; }
/* Dots */
.spotlight-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 10px;
}
.spotlight-dot {
  width: 6px; height: 6px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.2); cursor: pointer;
  transition: background 0.2s, width 0.2s; padding: 0;
}
.spotlight-dot.active {
  width: 18px; border-radius: 3px; background: #5b9cf5;
}
/* Light mode — card sits on dark welcome banner, so keep dark card appearance.
   Only override the dots since they sit outside the banner. */
/* Light mode — banner bg is lighter navy (#2c4a7c), so boost vibrancy to pop */
[data-theme="light"] .spotlight-card {
  background: linear-gradient(145deg, rgba(91,156,245,0.14), rgba(96,212,232,0.08), rgba(167,139,250,0.10));
  border-color: rgba(91,156,245,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
[data-theme="light"] .spotlight-card:hover {
  border-color: rgba(91,156,245,0.45);
  box-shadow: inset 0 0 24px rgba(91,156,245,0.12), 0 0 0 1px rgba(91,156,245,0.2);
}
[data-theme="light"] .wan-glow {
  background: radial-gradient(ellipse at 50% 0%, rgba(91,156,245,0.2) 0%, rgba(96,212,232,0.1) 40%, transparent 70%);
}
[data-theme="light"] .wan-orb-ring {
  background: conic-gradient(from 0deg, rgba(91,156,245,0.5), rgba(96,212,232,0.35), rgba(167,139,250,0.4), rgba(91,156,245,0.5));
}
[data-theme="light"] .wan-orb::before {
  background: rgba(91,156,245,0.15);
}
[data-theme="light"] .wan-orb i,
[data-theme="light"] .wan-orb svg {
  filter: drop-shadow(0 0 8px rgba(91,156,245,0.6));
}
[data-theme="light"] .spotlight-label {
  color: rgba(255,255,255,0.55);
}
[data-theme="light"] .spotlight-main {
  color: rgba(255,255,255,0.88);
}
[data-theme="light"] .spotlight-cta {
  color: #7bb8ff;
  filter: drop-shadow(0 0 4px rgba(91,156,245,0.3));
}
[data-theme="light"] .draw-num {
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,0.15);
}
[data-theme="light"] .draw-unit {
  color: rgba(255,255,255,0.55);
}
[data-theme="light"] .draw-divider {
  background: rgba(255,255,255,0.15);
}
[data-theme="light"] .draw-date {
  color: rgba(255,255,255,0.55);
}
[data-theme="light"] .draw-icon {
  background: rgba(91,156,245,0.18);
}
[data-theme="light"] .deadline-icon {
  background: rgba(245,158,11,0.18);
}
[data-theme="light"] .insight-icon {
  background: rgba(167,139,250,0.18);
}
[data-theme="light"] .countdown-desc {
  color: rgba(255,255,255,0.75);
}
[data-theme="light"] .countdown-unit {
  color: rgba(255,255,255,0.55);
}
[data-theme="light"] .insight-text {
  color: rgba(255,255,255,0.8);
}
[data-theme="light"] .insight-text strong {
  color: #c4b5fd;
  text-shadow: 0 0 6px rgba(167,139,250,0.3);
}
[data-theme="light"] .draw-delta-badge.down {
  background: rgba(34,197,94,0.18);
}
[data-theme="light"] .draw-delta-badge.up {
  background: rgba(245,158,11,0.18);
}
[data-theme="light"] .spotlight-dot {
  background: rgba(255,255,255,0.25);
}
[data-theme="light"] .spotlight-dot.active {
  background: #5b9cf5;
}
/* Mobile: horizontal swipe card */
@media (max-width: 768px) {
  .spotlight-carousel { max-width: 100%; min-width: unset; }
  .spotlight-card {
    padding: 16px 20px; border-radius: 14px; gap: 6px; min-height: auto;
  }
  .wan-glow { display: none; }
  .wan-orb { width: 40px; height: 40px; }
  .wan-orb-ring {
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
  }
  .spotlight-icon { width: 36px; height: 36px; }
  .countdown-num { font-size: 28px; }
  .draw-num { font-size: 18px; }
  .spotlight-dots { margin-top: 8px; }
}

/* ===== KPI GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.kpi-card {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  transition: all var(--transition-interactive);
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon i { width: 22px; height: 22px; }

.kpi-data { display: flex; flex-direction: column; }
.kpi-value { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }
.kpi-label { font-size: var(--text-xs); color: var(--color-text-muted); }

.kpi-delta {
  font-size: var(--text-xs);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.kpi-delta.positive { color: var(--color-success); }
.kpi-delta.neutral { color: var(--color-text-muted); }
.kpi-delta.warning { color: var(--color-warning); }

/* ===== CARDS ===== */
.card {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 100%;
  box-sizing: border-box;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.card-header h2 {
  font-size: var(--text-base);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}
.badge-primary { background: var(--color-primary-subtle); color: var(--color-primary); }
.badge-muted { background: var(--color-surface-offset); color: var(--color-text-muted); }
.badge-warning { background: var(--color-warning-highlight); color: var(--color-warning); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-interactive);
  white-space: nowrap;
}

.btn-sm { padding: 3px var(--space-3); font-size: var(--text-sm); }

.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-accent { background: linear-gradient(135deg, #e05555, #f07a6e, #f4937e); color: #fff; border: none; box-shadow: 0 4px 16px rgba(224, 85, 85, 0.3); }
.btn-accent:hover { background: linear-gradient(135deg, #d04a4a, #eb6f63, #f08872); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(224, 85, 85, 0.4); }
.btn-accent:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(224, 85, 85, 0.3); }

.btn-secondary { background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-surface-offset); }

.btn-ghost { color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary-subtle); }

.btn-full { width: 100%; }

/* ===== ACTION LIST ===== */
.action-list { display: flex; flex-direction: column; gap: var(--space-3); }

.action-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--transition-interactive);
}
.action-item:hover { background: var(--color-surface-offset); }

.action-priority {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.action-priority.high { background: var(--color-error); }
.action-priority.medium { background: var(--color-warning); }
.action-priority.low { background: var(--color-text-faint); }

.action-content { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: visible; }
.action-title { font-size: var(--text-xs); font-weight: 500; }
.action-meta { font-size: var(--text-sm); color: var(--color-text-muted); }
.action-impact { font-size: var(--text-base); font-weight: 600; color: var(--color-primary); white-space: nowrap; }

/* ===== ALERT LIST ===== */
.alert-list { display: flex; flex-direction: column; gap: var(--space-3); }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
}
.alert-item.alert-warning { background: var(--color-warning-highlight); }
.alert-item.alert-info { background: var(--color-surface-offset); }
.alert-icon { flex-shrink: 0; padding-top: 2px; }
.alert-item.alert-warning .alert-icon { color: var(--color-warning); }
.alert-item.alert-info .alert-icon { color: var(--color-text-muted); }
.alert-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-title { font-size: var(--text-xs); font-weight: 600; }
.alert-desc { font-size: var(--text-sm); color: var(--color-text-muted); }
.alert-time { font-size: var(--text-xs); color: var(--color-text-faint); }

/* ===== ACTIVITY LIST ===== */
.activity-list { display: flex; flex-direction: column; gap: var(--space-3); }
.activity-item { display: flex; align-items: center; gap: var(--space-3); }
.activity-dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; }
.activity-content { display: flex; align-items: center; gap: var(--space-3); flex: 1; font-size: var(--text-xs); }
.activity-time { font-size: var(--text-xs); color: var(--color-text-faint); margin-left: auto; white-space: nowrap; }

/* ===== CHAT ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Make chat section fill the content-scroll area without scrolling */
#section-chat.section-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chat-mode-pills { display: flex; gap: var(--space-1); }
.mode-pill {
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  cursor: pointer;
  transition: all var(--transition-interactive);
}
.mode-pill.active { background: var(--color-primary); color: var(--color-text-inverse); }
.mode-pill:hover:not(.active) { color: var(--color-text); }

.chat-indicators { display: flex; gap: var(--space-3); }
.indicator {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-base);
  color: var(--color-text-faint);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-4);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
  padding-top: var(--space-6);
}

/* Once conversation starts, anchor messages to bottom */
.chat-messages.has-conversation {
  justify-content: flex-end;
}

/* ===== CHAT WELCOME — Premium Redesign ===== */

/* Entrance keyframes */
@keyframes chatFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes chatScaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes chatPulseGlow {
  0%, 100% { box-shadow: 0 0 0 4px oklch(from var(--color-primary) l c h / 0.12), 0 8px 32px oklch(from var(--color-primary) l c h / 0.15); }
  50% { box-shadow: 0 0 0 6px oklch(from var(--color-primary) l c h / 0.08), 0 12px 40px oklch(from var(--color-primary) l c h / 0.2); }
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: var(--space-8) var(--space-4) var(--space-4);
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Avatar with gradient ring --- */
.chat-welcome-avatar {
  margin-bottom: var(--space-4);
  animation: chatScaleIn 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.chat-welcome-avatar-ring {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), oklch(from var(--color-primary) calc(l + 0.12) c h));
  color: var(--color-text-inverse);
  box-shadow: 0 0 0 4px oklch(from var(--color-primary) l c h / 0.12), 0 8px 32px oklch(from var(--color-primary) l c h / 0.15);
  position: relative;
  animation: chatPulseGlow 4s ease-in-out infinite;
}
.chat-welcome-avatar-ring i {
  width: 26px;
  height: 26px;
}

/* --- Greeting + subtitle --- */
.chat-welcome-content {
  margin-bottom: var(--space-5);
  animation: chatFadeUp 500ms cubic-bezier(0.16, 1, 0.3, 1) 100ms both;
}
.chat-welcome-greeting {
  font-size: 1.625rem;
  font-weight: 650;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.chat-welcome-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.45;
  max-width: 100%;
}

/* --- Trust indicators (inline, subtle) --- */
.chat-welcome-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
.chat-welcome-trust span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--color-text-faint);
  font-weight: 450;
  letter-spacing: 0.01em;
}
.chat-welcome-trust i {
  opacity: 0.55;
}
.chat-trust-dot {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-text-faint);
  opacity: 0.35;
}

/* --- Suggestion cards (2-col grid, premium) --- */
.chat-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  animation: chatFadeUp 500ms cubic-bezier(0.16, 1, 0.3, 1) 250ms both;
}
.suggestion-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.8125rem;
  font-weight: 450;
  line-height: 1.4;
  text-align: left;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.suggestion-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, oklch(from var(--color-primary) l c h / 0.06), transparent 60%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}
.suggestion-card i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: oklch(from var(--color-primary) l c h / 0.5);
  transition: all 220ms ease;
}
.suggestion-card span {
  flex: 1;
  min-width: 0;
}
.suggestion-card:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.35);
  background: var(--color-surface-2);
  color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px oklch(from var(--color-primary) l c h / 0.08);
}
.suggestion-card:hover::before {
  opacity: 1;
}
.suggestion-card:hover i {
  color: var(--color-primary);
  transform: scale(1.08);
}
.suggestion-card:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
  transition-duration: 80ms;
}

/* Legacy classes kept for conversation messages */
.chat-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xs);
}
.chat-avatar.bot { background: var(--color-primary-subtle); color: var(--color-primary); }
.chat-avatar.bot i { width: 18px; height: 18px; }
.chat-avatar.user { background: var(--color-primary); color: var(--color-text-inverse); font-weight: 600; }

.chat-bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  line-height: 1.6;
  max-width: 85%;
}
.chat-bubble.bot { background: var(--color-surface-2); border: 1px solid oklch(from var(--color-text) l c h / 0.08); }
.chat-bubble.user { background: var(--color-primary); color: var(--color-text-inverse); margin-left: auto; }

.source-badges { display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.source-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px var(--space-2); border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 500;
}
.source-badge.official { background: var(--color-success-highlight); color: var(--color-success); }
.source-badge.trust { background: var(--color-warning-highlight); color: var(--color-warning); }

.chat-message { display: flex; gap: var(--space-3); }
.chat-message.user { justify-content: flex-end; }

/* Legacy suggestion chips (kept for JS compat) */
.chat-suggestions { display: none; }
.suggestion-chip {
  padding: 6px var(--space-3); border-radius: var(--radius-full);
  font-size: 0.8125rem; background: var(--color-surface-2);
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  cursor: pointer; transition: all 200ms ease; font-weight: 450;
}
.suggestion-chip:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }

/* ===== CHAT COMPOSER — Premium Input Area ===== */
.chat-tools-bar {
  display: flex;
  gap: 2px;
}
.chat-tool-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-faint);
  transition: all 150ms ease;
  border: none;
  background: none;
  cursor: pointer;
}
.chat-tool-btn:hover { background: oklch(from var(--color-text) l c h / 0.06); color: var(--color-text-muted); }

.chat-input-area {
  padding: 0 var(--space-4) var(--space-4);
  background: transparent;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  flex-shrink: 0;
}

.chat-composer {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 250ms ease, box-shadow 250ms ease;
  box-shadow: 0 1px 3px oklch(from var(--color-text) l c h / 0.04);
}
.chat-composer:focus-within {
  border-color: oklch(from var(--color-primary) l c h / 0.4);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.06), 0 2px 8px oklch(from var(--color-primary) l c h / 0.06);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: var(--space-3) var(--space-4) var(--space-1);
}

.chat-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1) var(--space-3) var(--space-2);
  gap: var(--space-3);
}

.chat-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 0.9375rem;
  outline: none !important;
  box-shadow: none !important;
  padding: var(--space-1);
  resize: none;
  overflow-y: auto;
  min-height: 36px;
  max-height: 120px;
  line-height: 1.5;
  font-family: inherit;
  color: var(--color-text);
  -webkit-appearance: none;
}
.chat-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.chat-send {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-inverse);
  background: linear-gradient(135deg, var(--color-primary), oklch(from var(--color-primary) calc(l + 0.08) c h));
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 8px oklch(from var(--color-primary) l c h / 0.25);
}
.chat-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px oklch(from var(--color-primary) l c h / 0.35);
}
.chat-send:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px oklch(from var(--color-primary) l c h / 0.2);
}
.chat-send i { width: 16px; height: 16px; }
.chat-send svg { width: 16px; height: 16px; flex-shrink: 0; }

.chat-disclaimer {
  font-size: 0.625rem;
  color: var(--color-text-faint);
  text-align: right;
  opacity: 0.5;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

/* ===== INTAKE WIZARD (F8) ===== */
.intake-progress { margin-bottom: var(--space-5); }
.intake-steps {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.intake-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}
.intake-step.active { color: var(--color-primary); font-weight: 600; }
.intake-step.completed { color: var(--color-success); }
.intake-step span:first-child {
  width: 22px; height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-base); font-weight: 600;
}
.intake-step.active span:first-child { background: var(--color-primary); color: var(--color-text-inverse); }
.intake-step.completed span:first-child { background: var(--color-success); color: var(--color-text-inverse); }

.intake-progress-bar {
  height: 4px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.intake-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.intake-panel { display: none; }
.intake-panel.active { display: block; }
.intake-panel h2 { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--space-1); }
.intake-helper { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-4); }

/* ===== FORM BASE STYLES ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}
.form-input,
.form-select,
select.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: var(--color-surface-offset);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
select.form-input {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--color-surface-offset);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca8ba' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}
[data-theme="dark"] select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5d78' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
.form-input:focus,
select.form-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.form-input::placeholder {
  color: var(--color-text-faint);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.form-field { display: flex; flex-direction: column; gap: var(--space-1); }
.form-field label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); }
.form-field input, .form-field select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.field-hint { font-size: var(--text-xs); color: var(--color-text-faint); }

.intake-nav { display: flex; justify-content: space-between; align-items: center; }

.intake-result-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.intake-result-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.result-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}
.result-label { font-size: var(--text-xs); color: var(--color-text-faint); display: block; }
.result-value { font-size: var(--text-base); font-weight: 700; color: var(--color-primary); display: block; }
.result-detail { font-size: var(--text-xs); color: var(--color-text-muted); display: block; }
.intake-result-actions { display: flex; gap: var(--space-3); }

/* ===== ROADMAP DAG (F5) ===== */
/* ===== JOURNEY TIMELINE (Roadmap DAG Redesign) ===== */
.roadmap-card { overflow: visible; }
.roadmap-card > .card-header h2 { font-size: var(--text-lg); }

.roadmap-progress-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roadmap-progress-ring {
  width: 64px;
  height: 64px;
  position: relative;
  flex-shrink: 0;
}

.roadmap-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.roadmap-progress-ring .ring-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 3;
}

.roadmap-progress-ring .ring-fill {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease;
}

.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.roadmap-progress-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.roadmap-progress-label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.roadmap-progress-est {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Timeline container */
.journey-timeline {
  padding: 8px 0 0 8px;
}

/* Phase blocks */
.journey-phase {
  position: relative;
  padding-left: 44px;
  padding-bottom: 8px;
}

.journey-phase:last-child {
  padding-bottom: 0;
}

/* Vertical connecting line */
.journey-phase::before {
  content: '';
  position: absolute;
  left: 15px; /* center of 32px dot = 16px, inside 44px padding */
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.journey-phase:first-child::before { top: 16px; }
.journey-phase:last-child::before { bottom: auto; height: 16px; }

.journey-phase.completed::before {
  background: var(--color-success);
}

.journey-phase.active::before {
  background: linear-gradient(to bottom, var(--color-success) 0%, var(--color-primary) 40%, var(--color-border) 100%);
}

/* Phase header row */
.phase-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
  position: relative;
}

.phase-indicator {
  position: absolute;
  left: -44px;
  z-index: 2;
}

.phase-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  position: relative;
  border: 2.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.phase-dot.done {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.phase-dot.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.phase-dot.future {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-faint);
}

/* Pulsing ring for active phase */
.phase-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  opacity: 0;
  animation: phasePulse 2.5s ease-out infinite;
}

@keyframes phasePulse {
  0% { opacity: 0.5; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* Phase title row */
.phase-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.phase-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.journey-phase.locked .phase-title {
  color: var(--color-text-muted);
}

.phase-status {
  font-size: var(--text-base);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.phase-status.done {
  background: rgba(67, 122, 34, 0.1);
  color: var(--color-success);
}

.phase-status.current {
  background: rgba(44, 74, 124, 0.1);
  color: var(--color-primary);
}

.phase-status.locked {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
}

[data-theme="dark"] .phase-status.done { background: rgba(109, 170, 69, 0.15); }
[data-theme="dark"] .phase-status.current { background: rgba(107, 159, 212, 0.12); }

/* Phase body with steps */
.phase-body {
  padding: 4px 0 12px 0;
}

.phase-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Individual step items */
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.step-item:hover {
  background: var(--color-surface-offset);
}

.step-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-item.done .step-check {
  background: var(--color-success);
  color: #fff;
}

.step-item.in-progress .step-check {
  background: var(--color-primary);
  color: #fff;
}

.step-item.in-progress .step-check.active-ring {
  box-shadow: 0 0 0 3px rgba(44, 74, 124, 0.2);
}

[data-theme="dark"] .step-item.in-progress .step-check.active-ring {
  box-shadow: 0 0 0 3px rgba(107, 159, 212, 0.2);
}

.step-item.upcoming .step-check {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
}

.step-item.locked .step-check {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
  opacity: 0.6;
}

.step-num {
  font-size: var(--text-base);
  font-weight: 600;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.step-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.step-item.locked .step-name {
  color: var(--color-text-muted);
}

.step-detail {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.step-item.locked .step-detail {
  color: var(--color-text-faint);
}

/* Step mini progress bar (for in-progress items) */
.step-progress-bar {
  width: min(200px, 100%);
  height: 4px;
  border-radius: 4px;
  background: var(--color-surface-offset);
  margin-top: 6px;
  overflow: hidden;
}

.step-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color-primary);
  transition: width 0.6s ease;
}

/* Final step highlight */
.step-item.final-step .step-check {
  background: var(--color-primary);
  color: #fff;
  opacity: 0.5;
}

.step-item.in-progress .step-check i {
  animation: spin 2s linear infinite;
}

/* Responsive — roadmap mobile overrides handled in comprehensive mobile block */

/* ===== PATHWAY ANALYSIS ===== */
.pathway-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.pathway-card {
  background: var(--color-bg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.pathway-card.best {
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
}

.pathway-match {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-2);
}

.pathway-card h3 {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.pathway-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.pathway-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
}
.pathway-stats span { display: flex; align-items: center; gap: var(--space-1); }

/* Replan (F6) */
.replan-content { display: flex; flex-direction: column; gap: var(--space-4); }
.replan-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-warning-highlight);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
}
.replan-changes { display: flex; flex-direction: column; gap: var(--space-2); }
.replan-change {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  padding: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.change-label { font-weight: 600; min-width: 120px; }
.change-from { color: var(--color-text-faint); text-decoration: line-through; }
.change-to { color: var(--color-primary); font-weight: 500; }

/* ===== SCORES (F15-F19) ===== */
.score-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.score-panel {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-5);
  align-items: center;
}
.score-circle { position: relative; flex-shrink: 0; }
.score-circle.large { width: 120px; height: 120px; }
.score-circle svg { width: 100%; height: 100%; }
.score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-num { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); }
.score-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.score-details { flex: 1; }
.score-details h3 { font-size: var(--text-xs); font-weight: 600; margin-bottom: var(--space-1); }
.score-details p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.score-breakdown { display: flex; flex-direction: column; gap: var(--space-2); }
.breakdown-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.breakdown-row span:first-child { flex: 1; color: var(--color-text-muted); }
.breakdown-row span:last-child { font-weight: 600; min-width: 35px; text-align: right; }
.mini-bar {
  width: 80px;
  height: 4px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.mini-bar > div {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* Timeline Risk (F18) */
.timeline-risk { display: flex; flex-direction: column; gap: var(--space-4); }
.risk-meter { margin-bottom: var(--space-2); }
.risk-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--color-success), var(--color-warning), var(--color-error));
  border-radius: var(--radius-full);
  position: relative;
}
.risk-marker {
  position: absolute;
  top: -5px;
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  border: 3px solid #fff;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .risk-marker {
  border-color: var(--color-surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.risk-labels { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-1); }
.risk-factors { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.risk-factor { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); }
.risk-factor.good { color: var(--color-success); }
.risk-factor.warning { color: var(--color-warning); }

/* Scenario chips */
.sim-preview p { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.sim-scenarios { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.scenario-chip {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-interactive);
}
.scenario-chip:hover { background: var(--color-primary-subtle); color: var(--color-primary); }

/* Data Sources */
.data-sources { display: flex; flex-direction: column; gap: var(--space-2); }
.source-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  font-size: var(--text-sm);
}
.source-status {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
}
.source-status.active { background: var(--color-success); }
.source-updated { margin-left: auto; color: var(--color-text-faint); }

/* ===== DOCUMENTS (F20-F23) ===== */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-interactive);
  text-align: center;
}
.upload-zone:hover { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.upload-zone p { font-size: var(--text-sm); font-weight: 500; }
.upload-hint { font-size: var(--text-sm); color: var(--color-text-faint); }

.upload-processing { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.processing-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  padding: var(--space-1) 0;
}
.processing-step.active { color: var(--color-primary); font-weight: 500; }
.processing-step.done { color: var(--color-success); }

.doc-checklist { display: flex; flex-direction: column; gap: var(--space-2); }
.doc-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
}
.doc-item.complete { background: var(--color-success-highlight); }
.doc-item.pending { background: var(--color-bg); }
.doc-check { flex-shrink: 0; }
.doc-item.complete .doc-check { color: var(--color-success); }
.doc-item.pending .doc-check { color: var(--color-text-faint); }
.doc-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.doc-name { font-weight: 500; }
.doc-meta { font-size: var(--text-base); color: var(--color-text-muted); }
.doc-status-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.doc-status-badge.complete { background: var(--color-success-highlight); color: var(--color-success); }
.doc-status-badge.pending { background: var(--color-warning-highlight); color: var(--color-warning); }
.doc-status-badge.locked { background: var(--color-surface-offset); color: var(--color-text-faint); }
.doc-status-badge.na { background: var(--color-surface-offset); color: var(--color-text-faint); }

/* Privacy */
.privacy-controls { display: flex; flex-direction: column; gap: var(--space-4); }
.privacy-item { display: flex; align-items: center; gap: var(--space-4); }
.privacy-info { flex: 1; }
.privacy-label { font-size: var(--text-xs); font-weight: 500; display: block; }
.privacy-desc { font-size: var(--text-sm); color: var(--color-text-muted); }

.toggle-switch {
  width: 40px; height: 22px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  padding: 2px;
  cursor: pointer;
  transition: all var(--transition-interactive);
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--color-primary); }
.toggle-knob {
  width: 18px; height: 18px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  transition: all var(--transition-interactive);
}
.toggle-switch.on .toggle-knob { transform: translateX(18px); }

/* ===== POLICY CENTER (F1-F4) ===== */
.policy-graph { padding: var(--space-3); }
.graph-node {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--color-surface-offset);
  margin: var(--space-1);
}
.graph-node.root { background: var(--color-primary); color: var(--color-text-inverse); font-size: var(--text-xs); display: block; text-align: center; margin-bottom: var(--space-3); }
.graph-level { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.graph-branch { flex: 1; min-width: 150px; }
.graph-connector { height: 16px; width: 2px; background: var(--color-border); margin-left: 40px; }
.graph-node.branch { background: var(--color-primary-subtle); color: var(--color-primary); font-weight: 600; }
.graph-children { display: flex; flex-direction: column; gap: 2px; margin-left: var(--space-4); margin-top: var(--space-1); }
.graph-node.leaf { font-size: var(--text-base); }
.graph-node.active-node { background: var(--color-primary); color: var(--color-text-inverse); }
.graph-node.dim { opacity: 0.5; }

/* Snapshots (F2) */
.snapshot-timeline { display: flex; flex-direction: column; gap: var(--space-3); }
.snapshot-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  align-items: center;
}
.snapshot-date { font-size: var(--text-base); color: var(--color-text-faint); min-width: 85px; white-space: nowrap; }
.snapshot-body { flex: 1; }
.snapshot-title { font-size: var(--text-xs); font-weight: 500; display: block; }
.snapshot-detail { font-size: var(--text-base); color: var(--color-text-muted); }
.snapshot-impact { font-size: var(--text-base); font-weight: 500; white-space: nowrap; }
.snapshot-impact.positive { color: var(--color-success); }
.snapshot-impact.neutral { color: var(--color-text-muted); }

/* Change Diff (F3) */
.change-diff { font-family: 'JetBrains Mono', monospace; }
.diff-header { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); font-family: var(--font-body); }
.diff-content { padding: var(--space-3); background: var(--color-bg); border-radius: var(--radius-md); margin-bottom: var(--space-3); }
.diff-line { font-size: var(--text-base); padding: 2px var(--space-2); }
.diff-line.removed { background: var(--color-error-highlight); color: var(--color-error); }
.diff-line.added { background: var(--color-success-highlight); color: var(--color-success); }
.diff-line.context { color: var(--color-text-muted); }
.diff-impact { padding: var(--space-3); background: var(--color-warning-highlight); border-radius: var(--radius-md); font-family: var(--font-body); font-size: var(--text-sm); }
.diff-impact-label { font-weight: 600; display: block; margin-bottom: 2px; }

/* Dependencies (F4) */
.dependency-map { display: flex; flex-direction: column; gap: var(--space-3); }
.dep-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.dep-program {
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 70px;
  color: var(--color-text-muted);
}
.dep-program.highlight { color: var(--color-primary); }
.dep-arrow { color: var(--color-text-faint); flex-shrink: 0; }
.dep-requires { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dep-req {
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}
.dep-req.met { background: var(--color-success-highlight); color: var(--color-success); }
.dep-req.pending { background: var(--color-warning-highlight); color: var(--color-warning); }
.dep-req.gap { background: var(--color-error-highlight); color: var(--color-error); }

/* ===== SETTLEMENT (F35-F38) ===== */
.col-comparison {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}
.col-city { flex: 1; }
.col-city h3 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-3); }
.col-items { display: flex; flex-direction: column; gap: var(--space-2); }
.col-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
}
.col-row > span:first-child {
  flex-shrink: 1;
  min-width: 0;
}
.col-row > .col-value {
  flex-shrink: 0;
  white-space: nowrap;
}
.col-row.total { border-bottom: none; font-weight: 600; color: var(--color-primary); }
.col-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.col-vs {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-faint);
  padding-top: var(--space-8);
}
.col-savings { font-size: var(--text-xs); color: var(--color-success); margin-top: var(--space-3); }

/* Jobs (F36) */
.job-matches { display: flex; flex-direction: column; gap: var(--space-2); }
.job-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.job-match {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  min-width: 45px;
}
.job-info h4 { font-size: var(--text-xs); font-weight: 500; }
.job-info span { font-size: var(--text-base); color: var(--color-text-muted); }

/* Housing (F37) */
.housing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.housing-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.housing-type { font-size: var(--text-xs); font-weight: 500; color: var(--color-primary); text-transform: uppercase; }
.housing-card h4 { font-size: var(--text-xs); font-weight: 500; }
.housing-price { font-size: var(--text-sm); font-weight: 700; color: var(--color-primary); }
.housing-details { font-size: var(--text-base); color: var(--color-text-muted); }

/* Community (F38) */
.community-list { display: flex; flex-direction: column; gap: var(--space-3); }
.community-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.community-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.community-info { flex: 1; }
.community-info h4 { font-size: var(--text-xs); font-weight: 500; }
.community-info span { font-size: var(--text-base); color: var(--color-text-muted); }

/* ===== APPLICATION (F32-F34, F39) ===== */
.form-mock { display: flex; flex-direction: column; gap: var(--space-2); }
.form-mock-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.form-mock-row label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 120px;
}
.form-mock-row input {
  flex: 1;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
}
.form-mock-row input.filled { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.autofill-note { font-size: var(--text-base); color: var(--color-text-faint); margin-top: var(--space-3); }

/* Validation (F32) */
.validation-results { display: flex; flex-direction: column; gap: var(--space-2); }
.validation-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  padding: var(--space-2);
}
.validation-item.pass { color: var(--color-success); }
.validation-item.fail { color: var(--color-error); }
.validation-item.warn { color: var(--color-warning); }

/* Fee Tracker (F33) */
.fee-tracker { display: flex; flex-direction: column; gap: var(--space-2); }
.fee-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
}
.fee-item.paid { background: var(--color-success-highlight); }
.fee-item.upcoming { background: var(--color-bg); }
.fee-info { flex: 1; }
.fee-name { font-weight: 500; display: block; }
.fee-date { font-size: var(--text-base); color: var(--color-text-muted); }
.fee-amount { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.fee-status-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
}
.fee-status-badge.paid { background: var(--color-success-highlight); color: var(--color-success); }
.fee-status-badge.upcoming { background: var(--color-warning-highlight); color: var(--color-warning); }
.fee-summary { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-1); }
.fee-total { display: flex; justify-content: space-between; font-size: var(--text-xs); }
.fee-total.highlight { font-weight: 700; color: var(--color-primary); font-size: var(--text-sm); }

/* Processing Time (F34) */
.processing-timeline { display: flex; flex-direction: column; gap: var(--space-3); }
.proc-phase { display: flex; align-items: center; gap: var(--space-3); }
.proc-label { font-size: var(--text-sm); min-width: 120px; color: var(--color-text-muted); }
.proc-bar { flex: 1; height: 6px; background: var(--color-surface-offset); border-radius: var(--radius-full); overflow: hidden; }
.proc-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); }
.proc-time { font-size: var(--text-sm); font-weight: 500; min-width: 80px; text-align: right; }
.proc-total { font-size: var(--text-xs); color: var(--color-primary); margin-top: var(--space-2); }

/* ===== FAMILY (F44) ===== */
.family-members { display: flex; flex-direction: column; gap: var(--space-3); }
.family-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}
.family-card.primary { background: var(--color-primary-subtle); }
.family-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: 600; flex-shrink: 0;
}
.family-info h4 { font-size: var(--text-xs); font-weight: 500; }
.family-info span { font-size: var(--text-base); color: var(--color-text-muted); }
.family-status { font-size: var(--text-xs); font-weight: 500; margin-left: auto; }
.family-status.active { color: var(--color-success); }
.family-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: center;
}
.family-empty p { font-size: var(--text-xs); color: var(--color-text-muted); max-width: 40ch; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.feature-list li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); }
.family-info-panel { padding: var(--space-2); }
.family-info-panel p { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); }

/* ===== PROFESSIONAL (F45-F46) ===== */
.consultant-list { display: flex; flex-direction: column; gap: var(--space-3); }
.consultant-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
}
.consultant-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 600; flex-shrink: 0;
}
.consultant-info { flex: 1; }
.consultant-info h4 { font-size: var(--text-xs); font-weight: 600; }
.consultant-info > span { font-size: var(--text-base); color: var(--color-text-muted); display: block; }
.consultant-stats { display: flex; gap: var(--space-3); margin-top: var(--space-1); font-size: var(--text-xs); color: var(--color-text-faint); }
.consultant-match {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--text-lg); font-weight: 700; color: var(--color-primary);
}
.consultant-match span { font-size: var(--text-xs); font-weight: 400; color: var(--color-text-muted); }
.escalation-info p { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); }

/* ===== NOTIFICATIONS (F40-F43) ===== */
.notification-list { display: flex; flex-direction: column; gap: var(--space-2); }
.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  align-items: flex-start;
}
.notif-item.unread { background: var(--color-primary-subtle); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-body { flex: 1; }
.notif-title { font-size: var(--text-xs); font-weight: 500; display: block; }
.notif-desc { font-size: var(--text-base); color: var(--color-text-muted); display: block; }
.notif-time { font-size: var(--text-xs); color: var(--color-text-faint); }

/* Preferences */
.pref-list { display: flex; flex-direction: column; gap: var(--space-3); }
.pref-item { display: flex; align-items: center; gap: var(--space-4); }
.pref-info { flex: 1; }
.pref-info > span:first-child { font-size: var(--text-xs); font-weight: 500; display: block; }
.pref-desc { font-size: var(--text-base); color: var(--color-text-muted); }

/* Milestones */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.milestone-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 500;
}
.milestone-item.earned { background: var(--color-primary-subtle); color: var(--color-primary); }
.milestone-item.locked { background: var(--color-surface-offset); color: var(--color-text-faint); }
.milestone-icon { width: 48px; height: 48px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; }
.milestone-item.earned .milestone-icon { background: var(--color-primary); color: var(--color-text-inverse); }
.milestone-item.locked .milestone-icon { background: var(--color-surface-dynamic); }

/* Engagement */
.engagement-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.engagement-metric {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}
.engagement-value { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); display: block; }
.engagement-label { font-size: var(--text-base); color: var(--color-text-muted); }

/* ===== ADMIN (F47-F55) ===== */
.system-status-grid { display: flex; flex-direction: column; gap: var(--space-2); }
.sys-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  padding: var(--space-2);
}
.sys-dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; }
.sys-dot.active { background: var(--color-success); }
.sys-name { font-weight: 500; }
.sys-detail { margin-left: auto; color: var(--color-text-faint); }

.audit-log { display: flex; flex-direction: column; gap: var(--space-1); }
.audit-entry {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--color-border);
}
.audit-time { color: var(--color-text-faint); min-width: 80px; }
.audit-action { flex: 1; }
.audit-actor { color: var(--color-text-faint); min-width: 50px; text-align: right; }

.compliance-grid { display: flex; flex-direction: column; gap: var(--space-2); }
.compliance-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); }
.compliance-actions { display: flex; gap: var(--space-3); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); }

.ab-tests { display: flex; flex-direction: column; gap: var(--space-3); }
.ab-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.ab-name { font-weight: 500; min-width: 150px; }
.ab-variant { color: var(--color-text-muted); min-width: 120px; }
.ab-result { margin-left: auto; display: flex; gap: var(--space-3); }
.ab-metric { font-weight: 600; color: var(--color-success); }
.ab-confidence { color: var(--color-text-faint); }

.cost-stats, .admin-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.cost-metric, .admin-kpi {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}
.cost-value, .admin-kpi-value { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); display: block; }
.cost-label, .admin-kpi-label { font-size: var(--text-base); color: var(--color-text-muted); }

.tenant-info, .api-stats { display: flex; flex-direction: column; gap: var(--space-2); }
.tenant-item, .api-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}
.tenant-label, .api-label { color: var(--color-text-muted); }
.tenant-value, .api-value { font-weight: 500; }

.qa-results { display: flex; flex-direction: column; gap: var(--space-2); }
.qa-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  padding: var(--space-2);
}
.qa-test { flex: 1; }
.qa-result { font-weight: 500; }
.qa-item.pass .qa-result { color: var(--color-success); }
.qa-item.warn .qa-result { color: var(--color-warning); }

.legal-items { display: flex; flex-direction: column; gap: var(--space-2); }
.legal-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); }

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--color-surface-2);
  border-radius: var(--radius-xl);
  width: min(560px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface-2);
  z-index: 1;
}
.modal-header h2 { font-size: var(--text-sm); font-weight: 600; }
.modal-body { padding: var(--space-5); }
.modal-desc { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-4); }

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.sim-field label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 2px;
}
.sim-field select {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: var(--text-sm);
}

.sim-result {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  justify-content: center;
}
.sim-score-box { text-align: center; }
.sim-label { font-size: var(--text-base); color: var(--color-text-muted); display: block; }
.sim-current { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-projected { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-primary); }
.sim-arrow { color: var(--color-text-faint); }
.sim-arrow i { width: 24px; height: 24px; }
.sim-delta { font-size: var(--text-xs); font-weight: 600; }
.sim-delta.positive { color: var(--color-success); }
.sim-delta.negative { color: var(--color-error); }

/* Handoff */
.handoff-options { display: flex; flex-direction: column; gap: var(--space-2); }
.handoff-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--transition-interactive);
  width: 100%;
  text-align: left;
}
.handoff-option:hover { background: var(--color-primary-subtle); }
.handoff-option span:first-of-type { font-size: var(--text-sm); font-weight: 500; flex: 1; }
.handoff-time { font-size: var(--text-base); color: var(--color-text-muted); }

/* Templates */
.template-list { display: flex; flex-direction: column; gap: var(--space-2); }
.template-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  cursor: pointer;
  transition: all var(--transition-interactive);
  width: 100%;
  text-align: left;
  color: var(--color-text);
}
.template-item:hover { background: var(--color-primary-subtle); }
.template-item i { color: var(--color-primary); flex-shrink: 0; }
.template-name { font-size: var(--text-xs); font-weight: 500; display: block; }
.template-desc { font-size: var(--text-base); color: var(--color-text-muted); }

/* Summary */
.summary-content { font-size: var(--text-xs); line-height: 1.7; }

/* ===== RESOURCES ===== */
.resources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.resources-header h1 { font-size: var(--text-xl); font-weight: 600; }

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  width: 280px;
}
.search-input {
  border: none;
  background: transparent;
  font-size: var(--text-xs);
  outline: none;
  flex: 1;
}

.resource-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-1);
}

.tab {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-interactive);
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 500; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.resource-card {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-interactive);
  cursor: pointer;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.resource-card.hidden, .offer-card.hidden { display: none; }

.resource-type {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
}

.resource-card h3 { font-size: var(--text-xs); font-weight: 600; margin-bottom: var(--space-2); }
.resource-card p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-3); }

.resource-meta {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-base);
  color: var(--color-text-faint);
}
.resource-meta span { display: flex; align-items: center; gap: var(--space-1); }

/* ===== OFFERS ===== */
.offers-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  margin-top: var(--space-2);
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.offer-card {
  background: var(--color-surface-2);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.offer-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  text-transform: uppercase;
}

.offer-logo {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-subtle);
  display: flex; align-items: center; justify-content: center;
}

.offer-card h3 { font-size: var(--text-xs); font-weight: 600; }
.offer-card p { font-size: var(--text-base); color: var(--color-text-muted); flex: 1; }
.offer-value { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pathway-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .offers-grid { grid-template-columns: repeat(2, 1fr); }
  .score-panel-grid { grid-template-columns: 1fr; }
  .housing-grid { grid-template-columns: 1fr 1fr; }
  .milestone-grid { grid-template-columns: repeat(4, 1fr); }
  .engagement-stats, .cost-stats, .admin-kpis { grid-template-columns: repeat(2, 1fr); }
  .intake-result-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open { left: 0; }
  .sidebar-close { display: flex; }
  .sidebar-header { justify-content: space-between; }
  .sidebar-overlay.active { display: block; }

  .main-content { grid-column: 1; }
  .hamburger { display: flex; }

  .section-inner { padding: var(--space-4); }

  .welcome-banner { flex-direction: column; gap: var(--space-4); text-align: center; }
  .milestone-badges { justify-content: center; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .offers-grid { grid-template-columns: 1fr; }
  .resources-header { flex-direction: column; align-items: stretch; }
  .search-bar { width: 100%; }
  .pathway-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .col-comparison { flex-direction: column; }
  .col-vs { display: none; }
  .housing-grid { grid-template-columns: 1fr; }
  .milestone-grid { grid-template-columns: repeat(2, 1fr); }
  .intake-steps { flex-wrap: wrap; }
  .intake-result-summary { grid-template-columns: 1fr 1fr; }

  .consultant-card { flex-wrap: wrap; }
  .ab-item { flex-wrap: wrap; }
  .sim-grid { grid-template-columns: 1fr; }
  .ai-status-pill { display: none; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .engagement-stats, .cost-stats, .admin-kpis { grid-template-columns: 1fr; }
  .milestone-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== ANIMATION ===== */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== TOOLKIT & RESOURCES STYLES ===== */

/* Resource grid — cards layout */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.resources-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.resources-header h1 { margin: 0; }

/* Toolkit card (clickable resource) */
.toolkit-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.toolkit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--color-primary);
}

.toolkit-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toolkit-card-icon i { width: 20px; height: 20px; }

.toolkit-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.toolkit-card p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Toolkit Panel (full-width detail view) */
.toolkit-panel {
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  padding: var(--space-6);
  margin-top: var(--space-4);
}

.toolkit-panel-header {
  margin-bottom: var(--space-5);
}

.toolkit-panel-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: var(--space-2) 0 0;
}

.toolkit-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: var(--space-1) 0 0;
}

.toolkit-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.toolkit-back-btn:hover { text-decoration: underline; }

/* ===== CALCULATOR STYLES ===== */
.calc-form { max-width: 700px; }

.calc-section {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
}
.calc-section:last-of-type { border-bottom: none; }

.calc-section h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.calc-max {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
}

.calc-hint {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}

.calc-note {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  font-style: italic;
}

.calc-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.calc-row-4 .form-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.calc-row-4 .form-label {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.calc-form .form-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

@media (max-width: 600px) {
  .calc-row-4 { grid-template-columns: repeat(2, 1fr); }
}

.calc-results {
  background: var(--color-bg);
  border-radius: 12px;
  padding: var(--space-6);
  margin-top: var(--space-5);
  border: 2px solid var(--color-primary);
}

.calc-score-display {
  text-align: center;
  margin-bottom: var(--space-5);
}

.calc-score-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.calc-score-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.calc-score-label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-1);
}

.calc-score-max {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border-radius: 6px;
}

.breakdown-row:nth-child(odd) { background: var(--color-surface); }
.breakdown-row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

.breakdown-row.total {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  margin-top: var(--space-2);
}
.breakdown-row.total span:last-child { font-weight: 700; }

.calc-context {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: 8px;
  font-size: var(--text-sm);
}

.calc-eligibility {
  text-align: center;
  padding: var(--space-3);
  border-radius: 8px;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.calc-eligibility.eligible {
  background: rgba(45, 138, 78, 0.1);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.calc-eligibility.not-eligible {
  background: rgba(197, 48, 48, 0.1);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.check-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: 6px;
  transition: background 0.1s;
}
.check-label:hover { background: var(--color-surface); }
.check-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-primary); }

/* Timeline visual */
.timeline-visual {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.timeline-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 24px;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}

.timeline-dot.completed { border-color: var(--color-success); background: var(--color-success); }
.timeline-dot.current { border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 0 4px rgba(10,110,110,0.15); }
.timeline-dot.pending { border-color: var(--color-border); }

.timeline-line {
  width: 2px;
  flex: 1;
  min-height: 24px;
  background: var(--color-border);
}
.timeline-line.completed { background: var(--color-success); }

.timeline-content h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  margin: 0;
}
.timeline-content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 2px 0 0;
}

/* POF / Budget */
.pof-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin: var(--space-3) 0;
  font-variant-numeric: tabular-nums;
}

.pof-note {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-align: center;
}

.pof-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: var(--text-base);
  margin-top: var(--space-4);
}

.budget-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: 8px;
  font-size: var(--text-sm);
}

.budget-row .budget-cat { font-weight: 500; }
.budget-row .budget-amt { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===== CHECKLIST STYLES ===== */
.checklist-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.checklist-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.checklist-progress-text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.checklist-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: var(--text-sm);
}
.checklist-item:hover { background: var(--color-bg); }

.checklist-item input[type="checkbox"] { display: none; }

.check-mark {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
}

.checklist-item input:checked ~ .check-mark {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.checklist-item input:checked ~ .check-mark::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.checklist-item input:checked ~ .check-text {
  text-decoration: line-through;
  opacity: 0.6;
}

.req-badge {
  display: inline-block;
  font-size: var(--text-base);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(197,48,48,0.1);
  color: var(--color-error);
  margin-left: 6px;
  vertical-align: middle;
}

.opt-badge {
  display: inline-block;
  font-size: var(--text-base);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(10,110,110,0.1);
  color: var(--color-primary);
  margin-left: 6px;
  vertical-align: middle;
}

/* ===== TEMPLATE STYLES (Email & Letter) ===== */
.template-body { max-width: 700px; }

.template-subject {
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-radius: 8px;
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.template-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'General Sans', sans-serif;
  font-size: var(--text-sm);
  line-height: 1.65;
  padding: var(--space-5);
  background: var(--color-bg);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  overflow-x: auto;
}

.template-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ===== FLASHCARD STYLES ===== */
.flashcard-controls {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  align-items: center;
}
.flashcard-controls .form-input { flex: 1; }

.flashcard-grid,
.flashcard-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.flashcard {
  perspective: 800px;
  height: 220px;
  cursor: pointer;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
  position: relative;
}

.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }

.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  text-align: center;
}

.flashcard-front {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  gap: var(--space-2);
}

.flashcard-back {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-success);
  transform: rotateY(180deg);
  overflow-y: auto;
  justify-content: flex-start;
  padding-top: var(--space-4);
}

.flashcard-term {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
}

.flashcard-hint {
  font-size: var(--text-xs);
  opacity: 0.5;
  margin-top: var(--space-1);
}

.flashcard-term-small {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  flex-shrink: 0;
}

.flashcard-def {
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-text-muted);
}

.flashcard-counter {
  text-align: center;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}

/* ===== RESOURCE TABS refinement ===== */
.resource-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

/* ===== LANGUAGE TOGGLE (in top bar) ===== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--color-surface-2, rgba(255,255,255,0.06));
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
}
.lang-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border-color: var(--color-primary);
}


/* ===== PATHWAY FILTER HERO ===== */
.pathway-filter-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.pathway-hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

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

.pathway-hero-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pathway-hero-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.pathway-hero-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.pathway-detected {
  flex-shrink: 0;
}

.pathway-detected-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(44, 74, 124, 0.1);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="dark"] .pathway-detected-badge {
  background: rgba(107, 159, 212, 0.12);
}

/* Pathway pills row */
.pathway-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pathway-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pathway-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(44, 74, 124, 0.05);
}

.pathway-pill.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

[data-theme="dark"] .pathway-pill:hover {
  background: rgba(107, 159, 212, 0.1);
}

[data-theme="dark"] .pathway-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Summary bar */
.pathway-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(44, 74, 124, 0.06);
  border: 1px solid rgba(44, 74, 124, 0.15);
  margin-bottom: 16px;
  gap: 12px;
}

[data-theme="dark"] .pathway-summary-bar {
  background: rgba(107, 159, 212, 0.08);
  border-color: rgba(107, 159, 212, 0.2);
}

.pathway-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  font-size: var(--text-base);
  font-weight: 500;
}

.pathway-summary-left strong {
  font-weight: 700;
}

.pathway-show-all-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pathway-show-all-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Pathway badges on cards */
.toolkit-card .pathway-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.pathway-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
}

.pathway-badge.pw-fsw { background: rgba(44, 74, 124, 0.1); color: #2c4a7c; }
.pathway-badge.pw-cec { background: rgba(45, 122, 79, 0.1); color: #2d7a4f; }
.pathway-badge.pw-pnp { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.pathway-badge.pw-family { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.pathway-badge.pw-study { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.pathway-badge.pw-work { background: rgba(217, 119, 6, 0.1); color: #d97706; }
.pathway-badge.pw-startup { background: rgba(147, 51, 234, 0.1); color: #9333ea; }
.pathway-badge.pw-aip { background: rgba(3, 105, 161, 0.1); color: #0369a1; }
.pathway-badge.pw-agrifood { background: rgba(21, 128, 61, 0.1); color: #15803d; }
.pathway-badge.pw-rnip { background: rgba(120, 113, 108, 0.1); color: #78716c; }
.pathway-badge.pw-childcare { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.pathway-badge.pw-all { background: rgba(44, 74, 124, 0.08); color: var(--color-text-muted); }

[data-theme="dark"] .pathway-badge.pw-fsw { background: rgba(107, 159, 212, 0.15); color: #6b9fd4; }
[data-theme="dark"] .pathway-badge.pw-cec { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
[data-theme="dark"] .pathway-badge.pw-pnp { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
[data-theme="dark"] .pathway-badge.pw-family { background: rgba(248, 113, 113, 0.15); color: #f87171; }
[data-theme="dark"] .pathway-badge.pw-study { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
[data-theme="dark"] .pathway-badge.pw-work { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
[data-theme="dark"] .pathway-badge.pw-startup { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
[data-theme="dark"] .pathway-badge.pw-aip { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
[data-theme="dark"] .pathway-badge.pw-agrifood { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
[data-theme="dark"] .pathway-badge.pw-rnip { background: rgba(168, 162, 158, 0.15); color: #a8a29e; }
[data-theme="dark"] .pathway-badge.pw-childcare { background: rgba(244, 114, 182, 0.15); color: #f472b6; }
[data-theme="dark"] .pathway-badge.pw-all { background: rgba(107, 159, 212, 0.08); color: var(--color-text-muted); }

/* Card relevance states */
.toolkit-card.pathway-dimmed {
  opacity: 0.4;
  order: 99 !important;
  transition: opacity 0.3s ease;
}

.toolkit-card.pathway-dimmed:hover {
  opacity: 0.75;
}

.toolkit-card.pathway-relevant {
  opacity: 1;
  order: 0 !important;
  transition: opacity 0.3s ease;
}

.toolkit-card.pathway-relevant::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--color-primary);
}

.toolkit-card {
  position: relative;
}

/* Reorder grid to show relevant first */
.resource-grid.pathway-active {
  display: flex !important;
  flex-wrap: wrap;
}

/* Other pathway section divider */
.pathway-other-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px 0;
  order: 50;
}

.pathway-other-divider span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pathway-other-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* Responsive */
@media (max-width: 768px) {
  .pathway-filter-hero {
    padding: 16px;
  }

  .pathway-hero-header {
    flex-direction: column;
  }

  .pathway-pills-row {
    gap: 6px;
  }

  .pathway-pill {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .pathway-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


/* ============================================================
   FEATURE 1: ONBOARDING OVERLAY
   ============================================================ */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s ease;
  padding: 1rem;
  overflow-y: auto;
}
.onboarding-overlay.hidden { display: none; }
.onboarding-modal {
  background: var(--color-bg); border-radius: 16px;
  max-width: 520px; width: 100%; padding: 2rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
  max-height: 90vh; overflow-y: auto;
  margin: auto;
}
.onboarding-progress {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-2); margin-bottom: var(--space-6);
}
.ob-step {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-border); color: var(--color-text-muted);
  font-size: var(--text-sm); font-weight: 600;
  transition: all 0.3s ease;
}
.ob-step.active { background: var(--color-primary); color: #fff; }
.ob-step.done { background: var(--color-success); color: #fff; }
.ob-line { width: 40px; height: 2px; background: var(--color-border); }
.ob-panel { display: none; animation: slideUp 0.3s ease; }
.ob-panel.active { display: block; }
.ob-icon-ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--color-surface-alt); margin: 0 auto var(--space-4);
  display: flex; align-items: center; justify-content: center;
}
.ob-icon-ring.ob-success { background: rgba(67,122,34,0.1); }
.ob-panel h2 { font-size: 1.5rem; margin-bottom: var(--space-2); }
.ob-subtitle { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); line-height: 1.5; }
.ob-features {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
  margin-bottom: var(--space-5); text-align: left;
}
.ob-feature {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 500; color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface); border-radius: 8px;
}
.ob-btn { width: 100%; padding: var(--space-3) var(--space-4); display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.ob-nav { display: flex; gap: var(--space-3); }
.ob-nav .ob-btn-back { flex: 0; white-space: nowrap; }
.ob-nav .ob-btn { flex: 1; }
.ob-form { text-align: left; margin-bottom: var(--space-5); }
.ob-field { margin-bottom: var(--space-4); }
.ob-field label { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); display: block; }
.ob-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.ob-option {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3); border: 2px solid var(--color-border);
  border-radius: 10px; background: var(--color-surface);
  font-size: var(--text-sm); font-weight: 500; cursor: pointer;
  transition: all 0.2s ease; text-align: left;
}
.ob-option:hover { border-color: var(--color-primary); background: var(--color-surface-alt); }
.ob-option.selected { border-color: var(--color-primary); background: rgba(44, 74, 124, 0.08); }
.ob-next-steps { text-align: left; margin-bottom: var(--space-3); }
.ob-next-step {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: 10px;
  background: var(--color-surface); margin-bottom: var(--space-2);
  cursor: pointer; transition: all 0.2s ease;
}
.ob-next-step:hover { background: var(--color-surface-alt); transform: translateX(4px); }
.ob-ns-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700; flex-shrink: 0;
}
.ob-ns-info strong { display: block; font-size: var(--text-sm); }
.ob-ns-info span { font-size: var(--text-xs); color: var(--color-text-muted); }

@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   FEATURE 2: SIDEBAR PROGRESS BAR
   ============================================================ */
/* ===== SIDEBAR WHAT'S NEXT SECTION ===== */
.sidebar-whats-next {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}
.swn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  padding: var(--space-3) 0 var(--space-2);
  margin: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.swn-header:hover { color: var(--color-text-muted); }
.swn-header span:first-child { flex: 1; }
.swn-toggle-icon {
  flex-shrink: 0;
  opacity: 0.4;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  user-select: none;
  transition: opacity 0.15s;
}
.swn-header:hover .swn-toggle-icon { opacity: 0.7; }
.swn-card-wrap {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 200px;
  opacity: 1;
}
.swn-card-wrap.collapsed {
  max-height: 0;
  opacity: 0;
}
.sidebar-whats-next.collapsed .swn-header {
  padding-bottom: 0;
}
.sidebar-whats-next.collapsed .swn-toggle-icon {
  /* +/- swap handled by JS */
}
@media (max-width: 768px) {
  .swn-toggle-icon { opacity: 0.5; }
  .swn-card-wrap { max-height: 0; opacity: 0; }
  .swn-card-wrap.expanded { max-height: 200px; opacity: 1; }
  .sidebar-whats-next:not(.expanded) .swn-header { margin-bottom: 0; }
  .sidebar-whats-next.expanded .swn-toggle-icon { transform: rotate(0deg); }
  .sidebar-whats-next:not(.expanded) .swn-toggle-icon { transform: rotate(-90deg); }
}
.swn-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  background: oklch(from var(--color-primary) l c h / 0.08);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.12);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.swn-card:hover {
  background: oklch(from var(--color-primary) l c h / 0.14);
  border-color: oklch(from var(--color-primary) l c h / 0.2);
}
.sns-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: oklch(from var(--color-primary) l c h / 0.15);
  color: var(--color-primary);
  flex-shrink: 0;
}
.sns-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sns-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  line-height: 1;
}
.sns-action {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}
.sns-arrow {
  color: var(--color-text-faint);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.sidebar-next-step:hover .sns-arrow {
  transform: translateX(2px);
  color: var(--color-primary);
}

/* ============================================================
   FEATURE 3: CONTEXTUAL NUDGE BANNER
   ============================================================ */
.action-nudge {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, rgba(10,110,110,0.08), rgba(10,110,110,0.04));
  border: 1px solid rgba(10,110,110,0.15); border-radius: 10px;
  font-size: var(--text-sm); margin-bottom: var(--space-3);
  color: var(--color-primary); animation: slideDown 0.3s ease;
}
.action-nudge.hidden { display: none; }
.nudge-go {
  margin-left: auto; padding: 4px 12px; border-radius: 6px;
  background: var(--color-primary); color: #fff; font-size: var(--text-sm);
  font-weight: 600; display: flex; align-items: center; gap: 4px;
  border: none; cursor: pointer; white-space: nowrap;
}
.nudge-go:hover { opacity: 0.9; }
.nudge-dismiss {
  padding: 2px; border: none; background: none; cursor: pointer;
  color: var(--color-text-muted); display: flex; align-items: center;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   FEATURE 5: BREADCRUMBS
   ============================================================ */
.section-breadcrumb {
  display: flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-3);
}
.section-breadcrumb a {
  color: var(--color-primary); text-decoration: none; cursor: pointer;
}
.section-breadcrumb a:hover { text-decoration: underline; }
.section-breadcrumb .bc-sep { opacity: 0.4; }

/* ============================================================
   FEATURE 6: UNIVERSAL SEARCH
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
.search-overlay.active { display: flex; }
.search-modal {
  background: var(--color-bg); border-radius: 14px;
  max-width: 580px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.search-input-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.search-input-row input {
  flex: 1; border: none; background: none; outline: none;
  font-size: var(--text-sm); color: var(--color-text); font-family: inherit;
}
.search-input-row kbd {
  padding: 2px 8px; border-radius: 4px; font-size: var(--text-base);
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text-muted); font-family: inherit;
}
.search-results {
  max-height: 400px; overflow-y: auto; padding: var(--space-3);
}
.search-group { margin-bottom: var(--space-3); }
.search-group-label {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2); margin-bottom: var(--space-1);
}
.search-hint {
  font-size: var(--text-sm); color: var(--color-text-muted);
  padding: var(--space-2); line-height: 1.5;
}
.search-result-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: 8px;
  cursor: pointer; font-size: var(--text-sm); transition: background 0.15s;
}
.search-result-item:hover, .search-result-item.highlighted { background: var(--color-surface-alt); }
.search-result-item .sri-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--color-surface); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.search-result-item .sri-info { flex: 1; }
.search-result-item .sri-info strong { display: block; font-size: var(--text-sm); }
.search-result-item .sri-info span { font-size: var(--text-sm); color: var(--color-text-muted); }
.search-result-item .sri-type {
  font-size: var(--text-xs); padding: 2px 8px; border-radius: 999px;
  background: var(--color-surface); color: var(--color-text-muted); font-weight: 600;
}
.search-trigger {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 14px; border-radius: 8px; font-size: var(--text-sm);
  background: var(--color-bg); border: 1px solid var(--color-border);
  color: var(--color-text-muted); cursor: pointer; transition: all 0.2s;
  white-space: nowrap; min-width: 160px;
}
.search-trigger:hover { border-color: var(--color-primary); color: var(--color-text); }
.search-trigger kbd {
  padding: 1px 5px; font-size: var(--text-xs); border-radius: 3px;
  background: var(--color-bg); border: 1px solid var(--color-border);
}
@media (max-width: 768px) {
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { padding: 6px; min-width: unset; width: 36px; height: 36px; justify-content: center; border-radius: 50%; }
  .lang-toggle span { display: none; }
  .lang-toggle { padding: 4px 8px; min-width: 36px; justify-content: center; }
  .top-bar { gap: var(--space-2); padding: var(--space-2) var(--space-3); }
  .top-bar-actions { gap: 4px; }
}

/* ============================================================
   FEATURE 7: TOOLKIT FAVORITES
   ============================================================ */
.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border-radius: 50%; border: none; background: var(--color-surface);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.2s; z-index: 2; color: var(--color-text-muted);
}
.toolkit-card:hover .fav-btn, .fav-btn.active { opacity: 1; }
.fav-btn.active { color: #FFC553; background: rgba(255,197,83,0.15); }
.fav-btn:hover { transform: scale(1.1); }
.toolkit-card { position: relative; }
.fav-section-header {
  grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) 0; font-size: var(--text-sm); font-weight: 600;
  color: var(--color-primary); border-bottom: 2px solid var(--color-primary);
  margin-bottom: var(--space-1);
}
.fav-section-header.hidden { display: none; }

/* ============================================================
   FEATURE 8: MOBILE BOTTOM NAV
   ============================================================ */
.mobile-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--color-bg); border-top: 1px solid var(--color-border);
  z-index: 900; padding: var(--space-1) 0;
  padding-bottom: calc(var(--space-1) + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .content-scroll { padding-bottom: 72px; }
}
.mbn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: var(--space-1); border: none; background: none;
  cursor: pointer; color: var(--color-text-muted); font-size: var(--text-xs);
  font-weight: 600; transition: color 0.2s;
}
.mbn-item.active { color: var(--color-primary); }
.mbn-item:active { transform: scale(0.95); }

/* ============================================================
   FEATURE 9: CLICKABLE KPI CARDS
   ============================================================ */
.clickable-kpi { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.clickable-kpi:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.clickable-kpi::after {
  content: '→'; position: absolute; top: 8px; right: 10px;
  font-size: var(--text-sm); color: var(--color-text-muted); opacity: 0;
  transition: opacity 0.2s;
}
.clickable-kpi:hover::after { opacity: 1; }
.kpi-card { position: relative; }

/* ============================================================
   FEATURE 10: CELEBRATION
   ============================================================ */
.celebration-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
}
.celebration-overlay.active { display: flex; }
.celebration-content {
  text-align: center; padding: var(--space-8);
  animation: celebPop 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}
.celebration-badge {
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,197,83,0.15); margin: 0 auto var(--space-4);
  display: flex; align-items: center; justify-content: center;
  animation: celebBounce 0.6s ease 0.3s both;
}
.celebration-content h2 { color: #fff; font-size: 1.6rem; margin-bottom: var(--space-2); }
.celebration-content p { color: rgba(255,255,255,0.7); font-size: var(--text-sm); margin-bottom: var(--space-5); }
@keyframes celebPop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes celebBounce { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

.celebration-confetti {
  position: fixed; inset: 0;  z-index: -1;
}
.confetti-piece {
  position: absolute; width: 10px; height: 10px;
  opacity: 0; animation: confettiFall 2s ease-out forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(-20vh) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ============================================================
   FEATURE 11: ROADMAP PHASE TIMELINE ESTIMATES
   ============================================================ */
.phase-timeline {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 500;
  background: var(--color-surface); padding: 2px 10px; border-radius: 999px;
  margin-top: 4px;
}

/* ============================================================
   FEATURE 13: HELP TOOLTIPS
   ============================================================ */
.term-tooltip {
  position: relative; display: inline-flex; align-items: center;
  cursor: help;
}
.term-tooltip .tt-icon {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 700; color: var(--color-text-muted);
  margin-left: 3px; cursor: help; vertical-align: middle;
  flex-shrink: 0;
}
.term-tooltip .tt-popup {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--color-text); color: var(--color-bg);
  padding: var(--space-2) var(--space-3); border-radius: 8px;
  font-size: var(--text-sm); line-height: 1.4; width: 260px;
   opacity: 0; transition: opacity 0.15s;
  z-index: 100; font-weight: 400; text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.term-tooltip:hover .tt-popup { opacity: 1; pointer-events: auto; }
.term-tooltip .tt-popup::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); border: 6px solid transparent;
  border-top-color: var(--color-text);
}

/* ============================================================
   FEATURE 14: ROADMAP EXPORT
   ============================================================ */
.roadmap-actions-bar {
  display: flex; gap: var(--space-2); margin-bottom: var(--space-3); justify-content: flex-end;
}
.btn-sm { padding: 4px 12px; font-size: var(--text-sm); }

@media print {
  .sidebar, .content-header, .mobile-bottom-nav,
  .action-nudge, .roadmap-actions-bar, .sidebar-overlay { display: none !important; }
  .content-area { margin-left: 0 !important; }
  .section { display: block !important; }
  .section:not(.section-active) { display: none !important; }
}


/* ============================================================
   PR MAINTENANCE SECTION
   ============================================================ */
.residency-tracker {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.res-tracker-visual {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  flex-wrap: wrap;
}
.res-ring-container {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.res-ring-svg {
  width: 100%;
  height: 100%;
}
.res-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.res-days-count {
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 700;
  color: var(--color-text);
}
.res-days-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.res-stats-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
  min-width: 200px;
}
.res-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
}
.res-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.res-stat-value {
  font-weight: 600;
  font-size: var(--text-sm);
}
.res-stat-value.highlight {
  color: var(--color-primary);
}
.res-stat-value.warning {
  color: var(--color-warning);
}
.res-status-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm);
  font-weight: 500;
}
.res-status-bar.on-track {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.res-status-bar.at-risk {
  background: var(--color-warning-highlight);
  color: var(--color-warning);
}

/* PR Card Renewal */
.prcard-info {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.prcard-timeline {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  padding-left: 44px;
}
.prcard-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-border);
}
.prcard-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  position: relative;
}
.prcard-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  position: absolute;
  left: -44px;
  z-index: 1;
}
.prcard-dot.done {
  background: var(--color-success);
  color: white;
}
.prcard-dot.warning {
  background: var(--color-warning);
  color: white;
}
.prcard-dot.future {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
}
.prcard-detail strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}
.prcard-detail span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.prcard-cost-box {
  min-width: 220px;
  background: var(--color-surface);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cost-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}
.cost-row strong {
  color: var(--color-primary);
}

/* Travel Rules */
.travel-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}
.travel-rule-card {
  padding: var(--space-4);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.travel-rule-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.travel-rule-card h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.travel-rule-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Tax Reminders */
.tax-reminders {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tax-reminder-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
.tax-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.tax-icon.done {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.tax-info {
  flex: 1;
}
.tax-info strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}
.tax-info span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.tax-tip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md, 8px);
  background: var(--color-warning-highlight);
  font-size: var(--text-xs);
  color: var(--color-text);
  line-height: 1.5;
}
.tax-tip i {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   CITIZENSHIP SECTION
   ============================================================ */
.cit-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}
.cit-req-card {
  padding: var(--space-4);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  position: relative;
}
.cit-req-check {
  margin-bottom: var(--space-3);
  color: var(--color-text-faint);
}
.cit-req-card.met .cit-req-check { color: var(--color-success); }
.cit-req-card.in-progress .cit-req-check { color: var(--color-primary); }
.cit-req-card h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.cit-req-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}
.cit-req-status {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.cit-req-status.met {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.cit-req-status.in-progress {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}
.cit-req-status.pending {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}

/* Presence Calculator */
.presence-calc {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.presence-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}
.presence-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 180px;
}
.presence-field label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}
.presence-field input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
}
.presence-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(44, 74, 124, 0.1);
}
.presence-result {
  background: var(--color-surface);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
}
.presence-result-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.presence-num {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.presence-total {
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
}
.presence-req {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.presence-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--color-surface-offset);
  overflow: hidden;
}
.presence-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color-primary);
  transition: width 0.6s ease;
}
.presence-detail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.presence-est {
  color: var(--color-primary);
  font-weight: 500;
}

/* Citizenship Test Topics */
.cit-test-topics {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cit-topic {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cit-topic:hover {
  border-color: var(--color-primary);
}
.cit-topic-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}
.cit-topic-arrow {
  transition: transform 0.2s;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.cit-topic.open .cit-topic-arrow {
  transform: rotate(90deg);
}
.cit-topic-header h4 {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
}
.cit-topic-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.cit-topic-body {
  display: none;
  padding: 0 var(--space-4) var(--space-4) var(--space-8, 2rem);
}
.cit-topic.open .cit-topic-body {
  display: block;
}
.cit-topic-body ul {
  list-style: disc;
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cit-topic-body li {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Citizenship Checklist */
.cit-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.cit-check-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-border);
  transition: background 0.2s;
  cursor: pointer;
}
.cit-check-item:hover {
  background: var(--color-surface);
}
.cit-check-item.done {
  background: var(--color-success-highlight);
  border-color: transparent;
}
.cit-check-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-faint);
}
.cit-check-box.done {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.cit-check-info strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}
.cit-check-info span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Citizenship Timeline */
.cit-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  padding-left: 52px;
}
.cit-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-border);
}
.cit-tl-step {
  display: flex;
  gap: var(--space-3);
  position: relative;
}
.cit-tl-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  position: absolute;
  left: -52px;
  z-index: 1;
}
.cit-tl-dot.pending {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 2px solid var(--color-border);
}
.cit-tl-dot.done {
  background: var(--color-success);
  color: white;
}
.cit-tl-dot.current {
  background: var(--color-primary);
  color: white;
}
.cit-tl-info {
  padding-top: 4px;
}
.cit-tl-info strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}
.cit-tl-info span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Onboarding wider options grid */
.ob-options-wide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
@media (max-width: 480px) {
  .ob-options-wide {
    grid-template-columns: 1fr;
  }
}

/* Badge styles for new sections */
.badge-success {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.badge-warning {
  background: var(--color-warning-highlight);
  color: var(--color-warning);
}


/* ============================================================
   COUNTRY PICKER — Custom searchable dropdown with flags
   ============================================================ */
.country-picker {
  position: relative;
  width: 100%;
}
.country-picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: left;
}
.country-picker-btn:hover {
  border-color: var(--color-primary);
}
.country-picker-btn:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(44, 74, 124, 0.1);
}
.cp-flag {
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.cp-flag .fi {
  font-size: var(--text-lg);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.cp-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dropdown */
.country-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  max-height: 320px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.country-dropdown.open {
  display: flex;
}

/* Search */
.cd-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.cd-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.cd-search-input::placeholder {
  color: var(--color-text-faint);
}

/* List */
.cd-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px;
}
.cd-group-label {
  padding: 6px 12px 4px;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}
.cd-group-divider {
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
  padding-top: 8px;
}
.cd-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: left;
  transition: background 0.15s;
}
.cd-option:hover {
  background: var(--color-surface-offset, rgba(0,0,0,0.04));
}
.cd-option.selected {
  background: var(--color-primary-subtle);
  font-weight: 500;
}
.cd-opt-flag {
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.cd-opt-flag .fi {
  font-size: var(--text-base);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.cd-opt-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Make sure it looks right in the intake form grid */
.form-grid .country-picker {
  max-width: 100%;
}

/* ============================================================
   COLLAPSIBLE CARDS
   ============================================================ */
.card-header {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.card-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
  margin-left: var(--space-2);
}
.card-toggle:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}
.card-toggle i,
.card-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.card.collapsed .card-toggle {
  color: var(--color-text-muted);
}
.card-body {
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
  max-height: 5000px;
  opacity: 1;
}
.card.collapsed .card-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  overflow: hidden;
}
.card.collapsed .card-header {
  margin-bottom: 0;
}

/* ============================================================
   COMPREHENSIVE MOBILE OVERHAUL
   Target: 390px viewport (iPhone 14/15), comfortable up to 480px
   ============================================================ */

@media (max-width: 768px) {

  /* --- Base typography bump --- */
  :root {
    --text-xs:   0.8125rem;   /* 13px → was ~12px */
    --text-sm:   0.9375rem;   /* 15px → was ~14px */
    --text-base: 1rem;        /* 16px */
    --text-lg:   1.25rem;     /* 20px */
    --text-xl:   1.5rem;      /* 24px */
  }

  /* --- Section padding: more breathing room --- */
  .section-inner {
    padding: var(--space-5) !important;
  }

  /* --- Section title rows --- */
  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  .section-title-row h1 {
    font-size: var(--text-lg);
  }

  /* --- Welcome banner: mobile reflow --- */
  .welcome-banner {
    flex-direction: column;
    padding: var(--space-5);
    gap: 0;
    border-radius: var(--radius-lg);
    text-align: center;
  }

  /* Progress ring first on mobile via order */
  .welcome-stat { order: -1; margin-bottom: var(--space-3); }
  .welcome-text { order: 0; }

  .stat-ring {
    width: 84px;
    height: 84px;
    margin: 0 auto;
  }
  .stat-value {
    font-size: var(--text-base);
    font-weight: 700;
  }

  .welcome-text h1 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
  }
  .welcome-text p {
    font-size: var(--text-sm);
    line-height: 1.4;
    margin-bottom: var(--space-3);
  }

  /* --- Milestone badges: clean bottom row --- */
  .milestone-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-3) 0 0;
    border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
    margin-top: var(--space-1);
  }
  .badge-earned,
  .badge-locked {
    flex: 1;
    min-width: 0;
    align-items: center;
  }
  .badge-earned > i,
  .badge-locked > i {
    width: 34px;
    height: 34px;
  }
  .badge-earned > i i,
  .badge-locked > i i,
  .badge-earned > i svg,
  .badge-locked > i svg {
    width: 16px !important;
    height: 16px !important;
  }
  .badge-earned > .badge-label,
  .badge-locked > .badge-label {
    font-size: 10px;
  }

  /* --- KPI cards: readable, comfortable --- */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
  .kpi-card {
    padding: var(--space-4);
    gap: var(--space-2);
  }
  .kpi-icon {
    width: 36px;
    height: 36px;
  }
  .kpi-icon i {
    width: 18px;
    height: 18px;
  }
  .kpi-value {
    font-size: var(--text-base);
  }
  .kpi-label {
    font-size: var(--text-xs);
    line-height: 1.3;
  }
  .kpi-delta {
    font-size: var(--text-xs);
  }

  /* --- Cards: generous padding --- */
  .card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }
  .card-header h2 {
    font-size: var(--text-base);
  }

  /* --- Action items: readable, thumb-friendly --- */
  .action-item {
    flex-wrap: wrap;
    padding: var(--space-4);
    min-height: 48px;
    gap: var(--space-2) var(--space-3);
    align-items: flex-start;
  }
  /* Let content + priority dot share first row, impact + button wrap to second row */
  .action-content {
    flex: 1 1 0%;
    min-width: calc(100% - 60px); /* force impact+btn to wrap below */
  }
  .action-impact {
    font-size: var(--text-xs);
  }
  .action-content strong,
  .action-content b {
    font-size: var(--text-sm);
    line-height: 1.4;
  }
  .action-content p,
  .action-content span {
    font-size: var(--text-xs);
    line-height: 1.5;
  }
  .action-content .smart-tool-links {
    margin-top: 8px;
  }
  .action-check {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }

  /* --- Buttons: minimum 44px touch target --- */
  .btn {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    min-height: 44px;
  }
  .btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    min-height: 36px;
  }

  /* --- Badges: slightly larger for readability --- */
  .badge {
    font-size: var(--text-sm);
    padding: 3px var(--space-2);
  }

  /* --- Hamburger button: bigger tap target --- */
  .hamburger {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- Sidebar open: wider on mobile for readability --- */
  .sidebar {
    width: 300px;
    left: -300px;
  }
  .sidebar.open {
    left: 0;
  }
  .nav-item {
    padding: 10px var(--space-3);
    font-size: var(--text-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-group-label {
    font-size: var(--text-sm);
    padding: var(--space-3) var(--space-4) var(--space-2);
  }

  /* --- Toolkit cards: larger, more readable --- */
  .toolkit-card {
    padding: var(--space-4);
  }
  .toolkit-card h3 {
    font-size: var(--text-sm);
  }
  .toolkit-card p {
    font-size: var(--text-xs);
    line-height: 1.5;
  }
  .toolkit-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
  }
  .toolkit-card-icon i {
    width: 22px;
    height: 22px;
  }

  /* --- Toolkit panels: comfortable reading --- */
  .toolkit-panel {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }
  .toolkit-panel-header h2 {
    font-size: var(--text-lg);
  }
  .toolkit-subtitle {
    font-size: var(--text-sm);
  }
  .toolkit-back-btn {
    font-size: var(--text-sm);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* --- Offers grid: single column, readable cards --- */
  .offers-grid {
    grid-template-columns: 1fr;
  }

  /* --- Forms: comfortable input sizing --- */
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS zoom */
    min-height: 44px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  /* --- Calculator: readable on mobile --- */
  .calc-section h3 {
    font-size: var(--text-sm);
  }
  .calc-hint, .calc-note, .calc-max {
    font-size: var(--text-xs);
  }

  /* --- Roadmap: readable steps --- */
  .journey-phase {
    padding-left: 44px;
  }
  .phase-indicator {
    left: -44px;
  }
  .phase-dot {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
  }
  .phase-title {
    font-size: var(--text-sm);
  }
  .step-name {
    font-size: var(--text-sm);
  }
  .step-item {
    padding: var(--space-3) var(--space-2);
    min-height: 44px;
  }
  .step-check {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }

  /* --- Roadmap progress summary --- */
  .roadmap-progress-summary {
    gap: var(--space-3);
    flex-wrap: wrap;
  }
  .roadmap-progress-ring {
    width: 56px;
    height: 56px;
  }

  /* --- Time estimates: readable --- */
  .step-time-est, .action-time-est {
    font-size: var(--text-sm);
  }

  /* --- Smart tool chips: thumb-friendly --- */
  .smart-tool-chip {
    font-size: var(--text-xs);
    padding: 3px 8px 3px 6px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
  }

  /* --- Phase timeline estimates --- */
  .phase-timeline {
    font-size: var(--text-xs);
  }

  /* --- Pathway pills: bigger touch targets --- */
  .pathway-pill {
    padding: 8px 14px;
    font-size: var(--text-base);
    min-height: 36px;
  }

  /* --- Score cards --- */
  .score-panel-grid {
    grid-template-columns: 1fr;
  }

  /* --- Resource/search header --- */
  .resources-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .search-bar {
    width: 100%;
  }

  /* --- Onboarding modal: full width on mobile --- */
  .onboarding-modal {
    padding: var(--space-6) var(--space-4);
    max-width: calc(100vw - 32px);
    border-radius: var(--radius-lg);
  }
  .onboarding-modal h1, .onboarding-modal h2 {
    font-size: var(--text-lg);
  }
  .onboarding-modal p {
    font-size: var(--text-sm);
    line-height: 1.5;
  }

  /* --- Bottom nav: comfortable touch targets --- */
  .mbn-item {
    font-size: var(--text-base);
    padding: var(--space-2);
    min-height: 48px;
  }
  .mbn-item i, .mbn-item svg {
    width: 22px;
    height: 22px;
  }

  /* --- Journey progress bar --- */
  .journey-progress-bar {
    padding: 8px var(--space-4);
    font-size: var(--text-xs);
  }
  .jpb-pct {
    font-size: var(--text-base);
  }

  /* --- FAB adjustment above bottom nav --- */
  .fab-container {
    bottom: 80px;
    right: 16px;
  }
  .fab-trigger {
    width: 48px;
    height: 48px;
  }
  .fab-action {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-4);
    min-height: 40px;
  }

  /* --- Notification items: readable --- */
  .notif-item, .notification-item {
    padding: var(--space-3) var(--space-4);
  }

  /* --- Consultant cards --- */
  .consultant-card {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  /* --- Intake steps row --- */
  .intake-steps {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .intake-step {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
    min-height: 36px;
  }

  /* --- Save indicator: readable --- */
  .intake-save-status {
    font-size: var(--text-xs);
  }

  /* --- Offer recommended cards --- */
  .offers-rec-grid {
    grid-template-columns: 1fr;
  }
  .offer-rec-card h4 {
    font-size: var(--text-sm);
  }
  .offer-rec-card p {
    font-size: var(--text-sm);
  }

  /* --- Empty state --- */
  .empty-state-enhanced {
    padding: var(--space-6) var(--space-4);
  }

  /* --- Content scroll: account for bottom nav --- */
  .content-scroll {
    padding-bottom: 80px;
  }

  /* --- Global: all hardcoded tiny fonts bump --- */
  .nav-group-label,
  .fav-section-header {
    font-size: var(--text-sm);
  }

  /* --- Prevent horizontal overflow --- */
  .main-content,
  .content-scroll,
  .section-inner,
  .card {
    max-width: 100%;
    box-sizing: border-box;
  }
  .action-item {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
  }
}

/* ===== EXTRA SMALL PHONES (≤ 380px) ===== */
@media (max-width: 380px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .milestone-badges {
    gap: 2px;
  }
  .badge-earned > i,
  .badge-locked > i {
    width: 30px;
    height: 30px;
  }
  .badge-earned > .badge-label,
  .badge-locked > .badge-label {
    font-size: 9px;
  }
  .welcome-text h1 {
    font-size: var(--text-base);
  }
  .stat-ring {
    width: 72px;
    height: 72px;
  }
}

/* Badge alignment — no underlines, vertically centered */
.badge {
  text-decoration: none;
  border-bottom: none;
  vertical-align: middle;
  line-height: 1.4;
}

.badge i, .badge svg {
  text-decoration: none;
  border-bottom: none;
}

/* Ensure card-header h2 icons have no underline */
.card-header h2 i,
.card-header h2 svg,
.section-title-row h1 i,
.section-title-row h1 svg {
  text-decoration: none;
  border-bottom: none;
  font-style: normal;
  vertical-align: middle;
}

/* ===== NUCLEAR FIX: Remove ALL browser-generated underlines from icons and title attributes ===== */
i[data-lucide],
i[data-lucide] *,
svg,
svg *,
[data-lucide] {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
  font-style: normal;
}

/* Remove browser tooltip underlines from title/aria attributes */
[title],
[aria-label],
abbr,
abbr[title] {
  text-decoration: none !important;
  text-decoration-line: none !important;
}
/* Only strip border-bottom from inline elements (not buttons/chips that need real borders) */
abbr, abbr[title] {
  border-bottom: none !important;
}

/* Ensure no parent element with title passes underline to children */
[title] i,
[title] svg,
.badge-earned,
.badge-locked,
.indicator,
.chat-tool-btn,
.lang-toggle,
.alert-icon {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: none !important;
}
/* For [title] descendants, only strip text-decoration, NOT border-bottom */
[title] * {
  text-decoration: none !important;
  text-decoration-line: none !important;
}

/* Ensure fav-btn star doesn't show underline */
.fav-btn {
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ===== SMART TOOL LINKS ===== */
.smart-tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding: 2px; /* prevent pill borders from being clipped by parent overflow */
}
.smart-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.25) !important;
  background: oklch(from var(--color-primary) l c h / 0.05);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.smart-tool-chip:hover {
  background: oklch(from var(--color-primary) l c h / 0.12);
  border-color: var(--color-primary) !important;
}
.smart-tool-chip:active {
  transform: translateY(0);
}
.smart-tool-chip i {
  flex-shrink: 0;
}
/* In action items, position the links naturally within content flow */
.action-content .smart-tool-links {
  margin-top: 6px;
}
/* Mobile chip sizing — see comprehensive mobile overhaul block */


/* ===== IMPROVEMENT #3: Milestone badge labels ===== */
/* (Moved to main badge-earned/badge-locked rules above line 293) */

/* ===== IMPROVEMENT #4: Persistent Journey Progress Bar ===== */
.journey-progress-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  flex-shrink: 0;
}
.jpb-track {
  flex: 1;
  height: 4px;
  background: oklch(from var(--color-text) l c h / 0.15);
  border-radius: 99px;
  overflow: hidden;
}
.jpb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: 99px;
  transition: width 0.6s ease;
}
.jpb-label {
  color: var(--color-text-muted);
  white-space: nowrap;
  font-weight: 500;
}
.jpb-pct {
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--text-xs);
}
@media (max-width: 768px) {
  .jpb-label { display: none; }
  .journey-progress-bar { padding: 6px var(--space-4); }
}

/* ===== IMPROVEMENT #5: Empty state enhancements ===== */
.empty-state-enhanced {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

/* ===== IMPROVEMENT #6: Recommended Offers ===== */
.offers-recommended {
  background: oklch(from var(--color-primary) l c h / 0.04);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}
.offers-recommended h2 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.offers-rec-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.offers-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.offer-rec-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: all 0.15s ease;
}
.offer-rec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.offer-rec-card h4 { font-size: var(--text-sm); font-weight: 600; margin-bottom: 2px; }
.offer-rec-card p { font-size: var(--text-base); color: var(--color-text-muted); }

/* ===== IMPROVEMENT #7: Time estimates ===== */
.step-time-est, .action-time-est {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  margin-left: var(--space-2);
  white-space: nowrap;
}
.step-content .step-time-est {
  display: flex;
  margin-left: 0;
  margin-top: 2px;
}
.action-content .action-time-est {
  display: inline-flex;
  margin-left: var(--space-2);
  font-size: var(--text-xs);
}

/* ===== IMPROVEMENT #8: Save indicator ===== */
.intake-save-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-success);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  background: oklch(from var(--color-success) l c h / 0.08);
  border-radius: var(--radius-full);
  width: fit-content;
}

/* ===== IMPROVEMENT #9: Notification unread state ===== */
.notif-unread {
  border-left: 3px solid var(--color-primary) !important;
  background: oklch(from var(--color-primary) l c h / 0.04);
}
.notif-unread .notif-title,
.notif-unread h4 {
  font-weight: 700;
}

/* ===== IMPROVEMENT #10: Floating Action Button ===== */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}
.fab-trigger {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px oklch(from var(--color-primary) l c h / 0.3);
  transition: all 0.2s ease;
  border: none;
}
.fab-trigger:hover { transform: scale(1.05); }
.fab-trigger:active { transform: scale(0.95); }
.fab-icon-close { display: none; }
.fab-container.open .fab-icon-open { display: none; }
.fab-container.open .fab-icon-close { display: block; }
.fab-container.open .fab-trigger { background: var(--color-text); }

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  
  transition: all 0.2s ease;
}
.fab-container.open .fab-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fab-action {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}
.fab-action:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
  transform: translateX(-4px);
}

/* FAB mobile — see comprehensive mobile overhaul block */

/* ===== UX GUIDANCE: Jargon Tooltip System ===== */
.jargon-term {
  position: relative;
  border-bottom: 1px solid oklch(from var(--color-primary) l c h / 0.35);
  cursor: help;
  color: inherit;
  text-decoration: none !important;
  transition: border-color 0.15s ease;
}
.jargon-term:hover,
.jargon-term:focus {
  border-bottom-color: var(--color-primary);
}
/* Inline .jargon-tip is hidden; the floating tooltip is #jargon-float appended to body */
.jargon-tip {
  display: none !important;
}
#jargon-float {
  position: fixed;
  display: none;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.5;
  width: 280px;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 99999;
  white-space: normal;
  text-align: left;
  opacity: 0;
}
#jargon-float.visible {
  display: block;
  opacity: 1;
  animation: jargonFadeIn 0.15s ease;
}
@keyframes jargonFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== UX GUIDANCE: CRS Benchmark Bar ===== */
.crs-benchmark {
  margin-top: 8px;
  width: 100%;
}
.crs-bench-bar {
  position: relative;
  height: 6px;
  background: oklch(from var(--color-primary) l c h / 0.1);
  border-radius: 3px;
  overflow: visible;
}
.crs-bench-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}
.crs-bench-cutoff {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 1px;
  transform: translateX(-50%);
}
.crs-bench-cutoff-label {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}
.crs-bench-hint {
  font-size: var(--text-base);
  color: var(--color-muted);
  margin-top: 6px;
  line-height: 1.3;
}
.crs-bench-hint strong {
  color: var(--color-primary);
  font-weight: 600;
}
/* Make KPI card accommodate the benchmark */
.kpi-card:has(.crs-benchmark) {
  padding-bottom: var(--space-3);
}

/* ===== UX GUIDANCE: Getting Started Checklist ===== */
.gs-checklist {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s;
  border-left: 3px solid var(--color-primary);
}
.gs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.gs-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.gs-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.gs-subtitle {
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.gs-dismiss {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.gs-dismiss:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}
.gs-progress {
  height: 3px;
  background: oklch(from var(--color-primary) l c h / 0.1);
}
.gs-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
  transition: width 0.4s ease;
}
.gs-tasks {
  padding: var(--space-2) 0;
}
.gs-task {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  color: var(--color-text);
}
.gs-task:hover {
  background: oklch(from var(--color-primary) l c h / 0.04);
}
.gs-task-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.gs-task-num {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
}
.gs-done .gs-task-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.gs-done .gs-task-label {
  text-decoration: line-through;
  color: var(--color-muted);
}
.gs-task-text {
  flex: 1;
  min-width: 0;
}
.gs-task-label {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.gs-task-desc {
  display: block;
  font-size: var(--text-base);
  color: var(--color-muted);
  margin-top: 1px;
}

/* ===== UX GUIDANCE: Focus Mode ===== */
.focus-show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: var(--space-3);
  background: none;
  border: none;
  border-top: 1px dashed var(--color-border);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: var(--space-2);
}
.focus-show-more:hover {
  background: oklch(from var(--color-primary) l c h / 0.05);
}

/* ===== UX GUIDANCE: Dedicated AI Chat FAB ===== */
.chat-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px oklch(from var(--color-primary) l c h / 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px oklch(from var(--color-primary) l c h / 0.4);
}
.chat-fab:active {
  transform: translateY(0);
}
/* Gentle pulse animation for first visit */
.chat-fab-pulse {
  animation: chatFabPulse 2s ease-in-out infinite;
}
@keyframes chatFabPulse {
  0%, 100% { box-shadow: 0 4px 16px oklch(from var(--color-primary) l c h / 0.3); }
  50% { box-shadow: 0 4px 24px oklch(from var(--color-primary) l c h / 0.5), 0 0 0 8px oklch(from var(--color-primary) l c h / 0.08); }
}
/* Override old FAB styles since we replaced the content */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
@media (max-width: 768px) {
  /* Hide FAB on mobile — Chat is already in the bottom nav bar */
  .fab-container {
    display: none;
  }
}

/* ===== REFERRAL BANNER (Dashboard) ===== */
.referral-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 70%, #000));
  color: #fff;
  margin-bottom: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.referral-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.referral-banner-icon i { width: 24px; height: 24px; }
.referral-banner-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.referral-banner-content strong { font-size: 14px; }
.referral-banner-content span { font-size: 12px; opacity: 0.85; }
.referral-banner-cta i { width: 20px; height: 20px; opacity: 0.7; }

/* ===== REFERRAL SECTION ===== */
.referral-hero-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}
.referral-hero-top {
  padding: 28px 24px;
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 70%, #000));
  color: #fff;
}
.referral-deal-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.referral-deal h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #fff;
}
.referral-deal p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
  line-height: 1.5;
}
.referral-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.referral-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px;
  border-right: 1px solid var(--color-border);
}
.referral-step:last-child { border-right: none; }
.referral-step-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.referral-step-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.referral-step-content strong {
  font-size: 13px;
  color: var(--color-text-primary);
}
.referral-step-content span {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* Referral Link */
.referral-link-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.referral-link-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 14px;
  font-family: monospace;
  outline: none;
}
.referral-link-input:focus { border-color: var(--color-primary); }
.referral-share-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Referral Stats */
.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.referral-stat {
  text-align: center;
  padding: 16px;
  border-radius: 10px;
  background: var(--color-bg);
}
.referral-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}
.referral-stat-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.referral-empty {
  text-align: center;
  padding: 20px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Invite by Email */
.referral-invite-row {
  display: flex;
  gap: 10px;
}
.referral-invite-success {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
  font-size: 13px;
  font-weight: 500;
  animation: referralFadeIn 0.3s ease;
}
@keyframes referralFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.referral-invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--color-bg);
  margin-bottom: 6px;
  font-size: 13px;
}
.referral-invite-item-email {
  color: var(--color-text-primary);
  font-weight: 500;
}
.referral-invite-item-status {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Terms box */
.referral-terms {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  width: 100%;
  box-sizing: border-box;
}
.referral-terms p {
  max-width: 100%;
}

@media (max-width: 600px) {
  .referral-steps { grid-template-columns: 1fr; }
  .referral-step { border-right: none; border-bottom: 1px solid var(--color-border); }
  .referral-step:last-child { border-bottom: none; }
  .referral-link-row { flex-direction: column; }
  .referral-invite-row { flex-direction: column; }
  .referral-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .referral-stat-value { font-size: 22px; }
  .referral-banner-content strong { font-size: 13px; }
}

/* ===== GEAR DROPDOWN ===== */
.gear-dropdown-wrap {
  position: relative;
}
.gear-dropdown {
  display: none;
  position: fixed;
  min-width: 190px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px oklch(0 0 0 / 0.14);
  padding: 6px;
  z-index: 99999;
  animation: gearDropIn 0.15s ease;
}
.gear-dropdown.open {
  display: block;
}
@keyframes gearDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gear-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  transition: background 0.12s;
  text-align: left;
}
.gear-dropdown-item:hover {
  background: var(--color-surface-offset);
}
.gear-dropdown-item i,
.gear-dropdown-item svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.gear-dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 6px;
}
.gear-dropdown-logout {
  color: var(--color-danger, #e05555);
}
.gear-dropdown-logout:hover {
  background: rgba(224, 85, 85, 0.08);
}
.gear-dropdown-logout i,
.gear-dropdown-logout svg {
  color: var(--color-danger, #e05555);
}

/* ===== ACCOUNT TABS ===== */
.account-tabs {
  display: flex;
  gap: 2px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: var(--space-5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.account-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.account-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}
.account-tab.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.12);
}
.account-tab-content {
  display: none;
}
.account-tab-content.active {
  display: block;
}
.account-tab-content .card + .card {
  margin-top: var(--space-4);
}

/* ===== PROFILE ===== */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== SUBSCRIPTION PLAN ===== */
.plan-current {
  padding: var(--space-4);
  border-radius: 10px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}
.plan-badge-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan-badge.pro {
  background: linear-gradient(135deg, var(--color-primary), oklch(from var(--color-primary) calc(l + 0.08) c h));
  color: #fff;
}
.plan-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}
.plan-price small {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}
.plan-features {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* ===== PAYMENT ===== */
.payment-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.payment-card-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}
.payment-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.payment-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.payment-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
}
.payment-card-exp {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ===== BILLING TABLE ===== */
.billing-table {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.billing-row {
  display: grid;
  grid-template-columns: 1fr 2fr 0.8fr 0.8fr;
  padding: 12px 16px;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}
.billing-row:last-child {
  border-bottom: none;
}
.billing-header {
  background: var(--color-surface-offset);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SESSIONS ===== */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  gap: var(--space-3);
}
.session-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-info > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ===== PREFERENCES ===== */
.pref-list {
  display: flex;
  flex-direction: column;
}
.pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-3);
}
.pref-item:last-child {
  border-bottom: none;
}
.pref-item > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pref-name {
  font-weight: 500;
  font-size: var(--text-sm);
}
.pref-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-border);
  border-radius: 24px;
  transition: background 0.2s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ===== ACCOUNT RESPONSIVE ===== */
@media (max-width: 600px) {
  .account-tabs {
    gap: 2px;
    padding: 3px;
  }
  .account-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
  .profile-avatar-row {
    flex-direction: column;
    text-align: center;
  }
  .billing-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 12px;
    padding: 10px 12px;
  }
  .billing-header {
    display: none;
  }
  .payment-card-item {
    flex-wrap: wrap;
  }
  .session-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .pref-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* ============================================================
   DEMO MODE STYLES
   ============================================================ */

/* Demo Banner */
.demo-banner {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: #2c4a7c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 10000;
  letter-spacing: 0.01em;
  font-family: var(--font-sans, 'General Sans', sans-serif);
}
.demo-banner-link {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
  margin-left: 2px;
}
.demo-banner-link:hover {
  opacity: 0.85;
}
.demo-banner-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px 8px;
  line-height: 1;
}
.demo-banner-close:hover {
  opacity: 1;
}
.demo-banner.hidden {
  display: none;
}

/* Push app shell down when banner is visible */
body.demo-banner-visible {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
body.demo-banner-visible .app-shell {
  flex: 1;
  height: auto;
}

/* Feature Gate Overlay */
.demo-gate-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-lg, 12px);
  text-align: center;
  padding: 2rem;
}
[data-theme="dark"] .demo-gate-overlay {
  background: rgba(17,24,39,0.7);
}
.demo-gate-overlay h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text, #1a1a2e);
  margin: 0 0 0.5rem;
}
[data-theme="dark"] .demo-gate-overlay h3 {
  color: #e2e8f0;
}
.demo-gate-overlay p {
  font-size: 0.85rem;
  color: var(--color-text-secondary, #64748b);
  margin: 0 0 1rem;
}
.demo-gate-overlay .demo-gate-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  background: #2c4a7c;
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.demo-gate-overlay .demo-gate-cta:hover {
  background: #1e3a5f;
}

/* Gated section content dimming */
.section.demo-gated > *:not(.demo-gate-overlay) {
  opacity: 0.4;
  
  user-select: none;
}
.section.demo-gated {
  position: relative;
}

/* Nav lock icon for gated items */
.nav-item .demo-lock-icon {
  margin-left: auto;
  opacity: 0.45;
  flex-shrink: 0;
}

/* Chat demo limit banner */
.demo-chat-limit {
  background: var(--color-surface, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #64748b);
}
.demo-chat-limit a {
  color: #2c4a7c;
  font-weight: 600;
  text-decoration: underline;
}
[data-theme="dark"] .demo-chat-limit {
  background: var(--color-surface-2, #1f2b3d);
  border-color: var(--color-border, #2e3d55);
}

/* Disabled edit button styling */
.demo-disabled-btn {
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  position: relative;
}

/* ===== TOOLKIT LOCKED STATE ===== */
.toolkit-locked {
  position: relative;
  cursor: default !important;
}
.toolkit-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--color-surface);
  opacity: 0.6;
  z-index: 2;
}
.toolkit-locked::before {
  content: "Upgrade to Unlock";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-surface-2, var(--color-surface));
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toolkit-locked:hover::before {
  background: var(--color-primary);
  color: #fff;
}
.toolkit-locked .toolkit-card-icon,
.toolkit-locked h3,
.toolkit-locked p {
  filter: blur(1px);
  opacity: 0.4;
}

/* ===== SIDEBAR USER ACTIONS (bell + gear next to profile) ===== */
.sidebar-user {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.sidebar-user .user-info {
  min-width: 0;
  flex: 1;
}
.sidebar-user .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}
.sidebar-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  flex-shrink: 0;
}
.sidebar-icon-btn:hover {
  background: var(--color-surface-2, rgba(255,255,255,0.06));
  color: var(--color-text);
}
.sidebar-icon-btn i {
  width: 16px;
  height: 16px;
}
.sidebar-icon-btn .notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-error, #e53e3e);
}
/* Gear dropdown opens UPWARD from sidebar bottom */
.sidebar-footer .gear-dropdown-wrap {
  position: relative;
}
.sidebar-footer .gear-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
  padding: 0.375rem;
  z-index: 100;
}

/* Mobile sidebar offset for banner — account for back-to-site bar (~28px) + demo banner (42px) */
@media (max-width: 768px) {
  body.demo-banner-visible .sidebar {
    top: 70px !important;
    height: calc(100dvh - 70px);
  }
  body.demo-banner-visible .sidebar-overlay.active {
    top: 70px;
  }
}

/* French override for locked toolkit cards */
html[lang="fr"] .toolkit-locked::before {
  content: "Débloquer";
}
html[lang="fr"] .kpi-benchmark-marker::after {
  content: '490 seuil';
}

/* ============================================
   FRENCH LANGUAGE LAYOUT FIXES
   French text is ~20-30% longer than English.
   These rules prevent overflow, truncation, 
   and broken layouts in FR mode.
   ============================================ */

/* --- PILLS & BADGES: allow wrapping / shrink text --- */
html[lang="fr"] .badge,
html[lang="fr"] .pill,
html[lang="fr"] .phase-status,
html[lang="fr"] .step-badge,
html[lang="fr"] [class*="badge"],
html[lang="fr"] .offer-badge,
html[lang="fr"] .category-badge {
  white-space: normal;
  word-break: break-word;
  font-size: 0.68rem;
  line-height: 1.3;
  padding-inline: 8px;
  max-width: 100%;
}

/* --- BUTTONS: allow text to shrink/wrap gracefully --- */
html[lang="fr"] .btn,
html[lang="fr"] button:not(.lang-toggle):not(.hamburger-btn):not(.sidebar-toggle):not(.theme-toggle) {
  white-space: normal;
  word-break: break-word;
  min-height: auto;
  line-height: 1.3;
}

/* --- SUGGESTION CHIPS: smaller text in FR --- */
html[lang="fr"] .suggestion-chip,
html[lang="fr"] .mode-pill {
  font-size: 0.72rem;
  padding: 6px 10px;
  white-space: normal;
  line-height: 1.3;
}

/* --- SIDEBAR NAV: prevent truncation --- */
html[lang="fr"] .sidebar-nav .nav-label {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  font-size: 0.82rem;
}

/* --- KPI CARDS: labels may be longer --- */
html[lang="fr"] .kpi-label {
  font-size: 0.72rem;
  white-space: normal;
  line-height: 1.3;
}

html[lang="fr"] .kpi-benchmark-label {
  font-size: 0.68rem;
  white-space: normal;
  line-height: 1.3;
}

html[lang="fr"] .kpi-delta {
  font-size: 0.68rem;
  white-space: normal;
}

/* --- DASHBOARD HERO: progress step labels --- */
html[lang="fr"] .jpb-label {
  font-size: 0.75rem;
  white-space: normal;
  line-height: 1.3;
}

/* --- DASHBOARD HERO: journey step icons/labels --- */
html[lang="fr"] .journey-step-label,
html[lang="fr"] .step-label {
  font-size: 0.6rem;
  white-space: normal;
  line-height: 1.2;
  max-width: 55px;
  text-align: center;
}

/* --- ROADMAP: phase status badges --- */
html[lang="fr"] .phase-status {
  font-size: 0.65rem;
  padding: 3px 8px;
  white-space: normal;
}

/* --- TABS: toolkit/offer category tabs --- */
html[lang="fr"] .tab-btn,
html[lang="fr"] .filter-btn,
html[lang="fr"] .category-tab,
html[lang="fr"] .pathway-tab {
  font-size: 0.78rem;
  white-space: nowrap;
  padding: 6px 12px;
}

/* --- TOOLKIT CARDS: titles may be longer --- */
html[lang="fr"] .toolkit-card h3,
html[lang="fr"] .toolkit-card-title {
  font-size: 0.9rem;
  line-height: 1.3;
  word-break: break-word;
}

/* --- OFFER CARDS: value badges --- */
html[lang="fr"] .offer-value {
  font-size: 0.72rem;
  white-space: normal;
  line-height: 1.3;
}

/* --- SECTION HEADER in top bar --- */
html[lang="fr"] .section-header-title,
html[lang="fr"] .content-header h2 {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- GETTING STARTED TASKS --- */
html[lang="fr"] .gs-task-label {
  font-size: 0.82rem;
  white-space: normal;
  line-height: 1.3;
}

/* --- ALERT DESCRIPTIONS --- */
html[lang="fr"] .alert-desc {
  font-size: 0.78rem;
  white-space: normal;
  line-height: 1.4;
}

/* --- MOBILE-SPECIFIC FR FIXES --- */
@media (max-width: 768px) {
  /* Mobile bottom nav labels */
  html[lang="fr"] .bottom-nav-label,
  html[lang="fr"] .mobile-nav-label,
  html[lang="fr"] .bottom-nav a span,
  html[lang="fr"] .mobile-bottom-nav span {
    font-size: 0.55rem !important;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
  }

  /* Mobile header title */
  html[lang="fr"] .mobile-header-title,
  html[lang="fr"] .content-header h2 {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 200px);
  }
  
  /* Mobile hero banner */
  html[lang="fr"] .demo-banner,
  html[lang="fr"] .banner-text {
    font-size: 0.72rem;
    white-space: normal;
    line-height: 1.3;
    padding: 8px 12px;
  }

  /* Mobile KPI cards */
  html[lang="fr"] .kpi-card {
    padding: 12px 10px;
  }
  html[lang="fr"] .kpi-label {
    font-size: 0.65rem;
  }
  html[lang="fr"] .kpi-value {
    font-size: 1.4rem;
  }
  
  /* Mobile pills and badges */
  html[lang="fr"] .badge,
  html[lang="fr"] .pill,
  html[lang="fr"] .phase-status,
  html[lang="fr"] [class*="badge"] {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  
  /* Mobile buttons */
  html[lang="fr"] .btn {
    font-size: 0.78rem;
    padding: 8px 14px;
  }
  
  /* Mobile journey step labels */
  html[lang="fr"] .journey-step-label,
  html[lang="fr"] .step-label {
    font-size: 0.5rem;
    max-width: 45px;
  }
  
  /* Mobile cards - allow text to wrap */
  html[lang="fr"] .card-title,
  html[lang="fr"] [class*="card"] h3 {
    font-size: 0.85rem;
    line-height: 1.3;
    word-break: break-word;
  }
  
  /* Mobile suggestion chips */
  html[lang="fr"] .suggestion-chip {
    font-size: 0.65rem;
    padding: 5px 8px;
  }
  
  /* Mobile tabs - horizontal scroll */
  html[lang="fr"] .tab-bar,
  html[lang="fr"] .tabs,
  html[lang="fr"] .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  html[lang="fr"] .tab-bar::-webkit-scrollbar,
  html[lang="fr"] .tabs::-webkit-scrollbar,
  html[lang="fr"] .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  html[lang="fr"] .tab-btn,
  html[lang="fr"] .filter-btn {
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Mobile policy bar text */
  html[lang="fr"] .policy-bar,
  html[lang="fr"] .monitoring-bar {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Mobile notification cards */
  html[lang="fr"] .notif-title {
    font-size: 0.78rem;
    line-height: 1.3;
  }
  html[lang="fr"] .notif-desc {
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  /* Mobile sidebar section group labels */
  html[lang="fr"] .nav-group-label {
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }
  
  /* Mobile toast/nudge cards */
  html[lang="fr"] .toast-title {
    font-size: 0.72rem;
  }
  html[lang="fr"] .toast-msg {
    font-size: 0.65rem;
    line-height: 1.3;
  }
}

/* --- EXTRA SMALL SCREENS (iPhone SE etc.) --- */
@media (max-width: 375px) {
  html[lang="fr"] .bottom-nav-label,
  html[lang="fr"] .mobile-nav-label,
  html[lang="fr"] .bottom-nav a span,
  html[lang="fr"] .mobile-bottom-nav span {
    font-size: 0.5rem !important;
    max-width: 55px;
  }
  
  html[lang="fr"] .kpi-label {
    font-size: 0.6rem;
  }
  
  html[lang="fr"] .badge,
  html[lang="fr"] [class*="badge"] {
    font-size: 0.55rem;
    padding: 2px 5px;
  }
}




/* ========== FRENCH FORMATTING FIXES V2 ========== */

/* Hero badge labels - wider on desktop for French */
html[lang="fr"] .badge-label {
  font-size: 0.6rem !important;
  max-width: 56px;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-align: center;
  line-height: 1.2;
}

@media (min-width: 769px) {
  html[lang="fr"] .badge-label {
    font-size: 0.65rem !important;
    max-width: 65px;
  }
}

/* Mobile header title - prevent 2-line wrapping */
@media (max-width: 768px) {
  html[lang="fr"] .content-header h2,
  html[lang="fr"] .mobile-header-title,
  html[lang="fr"] #page-title {
    font-size: 0.82rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 180px);
  }
  
  /* Policy ticker - ensure it doesn't clip */
  html[lang="fr"] .policy-ticker,
  html[lang="fr"] .monitoring-bar,
  html[lang="fr"] .policy-bar {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  
  /* Bottom nav labels - ensure French fits */
  html[lang="fr"] .bottom-nav-item span:not(:has(i)):not(:has(svg)) {
    font-size: 0.6rem !important;
    white-space: nowrap;
    letter-spacing: -0.02em;
  }
  
  /* Settlement cost table - add spacing */
  html[lang="fr"] .cost-row,
  html[lang="fr"] .cost-item {
    gap: 8px;
  }
  html[lang="fr"] .cost-label {
    white-space: nowrap;
    margin-right: 6px;
  }
}

/* Roadmap phase badges - prevent overflow */
html[lang="fr"] .phase-badge,
html[lang="fr"] .roadmap-status {
  font-size: 0.7rem;
  white-space: nowrap;
  padding: 3px 10px;
}

/* Flashcard content - allow wrapping */
html[lang="fr"] .flashcard-front,
html[lang="fr"] .flashcard-back {
  font-size: 0.85rem;
  word-break: break-word;
  hyphens: auto;
}

/* AI chat suggestion chips - tighter on mobile */
@media (max-width: 768px) {
  html[lang="fr"] .chat-suggestion,
  html[lang="fr"] .suggestion-chip {
    font-size: 0.65rem;
    padding: 5px 8px;
    line-height: 1.3;
  }
}

/* Onboarding step indicators */
html[lang="fr"] .step-indicator-label {
  font-size: 0.7rem;
  white-space: nowrap;
}

/* Ensure all FR buttons don't overflow on mobile */
@media (max-width: 768px) {
  html[lang="fr"] .btn-primary,
  html[lang="fr"] .btn-secondary,
  html[lang="fr"] .btn-outline {
    font-size: 0.78rem;
    padding: 8px 14px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ========== LANGUAGE SWITCHER ========== */
.lang-opt {
  color: var(--color-text-faint, #606a82);
}
.lang-opt:hover {
  color: var(--color-text, #1a2b42);
  background: var(--color-surface-2, rgba(0,0,0,0.04));
}
.lang-opt.active {
  color: var(--color-text, #1a2b42);
}
[data-theme="dark"] .lang-opt {
  color: var(--color-text-faint, #606a82);
}
[data-theme="dark"] .lang-opt:hover {
  color: var(--color-text, #e2e6f0);
  background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .lang-opt.active {
  color: var(--color-text, #e2e6f0);
}

/* ===== FR MOBILE FIXES — iPhone 16 Pro ===== */

/* Policy timeline mobile: prevent text bleeding */
@media (max-width: 480px) {
  html[lang="fr"] .timeline-table td,
  html[lang="fr"] .timeline-table th {
    padding: 8px 6px;
    font-size: 0.72rem;
    word-break: break-word;
    line-height: 1.3;
  }
  html[lang="fr"] .timeline-table td:first-child {
    white-space: nowrap;
    width: 70px;
    min-width: 70px;
  }
  html[lang="fr"] .timeline-table td:nth-child(2) {
    max-width: 120px;
    word-break: break-word;
    hyphens: auto;
  }
  /* Score circle label overflow */
  html[lang="fr"] .score-label {
    font-size: 0.65rem !important;
    letter-spacing: -0.02em;
  }
  /* Progress bar banner text overflow */
  html[lang="fr"] .progress-banner,
  html[lang="fr"] .journey-progress-label,
  html[lang="fr"] #jpb-label {
    font-size: 0.7rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  /* Roadmap unlock labels */
  html[lang="fr"] .phase-unlock,
  html[lang="fr"] .dag-unlock,
  html[lang="fr"] .step-unlock {
    font-size: 0.7rem;
    white-space: normal;
    word-break: break-word;
  }
  /* Roadmap step description */
  html[lang="fr"] .step-desc,
  html[lang="fr"] .dag-step-desc,
  html[lang="fr"] .step-detail {
    font-size: 0.8rem;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  /* Smart Profile form labels */
  html[lang="fr"] .form-field label {
    font-size: 0.8rem;
    line-height: 1.3;
  }
  /* Toast position above mobile nav */
  .toast-container {
    bottom: 80px !important;
  }
}

/* FR policy timeline — tablet */
@media (max-width: 768px) {
  html[lang="fr"] .timeline-table {
    font-size: 0.8rem;
  }
  html[lang="fr"] .timeline-table td {
    padding: 10px 8px;
    line-height: 1.3;
  }
}

/* FR snapshot timeline — mobile stacked layout */
@media (max-width: 480px) {
  .snapshot-item {
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 12px;
    align-items: flex-start;
  }
  .snapshot-date {
    font-size: 0.75rem;
    min-width: auto;
    width: 100%;
    margin-bottom: 2px;
  }
  .snapshot-body {
    flex: 1 1 100%;
    min-width: 0;
  }
  .snapshot-title {
    font-size: 0.8rem;
    line-height: 1.3;
  }
  .snapshot-detail {
    font-size: 0.75rem;
    line-height: 1.35;
    word-break: break-word;
  }
  .snapshot-impact {
    font-size: 0.75rem;
    white-space: normal;
    margin-top: 4px;
    width: 100%;
  }
}

/* Policy tree node pills - prevent overflow on mobile FR */
@media (max-width: 480px) {
  html[lang="fr"] .tree-node,
  html[lang="fr"] .policy-node,
  html[lang="fr"] [class*="tree"] .node-label {
    font-size: 0.75rem;
    padding: 6px 8px;
    word-break: break-word;
    white-space: normal;
    max-width: 140px;
  }
}

/* ============================================================
   TABLET (769-1024px): Mirror mobile layout — collapsed sidebar,
   bottom nav, hamburger. Chyron stays sticky (more screen space).
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Collapse the grid to single column like mobile */
  .app-shell { grid-template-columns: 1fr; }

  /* Sidebar: off-screen drawer (same as mobile) */
  .sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 0;
    width: 300px;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    will-change: transform;
    z-index: 9001;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,0.25);
  }
  .sidebar-close { display: flex; }
  .sidebar-header { justify-content: space-between; }
  .sidebar-overlay.active { display: block; }

  /* Main content fills full width */
  .main-content { grid-column: 1; }

  /* Show hamburger + bottom nav */
  .hamburger { display: flex; }
  .mobile-bottom-nav { display: flex; }

  /* Bottom-nav spacing */
  .content-scroll { padding-bottom: 80px !important; }
  .sidebar-footer { margin-bottom: 72px; }

  /* Hide desktop-only elements that mobile hides */
  .ai-status-pill { display: none; }
  .fab-container { display: none; }

  /* Banner offset for sidebar drawer — account for back-to-site bar (~28px) + demo banner (42px) */
  body.demo-banner-visible .sidebar {
    top: 70px !important;
    height: calc(100dvh - 70px);
  }
  body.demo-banner-visible .sidebar-overlay.active {
    top: 70px;
  }

  /* Bottom nav: full width, proper centering */
  .mobile-bottom-nav {
    left: 0;
    right: 0;
    width: 100%;
  }
}
