/* ============================================================
   BURNOUT PLATFORM — Design System & Styles
   
   Brand: Calm, supportive, psychologically safe
   Theme: Dark mode with warm accents
   Typography: Outfit (headings), Inter (body) from Google Fonts
   Icons: Lucide Icons (SVG) — NO emojis
   ============================================================ */

/* ── Theme Definitions ── */
:root {
  /* Core Colors — Light Mode (Warm, Engageable Slate/Cyan Base) */
  --bg-main: #f0f7f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  
  /* Brand Colors — Light Mode (Flare branding PDF exact values) */
  --bg-primary: #fdf8f6;
  --bg-secondary: #f5f0ed;
  --bg-card: #ffffff;
  --bg-card-hover: #fdf5f5;
  --bg-glass: rgba(255, 164, 168, 0.06);
  --bg-input: rgba(0, 0, 0, 0.04);

  /* Text — dark on white */
  --text-primary: #000000;
  --text-secondary: #40391c;
  --text-tertiary: rgba(64, 57, 28, 0.65);
  --text-muted: rgba(0, 0, 0, 0.45);

  /* Accent Colors — exact from branding PDF */
  --accent-primary: #ffa4a8;
  --accent-primary-light: rgba(255, 164, 168, 0.15);
  --accent-primary-dark: #e8888d;
  --accent-warm: #f2532e;
  --accent-warm-light: rgba(242, 83, 46, 0.12);
  --accent-green: #94ae73;
  --accent-green-light: rgba(148, 174, 115, 0.15);
  --accent-blue: #3b82f6;
  --accent-blue-light: rgba(59, 130, 246, 0.12);
  --accent-orange: #f97316;
  --accent-orange-light: rgba(249, 115, 22, 0.12);
  --accent-purple: #dee8ff;
  --accent-purple-light: rgba(222, 232, 255, 0.5);
  --accent-teal: #94ae73;
  --accent-teal-light: rgba(20, 184, 166, 0.12);
  --accent-red: #ef4444;
  --accent-red-light: rgba(239, 68, 68, 0.12);

  /* Level colors */
  --level-healthy: #94ae73;
  --level-warning: #f59e0b;
  --level-moderate: #f97316;
  --level-severe: #f2532e;

  /* Border */
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-light: rgba(0, 0, 0, 0.12);
  --border-color: var(--border-light);

  /* Shadows — soft as per branding PDF */
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 32px rgba(255, 164, 168, 0.25);

  /* Typography — Sora for display, Inter for UI, Noto Sans Arabic for Arabic */
  --font-heading: 'Sora', 'Noto Sans Arabic', sans-serif;
  --font-body: 'Inter', 'Noto Sans Arabic', sans-serif;
  --font-display: 'Sora', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark Mode — warm Flare branding ── */
[data-theme="dark"] .welcome-hero-card {
  background: linear-gradient(180deg, rgba(30, 22, 18, 0.92) 0%, rgba(24, 18, 14, 0.95) 100%);
  border-color: rgba(242, 83, 46, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0f0d0c;
  --bg-secondary: #181412;
  --bg-card: rgba(30, 22, 18, 0.75);
  --bg-card-hover: rgba(42, 30, 24, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.06);

  --text-primary: #f5ede8;
  --text-secondary: rgba(245, 237, 232, 0.68);
  --text-tertiary: rgba(245, 237, 232, 0.45);
  --text-muted: rgba(245, 237, 232, 0.38);

  --border-subtle: rgba(242, 83, 46, 0.08);
  --border-light: rgba(242, 83, 46, 0.14);
  --border-color: var(--border-light);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 36px rgba(242, 83, 46, 0.25);

  --accent-primary-light: rgba(242, 83, 46, 0.15);
  --card-bg: rgba(30, 22, 18, 0.75);
}

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

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  width: 100%;
}

/* Background gradient pattern */
body::before { display: none; }



/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-warm);
}

/* ── Language Switcher (base pass — i18n.css overrides) ── */
.language-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 10px;
  background: rgba(15, 22, 40, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.06);
}

.language-switcher:hover {
  background: rgba(255, 164, 168, 0.18);
  border-color: rgba(255, 164, 168, 0.5);
  color: #ffa4a8;
  box-shadow: 0 0 0 3px rgba(255, 164, 168, 0.12), 0 4px 20px rgba(255, 164, 168, 0.2);
  transform: translateY(-1px);
}

.language-switcher svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.language-switcher:hover svg {
  transform: rotate(20deg) scale(1.1);
}

[dir="rtl"] .language-switcher {
  right: auto;
  left: 16px;
}

/* ── Theme Toggle ── */
.theme-toggle {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 10px;
  background: rgba(15, 22, 40, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease, transform 0.2s ease, color 0.2s ease;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.06);
}

.theme-toggle:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1), 0 4px 20px rgba(245, 158, 11, 0.18);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: scale(0.96);
  box-shadow: none;
}

.theme-toggle:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.9;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.theme-toggle:hover svg {
  transform: rotate(30deg) scale(1.15);
  opacity: 1;
}

/* When in light mode: flip glow to moon/indigo */
[data-theme="light"] .theme-toggle:hover {
  background: rgba(255, 164, 168, 0.12);
  border-color: rgba(255, 164, 168, 0.4);
  color: #ffa4a8;
  box-shadow: 0 0 0 3px rgba(255, 164, 168, 0.1), 0 4px 20px rgba(255, 164, 168, 0.15);
}

[data-theme="light"] .theme-toggle:hover svg {
  transform: rotate(-20deg) scale(1.1);
}

[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(15, 23, 42, 0.8);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.9);
}

[dir="rtl"] .theme-toggle {
  right: auto;
  left: 16px;
}

/* Mobile: icon only */
@media (max-width: 520px) {
  .theme-toggle {
    padding: 9px;
    gap: 0;
  }
  .theme-toggle span {
    display: none;
  }
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
  .theme-toggle,
  .language-switcher {
    top: 12px;
  }
  .theme-toggle {
    top: 62px;
  }
}

/* ── Light Mode Specific Overrides ── */
[data-theme="light"] .card,
[data-theme="light"] .card-flat {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .welcome-logo {
  filter: drop-shadow(0 6px 28px rgba(255, 164, 168, 0.4));
}

[data-theme="light"] .btn-primary {
  box-shadow: 0 4px 15px rgba(255, 164, 168, 0.30);
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 6px 25px rgba(255, 164, 168, 0.40);
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  box-sizing: border-box;
}

@media (max-width: 400px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.screen {
  display: none !important;
  min-height: 100dvh;
  position: relative;
  width: 100%;
  z-index: 1;
  padding: calc(var(--space-3xl) + env(safe-area-inset-top, 0px)) 0 calc(var(--space-3xl) + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
  overflow-y: visible;
  animation: fadeSlideIn 0.3s ease forwards;
  background: var(--bg-primary);
  visibility: hidden;
  opacity: 0;
}

.screen.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 4px 16px rgba(255, 164, 168, 0.30)); }
  50% { filter: drop-shadow(0 6px 28px rgba(255, 164, 168, 0.50)); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: slideUp 0.5s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }
.animate-delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ── Glass Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-flat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 13px 26px;
  border: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

/* Shimmer disabled — was causing white overlay in light mode */
.btn::before {
  display: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* ── Primary — vivid gradient pill ── */
.btn-primary {
  background: #f2532e;
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(255, 164, 168, 0.30), 0 1px 3px rgba(0,0,0,0.12);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(242,83,46,0.30), 0 2px 6px rgba(0,0,0,0.10);
  background: #d9441e;
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(255, 164, 168, 0.3);
}

/* ── Secondary — glassy bordered pill ── */
.btn-secondary {
  background: #ffffff;
  color: #f2532e;
  border: 1.5px solid #ffa4a8;
}

.btn-secondary:hover {
  background: rgba(255, 164, 168, 0.08);
  border-color: #f2532e;
  color: #f2532e;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(242, 83, 46, 0.15);
}

.btn-secondary:active {
  transform: scale(0.97);
}

[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #ffa4a8;
  border-color: rgba(255, 164, 168, 0.30);
}
[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 164, 168, 0.12);
  border-color: #ffa4a8;
  color: #ffa4a8;
}

/* ── Ghost — minimal text pill ── */
.btn-ghost {
  background: transparent;
  color: #40391c;
  padding: 10px 20px;
  border: 1.5px solid transparent;
}

.btn-ghost:hover {
  color: #1a1008;
  background: rgba(255, 164, 168, 0.08);
  border-color: rgba(255, 164, 168, 0.25);
}

[data-theme="dark"] .btn-ghost {
  color: rgba(232, 237, 245, 0.65);
}
[data-theme="dark"] .btn-ghost:hover {
  color: #e8edf5;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ── Large variant ── */
.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.btn i, .btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.btn:hover i,
.btn:hover svg {
  transform: translateX(2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Icon Wrapper ── */
.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.icon-wrapper.sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.icon-wrapper.lg {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
}

.icon-wrapper i, .icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.icon-wrapper.sm i, .icon-wrapper.sm svg {
  width: 18px;
  height: 18px;
}

.icon-wrapper.lg i, .icon-wrapper.lg svg {
  width: 32px;
  height: 32px;
}

/* ── Welcome Screen ── */
#welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-xl) 0;
}

.welcome-content {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.welcome-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  animation: fadeIn 0.6s ease;
}

/* ── Welcome brand logo ── */
.welcome-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.welcome-logo-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoFloat 4s ease-in-out infinite;
}

.welcome-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,164,168,0.22) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
}

.welcome-logo-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(255, 100, 80, 0.35));
  animation: logoFloat 4s ease-in-out infinite;
  display: block;
}

.welcome-app-name {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.welcome-brand-name {
  font-family: 'Sora', 'Noto Sans Arabic', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 auto;
  text-align: center;
  letter-spacing: -0.02em;
}

/* ── Logo float animation ── */
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(1deg); }
  75% { transform: translateY(4px) rotate(-1deg); }
}

/* ── Phosphor icon sizing overrides ── */
.ph, [class^="ph-"], [class*=" ph-"] {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav .ph, .bottom-nav [class^="ph-"] {
  font-size: 1.5rem;
  display: block;
}

/* ── Heading typography ── */
h1, h2, h3 {
  font-family: 'Sora', 'Noto Sans Arabic', sans-serif;
  letter-spacing: -0.02em;
}
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 {
  font-family: 'Noto Sans Arabic', sans-serif;
  letter-spacing: 0;
}

/* ── Body typography ── */
body {
  font-family: var(--font-body);
}

/* ── Welcome screen logo (old selectors kept for compat) ── */
.welcome-logo {
  width: 200px;
  height: 200px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-title {
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.welcome-hero-card {
  width: min(100%, 860px);
  margin: 0 auto var(--space-2xl);
  padding: clamp(24px, 5vw, 40px);
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,248,246,0.92) 100%);
  border: 1px solid rgba(242, 83, 46, 0.10);
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(20, 24, 40, 0.08);
}

.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  margin-bottom: var(--space-md);
  border-radius: 999px;
  background: rgba(242, 83, 46, 0.10);
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-subtitle {
  font-size: 1.15rem;
  color: var(--text-primary);
  max-width: 700px;
  margin: 0 auto var(--space-lg);
  line-height: 1.85;
  font-weight: 600;
}

.welcome-description {
  max-width: 720px;
  margin: 0 auto var(--space-2xl);
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 1rem;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.welcome-feature {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-base);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.welcome-feature::before { display: none; }

.welcome-feature:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.welcome-feature:hover::before {
  left: 100%;
}

.welcome-feature .icon-wrapper {
  margin: 0 auto var(--space-md);
}

.welcome-feature h4 {
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
}

.welcome-feature p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.welcome-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(222, 232, 255, 0.5);
  border: 1px solid rgba(148, 174, 115, 0.20);
  border-radius: var(--radius-md);
  margin-top: var(--space-xl);
  text-align: left;
}

.welcome-disclaimer i, .welcome-disclaimer svg {
  width: 18px;
  height: 18px;
  color: #94ae73;
  flex-shrink: 0;
  margin-top: 2px;
}

.welcome-disclaimer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Education Screen ── */
.education-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.education-header .icon-wrapper {
  margin: 0 auto var(--space-lg);
}

.education-section {
  margin-bottom: var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-header .icon-wrapper {
  flex-shrink: 0;
}

.education-highlight {
  padding: var(--space-lg) var(--space-xl);
  background: var(--accent-primary-light);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.education-details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.education-details li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.education-details li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}

/* Dimensions cards in education */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.dimension-card {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.dimension-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dimension-card .icon-wrapper {
  margin-bottom: var(--space-md);
}

.dimension-card h4 {
  margin-bottom: var(--space-sm);
}

.dimension-card p {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Comparison table */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-md);
}

.comparison-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.comparison-table th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-light);
}

.comparison-table td {
  padding: var(--space-md) var(--space-lg);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.comparison-table tr:hover td {
  background: var(--bg-glass);
}

.comparison-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Warning signs */
.warning-signs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.warning-category {
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.warning-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.warning-category-header h4 {
  font-size: 0.95rem;
}

.warning-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.warning-list li {
  font-size: 0.83rem;
  color: var(--text-secondary);
  padding-left: var(--space-md);
  position: relative;
  line-height: 1.5;
}

.warning-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-warm);
}

/* Risks grid */
.risks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.risk-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.risk-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.risk-card .icon-wrapper {
  flex-shrink: 0;
}

.risk-card h4 {
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.risk-card p {
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Education warning box */
.education-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  background: rgba(233, 69, 96, 0.06);
  border: 1px solid rgba(233, 69, 96, 0.15);
  border-radius: var(--radius-md);
  margin-top: var(--space-lg);
}

.education-warning i, .education-warning svg {
  color: var(--accent-primary);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.education-warning p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.education-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-3xl);
}

/* ── Assessment Screen ── */
.assessment-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

/* Progress bar */
.progress-wrapper {
  margin-bottom: var(--space-2xl);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-text strong {
  color: var(--text-primary);
}

.progress-percentage {
  font-weight: 600;
  color: var(--accent-primary);
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: #ffa4a8;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -4px;
  width: 14px;
  height: 14px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(233, 69, 96, 0.4);
}

.progress-glow {
  position: absolute;
  top: -8px;
  width: 20px;
  height: 22px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.3), transparent);
  border-radius: 50%;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.progress-dimensions {
  display: flex;
  gap: 6px;
  margin-top: var(--space-md);
  justify-content: center;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all var(--transition-base);
}

.progress-dot.upcoming {
  background: rgba(255, 255, 255, 0.1);
}

.progress-dot.active {
  background: var(--accent-primary);
  box-shadow: 0 0 8px rgba(233, 69, 96, 0.4);
  transform: scale(1.3);
}

.progress-dot.completed {
  background: var(--accent-green);
}

/* Question card */
.question-container {
  max-width: 640px;
  margin: 0 auto;
}

.question-dimension-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.question-dimension-badge i, .question-dimension-badge svg {
  width: 14px;
  height: 14px;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  animation: scaleIn 0.3s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s var(--transition-base);
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.question-text {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: var(--space-2xl);
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

/* Response options */
.response-options {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.response-option {
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  padding: var(--space-md) var(--space-sm);
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--transition-base);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.response-option:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--accent-primary-light);
  transform: translateY(-2px);
}

.response-option.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  font-weight: 600;
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.question-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2xl);
}

/* ── Results Screen ── */
.results-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.results-level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: var(--radius-xl);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-lg);
}

.results-level-badge i, .results-level-badge svg {
  width: 20px;
  height: 20px;
}

.results-description {
  text-align: center;
  max-width: 600px;
  margin: var(--space-lg) auto var(--space-2xl);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}
@media (max-width: 640px) {
  .results-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  #score-ring { display: flex; justify-content: center; }
  .results-score-section, .results-chart-section { align-items: center; }
}

.results-chart-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-chart-section h3 {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.results-score-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-score-section h3 {
  margin-bottom: var(--space-lg);
  text-align: center;
}

/* Dimension bars */
.dimension-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  margin-top: var(--space-xl);
}

.dimension-bar-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.dimension-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dimension-bar-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  font-weight: 500;
}

.dimension-bar-label i, .dimension-bar-label svg {
  width: 16px;
  height: 16px;
}

.dimension-bar-score {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.dimension-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.dimension-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top concerns & strengths */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.insight-card {
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.insight-card h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.insight-card h3 i, .insight-card h3 svg {
  width: 20px;
  height: 20px;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: var(--bg-glass);
}

.insight-item .icon-wrapper {
  width: 36px;
  height: 36px;
}

.insight-item-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
}

.insight-item-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
}

.results-nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-3xl);
}

.results-nav .btn {
  min-width: min(280px, 100%);
  justify-content: center;
}

/* ── Results Action Plan Preview ── */
.results-action-plan {
  margin: var(--space-3xl) auto;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.results-ap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.results-ap-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  margin: 0;
}

.results-ap-tasks {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.results-ap-task {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.results-ap-task:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}

.results-ap-task.task-done {
  opacity: 0.65;
  background: var(--bg-tertiary);
}

.results-ap-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.results-ap-check.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.results-ap-check i, .results-ap-check svg {
  width: 14px;
  height: 14px;
  color: var(--border-color);
}

.results-ap-check.checked i,
.results-ap-check.checked svg {
  color: white;
}

.results-ap-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.results-ap-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.results-ap-task.task-done .results-ap-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.results-ap-freq {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ── Guidance Screen ── */
.guidance-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.guidance-level-summary {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2xl);
}

.guidance-level-summary .icon-wrapper {
  width: 56px;
  height: 56px;
}

.guidance-level-text h3 {
  margin-bottom: var(--space-xs);
}

.guidance-level-text p {
  font-size: 0.9rem;
}

.guidance-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  margin-top: var(--space-2xl);
}

.guidance-category-header h3 {
  font-size: 1.1rem;
}

.guidance-category-header i, .guidance-category-header svg {
  width: 22px;
  height: 22px;
  color: var(--accent-primary);
}

.guidance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.guidance-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.guidance-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.guidance-card .icon-wrapper {
  flex-shrink: 0;
}

.guidance-card-content h4 {
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.guidance-card-content p {
  font-size: 0.83rem;
  line-height: 1.6;
}

.guidance-card-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ── Habits Screen ── */
.habits-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.habits-grid {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.habit-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.habit-card:hover {
  border-color: var(--border-light);
  transform: translateX(4px);
}

.habit-card .icon-wrapper {
  flex-shrink: 0;
}

.habit-info {
  flex: 1;
}

.habit-info h4 {
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.habit-info p {
  font-size: 0.82rem;
  line-height: 1.5;
}

.habit-time {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent-primary);
  padding: 4px 12px;
  background: var(--accent-primary-light);
  border-radius: var(--radius-xl);
  white-space: nowrap;
}

.habits-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}

/* ── Reassess Screen ── */
#reassess {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.reassess-content {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.reassess-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.reassess-content h2 {
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
}

.reassess-content p {
  margin: 0 auto var(--space-2xl);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.reassess-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

.reassess-btn-main {
  width: 100%;
  justify-content: center;
}

.reassess-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding-top: var(--space-sm);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-base);
}

.btn-link i, .btn-link svg {
  width: 14px;
  height: 14px;
}

.btn-link:hover {
  color: var(--text-primary);
}

.reassess-divider {
  color: var(--border-light);
  font-size: 1rem;
  user-select: none;
}

/* ── Disclaimer footer ── */
.disclaimer-footer {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(52, 152, 219, 0.05);
  border: 1px solid rgba(52, 152, 219, 0.1);
  border-radius: var(--radius-md);
  margin-top: var(--space-3xl);
}

.disclaimer-footer i, .disclaimer-footer svg {
  width: 16px;
  height: 16px;
  color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 2px;
}

.disclaimer-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .screen {
    padding: var(--space-2xl) 0;
  }

  .welcome-features {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    font-size: 0.78rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: var(--space-sm) var(--space-md);
  }

  .dimensions-grid {
    grid-template-columns: 1fr;
  }

  .warning-signs-grid {
    grid-template-columns: 1fr;
  }

  .risks-grid {
    grid-template-columns: 1fr;
  }

  .guidance-cards {
    grid-template-columns: 1fr;
  }

  .response-options {
    flex-direction: row;
    gap: 6px;
  }

  .response-option {
    min-width: 60px;
    padding: var(--space-sm) var(--space-xs);
    font-size: 0.78rem;
  }

  .question-text {
    font-size: 1.05rem;
  }

  .guidance-level-summary {
    flex-direction: column;
    text-align: center;
  }

  .habit-card {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }

  .card {
    padding: var(--space-lg);
  }

  .question-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
  }
}


/* ============================================================
   PWA SPECIFIC STYLES
   ============================================================ */

/* PWA Install Button */
.pwa-install-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(233, 69, 96, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-install-btn.show {
  transform: translateY(0);
  opacity: 1;
}

.pwa-install-btn:hover {
  background: #ff5571;
  box-shadow: 0 12px 32px rgba(233, 69, 96, 0.5);
  transform: translateY(-2px);
}

.pwa-install-btn:active {
  transform: translateY(0);
}

.pwa-install-btn svg {
  width: 20px;
  height: 20px;
}

/* PWA Update Notification */
.pwa-update-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-update-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.pwa-update-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.pwa-update-content svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.pwa-update-content span {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.pwa-update-btn {
  padding: 8px 16px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pwa-update-btn:hover {
  background: #ff5571;
}

.pwa-dismiss-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.pwa-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Connection Status Bar */
.connection-status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.connection-status.show {
  transform: translateY(0);
}

.connection-status.online {
  background: var(--accent-green);
  color: white;
}

.connection-status.offline {
  background: var(--accent-warm);
  color: white;
}

/* PWA Mode Adjustments */
.pwa-mode {
  /* Add safe area insets for notched devices */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.pwa-mode body {
  /* Prevent overscroll bounce on iOS */
  overscroll-behavior-y: contain;
}

/* Offline Mode Indicator */
.offline-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-warm);
  z-index: 9998;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Mobile Responsive Adjustments for PWA */
@media (max-width: 768px) {
  .pwa-install-btn {
    bottom: calc(78px + env(safe-area-inset-bottom));
    right: 16px;
    padding: 12px 18px;
    font-size: 14px;
    max-width: calc(100vw - 32px);
  }
  
  .pwa-update-notification {
    top: 16px;
    right: 16px;
    left: 16px;
  }
  
  .pwa-update-content {
    padding: 14px 16px;
    font-size: 13px;
  }
}

/* Landscape Mode on Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pwa-install-btn {
    bottom: 12px;
    right: 12px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .pwa-install-btn {
    bottom: 20px;
    right: 20px;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .pwa-install-btn {
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.35);
  }
}

/* Dark Mode Support (already dark, but for future light mode) */
@media (prefers-color-scheme: light) {
  /* Future light mode styles */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .pwa-install-btn,
  .pwa-update-notification,
  .connection-status {
    transition: none;
  }
  
  .offline-mode::before {
    animation: none;
  }
}

/* Print Styles */
@media print {
  .pwa-install-btn,
  .pwa-update-notification,
  .connection-status {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   NEW ASSESSMENT UI — Question Cards, Options, Progress
   ══════════════════════════════════════════════════════════ */

/* ── Assessment Dimension Progress Dots ── */
.assessment-dimension-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-md) 0;
}

.dim-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.dim-progress-dot.completed {
  background: var(--accent-primary);
  box-shadow: 0 0 8px rgba(255, 164, 168, 0.5);
  transform: scale(1.1);
}

.dim-progress-dot.active {
  background: var(--accent-warm);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  transform: scale(1.3);
}

/* ── Assessment Dimension Badge ── */
.assessment-dim-badge {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-base);
}

.dim-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dim-badge-icon i,
.dim-badge-icon svg {
  width: 22px;
  height: 22px;
}

.dim-badge-text {
  text-align: start;
}

.dim-badge-text h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.3;
}

.dim-badge-text p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}

/* ── New Question Card ── */
.new-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
  animation: scaleIn 0.3s ease;
}

.new-question-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.new-question-counter {
  display: inline-flex;
  padding: 4px 14px;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  font-family: var(--font-body);
  letter-spacing: 0.3px;
}

.new-question-subtitle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
  font-style: italic;
}

.new-question-subtitle i,
.new-question-subtitle svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.new-question-text {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: var(--space-2xl);
  font-family: var(--font-heading);
}

/* ── New Response Options ── */
.new-response-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.new-response-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: start;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.new-response-option::before { display: none; }

.new-response-option:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--accent-primary-light);
  transform: translateX(-4px);
  box-shadow: 0 4px 16px rgba(255, 164, 168, 0.2);
}

[dir="ltr"] .new-response-option:hover {
  transform: translateX(4px);
}

/* hover::before removed — was overlaying text */

.new-response-option.selected {
  border-color: #ffa4a8;
  background: #ffa4a8;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(255, 164, 168, 0.25), 0 4px 20px rgba(255, 164, 168, 0.2);
  transform: translateX(-4px);
}

[dir="ltr"] .new-response-option.selected {
  transform: translateX(4px);
}

.option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  position: relative;
}

.new-response-option:hover .option-radio {
  border-color: var(--accent-primary);
}

.new-response-option.selected .option-radio {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.new-response-option.selected .option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  display: block;
}


/* Dark mode: make unselected options clearly distinct */
[data-theme="dark"] .new-response-option {
  border-color: rgba(245, 237, 232, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}
[data-theme="dark"] .option-radio {
  border-color: rgba(245, 237, 232, 0.35);
  background: transparent;
}
[data-theme="dark"] .new-response-option:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
}
[data-theme="dark"] .new-response-option.selected {
  border-color: #ffa4a8;
  background: rgba(255, 164, 168, 0.25);
  color: #ffa4a8;
}
[data-theme="dark"] .new-response-option.selected .option-radio {
  border-color: #ffa4a8;
  background: #ffa4a8;
}

/* ══════════════════════════════════════════════════════════
   NEW RESULTS UI — Dimension Cards, Bars, Advice
   ══════════════════════════════════════════════════════════ */

.new-results-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

/* ── Overall Score Summary Card ── */
.overall-score-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.overall-score-summary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 164, 168, 0.08), transparent 70%);
  pointer-events: none;
}

.overall-score-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
}

.overall-score-value {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-sm);
  filter: drop-shadow(0 0 20px currentColor);
}

.overall-score-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

/* ── Dimension Result Card ── */
.dim-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  animation: scaleIn 0.4s ease backwards;
}

.dim-result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}

/* ── Dimension Result Header ── */
.dim-result-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.dim-result-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.dim-result-card:hover .dim-result-icon {
  transform: scale(1.1);
}

.dim-result-icon i,
.dim-result-icon svg {
  width: 26px;
  height: 26px;
}

.dim-result-info {
  flex: 1;
  min-width: 0;
}

.dim-result-info h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 var(--space-xs);
  color: var(--text-primary);
}

.dim-result-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.3px;
}

.dim-result-level i,
.dim-result-level svg {
  width: 13px;
  height: 13px;
}

/* ── Dimension Score Bar ── */
.dim-score-bar {
  margin-bottom: var(--space-lg);
}

.dim-score-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.score-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.score-value {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.dim-score-bar-track {
  height: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.dim-score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 12px rgba(255, 164, 168, 0.4);
}

.dim-score-bar-fill::after { display: none; /* shimmer removed — was overlaying bar */ }

/* ── Dimension Advice Section ── */
.dim-advice-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-lg);
  margin-top: var(--space-md);
}

.dim-advice-section h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.dim-advice-section h4 i,
.dim-advice-section h4 svg {
  width: 18px;
  height: 18px;
}

.dim-advice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.dim-advice-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.advice-bullet {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.advice-bullet i,
.advice-bullet svg {
  width: 14px;
  height: 14px;
}

/* ── Responsive for new assessment & results ── */
@media (max-width: 640px) {
  .new-question-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .new-question-text {
    font-size: 1.05rem;
  }

  .new-response-option {
    padding: var(--space-md);
    font-size: 0.9rem;
  }

  .overall-score-value {
    font-size: 3rem;
  }

  .dim-result-card {
    padding: var(--space-lg);
  }

  .assessment-dim-badge {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════
   BURNOUT CONTEXT CARD — Empathy, WHO Notes, Actions, Crisis
   ══════════════════════════════════════════════════════════ */

.burnout-context-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-inline-start: 4px solid var(--ctx-color, #ffa4a8);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.burnout-context-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(255, 164, 168, 0.05), transparent 60%);
  pointer-events: none;
}

.burnout-ctx-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.burnout-ctx-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.burnout-ctx-icon-wrap i,
.burnout-ctx-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.burnout-ctx-headline {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  flex: 1;
}

.burnout-ctx-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: none;
}

/* WHO / Research note */
.burnout-who-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.burnout-who-note i,
.burnout-who-note svg {
  width: 18px;
  height: 18px;
  color: #60a5fa;
  flex-shrink: 0;
  margin-top: 2px;
}

.burnout-who-note p {
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-style: italic;
  max-width: none;
}

/* Actions list */
.burnout-actions {
  margin-bottom: var(--space-xl);
}

.burnout-actions-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.burnout-actions-label i,
.burnout-actions-label svg {
  width: 17px;
  height: 17px;
}

.burnout-actions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.burnout-actions-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.burnout-action-bullet {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.burnout-action-bullet i,
.burnout-action-bullet svg {
  width: 15px;
  height: 15px;
}

/* Hope / recovery message */
.burnout-hope-message {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.burnout-hope-message i,
.burnout-hope-message svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.burnout-hope-message p {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: none;
  font-style: italic;
}

/* Crisis box */
.burnout-crisis-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
}

.burnout-crisis-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.burnout-crisis-header i,
.burnout-crisis-header svg {
  width: 20px;
  height: 20px;
  color: #f87171;
}

.burnout-crisis-header h4 {
  font-size: 0.95rem;
  color: #f87171;
}

.burnout-crisis-box > p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  max-width: none;
}

.crisis-resources {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.crisis-resource {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.crisis-resource i,
.crisis-resource svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.crisis-resource strong {
  color: var(--text-primary);
  word-break: break-all;
  font-size: 0.78rem;
}

/* ── Science facts strip ── */
.burnout-science-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.science-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
  min-width: 220px;
  backdrop-filter: blur(10px);
}

.science-pill i,
.science-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Section divider ── */
.results-section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-sm) 0;
}

.results-section-divider::before,
.results-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.results-section-divider span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  white-space: nowrap;
  font-family: var(--font-body);
}

/* ── Progress bar shimmer animation ── */
@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Light mode adjustments ── */
[data-theme="light"] .burnout-context-card {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .burnout-who-note {
  background: rgba(148, 196, 115, 0.05);
}

[data-theme="light"] .science-pill {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(255, 164, 168, 0.08);
  border-color: rgba(255, 164, 168, 0.4);
  color: #ffa4a8;
}

[data-theme="light"] .btn-ghost {
  color: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .btn-ghost:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Responsive burnout context card */
@media (max-width: 640px) {
  .burnout-context-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .burnout-ctx-header {
    flex-direction: column;
    gap: var(--space-md);
  }

  .burnout-ctx-headline {
    font-size: 1rem;
  }

  .burnout-science-strip {
    flex-direction: column;
  }

  .science-pill {
    min-width: unset;
  }
}

/* ══════════════════════════════════════════════════════════
   SCROLL-REVEAL SYSTEM — Engage as user scrolls
   ══════════════════════════════════════════════════════════ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.19, 1, 0.22, 1),
              transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: opacity, transform;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: none;
}

/* Stagger transition delays */
.sd-1 { transition-delay: 0.04s; }
.sd-2 { transition-delay: 0.10s; }
.sd-3 { transition-delay: 0.16s; }
.sd-4 { transition-delay: 0.22s; }
.sd-5 { transition-delay: 0.28s; }
.sd-6 { transition-delay: 0.34s; }
.sd-7 { transition-delay: 0.40s; }
.sd-8 { transition-delay: 0.46s; }

/* ── Bar grows when its card scrolls into view ── */
.scroll-reveal .dim-score-bar-fill {
  width: 0% !important;
  transition: width 1.1s cubic-bezier(0.19, 1, 0.22, 1) 0.15s;
}

.scroll-reveal.revealed .dim-score-bar-fill {
  width: var(--bar-target, 0%) !important;
}

/* ── Action bullet hover bounce ── */
.burnout-action-bullet {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.burnout-actions-list li:hover .burnout-action-bullet {
  transform: scale(1.15) rotate(12deg);
}

/* ── Science pill hover lift ── */
.science-pill:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ── Crisis box border pulse ── */
.burnout-crisis-box.pulse {
  animation: crisisPulse 2.5s ease-in-out infinite;
}

@keyframes crisisPulse {
  0%, 100% {
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: none;
  }
  50% {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.08);
  }
}

/* ── Overall score value — count-up animation readiness ── */
.overall-score-value {
  font-variant-numeric: tabular-nums;
  transition: color 0.5s ease;
}

/* ── Responsive: welcome features 3→2→1 col ── */
@media (max-width: 1024px) and (min-width: 600px) {
  .welcome-features {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 599px) {
  .welcome-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .welcome-features {
    grid-template-columns: 1fr;
  }
}

/* ── Light mode: respect reduced transparency ── */
[data-theme="light"] .burnout-context-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ── Prefers-reduced-motion: disable non-essential animation ── */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    transition: opacity 0.01s;
    transform: none;
  }
  .scroll-reveal.revealed {
    opacity: 1;
  }
  .burnout-crisis-box.pulse {
    animation: none;
  }
  .burnout-action-bullet {
    transition: none;
  }
}

/* ═══════════════════════════════════════════════════════
   RECOVERY PRACTICES GRID
   ═══════════════════════════════════════════════════════ */

.recovery-practices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.practice-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: transform 200ms ease, box-shadow 200ms ease;
  backdrop-filter: blur(16px);
}

.practice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.practice-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.practice-icon i,
.practice-icon svg {
  width: 20px;
  height: 20px;
}

.practice-content {
  flex: 1;
  min-width: 0;
}

.practice-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
  font-family: var(--font-heading);
}

.practice-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════
   DIM VALIDATION MESSAGE
   (empathy note at top of each dimension result card)
   ═══════════════════════════════════════════════════════ */

.dim-validation-message {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}

.dim-validation-message i,
.dim-validation-message svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.dim-validation-message p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   WHAT NOT TO DO SECTION
   ═══════════════════════════════════════════════════════ */

.what-not-to-do-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.what-not-to-do-section h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
  font-family: var(--font-heading);
}

.what-not-to-do-section h4 i,
.what-not-to-do-section h4 svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mistake-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mistake-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.mistake-bullet {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mistake-bullet i,
.mistake-bullet svg {
  width: 12px;
  height: 12px;
}

/* ═══════════════════════════════════════════════════════
   SEEK HELP CARD
   (shown for critical-tier dimensions)
   ═══════════════════════════════════════════════════════ */

.seek-help-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding: var(--space-lg) var(--space-xl);
  background: rgba(239, 68, 68, 0.06);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
}

.seek-help-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.seek-help-icon i,
.seek-help-icon svg {
  width: 22px;
  height: 22px;
}

.seek-help-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ef4444;
  margin: 0 0 6px;
  font-family: var(--font-heading);
}

.seek-help-content p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — New Result Sections
   ═══════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .recovery-practices-grid {
    grid-template-columns: 1fr;
  }

  .practice-card {
    padding: var(--space-md);
  }

  .seek-help-card {
    flex-direction: column;
    gap: var(--space-md);
  }
}

[data-theme="light"] .practice-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

[data-theme="light"] .seek-help-card {
  background: rgba(239, 68, 68, 0.04);
}

/* ── Habit Selection ──────────────────────────────────────────── */
.habits-select-hint {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--accent-primary-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

.habits-progress-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.habits-progress-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.habits-progress-bar-wrap {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
}

.habits-progress-bar-fill {
  height: 100%;
  background: var(--accent-green, #22c55e);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.habits-section-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.habits-select-hint p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.habit-check-circle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.habit-check-circle.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.habit-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}

.habit-card:active {
  transform: scale(0.98);
}

.habit-selected {
  border-color: var(--accent-green) !important;
  background: rgba(46, 204, 113, 0.06) !important;
}

.my-plan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

.my-plan-bar-info {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.my-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.my-plan-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.my-plan-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

/* ── Guidance dimension blocks ────────────────────────────────── */
.guidance-dim-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.guidance-dim-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.guidance-dim-header h4 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 1rem;
}

.dim-result-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 600;
}

.guidance-validation-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid;
  font-size: 0.9rem;
}

.guidance-validation-note i {
  flex-shrink: 0;
  margin-top: 2px;
}

.guidance-validation-note p {
  margin: 0;
  line-height: 1.55;
  color: var(--text-secondary);
}

.guidance-level-text h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
}

.guidance-level-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.guidance-advice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.guidance-advice-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

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

.advice-bullet i {
  width: 12px;
  height: 12px;
}

.guidance-avoid-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-md);
}

.guidance-avoid-section h5 {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 0 var(--space-sm) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.mistake-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.mistake-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.mistake-bullet {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.mistake-bullet i {
  width: 10px;
  height: 10px;
}

/* ── Profile / Settings ───────────────────────────────────────── */
.profile-section {
  border: 2px solid var(--accent-primary)22;
}

.column-item {
  flex-direction: column;
  align-items: flex-start !important;
  gap: var(--space-sm) !important;
}

.setting-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.setting-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.btn-sm {
  padding: var(--space-xs) var(--space-lg);
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

.profile-welcome-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 30px;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: var(--space-xs);
}

/* ── Auth Screen ─────────────────────────────────────────────── */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header .icon-wrapper {
  margin: 0 auto var(--space-md);
}

.auth-header p {
  margin: var(--space-sm) auto 0;
}

.auth-content {
  max-width: 640px;
  margin: 0 auto;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: #ffa4a8;
  color: #ffffff;
}

.auth-alert {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.auth-alert.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.auth-alert.success {
  background: rgba(148, 174, 115, 0.12);
  border-color: rgba(148, 174, 115, 0.30);
  color: #3d6b25;
}

.auth-alert.warning {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
}

.auth-alert.error {
  background: rgba(242, 83, 46, 0.10);
  border-color: rgba(242, 83, 46, 0.25);
  color: #b91c1c;
}

[data-theme="light"] .auth-alert.info {
  color: #1d4ed8;
}

[data-theme="light"] .auth-alert.success {
  color: #166534;
}

[data-theme="light"] .auth-alert.warning {
  color: #92400e;
}

[data-theme="light"] .auth-alert.error {
  color: #b91c1c;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-field.hidden {
  display: none;
}

.auth-field label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: #1a1008;
  font-size: 0.95rem;
  font-family: var(--font-body);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.auth-user-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.auth-user-summary h4 {
  margin: 0;
}

.auth-user-summary p {
  margin: 0;
}

.auth-verify-state {
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-verify-state.ok {
  color: var(--accent-green);
}

.auth-verify-state.warn {
  color: var(--accent-warm);
}

.auth-actions-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.auth-nav {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
}

@media (max-width: 640px) {
  .auth-card {
    padding: var(--space-md);
  }

  .auth-actions-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════════════
   ONBOARDING SCREEN
   ══════════════════════════════════════════════════════════════ */

#onboarding {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Animated background blobs */
.onboarding-bg-decoration { display: none; }

.ob-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: blobFloat 12s ease-in-out infinite;
}

.ob-blob-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  top: -120px;
  left: -100px;
  animation-delay: 0s;
}

.ob-blob-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-purple);
  bottom: -80px;
  right: -60px;
  animation-delay: -4s;
}

.ob-blob-3 {
  width: 220px;
  height: 220px;
  background: var(--accent-warm);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
}

@keyframes blobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  33%       { transform: translateY(-30px) scale(1.05); }
  66%       { transform: translateY(20px) scale(0.97); }
}

.ob-blob-3 {
  animation-name: blobFloat3;
}

@keyframes blobFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-50%, -60%) scale(1.1); }
}

/* Wrapper */
.onboarding-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--space-xl) + env(safe-area-inset-top, 0px) + 16px) var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  min-height: 100dvh;
  justify-content: center;
}

/* Skip button */
.onboarding-skip {
  position: fixed;
  top: calc(var(--safe-area-top, 0px) + var(--space-sm));
  left: var(--space-lg);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: color var(--transition-base), background var(--transition-base);
  z-index: 1201;
}

[dir="ltr"] .onboarding-skip {
  left: auto;
  right: var(--space-lg);
}

.onboarding-skip:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* Step container */
.onboarding-step {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

/* Tag pill */
.onboarding-tag {
  display: inline-block;
  padding: 5px 18px;
  border-radius: 30px;
  background: rgba(242, 83, 46, 0.12);
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Feature icon (new onboarding steps) */
.ob-feature-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 4px;
  flex-shrink: 0;
}

/* 8-dimension chips grid */
.ob-dims-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}
.ob-dim-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Exercise list (relaxation step) */
.ob-exercises-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.ob-exercise-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  text-align: start;
}
.ob-exercise-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Ready check icon */
.ob-ready-icon {
  display: flex; align-items: center; justify-content: center;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(242,83,46,0.1);
  margin: 0 auto 8px;
}

/* Hero step specific */
.onboarding-hero-logo {
  width: 180px;
  height: 180px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  animation: logoFloat 4s ease-in-out infinite;
}

.onboarding-hero-logo::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,164,168,0.18) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
}

.onboarding-logo-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 8px 28px rgba(242, 83, 46, 0.3));
  display: block;
  position: relative;
  z-index: 1;
}

.onboarding-hero-logo i,
.onboarding-hero-logo svg {
  width: 80px;
  height: 80px;
  color: white;
  position: relative;
  z-index: 1;
}

.onboarding-hero-title {
  font-family: 'Sora', 'Noto Sans Arabic', sans-serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.15;
}

.onboarding-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.65;
  margin: 0;
}

/* Stat row */
.onboarding-stat-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 16px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  margin: var(--space-sm) 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.onboarding-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.onboarding-stat-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: #f2532e;
  line-height: 1;
}

.onboarding-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
}

/* CTA button */
.onboarding-cta {
  min-width: 220px;
  justify-content: center;
  margin-top: var(--space-sm);
}

.onboarding-explore-btn {
  margin-top: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Step titles */
.onboarding-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.onboarding-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.6;
  margin: 0;
}

/* Symptom cards */
.onboarding-symptoms {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.onboarding-symptom-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: start;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.onboarding-symptom-card:hover {
  border-color: var(--border-light);
  transform: translateX(-3px);
}

[dir="ltr"] .onboarding-symptom-card:hover {
  transform: translateX(3px);
}

.onboarding-symptom-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent-primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-symptom-icon i,
.onboarding-symptom-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent-primary);
}

.onboarding-symptom-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.onboarding-symptom-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Note line */
.onboarding-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.onboarding-note i,
.onboarding-note svg {
  width: 14px;
  height: 14px;
  color: var(--accent-green);
  flex-shrink: 0;
}

/* How-it-works steps */
.onboarding-steps-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.onboarding-how-step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: start;
  transition: border-color var(--transition-base);
}

.onboarding-how-step:hover {
  border-color: var(--accent-primary);
}

.onboarding-step-num {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--border-light);
  min-width: 36px;
  line-height: 1;
}

.onboarding-step-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 164, 168, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-step-icon i,
.onboarding-step-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
}

.onboarding-step-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.onboarding-step-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Personalize form */
.onboarding-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.onboarding-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-align: start;
}

.onboarding-input {
  width: 100%;
  padding: 12px var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  box-sizing: border-box;
}

.onboarding-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 164, 168, 0.2);
}

/* Role chips */
.onboarding-role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.role-chip {
  padding: 8px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.role-chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.role-chip.selected {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

/* Ready step */
.onboarding-ready-icon {
  width: 100px;
  height: 100px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: none;
  box-shadow: none;
}

.onboarding-ready-icon i,
.onboarding-ready-icon svg {
  width: 38px;
  height: 38px;
  color: white;
}

.onboarding-ready-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.onboarding-ready-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.onboarding-ready-feature i,
.onboarding-ready-feature svg {
  width: 18px;
  height: 18px;
  color: var(--accent-green);
  flex-shrink: 0;
}

/* Progress dots */
.onboarding-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: all 0.3s ease;
}

.onboarding-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent-primary);
}

.onboarding-dot.done {
  background: var(--accent-primary);
  opacity: 0.4;
}

/* Bottom nav */
.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: var(--space-md);
}

/* ── Welcome Last-Result Card ─────────────────────────────── */
.welcome-last-result {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  text-align: start;
}

.wlr-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

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

.wlr-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.wlr-pct {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
}

/* ── Guest Save Banner ─────────────────────────────────────── */
.guest-save-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}

.guest-save-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent-primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guest-save-icon i,
.guest-save-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent-primary);
}

.guest-save-text {
  flex: 1;
  min-width: 180px;
  text-align: start;
}

.guest-save-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.guest-save-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Light mode overrides ─────────────────────────────────── */


[data-theme="light"] .onboarding-input {
  background: #fff;
}

[data-theme="light"] .role-chip {
  background: #fff;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  body.onboarding-active .language-switcher,
  body.onboarding-active .theme-toggle {
    display: none;
  }

  .onboarding-wrapper {
    padding: var(--space-lg) var(--space-md);
  }

  .onboarding-stat-row {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-md);
  }

  .onboarding-stat-num {
    font-size: 1.5rem;
  }

  .onboarding-how-step,
  .onboarding-symptom-card {
    padding: var(--space-sm) var(--space-md);
  }

  .guest-save-banner {
    flex-direction: column;
    text-align: center;
  }

  .guest-save-text {
    text-align: center;
  }
}

/* ── Welcome secondary actions row ──────────────────────────── */
.welcome-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.welcome-secondary-actions .btn {
  flex: 0 0 auto;
  font-size: 0.82rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.welcome-secondary-actions .btn:hover {
  opacity: 1;
}

/* ── Auth screen enhancements ───────────────────────────────── */
.auth-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-sm);
}

.auth-user-avatar i {
  color: var(--accent-primary);
  width: 28px;
  height: 28px;
}

.auth-user-email {
  font-size: 0.9rem;
  color: var(--text-secondary);
  word-break: break-all;
  margin-bottom: var(--space-sm);
}

.auth-profile-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.auth-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 4px;
}

.auth-profile-row span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-profile-chip {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.74rem;
  font-weight: 700;
}

.auth-profile-chip.complete {
  color: var(--accent-green);
  background: var(--accent-green-light);
}

.auth-profile-chip.incomplete {
  color: var(--accent-warm);
  background: var(--accent-warm-light);
}

.auth-profile-summary p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-switch-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: var(--space-md);
}

.auth-switch-hint .btn-link,
.auth-resend-hint .btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  font-family: inherit;
}

.auth-resend-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

.auth-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* Spinner for auth loading state */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Hide old auth-nav back button text — handled dynamically */
.auth-nav .btn i {
  flex-shrink: 0;
}
/* Auth tabs — Sign Up first (matches default register tab) */
.auth-tabs {
  display: flex;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: 3px;
  margin-bottom: var(--space-lg);
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.welcome-profile-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  text-align: start;
}

.welcome-profile-prompt-copy {
  flex: 1;
}

.welcome-profile-prompt-copy h4 {
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.welcome-profile-prompt-copy p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .welcome-profile-prompt {
    flex-direction: column;
    text-align: center;
  }

  .onboarding-wrapper {
    justify-content: flex-start;
    padding-top: calc(var(--space-xl) + env(safe-area-inset-top, 0px) + 56px);
  }
}

.welcome-stat-num { color: #f2532e; font-weight: 700; }

/* ── Auth select & input shared style ─────────────────────── */
.setting-select,
.auth-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #1a1008;
  font-size: 0.95rem;
  font-family: var(--font-body);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2340391c' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 40px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[dir="ltr"] .setting-select,
[dir="ltr"] .auth-field select {
  background-position: right 12px center;
  padding-left: 14px;
  padding-right: 40px;
}

.setting-select:focus,
.auth-field select:focus {
  outline: none;
  border-color: #ffa4a8;
  box-shadow: 0 0 0 3px rgba(255, 164, 168, 0.18);
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #1a1008;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.auth-field input:focus {
  outline: none;
  border-color: #ffa4a8;
  box-shadow: 0 0 0 3px rgba(255, 164, 168, 0.18);
}

/* auth form spacing */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field label { font-size: 0.88rem; font-weight: 600; color: #40391c; margin-bottom: 4px; display: block; }
.auth-switch-hint { text-align: center; font-size: 0.88rem; color: #6b5d4a; margin-top: 4px; }
.auth-switch-hint .btn-link { background: none; border: none; color: #f2532e; font-weight: 600; cursor: pointer; text-decoration: underline; font-size: inherit; padding: 0; }
.auth-submit-btn { width: 100%; margin-top: 4px; }
[data-theme="dark"] .auth-field input,
[data-theme="dark"] .auth-field select {
    background: var(--bg-secondary);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
[data-theme="dark"] .auth-field input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}
[data-theme="dark"] .auth-card {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .auth-field label {
    color: var(--text-secondary);
}
[data-theme="dark"] .auth-switch-hint {
    color: var(--text-secondary);
}

[data-theme="dark"] select,
[data-theme="dark"] option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   MOBILE FIXES — App-like feel on small screens
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Prevent horizontal scroll */
  body { overflow-x: hidden; }
  .container { padding: 16px 16px 100px; max-width: 100%; }

  /* Questions */
  .new-question-card {
    padding: 20px 16px;
    border-radius: 20px;
    margin: 0;
  }
  .new-response-option {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-radius: 14px;
  }
  .new-question-counter {
    font-size: 0.75rem;
    padding: 3px 12px;
  }

  /* Assessment navigation */
  .assessment-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fdf8f6;
    border-top: 1px solid rgba(255,164,168,0.15);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
    gap: 12px;
  }
  .assessment-nav .btn { flex: 1; justify-content: center; }

  /* Results */
  .results-grid {
    grid-template-columns: 1fr !important;
  }
  .dim-result-card { padding: 16px; }
  .dim-score-bar-header { flex-direction: row; }

  /* Auth */
  .auth-card { padding: 20px 16px; border-radius: 20px; }
  .auth-tabs { gap: 6px; }
  .auth-tab { padding: 9px 12px; font-size: 0.88rem; }

  /* Onboarding */
  .onboarding-step { padding: 24px 16px; }
  .onboarding-cta { width: 100%; justify-content: center; }

  /* Health Teaching */
  .ht-gallery-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .ht-gallery-card { border-radius: 14px; }
  .ht-gallery-image { height: 120px; }

  /* Nav buttons */
  .btn-text { display: inline; }
  .nav-link span { display: none; }

  /* Dimension badge compact */
  .assessment-dim-badge {
    padding: 10px 12px;
    gap: 10px;
  }
  .assessment-dim-badge h4 { font-size: 0.85rem; }
  .assessment-dim-badge p { font-size: 0.75rem; }

  /* Score ring resize */
  #score-ring svg { max-width: 160px; }

  /* Stat row compact */
  .dim-result-card .score-value { font-size: 0.88rem; }

  /* Welcome screen */
  .welcome-features { grid-template-columns: 1fr !important; }

  /* Fix buttons not overflowing */
  .results-nav { flex-direction: column; gap: 10px; }
  .results-nav .btn { width: 100%; justify-content: center; }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .ht-gallery-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .welcome-features { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ══════════════════════════════════════════════════════════
   HOME DASHBOARD
   ══════════════════════════════════════════════════════════ */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-top: 12px;
}
.home-greeting h2 { font-size: 1.4rem; font-weight: 700; margin: 0 0 4px; }
.home-date { font-size: 0.8rem; color: var(--text-tertiary); margin: 0; }
.home-actions-top { display: flex; gap: 8px; }

.home-score-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}
.home-score-main { display: flex; align-items: center; gap: 16px; }
.home-score-ring { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.home-score-num {
  position: absolute;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.home-score-info { flex: 1; }
.home-score-info h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 6px; }
.home-level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.home-dim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.home-dim-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid;
  font-size: 0.78rem;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.home-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: all 0.2s ease;
}
.home-action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.home-action-btn i { width: 24px; height: 24px; }

.home-login-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid rgba(242,83,46,0.2);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}
.home-login-prompt i { color: #f2532e; width: 24px; height: 24px; flex-shrink: 0; }
.home-login-prompt > div { flex: 1; }
.home-login-prompt p { margin: 0; font-size: 0.88rem; }

@media (max-width: 640px) {
  .home-quick-actions { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
  .home-action-btn { padding: 14px 6px; }
}

/* ── New Home: Greeting Card ── */
.home-greet-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px 20px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}
.home-time-greet {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: 0 0 4px;
  font-weight: 500;
}
.home-name-greet {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.home-context-msg {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.home-motivation-quote {
  font-size: 0.82rem;
  color: var(--accent-primary);
  margin: 10px 0 0;
  font-style: italic;
  line-height: 1.5;
  opacity: 0.9;
}

/* ── Weekly Adherence Card ── */
.home-adherence-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 16px 18px 14px;
  margin-bottom: 16px;
}
.hac2-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.hac2-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hac2-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.hac2-pct {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1;
}
.hac2-streak {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 8px 14px;
  min-width: 64px;
  gap: 1px;
}
.hac2-streak-icon {
  font-size: 1.3rem;
  line-height: 1;
}
.hac2-streak-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-heading);
  line-height: 1;
}
.hac2-streak-label {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-align: center;
}
.hac2-bar-track {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.hac2-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.hac2-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── New Home: Score Card ── */
.home-score-row { display: flex; align-items: center; gap: 16px; }

/* ── New Home: Dimension Highlights ── */
.home-dim-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.home-dim-tag {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}

/* ── New Home: Start Card (no result state) ── */
.home-start-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 16px;
}
.home-start-logo {
  width: 60px; height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(242,83,46,0.25));
}
.home-start-card h3 { margin: 0; font-size: 1.1rem; }
.home-start-card p { font-size: 0.85rem; color: var(--text-tertiary); margin: 0; }

/* ── New Home: Report link ── */
.home-report-link {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-body);
  transition: color 0.15s;
  display: block;
  margin-top: 6px;
}
.home-report-link:hover { color: var(--accent-warm); }

/* ── New Home: Actions Grid ── */
.home-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.home-act-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  text-align: start;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.home-act-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.home-act-card:active { transform: scale(0.97); box-shadow: none; background: var(--bg-secondary); }
.hac-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.hac-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.hac-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════
   PROFILE SCREEN
   ══════════════════════════════════════════════════════════ */
.profile-header {
  text-align: center;
  padding: 20px 0 24px;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffa4a8, #f2532e);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(255,164,168,0.35);
}
.profile-avatar-initials { font-size: 1.6rem; font-weight: 700; color: #fff; }
.profile-header h2 { margin: 0 0 4px; font-size: 1.3rem; }
.profile-role-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  background: rgba(255,164,168,0.12);
  color: #f2532e;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-stat-val { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.profile-stat-label { font-size: 0.72rem; color: var(--text-tertiary); }

.profile-results-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}
.profile-dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-dim-row:last-child { border-bottom: none; }
.profile-dim-name {
  display: flex; align-items: center; gap: 6px;
  min-width: 150px; font-size: 0.82rem; font-weight: 500;
}
.profile-dim-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}
.profile-dim-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.profile-dim-label {
  min-width: 70px;
  text-align: start;
  font-size: 0.72rem;
  font-weight: 600;
}
.profile-actions {
  display: flex;
  gap: 10px;
  padding-bottom: 32px;
}
.profile-actions .btn { flex: 1; justify-content: center; }

@media (max-width: 640px) {
  .profile-stats-row { grid-template-columns: 1fr 1fr; }
  .profile-stats-row .profile-stat-card:last-child { grid-column: 1/-1; }
  .profile-dim-name { min-width: 100px; }
}

/* ══════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR
   ══════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding: 0 8px;
  box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
  -webkit-tap-highlight-color: transparent;
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 0.65rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition: color 0.2s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item i { width: 22px; height: 22px; }
.bnav-item.active { color: #f2532e; }
.bnav-item.active i { filter: drop-shadow(0 0 6px rgba(242,83,46,0.35)); }

.bnav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffa4a8, #f2532e);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.bnav-avatar span { color: #fff; font-weight: 700; font-size: 0.9rem; }

/* Ensure screens have bottom padding for nav */
body:not(.onboarding-active) .screen.active .container {
  padding-bottom: 80px !important;
}

/* ── Updated Home CSS ── */
.home-logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-brand-logo {
  width: 56px; height: 56px;
  object-fit: contain;
}
.home-brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}
.home-tagline {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin: 2px 0 0;
}
.home-score-title {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin: 0 0 4px;
  font-weight: 500;
}
.home-welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.home-welcome-icon {
  width: 60px; height: 60px;
  background: var(--accent-warm-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.home-welcome-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.home-welcome-card p { font-size: 0.88rem; color: var(--text-tertiary); margin: 0; }

/* Welcome screen - logo fix */
.welcome-logo { width: 160px; height: 160px; }
.welcome-logo-img { width: 160px; height: 160px; }

/* ══════════════════════════════════════════════════════════
   PROFILE PHOTO UPLOAD
   ══════════════════════════════════════════════════════════ */
.profile-avatar {
  position: relative;
  width: 80px; height: 80px;
  overflow: visible !important;
}
.profile-avatar-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,164,168,0.4);
}
.profile-avatar-edit-badge {
  position: absolute;
  bottom: 0; right: 0;
  width: 24px; height: 24px;
  background: #f2532e;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ══════════════════════════════════════════════════════════
   WELCOME SCREEN - TITLE SIZE FIX
   ══════════════════════════════════════════════════════════ */
.welcome-title {
  font-family: 'Sora', 'Noto Sans Arabic', sans-serif !important;
  font-size: clamp(1.8rem, 5vw, 2.6rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  margin-bottom: 12px !important;
}

/* Fix Flare h1 in welcome specifically */
#welcome h1.welcome-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem) !important;
}

/* ══════════════════════════════════════════════════════════
   PHOSPHOR ICONS - ensure display
   ══════════════════════════════════════════════════════════ */
i[class*="ph-"] {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   WELCOME SCREEN FINAL OVERRIDES
   ══════════════════════════════════════════════════════════ */
#welcome .welcome-brand,
.welcome-brand {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  margin-bottom: 28px !important;
  text-align: center !important;
  width: 100% !important;
}
#welcome .welcome-logo-wrap,
.welcome-logo-wrap {
  flex-shrink: 0 !important;
  margin: 0 auto !important;
}
#welcome .welcome-app-name,
.welcome-app-name {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  font-family: 'Sora', sans-serif !important;
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.02em !important;
}
/* Welcome content centered full-width */
#welcome .welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 32px;
  max-width: 440px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════
   ADMIN DASHBOARD — Professional analytics panel
   ══════════════════════════════════════════════════════════ */
.admin-header {
  margin-bottom: 24px;
}
.admin-live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #94ae73;
  margin-right: 4px;
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* Stat cards */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.admin-stat-card:hover { transform: translateY(-2px); }
.admin-stat-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.admin-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.admin-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.admin-stat-sub {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Sections */
.admin-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.admin-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-section h3::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  flex-shrink: 0;
}

/* Level bar */
.admin-level-bar {
  display: flex;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}
.admin-level-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  transition: width 0.6s ease;
}
.admin-level-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.admin-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
}
.admin-legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Dimension bars */
.admin-dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-dim-label {
  width: 90px;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}
.admin-dim-track {
  flex: 1;
  height: 22px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}
.admin-dim-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  min-width: 0;
}
.admin-dim-val {
  width: 44px;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Trend chart */
.admin-trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
}
.admin-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
}
.admin-trend-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
  min-height: 3px;
}
.admin-trend-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}
.admin-trend-day {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* Recent table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-table tr:hover {
  background: rgba(255,164,168,0.04);
}
.admin-badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .admin-dim-label {
    width: 70px;
    font-size: 0.72rem;
  }
  .admin-table th, .admin-table td {
    padding: 6px 6px;
    font-size: 0.75rem;
  }
}
@media (max-width: 480px) {
  .admin-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .admin-stat-value {
    font-size: 1.4rem;
  }
  .admin-stat-icon {
    width: 32px; height: 32px;
    font-size: 1rem;
  }
  .admin-section {
    padding: 14px;
  }
  .admin-dim-label {
    width: 60px;
    font-size: 0.68rem;
  }
}

/* ── Action Plan Tab Bar ── */
.ap-tab-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 4px;
  margin-bottom: var(--space-xl);
}

.ap-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: calc(var(--radius-xl) - 3px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ap-tab.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.ap-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-card-hover, rgba(255,255,255,0.05));
}

/* ── Action Plan Screen Styles ── */
.action-plan-progress {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-sm);
}
.action-plan-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}
.action-plan-progress-header h3 {
  font-size: 1.1rem;
  margin: 0;
}
.action-plan-progress-percent {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 1.2rem;
}
.action-plan-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}
.action-plan-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.action-plan-progress-sub {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin: 0;
}
.action-plan-category {
  margin-bottom: var(--space-2xl);
}
.action-plan-category-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}
.action-plan-category-title i, .action-plan-category-title svg {
  width: 20px;
  height: 20px;
}
.action-plan-tasks {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.action-plan-task {
  display: flex;
  gap: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.action-plan-task:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-color);
}
.action-plan-task.task-done {
  opacity: 0.6;
  background: var(--bg-tertiary);
}
.task-check {
  flex-shrink: 0;
  padding-top: 2px;
}
.task-check-box {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.task-check-box.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.task-check-box i, .task-check-box svg {
  width: 14px;
  height: 14px;
  color: transparent;
}
.task-check-box.checked i, .task-check-box.checked svg {
  color: white;
}
.task-info {
  flex: 1;
}
.task-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xs);
  gap: var(--space-sm);
}
.task-title-row h5 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--text-primary);
}
.task-done .task-title-row h5 {
  text-decoration: line-through;
  color: var(--text-tertiary);
}
.task-freq {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  white-space: nowrap;
}
.task-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--space-sm) 0;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.task-completed-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--accent-green);
}
.task-urgent-badge {
  font-size: 0.75rem;
  color: var(--accent-warm);
  padding: 2px 8px;
  background: rgba(245,166,35,0.1);
  border-radius: var(--radius-xl);
}
.task-icon-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.action-plan-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-color);
}
.action-plan-empty i, .action-plan-empty svg {
  margin-bottom: var(--space-lg);
}
.action-plan-empty p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

/* Daily Progress Card on Home Screen */
.home-daily-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-top: var(--space-xl);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.home-daily-progress-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.hdp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Home Tasks Widget ──────────────────────────────────── */
.home-tasks-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.htw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.htw-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.htw-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.htw-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 999px;
  padding: 2px 10px;
}

.htw-badge.done {
  color: #22c55e;
  background: rgba(34,197,94,0.1);
}

.htw-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.htw-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.htw-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.htw-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
}

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

.htw-item:hover {
  background: var(--bg-secondary);
}

.htw-item.done .htw-item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.htw-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.htw-check.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.htw-item-name {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.htw-more-btn {
  width: 100%;
  margin-top: var(--space-sm);
  padding: 8px;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.htw-more-btn:hover {
  background: var(--accent-primary-light);
}

/* ─────────────────────────────────────────────
   7-Day Week Strip  (Action Plan)
   ───────────────────────────────────────────── */
.week-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: var(--space-lg);
  scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }

.week-day-btn {
  flex: 1;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  position: relative;
}
.week-day-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}
.week-day-btn.today {
  border-color: var(--accent-secondary);
}
.week-day-btn.selected {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb, 94,57,255), 0.35);
}
.week-day-btn.all-done {
  border-color: var(--accent-green);
}
.week-day-btn.some-done {
  border-color: var(--accent-secondary);
}
.wdb-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.week-day-btn.selected .wdb-name {
  color: white;
}
.wdb-count {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.week-day-btn.selected .wdb-count {
  color: rgba(255,255,255,0.8);
}
.wdb-check {
  width: 12px !important;
  height: 12px !important;
  color: var(--accent-green);
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
}

/* Day Tasks Panel */
.week-day-tasks {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-2xl);
}
.wdt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
.wdt-header h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.wdt-date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}
.wdt-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-tertiary);
}
.wdt-empty i, .wdt-empty svg {
  display: block;
  margin: 0 auto var(--space-md);
}
.week-day-tasks .action-plan-task {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0;
}
.week-day-tasks .action-plan-task:last-child {
  border-bottom: none;
}
.task-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--space-sm) 0;
}
.task-rationale {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
  line-height: 1.4;
  margin: 0 0 var(--space-sm) 0;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-inline-start: 2px solid var(--accent-secondary);
}
.task-cat-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  white-space: nowrap;
}
.action-plan-task.urgent {
  border-inline-start: 3px solid var(--accent-warm) !important;
}
.action-plan-task.important {
  border-inline-start: 3px solid var(--accent-secondary) !important;
}
