/* ================================================================
   UNFURL — Universal Adaptive Clarity Engine
   Design System: NoirBloom x VelvetGold x TagSystem Fusion
   Dark-first. WCAG AAA. Luxury-tier.
   ================================================================ */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Surfaces — warm-tinted darks */
  --surface-canvas: #0a0a09;
  --surface-1: #121210;
  --surface-2: #1a1917;
  --surface-3: #242320;
  --surface-4: #2e2d2a;

  /* Accent — UNFURL lime green (from logo) */
  --accent: #9EC02B;
  --accent-light: #B5D84A;
  --accent-dark: #7EA020;
  --accent-dim: rgba(158, 192, 43, 0.10);
  --accent-glow: rgba(158, 192, 43, 0.25);
  --accent-border: rgba(158, 192, 43, 0.20);

  /* Teal — deep teal from logo */
  --teal: #1B3E50;
  --teal-light: #2A5F78;
  --teal-glow: rgba(27, 62, 80, 0.30);

  /* Gold highlight — tulip accent from icon */
  --gold: #D4A04A;
  --gold-dim: rgba(212, 160, 74, 0.08);
  --gold-glow: rgba(212, 160, 74, 0.15);

  /* Semantic */
  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;

  /* Text — warm whites */
  --text-primary: #e8e4e0;
  --text-secondary: #b0a898;
  --text-tertiary: #9a8e82;
  --text-disabled: #5a5048;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(158, 192, 43, 0.25);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'Fira Code', monospace;

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

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-glow-lg: 0 0 32px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-luxury: 500ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width: 1100px;
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
  --surface-canvas: #FAFAF8;
  --surface-1: #F2F1EE;
  --surface-2: #E8E7E3;
  --surface-3: #DDDCD8;
  --surface-4: #D1D0CC;

  --accent: #6B8A1A;
  --accent-light: #7EA020;
  --accent-dark: #4F6A10;
  --accent-dim: rgba(107, 138, 26, 0.08);
  --accent-glow: rgba(107, 138, 26, 0.15);
  --accent-border: rgba(107, 138, 26, 0.25);

  --teal: #1B3E50;
  --teal-light: #2A5F78;
  --teal-glow: rgba(27, 62, 80, 0.12);

  --gold: #B8882E;
  --gold-dim: rgba(184, 136, 46, 0.06);
  --gold-glow: rgba(184, 136, 46, 0.10);

  --success: #1A9960;
  --warning: #C89300;
  --error: #D04040;

  --text-primary: #1C1B18;
  --text-secondary: #4A4740;
  --text-tertiary: #5e5b55;
  --text-disabled: #A8A5A0;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --border-accent: rgba(107, 138, 26, 0.25);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-glow-lg: 0 0 32px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.theme-toggle:hover {
  background: var(--surface-3);
  color: var(--accent);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-glow);
}

/* Light-specific component overrides */
[data-theme="light"] .hero {
  background: linear-gradient(180deg, #F0EFE8, #F5F4F0 50%, var(--surface-canvas));
}
[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse at center, rgba(107, 138, 26, 0.06) 0%, rgba(27, 62, 80, 0.03) 50%, transparent 80%);
}
[data-theme="light"] .session-header {
  background: rgba(250, 250, 248, 0.85);
}
[data-theme="light"] .chat-input-area {
  background: rgba(250, 250, 248, 0.92);
}
[data-theme="light"] .message-user {
  box-shadow: 0 2px 12px rgba(107, 138, 26, 0.15);
}
[data-theme="light"] .directive-overlay {
  background: rgba(255, 255, 255, 0.65);
}
[data-theme="light"] .directive-card {
  box-shadow: 0 0 40px rgba(107, 138, 26, 0.06), 0 16px 48px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .domain-picker::before {
  background: radial-gradient(ellipse at center, rgba(107, 138, 26, 0.04) 0%, transparent 70%);
}
[data-theme="light"] ::selection {
  background: var(--accent);
  color: #fff;
}
[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .confidence-panel {
  background: var(--surface-1);
}
[data-theme="light"] .new-session-bar {
  background: rgba(250, 250, 248, 0.92);
}
[data-theme="light"] .hero-glow {
  background: radial-gradient(circle at center,
    rgba(107, 138, 26, 0.10) 0%,
    rgba(27, 62, 80, 0.06) 35%,
    rgba(107, 138, 26, 0.03) 60%,
    transparent 80%
  );
  opacity: 0.4;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}
[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font-body);
  background: var(--surface-canvas);
  color: var(--text-primary);
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding-top: var(--s-shell-height, 0px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--surface-canvas);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-light); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
}
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }
h4, h5, h6 { font-weight: 500; }

/* ================================================================
   LANDING PAGE
   ================================================================ */

/* --- Hero --- */
.hero {
  position: relative;
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  background: linear-gradient(180deg, #0a1014, #0a0f12 50%, var(--surface-canvas));
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(158, 192, 43, 0.06) 0%, rgba(27, 62, 80, 0.04) 50%, transparent 80%);
  pointer-events: none;
}

.brand {
  margin-bottom: 2rem;
  position: relative;
  display: flex;
  justify-content: center;
}
.brand-logo {
  height: 110px;
  width: auto;
}
.brand-logo-sm {
  height: 40px;
  width: auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 800px;
  margin: 0 auto 1.5rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}
.subtitle strong {
  color: var(--accent-light);
}

.cta-button {
  display: inline-block;
  background: var(--accent);
  color: var(--surface-canvas);
  padding: 16px 40px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-luxury);
  box-shadow: 0 0 20px var(--accent-glow);
  position: relative;
}
.cta-button:hover {
  background: var(--accent-light);
  color: var(--surface-canvas);
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.4);
}
.cta-button:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 100ms;
}

.cta-subtext {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* --- Hero Glow --- */
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(158, 192, 43, 0.12) 0%,
    rgba(27, 62, 80, 0.08) 35%,
    rgba(158, 192, 43, 0.04) 60%,
    transparent 80%
  );
  opacity: 0.35;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  animation: heroGlowPulse 8s ease-in-out infinite;
}
@keyframes heroGlowPulse {
  0%, 100% { transform: translate(-50%, -55%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -55%) scale(1.15); opacity: 0.45; }
}
.hero .container { position: relative; z-index: 1; }

/* --- Social Proof --- */
.social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s forwards;
}
.social-proof p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.social-proof-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.social-proof-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}
.social-proof-dots span:nth-child(2) {
  opacity: 0.35;
}
.social-proof-dots span:nth-child(3) {
  opacity: 0.2;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Domain Grid (Landing) --- */
.domains {
  padding: var(--space-2xl) 0;
  background: transparent;
}
.domains h2 {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  letter-spacing: -0.01em;
}

.domain-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 720px;
  margin: 0 auto;
  background: var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.domain-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-align: left;
  background: var(--surface-canvas);
  border: none;
  padding: var(--space-md) var(--space-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-luxury);
  position: relative;
}
.domain-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--teal), var(--accent));
  opacity: 0;
  transition: opacity var(--transition-luxury);
}
.domain-card:hover {
  background: var(--surface-1);
  color: var(--text-primary);
}
.domain-card:hover::before {
  opacity: 1;
}
.domain-card:hover .domain-icon {
  color: var(--accent);
  transform: scale(1.1);
}

.domain-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: all var(--transition-luxury);
}
.domain-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: all var(--transition-luxury);
}
.domain-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.domain-card p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* --- How It Works --- */
.how-it-works {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
}
.how-it-works h2 {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  letter-spacing: -0.01em;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
  counter-reset: step-counter;
}
.step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.step:last-child {
  border-bottom: none;
}
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.step h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}
.step p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* --- Values --- */
.values {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.value-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}

.value-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: var(--space-lg) 0;
  padding-left: var(--space-md);
  position: relative;
}
.value-card:last-child {
  border-bottom: none;
}
.value-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-lg);
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--teal), var(--accent));
}
.value-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.value-card p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* --- Pricing --- */
.pricing {
  padding: var(--space-2xl) 0;
  text-align: center;
}
.pricing h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  letter-spacing: -0.01em;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  max-width: 900px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  transition: all var(--transition-luxury);
}
.pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.pricing-card.featured {
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, var(--teal-light), var(--accent) 50%, var(--gold)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 32px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--surface-canvas);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 0 12px var(--accent-glow);
  white-space: nowrap;
}

.pricing-card h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.price {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.price span {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-weight: 400;
}

.pricing-card ul {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}
.pricing-card li {
  padding: 0.4rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.pricing-card li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  margin-right: 0.6rem;
}

.pricing-cta {
  display: inline-block;
  padding: 12px 32px;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-base);
  letter-spacing: 0.01em;
}
.pricing-cta:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: 0 0 16px var(--accent-glow);
}
.featured .pricing-cta {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface-canvas);
}
.featured .pricing-cta:hover {
  background: var(--accent-light);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* --- Quote --- */
.quote-section {
  padding: var(--space-2xl) 0;
  background: var(--surface-1);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}
blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-style: italic;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
  padding-top: 2rem;
}
blockquote::before {
  content: '\201C';
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--accent-dim);
  line-height: 1;
  pointer-events: none;
}
blockquote footer {
  font-family: var(--font-body);
  font-size: 0.85rem;
  margin-top: 1rem;
  font-style: normal;
  color: var(--text-tertiary);
}

/* --- Site Footer --- */
.site-footer {
  padding: var(--space-xl) 0;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}
.site-footer .brand {
  margin-bottom: 0.5rem;
}
.site-footer .brand-logo {
  height: 32px;
}
.site-footer p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
.footer-links { margin-top: 1rem; }
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--accent); }
.separator { margin: 0 0.6rem; color: var(--border-medium); }
.footer-attribution {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.footer-attribution a {
  color: var(--accent);
  font-weight: 500;
}
.footer-attribution a:hover {
  color: var(--accent-light);
}
.footer-copyright {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-disabled);
  letter-spacing: 0.02em;
}

/* ================================================================
   SESSION / CHAT PAGE
   ================================================================ */

.session-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--surface-canvas);
}

/* --- Session Header (frosted glass) --- */
.session-header {
  padding: 12px var(--space-md);
  background: rgba(10, 10, 9, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.session-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.session-brand img {
  height: 28px;
  width: auto;
}
.progress-container {
  flex: 1;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 2px;
  transition: width var(--transition-luxury);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: progressPulse 2s ease-in-out infinite;
}
@keyframes progressPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50% { box-shadow: 0 0 16px var(--accent-glow); }
}
.progress-text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

/* --- Chat Messages --- */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.chat-container::-webkit-scrollbar {
  width: 6px;
}
.chat-container::-webkit-scrollbar-track {
  background: transparent;
}
.chat-container::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}

.chat-messages {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  line-height: 1.7;
  font-size: 0.93rem;
  animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.message-assistant {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--radius-sm);
  color: var(--text-primary);
}
.message-user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--surface-canvas);
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(158, 192, 43, 0.2);
}

.message-assistant strong { color: var(--accent-light); }
.message-assistant em { color: var(--text-secondary); }
.message-assistant h1,
.message-assistant h2,
.message-assistant h3 {
  color: var(--accent);
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}
.message-assistant h2 { font-size: 1.1rem; }
.message-assistant h3 { font-size: 1rem; }
.message-assistant ul,
.message-assistant ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.message-assistant li {
  margin-bottom: 0.3rem;
  color: var(--text-secondary);
}
.message-assistant code {
  background: var(--surface-canvas);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-light);
}
.message-assistant pre {
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin: 0.75rem 0;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}
.message-assistant pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}
.message-assistant hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1rem 0;
}

.message-system {
  align-self: center;
  text-align: center;
  padding: var(--space-sm);
}
.view-directive-btn {
  font-size: 0.95rem;
  padding: 0.6rem 1.5rem;
}

/* Typing indicator */
.typing-indicator {
  align-self: flex-start;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  display: flex;
  gap: 6px;
  align-items: center;
  animation: messageIn 0.3s ease both;
}
.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Directive Overlay --- */
.directive-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-sm);
  animation: overlayIn 0.4s ease both;
}
.directive-card {
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(158, 192, 43, 0.08), 0 16px 48px rgba(0, 0, 0, 0.6);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.directive-card::-webkit-scrollbar { width: 6px; }
.directive-card::-webkit-scrollbar-track { background: transparent; }
.directive-card::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

.directive-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--accent);
  letter-spacing: -0.01em;
}
.directive-content {
  line-height: 1.8;
  font-size: 0.93rem;
  color: var(--text-secondary);
}
.directive-content h2 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  color: var(--accent);
}
.directive-content h3 {
  font-size: 1rem;
  color: var(--accent-light);
  margin-top: 1rem;
}
.directive-content ul, .directive-content ol { padding-left: 1.5rem; }
.directive-content li { margin-bottom: 0.5rem; }
.directive-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.5rem 0;
}
.directive-content strong { color: var(--text-primary); }

.directive-content pre {
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.directive-content code {
  background: var(--surface-canvas);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-light);
}
.directive-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.locked-content {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.directive-actions {
  margin-top: var(--space-lg);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Buttons --- */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  letter-spacing: 0.01em;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--surface-canvas);
  box-shadow: 0 0 12px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 0 8px var(--accent-glow);
  transition-duration: 100ms;
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.btn-secondary:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.btn-secondary:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}

.btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border-medium);
}
.btn-ghost:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.btn-ghost:active {
  transform: scale(0.97);
  background: var(--surface-3);
  transition-duration: 100ms;
}

/* --- Chat Input --- */
.chat-input-area {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 10, 9, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.input-wrapper {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
#userInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.93rem;
  line-height: 1.5;
  resize: none;
  min-height: 46px;
  max-height: 130px;
  background: var(--surface-1);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}
#userInput::placeholder {
  color: var(--text-tertiary);
}
#userInput:hover {
  border-color: var(--accent-border);
}
#userInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 16px var(--accent-glow);
  background: var(--surface-2);
}

.send-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--surface-canvas);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-bounce);
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-glow);
}
.send-button:hover {
  background: var(--accent-light);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 0 20px var(--accent-glow);
}
.send-button:active:not(:disabled) {
  transform: scale(0.92);
  transition-duration: 100ms;
}
.send-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: scale(0.95);
  transition: all var(--transition-base);
}

/* ================================================================
   DOMAIN PICKER (Session Page)
   ================================================================ */

.domain-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
  background: var(--surface-canvas);
  position: relative;
}
.domain-picker::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(158, 192, 43, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  margin-bottom: 1rem;
}
.back-home:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.domain-picker-inner {
  max-width: 680px;
  width: 100%;
  position: relative;
}

.domain-picker h2 {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.domain-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.domain-picker-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-align: left;
  background: var(--surface-canvas);
  border: none;
  border-radius: 0;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: all var(--transition-luxury);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}
.domain-picker-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--teal), var(--accent));
  opacity: 0;
  transition: opacity var(--transition-luxury);
}
.domain-picker-card:hover {
  background: var(--surface-1);
}
.domain-picker-card:hover::before {
  opacity: 1;
}
.domain-picker-card:hover .domain-picker-icon {
  color: var(--accent);
  transform: scale(1.1);
}
.domain-picker-card:active {
  background: var(--surface-2);
}
.domain-picker-card:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.domain-card:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.domain-picker-icon {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: all var(--transition-luxury);
}

.domain-picker-card strong {
  display: block;
  margin-bottom: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.domain-picker-tagline {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ================================================================
   EXPORT GROUP
   ================================================================ */

.export-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================================================================
   EMAIL COLLECTION MODAL
   ================================================================ */

.email-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: var(--space-sm);
  animation: overlayIn 0.4s ease both;
}
.email-modal-card {
  background: var(--surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(158, 192, 43, 0.08), 0 16px 48px rgba(0, 0, 0, 0.6);
  position: relative;
}
.email-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}
.email-modal-close:hover {
  color: var(--text-primary);
}
.email-modal-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.email-modal-card > p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}
.email-form {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-sm);
}
.email-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.93rem;
  background: var(--surface-2);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}
.email-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.email-form .btn {
  white-space: nowrap;
}
.email-privacy {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.email-privacy a {
  color: var(--text-secondary);
  text-decoration: underline;
}
.email-privacy a:hover {
  color: var(--accent);
}

/* ================================================================
   PHASE NAVIGATION
   ================================================================ */

.phase-nav {
  padding: var(--space-md) var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-canvas);
  animation: fadeIn 0.5s ease both;
}
.phase-nav-inner {
  max-width: 700px;
  margin: 0 auto;
}
.phase-nav h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--accent);
}
.phase-nav-subtitle {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}
.phase-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.phase-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-body);
  color: var(--text-primary);
  position: relative;
}
.phase-card:hover:not([aria-disabled="true"]) {
  border-color: var(--accent-border);
  background: var(--surface-3);
  transform: translateY(-1px);
  box-shadow: 0 0 12px var(--accent-glow);
}
.phase-card:active:not(:disabled) {
  transform: scale(0.98);
  transition-duration: 100ms;
}
.phase-card strong {
  font-size: 0.85rem;
  font-weight: 600;
}
.phase-card-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.phase-card-special {
  border-color: var(--gold-dim);
  background: linear-gradient(135deg, var(--surface-2), rgba(212, 160, 74, 0.04));
}
.phase-card-special:hover:not([aria-disabled="true"]) {
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}
.phase-locked,
.phase-card[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.phase-card[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-subtle);
}
.phase-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
}

/* ================================================================
   SESSION ACTIONS BAR
   ================================================================ */

.session-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

/* Locked button state (premium gate) */
.btn-locked,
.btn-locked:hover,
.btn-locked:active {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-locked::after {
  content: '\1F512';
  font-size: 0.72rem;
  margin-left: 6px;
}

/* ================================================================
   NAME SUGGESTIONS (Phase 3)
   ================================================================ */

.message.name-suggestions {
  max-width: 100%;
}
.name-suggestions h3 {
  color: var(--accent);
  margin-bottom: var(--space-sm);
}
.name-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.name-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.name-card:hover {
  border-color: var(--accent-border);
  background: var(--surface-1);
}
.name-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.name-info {
  flex: 1;
  min-width: 0;
}
.name-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  display: block;
}
.name-lens {
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.name-why {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 2px 0;
}
.name-domain {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}
.name-uniqueness {
  font-size: 0.72rem;
  color: var(--gold);
  margin-left: 8px;
}

/* ================================================================
   PHASE 2 OUTPUT
   ================================================================ */

.message.phase2-output {
  max-width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
}
.phase2-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}
.phase2-output-header h3 {
  color: var(--accent);
  margin: 0;
  font-size: 0.95rem;
}
.phase2-output-actions {
  display: flex;
  gap: 6px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.75rem;
}
.phase2-output-content {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.phase2-output-content h2 {
  color: var(--accent);
  font-size: 1rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}
.phase2-output-content h3 {
  color: var(--text-primary);
  font-size: 0.92rem;
  margin-top: var(--space-sm);
}
.phase2-output-content ul,
.phase2-output-content ol {
  padding-left: var(--space-md);
  margin: var(--space-xs) 0;
}
.phase2-output-content li {
  margin-bottom: 4px;
}
.phase2-output-content strong {
  color: var(--text-primary);
}

/* Light mode overrides for new components */
[data-theme="light"] .email-modal {
  background: rgba(255, 255, 255, 0.65);
}
[data-theme="light"] .email-modal-card {
  box-shadow: 0 0 40px rgba(107, 138, 26, 0.06), 0 16px 48px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .name-card {
  background: var(--surface-1);
}
[data-theme="light"] .message.phase2-output {
  background: var(--surface-1);
  border-color: var(--accent-border);
}
[data-theme="light"] .phase-card:hover:not([aria-disabled="true"]) {
  box-shadow: 0 0 12px rgba(107, 138, 26, 0.12);
}
[data-theme="light"] .phase-card-special {
  background: linear-gradient(135deg, var(--surface-2), rgba(184, 136, 46, 0.06));
}
[data-theme="light"] .phase-card[aria-disabled="true"] {
  opacity: 0.6;
}

@media (max-width: 768px) {
  .phase-cards {
    grid-template-columns: 1fr;
  }
  .email-form {
    flex-direction: column;
  }
  .session-actions {
    flex-direction: column;
  }
}

/* ================================================================
   TOAST NOTIFICATION SYSTEM
   ================================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-body);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease both;
  max-width: 320px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--error); }
.toast.toast-info { border-left: 3px solid var(--accent); }
.toast-exit { animation: toastOut 0.3s ease both; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ================================================================
   CONFIDENCE BARS (Session Page)
   ================================================================ */

.confidence-panel {
  padding: 12px var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-1);
  overflow-x: auto;
  flex-shrink: 0;
}
.confidence-bars {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.confidence-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.confidence-bar-fill {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}
.confidence-bar-fill::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--confidence, 0%);
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.confidence-bar-label {
  font-size: 0.6rem;
  color: var(--text-disabled);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ================================================================
   NEW SESSION BAR
   ================================================================ */

.new-session-bar {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 10, 9, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  text-align: center;
}
.new-session-bar .btn {
  min-width: 200px;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

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

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes overlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.directive-overlay.closing {
  animation: overlayOut 0.3s ease both;
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
.skeleton-message {
  height: 60px;
  max-width: 70%;
  margin-bottom: var(--space-sm);
}
.skeleton-input {
  height: 46px;
  width: 100%;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 768px) {
  .hero { padding: var(--space-2xl) 0 var(--space-xl); }
  .hero h1 { font-size: 1.8rem; white-space: normal; }

  .pricing-grid { grid-template-columns: 1fr; }
  .brand-logo { height: 72px; }

  .message { max-width: 92%; }

  .directive-card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .progress-text {
    font-size: 0.65rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .domain-picker-card {
    padding: var(--space-sm);
  }

  .directive-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .directive-actions .btn {
    text-align: center;
  }
  .export-group {
    flex-direction: column;
  }

  .confidence-panel {
    padding: 8px var(--space-sm);
  }
  .confidence-bars { gap: 4px; }
  .confidence-bar-label { font-size: 0.5rem; }
  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { max-width: none; word-break: break-word; }
}

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

  .domain-picker-card {
    padding: var(--space-xs) var(--space-sm);
  }

  .chat-input-area { padding: 10px var(--space-sm); }
  #userInput { font-size: 0.9rem; padding: 10px 12px; }

  .hero::before { width: 400px; height: 300px; }

  .email-modal-card { padding: var(--space-md); }
  .name-card { padding: var(--space-xs); gap: var(--space-xs); }
  .phase-card { padding: var(--space-xs) var(--space-sm); }
  .phase2-output { padding: var(--space-sm); }
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Keyboard focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link (hidden until focused) */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  background: var(--accent);
  color: var(--surface-canvas);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-sm);
}

/* Screen-reader only (visually hidden, accessible to assistive tech) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ================================================================
   PRINT
   ================================================================ */

@media print {
  .session-header,
  .chat-input-area,
  .directive-actions,
  .domain-picker,
  .email-modal,
  .phase-nav,
  .new-session-bar,
  .toast-container,
  .confidence-panel { display: none; }

  .directive-overlay {
    position: static;
    background: none;
    backdrop-filter: none;
  }
  .directive-card {
    box-shadow: none;
    max-height: none;
    padding: 0;
    border: none;
    background: #fff;
    color: #000;
  }
  .directive-content { color: #333; }
  .directive-content h2 { color: #000; }
  .locked-content { filter: none; }

  body {
    background: #fff;
    color: #000;
  }

  .chat-container { overflow: visible; height: auto; max-height: none; }
  .message-user { background: #f0f0f0 !important; color: #000 !important; box-shadow: none !important; }
  .message-assistant { background: #fff !important; border: 1px solid #ddd !important; color: #333 !important; }
  .message-assistant strong { color: #000 !important; }
}

/* ===== LANDING PAGE ENHANCEMENTS ===== */

/* Gradient text animation */
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 50%, var(--accent-light) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Stats Bar */
.stats-bar {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-1);
}

.stats-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* Testimonials */
.testimonials {
  padding: var(--space-3xl) 0;
}

.testimonials h2 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: var(--space-xl);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  max-width: 960px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.testimonial-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 4px 20px rgba(158, 192, 43, 0.08);
}

.testimonial-text {
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.testimonial-author {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-subtle);
}

.testimonial-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.testimonial-role {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Value card icons */
.value-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

/* Final CTA Section */
.final-cta {
  padding: var(--space-3xl) 0;
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, var(--surface-1) 100%);
}

.final-cta h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.final-cta p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animations for grid items */
.domain-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.domain-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.domain-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }
.domain-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.32s; }
.domain-grid .animate-on-scroll:nth-child(6) { transition-delay: 0.40s; }

.testimonial-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.testimonial-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }

.steps .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.steps .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }

.value-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.value-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }

/* Light mode testimonials */
[data-theme="light"] .testimonial-card {
  background: #fff;
  border-color: #e0e0e0;
}
[data-theme="light"] .testimonial-card:hover {
  border-color: var(--accent);
}
[data-theme="light"] .stats-bar {
  background: #f8f8f6;
}
