/* ========================================
   Neurotypo Design System — "Quiet Studio"
   Monochrome slate-blue palette for maximum sensory friendliness.
   Minimal color variation = minimal visual noise.
   Designed for neurodivergent users — solid backgrounds,
   reduced motion, no glassmorphism. WCAG 2.2 AA compliant.
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  /*
   * Quiet Studio Palette
   * Research basis: Kanakri et al. (2017) — muted, low-saturation colors
   * reduce anxiety. Monochrome palettes minimize visual competition.
   * Blue-grey undertones are consistently rated as calming
   * (Hidayetoglu et al., 2012; Küller et al., 2006).
   * No violet/purple, no brown, no bright green.
   */

  /* Steel — primary accent ramp (muted blue-grey) */
  --sage-50: #EDF1F5;
  --sage-100: #D8E0E8;
  --sage-200: #B8C6D4;
  --sage-300: #A8C0D4;
  --sage-400: #7B8FA8;
  --sage-500: #5E7189;
  --sage-600: #4D5F74;
  --sage-700: #3F4E60;
  --sage-800: #334050;
  --sage-900: #283340;

  /* Ocean — secondary accent (kept for compatibility, now cooler steel-blue) */
  --ocean-50: #EDF2F7;
  --ocean-100: #D4DEE8;
  --ocean-200: #B0C4D6;
  --ocean-300: #8AABC4;
  --ocean-400: #6A90AE;
  --ocean-500: #527894;
  --ocean-600: #43627A;
  --ocean-700: #375064;
  --ocean-800: #2D4150;
  --ocean-900: #23343F;

  /* Slate — neutrals with cool blue undertone */
  --slate-50: #F0F2F4;
  --slate-100: #D8D4CF;
  --slate-200: #C4C0BC;
  --slate-300: #9EA4AB;
  --slate-400: #727A84;
  --slate-500: #565E68;
  --slate-600: #434A53;
  --slate-700: #353C45;
  --slate-800: #1D222B;
  --slate-900: #171B22;
  --slate-950: #111318;

  /* Functional — muted, low-stimulation */
  --rose-muted: #C97D7D;
  --amber-muted: #D4B754;
  --emerald-muted: #6BAA7D;
  --sky-muted: #6A90AE;

  /* Semantic colors */
  --bg-primary: var(--slate-950);
  --bg-secondary: var(--slate-900);
  --bg-card: #171B22;
  --bg-card-hover: #1D222B;
  --bg-input: #13161C;
  --text-primary: var(--slate-100);
  --text-secondary: var(--slate-300);
  --text-muted: var(--slate-400);
  --text-accent: var(--sage-300);
  --border-color: #252A33;
  --border-hover: #353C48;
  --accent-primary: var(--sage-400);
  --accent-secondary: var(--ocean-400);
  --accent-gradient: linear-gradient(135deg, var(--sage-500), var(--ocean-500));
  --accent-gradient-soft: linear-gradient(135deg, #181D26, #1A2230);
  --danger: var(--rose-muted);
  --warning: var(--amber-muted);
  --success: var(--emerald-muted);

  /* Severity / confidence colors — desaturated for reduced visual intensity */
  --severity-0: var(--slate-500);
  --severity-1: var(--emerald-muted);
  --severity-2: var(--sky-muted);
  --severity-3: var(--amber-muted);
  --severity-4: var(--rose-muted);

  /* Spacing & sizing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
  --max-width: 1200px;

  /* Typography — Inter is clean, high-legibility */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;
}

/* High contrast mode */
.high-contrast {
  --bg-primary: #08090C;
  --bg-secondary: #0D0F14;
  --bg-card: #0D0F14;
  --bg-card-hover: #151821;
  --text-primary: #F0F2F5;
  --text-secondary: #CDD2DA;
  --text-muted: #9EA4AB;
  --border-color: #3A4050;
  --border-hover: #505868;
  --accent-primary: #95AAC0;
  --accent-secondary: #7AAEC2;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--text-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--sage-200); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Skip Link --- */
.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 10000;
  background: var(--accent-primary); color: #fff;
  padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* --- Consent Banner --- */
.consent-banner {
  position: fixed; inset: 0; z-index: 9999;
  background: #0D0F14;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.consent-banner.hidden { display: none; }
.consent-inner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: 44px;
  max-width: 660px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.consent-icon { font-size: 3rem; margin-bottom: 16px; }
.consent-inner h2 { font-size: var(--fs-2xl); margin-bottom: 12px; color: var(--warning); }
.consent-text p { color: var(--text-secondary); margin-bottom: 10px; line-height: 1.6; font-size: var(--fs-sm); }
.consent-sub { font-size: var(--fs-xs) !important; color: var(--text-muted) !important; }
.consent-inner .btn { margin-top: 20px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius-md);
  font-weight: 600; font-size: var(--fs-sm);
  border: none; transition: all var(--transition);
  letter-spacing: 0.01em;
}
.btn-lg { padding: 14px 32px; font-size: var(--fs-base); border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 14px; font-size: var(--fs-xs); }
.btn-primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent; color: var(--text-accent);
  border: 1.5px solid var(--border-hover);
}
.btn-outline:hover { background: var(--bg-card-hover); border-color: var(--accent-primary); }
.btn-accent {
  background: linear-gradient(135deg, var(--ocean-500), var(--ocean-600));
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; transition: all var(--transition);
  color: var(--text-secondary);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-hover); }

.btn-text-danger { background: none; border: none; color: var(--danger); font-size: var(--fs-sm); font-weight: 500; padding: 6px 12px; }
.btn-text-danger:hover { text-decoration: underline; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--slate-950);
  border-bottom: 1px solid var(--border-color);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center;
  height: 64px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fs-lg); color: var(--text-primary); text-decoration: none; }
.logo-icon { font-size: 1.6rem; }
.logo-text {
  color: var(--sage-300);
}
.logo:hover { color: var(--text-primary); }
.nav-list { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.nav-link.active { color: var(--accent-primary); background: var(--bg-card); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.main-nav { flex: 1; }

/* Mobile menu */
.mobile-menu-toggle { display: none; background: none; border: none; padding: 8px; }
.hamburger {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary); position: relative; transition: var(--transition);
}
.hamburger::before, .hamburger::after {
  content: ''; position: absolute; width: 22px; height: 2px;
  background: var(--text-primary); transition: var(--transition); left: 0;
}
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* --- Page Sections --- */
.page-section { display: none; animation: fadeIn 0.5s ease; }
.page-section.active { display: block; }
.section-container { max-width: var(--max-width); margin: 0 auto; padding: 32px 24px 64px; }
.section-header { text-align: center; margin-bottom: 32px; }
.section-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bg-card); color: var(--accent-primary);
  margin-bottom: 16px;
}
.section-header h2 { font-size: var(--fs-3xl); font-weight: 800; margin-bottom: 12px; }
.section-subtitle { font-size: var(--fs-lg); color: var(--text-secondary); max-width: 640px; margin: 0 auto; }
.subsection-title {
  font-size: var(--fs-xl); font-weight: 700;
  margin: 40px 0 20px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* --- Hero --- */
.hero {
  min-height: 0;
  display: flex; align-items: center;
  max-width: var(--max-width); margin: 0 auto;
  padding: 20px 24px 32px; gap: 40px; position: relative;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
}
.hero-content { flex: 1; }
.hero-badge {
  display: inline-block; padding: 5px 14px; border-radius: 20px;
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bg-card); color: var(--accent-primary);
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(var(--fs-3xl), 5vw, var(--fs-5xl));
  font-weight: 800; line-height: 1.15; margin-bottom: 20px;
}
.gradient-text {
  color: var(--sage-300);
}
.hero-subtitle {
  font-size: var(--fs-lg); color: var(--text-secondary);
  max-width: 540px; margin-bottom: 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-disclaimer {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); color: var(--text-muted);
  padding: 10px 16px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color);
}
.hero-visual { flex: 0 0 380px; display: flex; justify-content: center; }
.hero-chart-preview {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-xl); padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0 4px;
}
.hero-carousel-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}
.hero-carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}
.hero-dot:hover {
  border-color: var(--accent-primary);
  transform: scale(1.2);
}
.hero-dot.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.15);
}

/* --- Feature Cards --- */
.features-grid {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 24px 60px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 28px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-gradient); opacity: 0; transition: opacity var(--transition);
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.feature-card:hover::before { opacity: 1; }
.feature-icon { font-size: 2rem; margin-bottom: 14px; }
.feature-card h3 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }

/* --- Conditions Section --- */
.conditions-section {
  max-width: var(--max-width); margin: 0 auto;
  padding: 48px 24px 24px;
  text-align: center;
}
.conditions-heading {
  font-size: var(--fs-2xl); font-weight: 800;
  margin-bottom: 8px;
}
.conditions-subtitle {
  font-size: var(--fs-sm); color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 28px; line-height: 1.6;
}
.conditions-grid {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px;
}
.condition-badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 12px 18px;
  transition: all var(--transition);
  text-align: left;
}
.condition-badge:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.condition-icon { font-size: 1.5rem; flex-shrink: 0; }
.condition-badge strong {
  display: block; font-size: var(--fs-sm); font-weight: 700;
}
.condition-instrument {
  display: block; font-size: var(--fs-xs);
  color: var(--text-muted); font-weight: 500;
  margin-top: 2px;
}

/* --- Stats Bar --- */
.stats-bar {
  max-width: var(--max-width); margin: 0 auto; padding: 40px 24px;
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
}
.stat { text-align: center; }
.stat-number {
  font-size: var(--fs-4xl); font-weight: 800;
  color: var(--sage-300);
}
.stat-suffix {
  font-size: var(--fs-2xl); font-weight: 800;
  color: var(--sage-300);
}
.stat-label { display: block; font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; }

/* --- Inline Disclaimer --- */
.inline-disclaimer {
  display: flex; gap: 12px; padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(212, 183, 84, 0.06);
  border: 1px solid rgba(212, 183, 84, 0.15);
  margin-bottom: 32px; font-size: var(--fs-sm);
  color: var(--text-secondary); align-items: flex-start;
}
.inline-disclaimer .disclaimer-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.results-disclaimer { background: rgba(244, 63, 94, 0.06); border-color: rgba(244, 63, 94, 0.15); }

/* --- Resume Banner --- */
.resume-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  animation: slideDown 0.4s ease;
}
.resume-banner-icon { font-size: 2rem; flex-shrink: 0; }
.resume-banner-text { flex: 1; }
.resume-banner-text h4 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 4px; }
.resume-banner-text p { font-size: var(--fs-sm); color: var(--text-secondary); }
.resume-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --- Auto-save Toast --- */
.save-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 10px 20px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-color);
  color: var(--text-secondary); font-size: var(--fs-sm);
  display: flex; align-items: center; gap: 8px;
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.save-toast.visible { transform: translateY(0); opacity: 1; }
.save-toast-icon { color: var(--success); }

/* --- Search --- */
.search-container { margin-bottom: 40px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; background: var(--bg-input);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  transition: border-color var(--transition); max-width: 560px; margin: 0 auto;
}
.search-box:focus-within { border-color: var(--accent-primary); box-shadow: var(--shadow-sm); }
.search-icon { font-size: 1.1rem; }
.search-input {
  flex: 1; background: none; border: none;
  color: var(--text-primary); font-size: var(--fs-base); outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear { background: none; border: none; color: var(--text-muted); font-size: 1rem; padding: 4px; }
.search-clear:hover { color: var(--text-primary); }

/* --- Timeline --- */
.timeline-tabs { margin-bottom: 20px; display: flex; gap: 4px; overflow-x: auto; padding: 4px; }
.timeline-tab {
  flex: 0 0 auto; padding: 8px 14px; border: none;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: transparent; color: var(--text-secondary);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.timeline-tab:hover:not(.active) { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.timeline-tab.active {
  color: var(--tab-color, var(--accent-primary));
  background: color-mix(in srgb, var(--tab-color, var(--accent-primary)) 15%, transparent);
  border-bottom-color: var(--tab-color, var(--accent-primary));
  font-weight: 700;
}
.timeline { position: relative; padding-left: 30px; --timeline-color: var(--accent-primary); }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px;
  background: var(--timeline-color);  opacity: 0.5;
}
.timeline-item { position: relative; padding: 16px 0 16px 24px; transition: opacity var(--transition); }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 22px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--timeline-color); background: var(--bg-primary);
}
.timeline-item[data-era="modern"]::before { background: var(--timeline-color); }
.timeline-item[data-era="transitional"]::before { background: color-mix(in srgb, var(--timeline-color) 50%, transparent); }
.timeline-year { font-weight: 700; color: var(--timeline-color); font-size: var(--fs-sm); }
.timeline-text { color: var(--text-secondary); font-size: var(--fs-sm); margin-top: 4px; }

/* --- Signs You Recognize --- */
.signs-intro {
  color: var(--text-secondary); font-size: var(--fs-base); max-width: 720px;
  margin: 0 auto 28px; text-align: center; line-height: 1.6;
}
.signs-grid { display: flex; flex-direction: column; gap: 12px; }
.sign-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-left: 4px solid var(--sign-color, var(--accent-primary));
  border-radius: var(--radius-lg); overflow: hidden;
  transition: box-shadow var(--transition);
}
.sign-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.sign-card-header {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 16px 20px; border: none; background: transparent;
  color: var(--text-primary); font-size: var(--fs-base);
  font-weight: 600; cursor: pointer; text-align: left;
}
.sign-card-icon { font-size: 1.3em; }
.sign-card-label { flex: 1; }
.sign-card-toggle {
  font-size: 1.2em; color: var(--text-muted);
  transition: transform var(--transition);
}
.sign-card.open .sign-card-toggle { transform: rotate(90deg); }
.sign-card-body {
  max-height: 0; overflow: hidden; padding: 0 20px;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.sign-card.open .sign-card-body { max-height: 800px; padding: 0 20px 20px; }
.sign-subtitle {
  font-size: var(--fs-sm); font-weight: 700; color: var(--sign-color, var(--accent-primary));
  margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.sign-list { list-style: none; padding: 0; margin: 0; }
.sign-list li {
  position: relative; padding: 8px 0 8px 20px;
  color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6;
}
.sign-list li::before {
  content: '\2014'; position: absolute; left: 0; color: var(--sign-color, var(--text-muted));
  font-weight: 700;
}
.sign-list li em { color: var(--text-primary); font-style: italic; }
.sign-research {
  color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.6;
  padding: 12px; background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md); border: 1px solid var(--border-color);
}
.sign-overlaps { display: flex; flex-wrap: wrap; gap: 8px; }
.sign-overlap-badge {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 8px 12px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-color);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary);
  cursor: default;
}
.overlap-note {
  display: block; font-size: var(--fs-xs); font-weight: 400;
  color: var(--text-muted); margin-top: 2px;
}
.sign-relevant {
  margin-top: 16px; padding: 12px 16px;
  background: color-mix(in srgb, var(--sign-color, var(--accent-primary)) 8%, transparent);
  border-radius: var(--radius-md); font-size: var(--fs-sm);
  color: var(--text-secondary); line-height: 1.6;
}
.signs-cta {
  margin-top: 32px; text-align: center;
  padding: 24px; background: var(--bg-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border-color);
}
.signs-cta p { color: var(--text-secondary); font-size: var(--fs-sm); margin-bottom: 16px; }

/* --- Explainer Cards --- */
.explainers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.explainer-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 24px;
  cursor: pointer; transition: all var(--transition);
}
.explainer-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.explainer-card h4 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 10px; }
.explainer-card p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }
.explainer-card.expanded p.explainer-full { display: block; }
p.explainer-full { display: none; margin-top: 10px; }

/* --- Research Cards --- */
.research-category {
  margin-bottom: 32px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden;
}
.category-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px; cursor: pointer; transition: background var(--transition);
  background: none; border: none; width: 100%; text-align: left; color: var(--text-primary);
}
.category-header:hover { background: rgba(255, 255, 255, 0.03); }
.category-icon { font-size: 1.5rem; }
.category-info { flex: 1; }
.category-info h4 { font-size: var(--fs-lg); font-weight: 700; }
.category-info p { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; }
.category-toggle { font-size: 1.2rem; color: var(--text-muted); transition: transform var(--transition); }
.category-header[aria-expanded="true"] .category-toggle { transform: rotate(180deg); }
.category-body { padding: 0 24px 24px; display: none; }
.category-header[aria-expanded="true"] + .category-body { display: block; }
.article-card {
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px;
}
.article-card:last-child { margin-bottom: 0; }
.article-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.article-badge {
  font-size: var(--fs-xs); padding: 2px 8px; border-radius: 12px;
  background: var(--bg-card); color: var(--accent-primary); font-weight: 500;
}
.article-badge.year { background: var(--bg-card); color: var(--accent-secondary); }
.article-card h5 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 8px; }
.article-card .article-summary { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.article-findings { margin-bottom: 12px; }
.article-findings li { font-size: var(--fs-sm); color: var(--text-secondary); padding: 3px 0 3px 20px; position: relative; }
.article-findings li::before { content: '→'; position: absolute; left: 0; color: var(--accent-primary); }
.article-implications {
  font-size: var(--fs-sm); color: var(--text-accent);
  padding: 10px 14px; background: var(--bg-card);
  border-radius: var(--radius-sm); border-left: 3px solid var(--accent-primary);
}

/* --- Condition Profiles --- */
.profiles-container { margin-top: 48px; }
.profiles-intro {
  font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: 20px;
  line-height: 1.6;
}
.profiles-grid { display: flex; flex-direction: column; gap: 12px; }
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden;
}
.profile-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 24px; cursor: pointer; transition: background var(--transition);
  background: none; border: none; width: 100%; text-align: left; color: var(--text-primary);
  border-left: 4px solid transparent;
}
.profile-header:hover { background: rgba(255, 255, 255, 0.03); }
.profile-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 2px; }
.profile-info { flex: 1; }
.profile-info h4 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 6px; }
.profile-summary { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }
.profile-toggle {
  font-size: 1.2rem; color: var(--text-muted); transition: transform var(--transition);
  flex-shrink: 0; margin-top: 4px;
}
.profile-header[aria-expanded="true"] .profile-toggle { transform: rotate(180deg); }
.profile-body { padding: 0 24px 24px; display: none; }
.profile-header[aria-expanded="true"] + .profile-body { display: block; }
.profile-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 20px; margin-bottom: 16px;
}
.profile-section:last-child { margin-bottom: 0; }
.profile-section h5 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 10px; }
.profile-section p {
  font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.7;
}
.profile-section p strong { color: var(--text-primary); font-weight: 600; }
.profile-nuances {
  border-left: 3px solid var(--accent-secondary);
  background: rgba(212, 183, 84, 0.04);
}
.profile-research { display: flex; flex-direction: column; gap: 12px; }
.profile-cite {
  padding: 12px 16px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
}
.profile-cite strong { display: block; font-size: var(--fs-sm); margin: 6px 0 2px; color: var(--text-primary); }
.cite-authors { font-size: var(--fs-xs); color: var(--text-secondary); }
.cite-doi {
  display: block; font-size: var(--fs-xs); color: var(--accent-primary);
  margin-top: 4px; word-break: break-all;
}

/* --- Stepper --- */
.stepper { margin-bottom: 40px; position: relative; }
.stepper-track {
  height: 3px; background: var(--border-color); border-radius: 2px;
  position: absolute; top: 20px; left: 40px; right: 40px;
}
.stepper-fill { height: 100%; background: var(--accent-gradient); border-radius: 2px; transition: width 0.4s ease; width: 0%; }
.stepper-steps { display: flex; justify-content: space-between; position: relative; }
.step {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text-muted);
  padding: 0; transition: color var(--transition); cursor: pointer;
}
.step.active, .step.completed { color: var(--text-primary); }
.step-number {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; background: var(--bg-secondary);
  border: 2px solid var(--border-color); transition: all var(--transition);
  font-size: var(--fs-sm);
}
.step.active .step-number { border-color: var(--accent-primary); background: var(--bg-card); color: var(--accent-primary); }
.step.completed .step-number { border-color: var(--accent-secondary); background: var(--accent-secondary); color: #fff; }
.step-label { font-size: var(--fs-xs); font-weight: 600; }

/* --- Form --- */
.form-step { display: none; animation: slideIn 0.3s ease; }
.form-step.active { display: block; }
.form-step-title { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: 8px; }
.form-step-desc { color: var(--text-secondary); margin-bottom: 28px; font-size: var(--fs-sm); }
.form-group { margin-bottom: 24px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: var(--fs-sm); }
.form-hint { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

.form-select, .form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: var(--fs-sm); transition: border-color var(--transition);
}
.form-select:focus, .form-input:focus { border-color: var(--accent-primary); outline: none; box-shadow: var(--shadow-sm); }
.form-select option { background: var(--bg-secondary); }

/* Checkbox grid */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.checkbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: background var(--transition); cursor: pointer; font-size: var(--fs-sm);
}
.checkbox-item:hover { background: rgba(255, 255, 255, 0.03); }
.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-primary); cursor: pointer; }

/* Likert scale */
.likert-scale { display: flex; gap: 8px; flex-wrap: wrap; }
.likert-option {
  flex: 1; min-width: 90px; text-align: center;
  padding: 12px 8px; background: var(--bg-input);
  border: 1.5px solid var(--border-color); border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition);
  font-size: var(--fs-xs); color: var(--text-secondary);
}
.likert-option:hover { border-color: var(--border-hover); }
.likert-option.selected { border-color: var(--accent-primary); background: var(--bg-card-hover); color: var(--text-primary); }
.likert-option .likert-value { display: block; font-size: var(--fs-lg); font-weight: 700; margin-bottom: 4px; }

/* Question cards for assessment */
.question-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
  transition: border-color var(--transition);
}
.question-card.answered { border-color: var(--border-hover); }
.question-card .question-number {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}
.question-card .question-text { font-size: var(--fs-base); font-weight: 500; margin-bottom: 16px; line-height: 1.6; }
.question-card .question-source {
  font-size: var(--fs-xs); color: var(--text-muted); margin-top: 12px;
  padding-top: 8px; border-top: 1px solid var(--border-color);
}

/* Assessment progress bar */
.assessment-progress {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; margin-bottom: 24px;
  position: sticky; top: 64px; z-index: 50;
  background: var(--bg-primary); border-bottom: 1px solid var(--border-color);
}
.assessment-progress-bar {
  flex: 1; height: 6px; background: var(--border-color);
  border-radius: 3px; overflow: hidden;
}
.assessment-progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}
.assessment-progress-text { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* Severity */
.severity-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Domain cards */
.symptom-domains { display: flex; flex-direction: column; gap: 12px; }
.domain-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color var(--transition);
}
.domain-card:hover { border-color: var(--border-hover); }
.domain-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer;
  background: none; border: none; width: 100%;
  text-align: left; color: var(--text-primary);
  transition: background var(--transition);
}
.domain-header:hover { background: rgba(255, 255, 255, 0.02); }
.domain-icon { font-size: 1.4rem; }
.domain-info { flex: 1; }
.domain-info h4 { font-size: var(--fs-base); font-weight: 600; }
.domain-info p { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.domain-severity-preview { display: flex; gap: 3px; align-items: center; }
.severity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-color); transition: background var(--transition); }
.severity-dot.active-0 { background: var(--severity-0); }
.severity-dot.active-1 { background: var(--severity-1); }
.severity-dot.active-2 { background: var(--severity-2); }
.severity-dot.active-3 { background: var(--severity-3); }
.severity-dot.active-4 { background: var(--severity-4); }
.domain-expand { font-size: 1rem; color: var(--text-muted); transition: transform var(--transition); }
.domain-header[aria-expanded="true"] .domain-expand { transform: rotate(180deg); }
.domain-body { display: none; padding: 0 20px 20px; }
.domain-header[aria-expanded="true"] + .domain-body { display: block; }
.domain-tooltip {
  font-size: var(--fs-xs); color: var(--text-accent);
  padding: 10px 14px; background: var(--bg-card);
  border-radius: var(--radius-sm); border-left: 3px solid var(--accent-primary); margin-bottom: 16px;
}

/* Form navigation */
.form-navigation {
  display: flex; align-items: center; gap: 12px;
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--border-color);
}
.form-nav-spacer { flex: 1; }

/* --- Results Dashboard --- */
.comparison-toggle, .radar-view-bar {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  padding: 4px; margin-bottom: 32px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.radar-view-bar::-webkit-scrollbar { display: none; }
.toggle-btn, .radar-view-btn {
  flex: 0 0 auto; padding: 10px 14px; border: none;
  border-radius: var(--radius-md); background: transparent;
  color: var(--text-secondary); font-size: var(--fs-sm);
  font-weight: 500; transition: all var(--transition); white-space: nowrap;
  cursor: pointer;
}
.toggle-btn.active, .radar-view-btn.active {
  background: var(--bg-card-hover); color: var(--accent-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.toggle-btn:hover:not(.active), .radar-view-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.03); color: var(--text-primary);
}

.charts-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }
.chart-panel {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 24px;
}
.chart-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 4px; }
.chart-desc { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 16px; }
.chart-wrapper { position: relative; max-height: 400px; }
.chart-legend-custom { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.legend-entry { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-secondary); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; }

/* --- Ranked Likelihood List --- */
.likelihood-list { margin-top: 32px; }
.likelihood-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; margin-bottom: 10px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); transition: all var(--transition);
  cursor: pointer; position: relative; overflow: hidden;
}
.likelihood-card:hover { border-color: var(--border-hover); transform: translateX(4px); }
.likelihood-rank {
  font-size: var(--fs-2xl); font-weight: 800; color: var(--text-muted);
  width: 40px; text-align: center; flex-shrink: 0;
}
.likelihood-info { flex: 1; }
.likelihood-name { font-size: var(--fs-base); font-weight: 700; margin-bottom: 4px; }
.likelihood-score-row { display: flex; align-items: center; gap: 12px; }
.likelihood-bar {
  flex: 1; height: 8px; background: var(--border-color);
  border-radius: 4px; overflow: hidden;
}
.likelihood-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.likelihood-percent { font-size: var(--fs-sm); font-weight: 700; width: 48px; text-align: right; }
.likelihood-confidence {
  font-size: var(--fs-xs); padding: 2px 10px; border-radius: 12px;
  font-weight: 600; flex-shrink: 0;
}
.confidence-high { background: rgba(52, 211, 153, 0.12); color: var(--emerald-400); }
.confidence-moderate { background: rgba(212, 183, 84, 0.12); color: var(--amber-muted); }
.confidence-low { background: rgba(148, 163, 184, 0.12); color: var(--gray-400); }
.likelihood-details {
  display: none; padding: 12px 0 0;
  font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6;
}
.likelihood-card.expanded .likelihood-details { display: block; }
.likelihood-symptoms { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.likelihood-symptom-tag {
  font-size: var(--fs-xs); padding: 3px 10px; border-radius: 12px;
  background: var(--bg-card); color: var(--text-accent);
}

/* Results empty */
.results-empty { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.results-empty h3 { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: 8px; }
.results-empty p { color: var(--text-secondary); }

/* Findings */
.findings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.finding-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 24px;
}
.finding-card h4 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 8px; }
.finding-card p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }
.finding-score { font-size: var(--fs-3xl); font-weight: 800; }

/* Strength cards */
.strengths-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.strength-card {
  background: #121A16; border: 1px solid #1E2B25;
  border-radius: var(--radius-lg); padding: 20px; transition: all var(--transition);
}
.strength-card:hover { border-color: #2E4236; transform: translateY(-2px); }
.strength-icon { font-size: 1.5rem; margin-bottom: 8px; }
.strength-card h4 { font-size: var(--fs-sm); font-weight: 700; margin-bottom: 6px; }
.strength-card p { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.5; }
.strength-citation { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 8px; font-style: italic; }

/* Clinician guide */
.clinician-guide {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 28px; margin-top: 16px;
}
.clinician-guide h4 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 16px; }
.guide-section { margin-bottom: 20px; }
.guide-section h5 { font-size: var(--fs-sm); font-weight: 700; color: var(--text-accent); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.guide-item { padding: 6px 0; font-size: var(--fs-sm); color: var(--text-secondary); padding-left: 16px; position: relative; }
.guide-item::before { content: '•'; position: absolute; left: 0; color: var(--accent-primary); }

/* Masking cost viz */
.masking-viz {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 24px; margin-top: 16px;
}
.masking-meter { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.masking-meter-bar { flex: 1; height: 12px; background: var(--border-color); border-radius: 6px; overflow: hidden; }
.masking-meter-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--emerald-muted), var(--amber-muted), var(--rose-muted));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.masking-label { font-size: var(--fs-sm); font-weight: 700; }

/* Export/Save actions */
.export-actions { margin-top: 40px; }
.save-privacy-notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-color);
  margin-bottom: 20px; font-size: var(--fs-sm); color: var(--text-secondary);
}
.save-buttons-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.save-meta { margin-top: 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.import-section { margin-top: 20px; }
.import-text { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 8px; }
.file-input-hidden { position: absolute; opacity: 0; width: 0; height: 0; }

/* --- Resources --- */
.resources-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.resource-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 28px;
}
.resource-card.crisis {
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.03);
}
.resource-icon { font-size: 2rem; margin-bottom: 12px; }
.resource-card h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 12px; }
.resource-card p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.resource-list { margin-top: 8px; }
.resource-list li {
  font-size: var(--fs-sm); color: var(--text-secondary);
  padding: 4px 0 4px 16px; position: relative;
}
.resource-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent-primary); }
.resource-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 12px; }
.crisis-lines { display: flex; flex-direction: column; gap: 12px; }
.crisis-line strong { font-size: var(--fs-sm); }
.crisis-line p { font-size: var(--fs-sm); margin: 0; }

/* --- About & Support --- */
.about-support {
  border-top: 1px solid var(--border-color);
  padding: 48px 24px;
  background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.02) 100%);
}
.about-support-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
}
.about-text { flex: 1; }
.about-heading {
  font-size: var(--fs-lg);
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 600;
}
.about-text p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.about-muted {
  color: var(--text-muted) !important;
  font-style: italic;
}
.about-bmc {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-link {
  color: var(--accent-primary);
  text-decoration: underline;
  transition: opacity 0.2s;
}
.about-link:hover { opacity: 0.8; }

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 32px 24px;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-disclaimer { margin-bottom: 16px; }
.footer-disclaimer p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }
.footer-meta p { font-size: var(--fs-xs); color: var(--text-muted); }

/* --- Modal --- */
.modal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s ease;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); }
.modal-content {
  position: relative; background: var(--bg-secondary);
  border: 1px solid var(--border-color); border-radius: var(--radius-xl);
  padding: 36px; max-width: 560px; width: 90%;
  box-shadow: var(--shadow-lg); max-height: 80vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-content h2 { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: 16px; }
.modal-body { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.7; }
.modal-body ul { margin: 12px 0; padding-left: 20px; }
.modal-body li { list-style: disc; margin-bottom: 6px; }
.modal-accept { margin-top: 20px; }

/* --- Tooltip --- */
.tooltip-overlay {
  position: fixed; z-index: 500; max-width: 300px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md); font-size: var(--fs-xs);
  color: var(--text-secondary); line-height: 1.5;
  pointer-events: none; opacity: 0; transition: opacity 0.2s ease;
}
.tooltip-overlay.visible { opacity: 1; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Constellation particles (CSS only) */
.constellation-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
}
.constellation-dot {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: var(--sage-700);
  animation: twinkle var(--duration, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.2); }
}

/* --- Print Styles --- */
@media print {
  .site-header, .site-footer, .consent-banner, .form-navigation,
  .export-actions, .comparison-toggle, .save-toast, .resume-banner,
  .btn, .header-actions, .mobile-menu-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .page-section { display: block !important; }
  .bg-card, .chart-panel, .finding-card, .likelihood-card { background: #fff; border-color: #ddd; }
  .gradient-text { -webkit-text-fill-color: #333; }
  .results-disclaimer { page-break-before: avoid; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero { flex-direction: column; min-height: auto; padding: 32px 20px; gap: 32px; }
  .hero-visual { flex: 0 0 auto; width: 100%; max-width: 300px; }
  .features-grid { padding: 0 20px 40px; grid-template-columns: 1fr; }
  .stats-bar { gap: 24px; padding: 24px 20px; }
  .charts-container { grid-template-columns: 1fr; }
  .section-container { padding: 32px 16px 60px; }
  .mobile-menu-toggle { display: block; }
  .nav-list {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-secondary); flex-direction: column;
    padding: 16px; border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
  }
  .nav-list.open { display: flex; }
  .explainers-grid { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .strengths-grid { grid-template-columns: 1fr; }
  .save-buttons-grid { flex-direction: column; }
  .likert-scale { flex-direction: column; }
  .likert-option { min-width: 100%; }
  .resume-banner { flex-direction: column; text-align: center; }
  .resume-banner-actions { width: 100%; justify-content: center; }
  .assessment-progress { position: static; }
  .likelihood-card { flex-wrap: wrap; }
  .qpp-controls { flex-wrap: wrap; }
  .about-support-inner { flex-direction: column; text-align: center; gap: 24px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: var(--fs-2xl); }
  .section-header h2 { font-size: var(--fs-2xl); }
  .stepper-steps { gap: 0; }
  .step-label { display: none; }
  .header-inner { padding: 0 16px; }
}

/* --- Questions-Per-Page Controls --- */
.qpp-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.qpp-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 500;
}
.qpp-btn {
  padding: 4px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.qpp-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}
.qpp-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.auto-save-indicator {
  font-size: var(--fs-xs);
  color: var(--emerald-muted);
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0.03em;
}
.qpp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
}
.qpp-page-info {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}
/* Single question mode — larger, centered card */
.question-card.qpp-single {
  max-width: 640px;
  margin: 40px auto;
  padding: 32px;
  border-width: 2px;
}
.question-card.qpp-single .question-text {
  font-size: var(--fs-xl);
  line-height: 1.6;
  margin-bottom: 24px;
}
.question-card.qpp-single .likert-scale {
  gap: 10px;
}
.question-card.qpp-single .likert-option {
  padding: 12px 20px;
  font-size: var(--fs-base);
}

/* --- Research Corner --- */
.research-corner {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}
.research-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.research-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}
.research-content {
  display: none;
  margin-top: 12px;
}
.research-corner.open .research-content {
  display: block;
}
.research-instrument {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.research-instrument:last-child {
  border-bottom: none;
}
.research-instrument-name {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin-bottom: 4px;
}
.research-doi {
  font-size: var(--fs-xs);
  color: var(--accent-primary);
  display: inline-block;
  margin-bottom: 8px;
}
.research-doi:hover {
  color: var(--sage-300);
}
.research-summary {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.research-limitations {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.research-limitations strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.research-limitations ul {
  list-style: disc;
  padding-left: 18px;
}
.research-limitations li {
  line-height: 1.5;
  margin-bottom: 2px;
}

/* --- Clinician Handout (hidden unless printing) --- */
#clinician-printout { display: none; }
.print-handout {
  font-family: 'Inter', -apple-system, sans-serif;
  color: #111;
  max-width: 700px;
  margin: 0 auto;
  padding: 40px;
}
.print-handout h1 { font-size: 1.5rem; margin-bottom: 4px; }
.print-handout h2 { font-size: 1.1rem; margin: 20px 0 8px; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
.print-subtitle { color: #666; font-size: 0.85rem; margin-bottom: 12px; }
.print-row { display: flex; gap: 24px; margin: 12px 0 20px; font-size: 0.9rem; }
.print-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.print-table th, .print-table td { border: 1px solid #ccc; padding: 6px 10px; text-align: left; }
.print-table th { background: #f5f5f5; font-weight: 600; }
.print-citations { font-size: 0.8rem; }
.print-citations li { margin-bottom: 6px; }
.print-footer { margin-top: 30px; font-size: 0.75rem; color: #888; }

@media print {
  .site-header, .consent-banner, .site-footer,
  .save-buttons-grid, .save-meta, .import-section,
  .inline-disclaimer, .stepper, .skip-link { display: none !important; }
  body { background: #fff; color: #111; }
  .section, .results-card, .finding-card { background: #fff; border-color: #ddd; box-shadow: none; }
  body.printing-handout > *:not(#clinician-printout) { display: none !important; }
  body.printing-handout #clinician-printout { display: block !important; }
}

/* --- Diary Styles --- */
.diary-section { margin-top: 32px; }
.diary-save-bar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px; padding: 14px 18px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); flex-wrap: wrap;
}
.diary-save-bar select, .diary-save-bar input {
  padding: 6px 10px; font-size: var(--fs-sm);
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary);
  flex: 1; min-width: 140px;
}
.diary-save-bar textarea {
  padding: 8px 10px; font-size: var(--fs-sm);
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-primary);
  width: 100%; min-height: 60px; resize: vertical; margin-top: 8px;
}
.diary-timeline {
  position: relative; padding-left: 24px;
  border-left: 2px solid var(--border-color); margin-top: 16px;
}
.diary-entry {
  position: relative; padding: 14px 18px; margin-bottom: 16px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--transition);
}
.diary-entry:hover { border-color: var(--accent-primary); }
.diary-entry::before {
  content: ''; position: absolute; left: -30px; top: 18px;
  width: 10px; height: 10px; background: var(--accent-primary);
  border-radius: 50%; border: 2px solid var(--bg-primary);
}
.diary-entry-date { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.diary-entry-label { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); margin: 4px 0; }
.diary-entry-type { font-size: var(--fs-xs); color: var(--accent-primary); text-transform: uppercase; letter-spacing: 0.05em; }
.diary-entry-scores { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.diary-score-chip { font-size: var(--fs-xs); padding: 2px 8px; background: var(--bg-secondary); border-radius: var(--radius-sm); color: var(--text-secondary); }
.diary-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: var(--fs-sm); }
