/*
 * DECISION HELP AI V2.0
 * Adaptive Personas • Warm Coaching • Action-Oriented
 */

/* ═══════════════════════════════════════════════════════════════
   THEME SYSTEM (5 Standard Themes)
   ═══════════════════════════════════════════════════════════════ */

/* Midnight Theme (Dark - Default) */
:root,
[data-theme="midnight"] {
  --bg: #0b1221;
  --bg-alt: #101827;
  --bg2: #101827;
  --bg3: #1a2436;
  --surface: #1a2436;
  --panel: #1a2436;
  --panel-soft: #111827;
  --panel-light: #293548;
  --card: #1a2436;
  --border: rgba(255, 255, 255, 0.06);
  --line: #334155;
  --line-soft: #1e293b;
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --ink: #f8fafc;
  --ink-secondary: #94a3b8;
  --ink-muted: #64748b;
  --muted: #64748b;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.15);
  --cyan: #06b6d4;
  --teal: #10b981;
  --orange: #f97316;
  --gold: #E9C46A;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --xfactor-orange: #F97316;
  --xfactor-orange-dark: #EA580C;
  --safe: #4caf50;
  --safe-bg: rgba(76, 175, 80, 0.15);
  --safe-border: rgba(76, 175, 80, 0.3);
  --safe-text: #4caf50;
  --proceed: #3b82f6;
  --proceed-bg: rgba(59, 130, 246, 0.15);
  --proceed-border: rgba(59, 130, 246, 0.3);
  --proceed-text: #3b82f6;
  --pause: #f59e0b;
  --pause-bg: rgba(245, 158, 11, 0.15);
  --pause-border: rgba(245, 158, 11, 0.3);
  --pause-text: #f59e0b;
  --caution: #ef4444;
  --caution-bg: rgba(239, 68, 68, 0.15);
  --caution-border: rgba(239, 68, 68, 0.3);
  --caution-text: #ef4444;
  --coach-purple: #a78bfa;
  --coach-purple-bg: rgba(167, 139, 250, 0.15);
  --coach-purple-border: rgba(167, 139, 250, 0.3);
  --surface-hover: rgba(255,255,255,0.05);
  --surface-highlight: rgba(255,255,255,0.03);
}

/* Cream Theme (Light) */
[data-theme="cream"] {
  --bg: #fdfbf7;
  --bg-alt: #f8f5f0;
  --bg2: #f8f5f0;
  --bg3: #ffffff;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f4ef;
  --panel-light: #f0ebe3;
  --card: #ffffff;
  --border: #d4cfc4;
  --line: #e5e0d8;
  --line-soft: #f0ebe3;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #7a7a7a;
  --ink: #1a1a1a;
  --ink-secondary: #4a4a4a;
  --ink-muted: #7a7a7a;
  --muted: #7a7a7a;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-light: #fffbeb;
  --cyan: #0891b2;
  --teal: #0d9488;
  --glow: 0 18px 44px rgba(0,0,0,0.08);
  /* Existing decision-helper colors stay the same */
  --xfactor-orange: #F97316;
  --xfactor-orange-dark: #EA580C;
  --safe: #059669;
  --safe-bg: #ECFDF5;
  --safe-border: #A7F3D0;
  --safe-text: #065F46;
  --proceed: #0284C7;
  --proceed-bg: #E0F2FE;
  --proceed-border: #7DD3FC;
  --proceed-text: #0369A1;
  --pause: #D97706;
  --pause-bg: #FFFBEB;
  --pause-border: #FDE68A;
  --pause-text: #92400E;
  --caution: #DC2626;
  --caution-bg: #FEF2F2;
  --caution-border: #FECACA;
  --caution-text: #991B1B;
  --coach-purple: #7C3AED;
  --coach-purple-bg: #F5F3FF;
  --coach-purple-border: #DDD6FE;
  --surface-hover: rgba(0,0,0,0.04);
  --surface-highlight: rgba(0,0,0,0.02);
}

[data-theme="ocean"] {
  --bg: #f0f9ff;
  --bg-alt: #e0f2fe;
  --bg2: #e0f2fe;
  --bg3: #ffffff;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-soft: #e0f2fe;
  --panel-light: #e0f2fe;
  --card: #ffffff;
  --border: #bae6fd;
  --line: #bae6fd;
  --line-soft: #e0f2fe;
  --text: #0c4a6e;
  --text-secondary: #075985;
  --text-muted: #0369a1;
  --ink: #0c4a6e;
  --ink-secondary: #075985;
  --ink-muted: #0369a1;
  --muted: #0369a1;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: #e0f2fe;
  --cyan: #0284c7;
  --teal: #0d9488;
  --glow: 0 18px 44px rgba(0,0,0,0.08);
  --xfactor-orange: #F97316;
  --xfactor-orange-dark: #EA580C;
  --safe: #059669;
  --safe-bg: #ECFDF5;
  --safe-border: #A7F3D0;
  --safe-text: #065F46;
  --proceed: #0284C7;
  --proceed-bg: #E0F2FE;
  --proceed-border: #7DD3FC;
  --proceed-text: #0369A1;
  --pause: #D97706;
  --pause-bg: #FFFBEB;
  --pause-border: #FDE68A;
  --pause-text: #92400E;
  --caution: #DC2626;
  --caution-bg: #FEF2F2;
  --caution-border: #FECACA;
  --caution-text: #991B1B;
  --coach-purple: #7C3AED;
  --coach-purple-bg: #F5F3FF;
  --coach-purple-border: #DDD6FE;
  --surface-hover: rgba(0,0,0,0.04);
  --surface-highlight: rgba(0,0,0,0.02);
}

[data-theme="tanzanite"] {
  --bg: #0f0d1a;
  --bg-alt: #1a1625;
  --bg2: #1a1625;
  --bg3: #252136;
  --surface: #252136;
  --panel: #1e1a2e;
  --panel-soft: #1a1625;
  --panel-light: #352f4a;
  --card: #252136;
  --border: #3d3654;
  --line: #3d3654;
  --line-soft: #2a2440;
  --text: #e8e4f0;
  --text-secondary: #c4bdd4;
  --text-muted: #8b82a8;
  --ink: #e8e4f0;
  --ink-secondary: #c4bdd4;
  --ink-muted: #8b82a8;
  --muted: #8b82a8;
  --accent: #a78bfa;
  --accent-hover: #8b5cf6;
  --accent-light: rgba(167, 139, 250, 0.15);
  --cyan: #a78bfa;
  --teal: #8b5cf6;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --xfactor-orange: #F97316;
  --xfactor-orange-dark: #EA580C;
  --safe: #4ade80;
  --safe-bg: rgba(74, 222, 128, 0.15);
  --safe-border: rgba(74, 222, 128, 0.3);
  --safe-text: #4ade80;
  --proceed: #60a5fa;
  --proceed-bg: rgba(96, 165, 250, 0.15);
  --proceed-border: rgba(96, 165, 250, 0.3);
  --proceed-text: #60a5fa;
  --pause: #fb923c;
  --pause-bg: rgba(251, 146, 60, 0.15);
  --pause-border: rgba(251, 146, 60, 0.3);
  --pause-text: #fb923c;
  --caution: #f87171;
  --caution-bg: rgba(248, 113, 113, 0.15);
  --caution-border: rgba(248, 113, 113, 0.3);
  --caution-text: #f87171;
  --coach-purple: #a78bfa;
  --coach-purple-bg: rgba(167, 139, 250, 0.15);
  --coach-purple-border: rgba(167, 139, 250, 0.3);
  --surface-hover: rgba(255,255,255,0.05);
  --surface-highlight: rgba(255,255,255,0.03);
}

/* Obsidian Theme (Dark) */
[data-theme="obsidian"] {
  --bg: #09090b;
  --bg-alt: #18181b;
  --bg2: #18181b;
  --bg3: #27272a;
  --surface: #27272a;
  --panel: #1c1c1f;
  --panel-soft: #18181b;
  --panel-light: #3f3f46;
  --card: #27272a;
  --border: #3f3f46;
  --line: #3f3f46;
  --line-soft: #27272a;
  --text: #fafafa;
  --text-secondary: #d4d4d8;
  --text-muted: #71717a;
  --ink: #fafafa;
  --ink-secondary: #d4d4d8;
  --ink-muted: #71717a;
  --muted: #71717a;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: rgba(245, 158, 11, 0.15);
  --cyan: #f59e0b;
  --teal: #d97706;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --xfactor-orange: #F97316;
  --xfactor-orange-dark: #EA580C;
  --safe: #4ade80;
  --safe-bg: rgba(74, 222, 128, 0.15);
  --safe-border: rgba(74, 222, 128, 0.3);
  --safe-text: #4ade80;
  --proceed: #60a5fa;
  --proceed-bg: rgba(96, 165, 250, 0.15);
  --proceed-border: rgba(96, 165, 250, 0.3);
  --proceed-text: #60a5fa;
  --pause: #fb923c;
  --pause-bg: rgba(251, 146, 60, 0.15);
  --pause-border: rgba(251, 146, 60, 0.3);
  --pause-text: #fb923c;
  --caution: #f87171;
  --caution-bg: rgba(248, 113, 113, 0.15);
  --caution-border: rgba(248, 113, 113, 0.3);
  --caution-text: #f87171;
  --coach-purple: #a78bfa;
  --coach-purple-bg: rgba(167, 139, 250, 0.15);
  --coach-purple-border: rgba(167, 139, 250, 0.3);
  --surface-hover: rgba(255,255,255,0.05);
  --surface-highlight: rgba(255,255,255,0.03);
}

/* ═══════════════════════════════════════════════════════════════
   TOOLBAR SYSTEM
   ═══════════════════════════════════════════════════════════════ */

body.toolbar-active {
  padding-top: 56px;
}

.app-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-toolbar.active {
  display: flex;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-center {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

body.analysis-mode .toolbar-center {
  display: flex;
}

.toolbar-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.toolbar-btn:hover {
  border-color: var(--cyan);
}

.toolbar-btn:active {
  transform: scale(0.95);
}

.toolbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-logo .logo-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.toolbar-logo .logo-text {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}

@media (max-width: 600px) {
  .toolbar-logo .logo-text {
    display: none;
  }
  .toolbar-center {
    gap: 0.25rem;
  }
  .toolbar-btn span {
    display: none;
  }
}

/* Theme Selector */
.theme-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-label {
  display: flex;
  align-items: center;
  color: var(--muted);
}

.theme-label svg {
  width: 18px;
  height: 18px;
}

.theme-selector select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.theme-selector select:hover {
  border-color: var(--cyan);
}

.theme-selector select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

@media (max-width: 768px) {
  .theme-selector select {
    padding: 6px 28px 6px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .theme-selector {
    display: none;
  }
}

/* Profile Dropdown */
.toolbar-profile {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #050811;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.toolbar-profile.open .profile-chevron {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .profile-name {
    display: none;
  }
  .profile-btn {
    padding: 6px;
    border-radius: 50%;
  }
  .profile-chevron {
    display: none;
  }
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transform-origin: top right;
  transition: all 0.2s ease;
  z-index: 1001;
}

.profile-dropdown.active,
.toolbar-profile.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dropdown-user-details {
  flex: 1;
  min-width: 0;
}

.dropdown-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-user-email {
  font-size: 0.8rem;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-user-plan {
  font-size: 0.75rem;
  color: var(--cyan);
  font-weight: 600;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface-hover);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
}

/* App Launcher */
.app-launcher-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 998;
}

.app-launcher-overlay.active {
  opacity: 1;
  visibility: visible;
}

.app-launcher {
  position: fixed;
  top: 64px;
  left: 16px;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(-10px);
  transform-origin: top left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow: hidden;
}

.app-launcher.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.app-launcher-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.app-launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--ink);
}

.app-launcher-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.app-launcher-item.current {
  background: var(--surface);
  border-color: var(--cyan);
}

.app-launcher-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  transition: all 0.2s ease;
}

.app-emoji {
  font-size: 1.75rem;
}

.app-launcher-item:hover .app-launcher-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-launcher-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  line-height: 1.3;
}

@media (max-width: 400px) {
  .app-launcher {
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ORIGINAL DECISION HELPER STYLES
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Spacing System */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border);
}

.logo-icon.xfactor-logo svg {
  width: 32px;
  height: 32px;
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN
   ═══════════════════════════════════════════════════════════════ */

.main {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* ═══════════════════════════════════════════════════════════════
   INPUT SECTION
   ═══════════════════════════════════════════════════════════════ */

.input-section {
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

body:not(.analysis-mode) .welcome-gate.hidden ~ .main .input-section {
  display: block;
}

.input-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.input-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.input-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════
   PERSONA SELECTOR
   ═══════════════════════════════════════════════════════════════ */

.persona-section {
  margin-bottom: var(--space-lg);
}

.persona-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
}

@media (max-width: 700px) {
  .persona-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .persona-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.persona-card {
  padding: var(--space-md);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.persona-card:hover {
  border-color: var(--xfactor-orange);
  background: var(--accent-light);
}

.persona-card.active {
  border-color: var(--xfactor-orange);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.persona-emoji {
  font-size: 1.75rem;
  margin-bottom: var(--space-xs);
}

.persona-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.persona-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Persona Info Box */
.persona-info {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--coach-purple-bg);
  border: 1px solid var(--coach-purple-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.persona-info-icon {
  font-size: 1.25rem;
}

.persona-info-text {
  font-size: 0.85rem;
  color: var(--coach-purple);
  line-height: 1.5;
}

.persona-info-text strong {
  display: block;
  margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT AREA
   ═══════════════════════════════════════════════════════════════ */

.input-area {
  width: 100%;
  min-height: 140px;
  padding: var(--space-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s ease;
}

.input-area:focus {
  outline: none;
  border-color: var(--accent);
}

.input-area::placeholder {
  color: var(--text-muted);
}

.analyze-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(135deg, var(--xfactor-orange) 0%, var(--xfactor-orange-dark) 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   ANALYSIS OUTPUT
   ═══════════════════════════════════════════════════════════════ */

.analysis {
  display: none;
}

.analysis.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

/* Hide input when analysis is visible */
body.analysis-mode .input-section {
  display: none;
}

body.analysis-mode .back-to-input {
  display: flex;
}

/* Footer visible by default, hidden during loading */
.page-footer {
  display: block;
}

.loading.visible ~ .page-footer {
  display: none;
}

.back-to-input {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: auto;
}

.back-to-input:hover {
  border-color: var(--xfactor-orange);
  color: var(--xfactor-orange);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   COACHING HERO
   ═══════════════════════════════════════════════════════════════ */

.coach-hero {
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  text-align: center;
  position: relative;
}

.coach-hero.pause {
  background: linear-gradient(135deg, var(--pause-bg) 0%, #FEF3C7 100%);
  border: 2px solid var(--pause-border);
}

.coach-hero.ready {
  background: linear-gradient(135deg, var(--safe-bg) 0%, #D1FAE5 100%);
  border: 2px solid var(--safe-border);
}

.coach-hero.stop {
  background: linear-gradient(135deg, var(--caution-bg) 0%, #FEE2E2 100%);
  border: 2px solid var(--caution-border);
}

.coach-emoji {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.coach-greeting {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
  opacity: 0.7;
}

.coach-verdict {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  letter-spacing: -0.5px;
}

.coach-hero.pause .coach-verdict { color: var(--pause-text); }
.coach-hero.ready .coach-verdict { color: var(--safe-text); }
.coach-hero.stop .coach-verdict { color: var(--caution-text); }

.coach-message {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  line-height: 1.7;
}

.coach-reassurance {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: white;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════════════════════
   EXECUTIVE SUMMARY (for VP/CEO)
   ═══════════════════════════════════════════════════════════════ */

.exec-summary {
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  color: white;
}

.exec-summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.exec-summary-icon {
  font-size: 1.5rem;
}

.exec-summary-title {
  font-size: 1rem;
  font-weight: 700;
}

.exec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 600px) {
  .exec-grid {
    grid-template-columns: 1fr;
  }
}

.exec-item {
  padding: var(--space-md);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  border-left: 3px solid;
}

.exec-item.risk { border-left-color: var(--caution); }
.exec-item.opportunity { border-left-color: var(--safe); }
.exec-item.decision { border-left-color: var(--proceed); }

.exec-item-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  margin-bottom: var(--space-xs);
}

.exec-item-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.exec-bottom-line {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.6;
}

.exec-bottom-line strong {
  color: #FCD34D;
}

/* ═══════════════════════════════════════════════════════════════
   DELEGATION SECTION (for CEO)
   ═══════════════════════════════════════════════════════════════ */

.delegation-section {
  background: var(--card);
  border: 2px solid var(--coach-purple);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.delegation-header {
  background: var(--coach-purple);
  color: white;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.delegation-header-icon {
  font-size: 1.25rem;
}

.delegation-header-text {
  font-size: 1rem;
  font-weight: 700;
}

.delegation-list {
  padding: var(--space-lg);
}

.delegation-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border-left: 4px solid var(--coach-purple);
}

.delegation-item:last-child {
  margin-bottom: 0;
}

.delegation-who {
  padding: 4px 12px;
  background: var(--coach-purple);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  height: fit-content;
}

.delegation-content {
  flex: 1;
}

.delegation-task {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.delegation-why {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   SIMPLE SECTION (for Personal)
   ═══════════════════════════════════════════════════════════════ */

.simple-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.simple-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.simple-icon {
  font-size: 1.5rem;
}

.simple-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.simple-list {
  list-style: none;
}

.simple-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.simple-list li:last-child {
  margin-bottom: 0;
}

.simple-bullet {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   STANDARD SECTIONS (reused)
   ═══════════════════════════════════════════════════════════════ */

.encourage-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid #FCD34D;
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.encourage-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.encourage-text {
  font-size: 0.95rem;
  color: #92400E;
  line-height: 1.6;
}

/* Positives */
.positives-section {
  background: var(--safe-bg);
  border: 1px solid var(--safe-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.positives-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.positives-icon {
  font-size: 1.25rem;
}

.positives-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--safe-text);
}

.positives-intro {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-style: italic;
}

.positives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.positive-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-md);
}

.positive-check {
  color: var(--safe);
  font-weight: 700;
}

.positive-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Quick Wins */
.quickwins-section {
  background: linear-gradient(135deg, var(--safe-bg) 0%, #D1FAE5 100%);
  border: 1px solid var(--safe-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.quickwins-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.quickwins-icon {
  font-size: 1.5rem;
}

.quickwins-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--safe-text);
}

.quickwins-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quickwin-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.quickwin-item:last-child {
  margin-bottom: 0;
}

.quickwin-badge {
  width: 40px;
  height: 40px;
  background: var(--safe-bg);
  border: 1px solid var(--safe-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.quickwin-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Actions */
.actions-section {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.actions-header {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: white;
  padding: var(--space-lg);
  text-align: center;
}

.actions-header-emoji {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.actions-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.actions-header-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
}

.actions-progress {
  padding: var(--space-md) var(--space-lg);
  background: rgba(255,255,255,0.5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--safe) 100%);
  border-radius: 100px;
  transition: width 0.4s ease;
}

.actions-list {
  padding: var(--space-md);
}

.action-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--bg);
}

.action-item:last-child {
  margin-bottom: 0;
}

.action-item:hover {
  background: var(--card);
  border-color: var(--accent);
}

.action-item.completed {
  background: var(--safe-bg);
  border-color: var(--safe-border);
}

.action-checkbox {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  color: transparent;
  transition: all 0.2s ease;
}

.action-item.completed .action-checkbox {
  background: var(--safe);
  border-color: var(--safe);
  color: white;
}

.action-content {
  flex: 1;
}

.action-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.action-item.completed .action-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.action-why {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.action-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
  padding: 6px 12px;
  background: var(--coach-purple-bg);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--coach-purple);
}

.actions-celebration {
  text-align: center;
  padding: var(--space-xl);
  background: linear-gradient(135deg, var(--safe-bg) 0%, #D1FAE5 100%);
  border-top: 2px solid var(--safe);
  animation: celebrateIn 0.5s ease;
}

@keyframes celebrateIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.celebration-emoji {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.celebration-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--safe-text);
}

/* Concerns */
.concerns-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.concerns-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.concerns-icon {
  font-size: 1.25rem;
}

.concerns-title-group {
  flex: 1;
}

.concerns-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.concerns-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.concerns-list {
  padding: var(--space-lg);
}

.concern-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  border-left: 4px solid;
}

.concern-item:last-child {
  margin-bottom: 0;
}

.concern-item.high {
  background: var(--caution-bg);
  border-left-color: var(--caution);
}

.concern-item.medium {
  background: var(--pause-bg);
  border-left-color: var(--pause);
}

.concern-priority {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.concern-item.high .concern-priority { background: var(--caution); }
.concern-item.medium .concern-priority { background: var(--pause); }

.concern-content {
  flex: 1;
}

.concern-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.concern-explain {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.concern-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: white;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* Next Steps */
.nextsteps-section {
  background: linear-gradient(135deg, var(--proceed-bg) 0%, #BAE6FD 100%);
  border: 1px solid var(--proceed-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.nextsteps-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.nextsteps-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--proceed-text);
  margin-bottom: var(--space-sm);
}

.nextsteps-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto var(--space-lg);
  line-height: 1.6;
}

.nextsteps-timeline {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.timeline-step {
  text-align: center;
}

.timeline-badge {
  width: 48px;
  height: 48px;
  background: white;
  border: 2px solid var(--proceed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin: 0 auto var(--space-sm);
}

.timeline-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.nextsteps-encouragement {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: white;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Export */
.export-section {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

/* Loading & Toast */
.loading{position:fixed;inset:0;background:transparent;display:none;align-items:center;justify-content:center;z-index:10002;opacity:0;visibility:hidden;transition:all 0.2s}
.loading.visible{display:flex;opacity:1;visibility:visible;background:rgba(0,0,0,0.7);backdrop-filter:blur(8px)}
.loading-content{background:white;border-radius:20px;width:90%;max-width:440px;padding:2rem;text-align:center;transform:translateY(20px);transition:transform 0.2s;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);position:relative;z-index:10003}
.loading.visible .loading-content{transform:translateY(0)}
.loading-cancel{position:absolute;top:1rem;right:1rem;background:none;border:none;color:#999;cursor:pointer;padding:0.25rem;font-size:1.5rem;z-index:10;transition:all 0.2s}
.loading-cancel:hover{color:#333}
.loading-spinner{width:48px;height:48px;border:3px solid #e5e5e5;border-top-color:#06b6d4;border-radius:50%;animation:spin 1s linear infinite;margin:0 auto}
.loading-text-container{text-align:center;margin-top:1rem}
.loading-text{font-size:1rem;font-weight:600;color:#1a1a1a}
.loading-subtext{font-size:0.8125rem;color:#666;margin-top:0.5rem}
.loading-progress{width:200px;height:4px;background:#e5e5e5;border-radius:2px;overflow:hidden;margin:1rem auto 0}
.loading-progress-bar{height:100%;background:#06b6d4;border-radius:2px;animation:loadingProgress 2s ease-in-out infinite}
.loading-cancel-btn{margin-top:1rem;padding:0.625rem 1.5rem;background:#f5f5f5;border:1px solid #e5e5e5;border-radius:8px;color:#1a1a1a;font-size:0.875rem;font-weight:600;cursor:pointer;transition:all 0.2s}
.loading-cancel-btn:hover{background:#e8f7fb;border-color:#06b6d4;color:#06b6d4}
.helper-pills-container{position:fixed;inset:0;pointer-events:none;overflow:hidden;opacity:0;transition:opacity 0.3s;z-index:10004}
.helper-pills-container.active{opacity:1}
.helper-pill{position:absolute;padding:8px 14px;border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;opacity:0;transition:opacity 0.3s;box-shadow:0 4px 16px rgba(0,0,0,0.15);border:1px solid rgba(255,255,255,0.3);z-index:10004}
.helper-pill.visible{opacity:1}
.helper-pill.marketing{background:linear-gradient(135deg,#c4a052 0%,#a88a3e 100%);color:white}
.helper-pill.audience{background:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);color:white}
.helper-pill.content{background:linear-gradient(135deg,#10b981 0%,#059669 100%);color:white}
.helper-pill.strategy{background:linear-gradient(135deg,#8b5cf6 0%,#6366f1 100%);color:white}
.helper-pill.insight{background:linear-gradient(135deg,#f59e0b 0%,#d97706 100%);color:white}
.helper-pill.creative{background:linear-gradient(135deg,#ec4899 0%,#db2777 100%);color:white}
.helper-pill.processing{background:linear-gradient(135deg,#64748b 0%,#475569 100%);color:white}
@keyframes loadingProgress{0%{width:0%}50%{width:80%}100%{width:100%}}
.spinner{width:48px;height:48px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:spin 0.8s linear infinite;margin:0 auto var(--space-md)}
@keyframes spin{to{transform:rotate(360deg)}}

/* Config/Settings Modal */
.config-modal{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(7,11,18,0.95);
  z-index:2001;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.config-modal.active{display:flex}

.config-panel{
  background:var(--panel);
  border-radius:16px;
  padding:32px;
  max-width:600px;
  width:100%;
  max-height:90vh;
  overflow-y:auto;
  border:1px solid var(--border);
  box-shadow:var(--glow);
}

.config-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px;
  padding-bottom:16px;
  border-bottom:2px solid var(--line);
}

.config-title{
  font-size:1.5rem;
  font-weight:700;
  color:var(--cyan);
}

.config-close{
  width:32px;
  height:32px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--ink);
  font-size:1.2rem;
  cursor:pointer;
  transition:all 0.2s;
}

.config-close:hover{
  background:rgba(255,255,255,0.1);
  border-color:var(--cyan);
}

.config-section{
  margin-bottom:24px;
}

.config-section-title{
  font-size:0.85rem;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:12px;
}

/* Theme Picker */
.theme-picker{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.theme-option{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  background:var(--panel-soft);
  border:2px solid var(--line);
  border-radius:10px;
  cursor:pointer;
  transition:all 0.2s;
}

.theme-option:hover{
  border-color:var(--cyan);
  transform:translateY(-2px);
}

.theme-option.active{
  border-color:var(--accent);
  background:rgba(255,145,77,0.1);
}

.theme-preview{
  width:36px;
  height:36px;
  border-radius:8px;
}

.theme-name{
  font-size:0.75rem;
  font-weight:600;
  color:var(--muted);
}

.form-group{
  margin-bottom:16px;
}

.form-label{
  display:block;
  font-size:0.9rem;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:600;
}

.form-input,
.form-select{
  width:100%;
  padding:10px 14px;
  background:var(--panel-light);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--ink);
  font-size:0.95rem;
  transition:all 0.2s;
}

.form-input:focus,
.form-select:focus{
  outline:none;
  border-color:var(--cyan);
  background:var(--panel);
}

.form-hint{
  font-size:0.8rem;
  color:var(--muted);
  margin-top:4px;
  font-style:italic;
}

.config-actions{
  display:flex;
  gap:12px;
  margin-top:24px;
  padding-top:20px;
  border-top:2px solid var(--line);
}

.config-btn-primary{
  flex:1;
  padding:12px 20px;
  background:linear-gradient(135deg, var(--cyan), var(--teal));
  border:none;
  border-radius:10px;
  color:#050811;
  font-size:1rem;
  font-weight:700;
  cursor:pointer;
  transition:all 0.2s;
}

.config-btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 24px rgba(6,182,212,0.4);
}

.config-btn-secondary{
  flex:1;
  padding:12px 20px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--ink);
  font-size:1rem;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s;
}

.config-btn-secondary:hover{
  background:rgba(255,255,255,0.1);
  border-color:var(--cyan);
}

.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1001;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 4px solid var(--safe); }
.toast.error { border-left: 4px solid var(--caution); }

/* Print */
@media print {
  .header, .input-section, .export-section, .loading, .toast-container, .welcome-gate, .page-footer, .settings-modal {
    display: none !important;
  }
  .analysis { display: block !important; }
}

/* ═══════════════════════════════════════════════════════════════
   WELCOME GATE
   ═══════════════════════════════════════════════════════════════ */

.welcome-gate {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-xl);
  min-height: auto;
}

.welcome-gate.hidden {
  display: none;
}

.welcome-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.welcome-x-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.welcome-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.welcome-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (max-width: 500px) {
  .welcome-grid {
    grid-template-columns: 1fr;
  }
}

.welcome-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg);
  border-radius: var(--radius-md);
}

.welcome-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.welcome-mini-x {
  width: 20px;
  height: 20px;
}

.welcome-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.welcome-item-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-btn {
  display: block;
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(135deg, var(--xfactor-orange) 0%, var(--xfactor-orange-dark) 100%);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.welcome-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE FOOTER DISCLOSURE
   ═══════════════════════════════════════════════════════════════ */

.page-footer {
  position: relative;
  z-index: 1001;
  padding: 24px 16px 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.ai-disclaimer {
  background: linear-gradient(145deg, rgba(255, 184, 0, 0.08) 0%, rgba(255, 184, 0, 0.03) 100%);
  border: 1px solid rgba(255, 184, 0, 0.15);
  border-radius: 16px;
  padding: 18px;
  margin: 0 auto 24px;
  max-width: 800px;
}

.ai-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #FFB800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-disclaimer-text {
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: var(--cyan);
}

.footer-copyright {
  text-align: center;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}
