/* ═══════════════════════════════════════════════════════════
   ASCENSION LIFEOS — LUXURY INTELLIGENCE OS
   Design System v4.0 — Ridiculously Expensive
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #07070d;
  color: #f0ede8;
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* Grain texture — always present */
/* SVG uses viewBox to tile sharply on high-DPI; background-size forces cover at any scale */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9999;
  image-rendering: auto;
}

h1, h2, h3, h4 {
  font-family: 'Syne', 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #f0ede8;
}

a { color: #c8a96e; text-decoration: none; }
a:hover { color: #e8d5a3; }

.mono, code, pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
}

/* ═══════════════════════════════════════════════════════════
   CSS VARIABLES — LUXURY DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Background layers */
  --bg-void:        #07070d;
  --bg-deep:        #0a0a12;
  --bg-surface:     #0e0e18;
  --bg-elevated:    #141424;
  --bg-glass:       rgba(14, 14, 24, 0.7);

  /* Gold — metallic gradient */
  --gold-primary:   #c8a96e;
  --gold-bright:    #e8d5a3;
  --gold-muted:     #8a7a52;
  --gold-dim:       #5a4a30;
  --gold-glow:      rgba(200, 169, 110, 0.12);
  --gold-glow-med:  rgba(200, 169, 110, 0.2);
  --gold-glow-strong: rgba(200, 169, 110, 0.35);
  --gold-gradient:  linear-gradient(135deg, #e8d5a3 0%, #c8a96e 40%, #8a7a52 100%);
  --gold-border:    rgba(200, 169, 110, 0.2);

  /* AI violet */
  --ai-primary:     #7b68ee;
  --ai-bright:      #a78bfa;
  --ai-deep:        #4a3f8a;
  --ai-glow:        rgba(123, 104, 238, 0.2);
  --ai-glow-strong: rgba(123, 104, 238, 0.4);

  /* Text */
  --text-primary:   #f0ede8;
  --text-secondary: #a8a4a0;
  --text-muted:     #6b6762;
  --text-ghost:     rgba(240, 237, 232, 0.35);

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.05);
  --border-glass:   rgba(255, 255, 255, 0.07);
  --border-active:  rgba(255, 255, 255, 0.12);
  --border-gold:    rgba(200, 169, 110, 0.2);
  --border-ai:      rgba(123, 104, 238, 0.25);

  /* Status */
  --success:        #4ade80;
  --success-dim:    rgba(74, 222, 128, 0.12);
  --warning:        #fbbf24;
  --warning-dim:    rgba(251, 191, 36, 0.12);
  --danger:         #f87171;
  --danger-dim:     rgba(248, 113, 113, 0.12);
  --info:           #60a5fa;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 100px;

  /* Typography */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  36px;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:      150ms;
  --dur-normal:    250ms;
  --dur-slow:      400ms;
  --dur-slowest:   700ms;

  /* Z-index layers */
  --z-shell:    50;
  --z-dock:     100;
  --z-nav:      200;
  --z-modal:    500;
  --z-toast:    600;
  --z-grain:    9999;

  /* Sidebar dimensions */
  --sidebar-collapsed: 64px;
  --sidebar-expanded:  220px;
  --topbar-height: 60px;
}

/* ═══════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* AI Glyph animations */
@keyframes glyphBreathe {
  0%, 100% { box-shadow: 0 0 20px rgba(123,104,238,0.3), 0 0 40px rgba(123,104,238,0.1); }
  50%      { box-shadow: 0 0 40px rgba(123,104,238,0.5), 0 0 80px rgba(123,104,238,0.2), 0 0 120px rgba(123,104,238,0.05); }
}
@keyframes glyphCoreBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@keyframes glyphSpinConic {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes glyphRingRotate1 { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes glyphRingRotate2 { from { transform: translate(-50%,-50%) rotate(360deg); } to { transform: translate(-50%,-50%) rotate(0deg); } }
@keyframes glyphPulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* Gold shimmer */
@keyframes goldShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-6px); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out-expo),
              transform var(--dur-slow) var(--ease-out-expo);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  body::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL — DESKTOP
   ═══════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── SIDEBAR ── */
.lux-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-collapsed);
  height: 100vh;
  z-index: var(--z-shell);
  background: rgba(7, 7, 13, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width var(--dur-slow) var(--ease-out-expo);
  overflow: hidden;
}

/* Grain on sidebar */
.lux-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.lux-sidebar:hover {
  width: var(--sidebar-expanded);
}

.sidebar-brand {
  padding: 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
  min-height: 64px;
  cursor: pointer;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #07070d;
  letter-spacing: -0.03em;
}

.sidebar-brand-text {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out-expo);
}

.lux-sidebar:hover .sidebar-brand-text {
  opacity: 1;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.sidebar-section-label {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out-expo);
  margin-top: 0.5rem;
}

.lux-sidebar:hover .sidebar-section-label {
  opacity: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--dur-fast) var(--ease-out-expo);
  position: relative;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px;
  border-left: 2px solid transparent;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out-expo);
}

.sidebar-link:hover::before { opacity: 1; }
.sidebar-link:hover { color: var(--text-primary); }

.sidebar-link.active {
  color: var(--gold-bright);
  border-left-color: var(--gold-primary);
  background: rgba(200, 169, 110, 0.06);
}

.sidebar-link.active::after {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 20px;
  background: var(--gold-primary);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(200, 169, 110, 0.5);
}

.sidebar-link-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  transition: all var(--dur-fast) var(--ease-out-expo);
}

.sidebar-link:hover .sidebar-link-icon {
  background: rgba(255,255,255,0.08);
}

.sidebar-link-text {
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out-expo);
}

.lux-sidebar:hover .sidebar-link-text {
  opacity: 1;
}

.sidebar-bottom {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out-expo);
  white-space: nowrap;
  min-height: 44px;
}

.sidebar-user:hover {
  background: rgba(255,255,255,0.04);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-deep), var(--ai-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #f0ede8;
  flex-shrink: 0;
  border: 1px solid var(--border-glass);
}

.sidebar-user-info {
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out-expo);
  overflow: hidden;
}

.lux-sidebar:hover .sidebar-user-info {
  opacity: 1;
}

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-user-level {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ── TOP BAR ── */
.lux-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-collapsed);
  right: 0;
  height: var(--topbar-height);
  z-index: var(--z-shell);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(7, 7, 13, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: left var(--dur-slow) var(--ease-out-expo);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-context-line {
  display: flex;
  flex-direction: column;
}

.topbar-context-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.topbar-context-value {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── MAIN CONTENT ── */
.app-content {
  margin-left: var(--sidebar-collapsed);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  width: calc(100% - var(--sidebar-collapsed));
  transition: all var(--dur-slow) var(--ease-out-expo);
  padding: 2rem 2.5rem;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   GLASS SURFACE SYSTEM — "RIDICULOUSLY EXPENSIVE"
   ═══════════════════════════════════════════════════════════ */

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3),
              0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(200, 169, 110, 0.04);
  transition: all var(--dur-normal) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

/* Ambient edge highlight */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3),
              0 24px 60px rgba(0, 0, 0, 0.5),
              0 0 24px rgba(200, 169, 110, 0.06);
}

.glass-card-elevated {
  background: rgba(20, 20, 36, 0.8);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(200, 169, 110, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 40px rgba(200, 169, 110, 0.05),
              0 30px 80px rgba(0, 0, 0, 0.5);
}

.glass-surface {
  background: rgba(14, 14, 24, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════
   STATE ZONES — DASHBOARD
   ═══════════════════════════════════════════════════════════ */

.state-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.state-zone {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.state-zone::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--zone-color, var(--gold-primary));
  opacity: 0.4;
  transition: opacity var(--dur-normal);
}

.state-zone:hover::after { opacity: 0.8; }

.state-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.state-zone-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid var(--border-subtle);
}

.state-zone-label {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.state-zone-statement {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.state-zone-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
}

.state-zone-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-sm);
  color: var(--zone-color, var(--gold-primary));
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: all var(--dur-normal) var(--ease-out-expo);
}

.state-zone:hover .state-zone-cta {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   MOBILE COMMAND DOCK
   ═══════════════════════════════════════════════════════════ */

.mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-dock);
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
  background: rgba(7, 7, 13, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
}

.dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.5rem;
  max-width: 480px;
  margin: 0 auto;
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--dur-fast) var(--ease-out-expo);
  min-width: 48px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
}

.dock-btn:active {
  transform: scale(0.92);
}

.dock-btn.active { color: var(--gold-primary); }
.dock-btn:hover { color: var(--text-primary); }

.dock-btn-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dock-btn-label {
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

/* AI Dock Orb — GPU-composited for sharp retina rendering */
.dock-ai-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--ai-primary) 0%, var(--ai-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(123,104,238,0.4), 0 0 40px rgba(123,104,238,0.15);
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out-expo);
  flex-shrink: 0;
  border: none;
  animation: glyphBreathe 4s ease-in-out infinite;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.dock-ai-orb:active {
  transform: scale(0.94) translateZ(0);
}

.dock-ai-orb .glyph-core-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
  transform: translateZ(0);
  will-change: contents;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD — MODULE GRID
   ═══════════════════════════════════════════════════════════ */

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.module-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.module-card-glyph {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.module-card-name {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.module-card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.module-card-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD HEADER
   ═══════════════════════════════════════════════════════════ */

.dashboard-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.greeting-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.greeting-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-weight: 500;
}

.greeting-name {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.greeting-name em {
  font-style: normal;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-date {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

/* XP Progress */
.xp-progress-wrap {
  max-width: 400px;
  margin-top: 0.5rem;
}

.xp-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.xp-level-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.xp-level-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold-primary);
  background: rgba(200, 169, 110, 0.1);
  border: 1px solid rgba(200, 169, 110, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
}

.xp-level-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.xp-progress-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.xp-progress-meta strong {
  color: var(--text-secondary);
}

.xp-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slowest) var(--ease-out-expo);
  box-shadow: 0 0 8px rgba(200,169,110,0.4);
}

/* Streak badge */
.streak-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
}

/* Weekly activity */
.weekly-activity-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.weekly-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-dot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all var(--dur-normal);
}

.activity-dot.active {
  background: var(--gold-primary);
  box-shadow: 0 0 6px rgba(200,169,110,0.4);
}

.activity-dot.inactive {
  background: rgba(255,255,255,0.1);
}

.activity-dot-wrapper.today .activity-dot.active {
  box-shadow: 0 0 10px rgba(200,169,110,0.7);
}

.activity-dot-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.weekly-summary {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════
   QUEST CARDS
   ═══════════════════════════════════════════════════════════ */

.quest-card {
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out-expo);
  border-left: 3px solid transparent;
}

.quest-card:hover {
  border-left-color: var(--gold-primary);
}

.quest-card-domain-health   { --quest-color: #4ade80; }
.quest-card-domain-fin      { --quest-color: #60a5fa; }
.quest-card-domain-prod    { --quest-color: #c8a96e; }
.quest-card-domain-social  { --quest-color: #f472b6; }
.quest-card-domain-mind    { --quest-color: #a78bfa; }
.quest-card-domain-crea    { --quest-color: #fb923c; }
.quest-card-domain-env     { --quest-color: #34d399; }
.quest-card-domain-finan   { --quest-color: #fbbf24; }
.quest-card-domain-lead    { --quest-color: #818cf8; }
.quest-card-domain-default { --quest-color: #6b6762; }

.quest-domain-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--quest-color, var(--gold-primary));
  flex-shrink: 0;
  margin-top: 0.4rem;
  box-shadow: 0 0 6px var(--quest-color, var(--gold-primary));
}

.quest-body { flex: 1; min-width: 0; }

.quest-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.quest-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.quest-xp-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold-primary);
  background: rgba(200,169,110,0.1);
  border: 1px solid rgba(200,169,110,0.2);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.quest-difficulty-low    { color: var(--success); }
.quest-difficulty-medium { color: var(--warning); }
.quest-difficulty-high   { color: var(--danger); }

.quest-domain-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Quest action buttons */
.quest-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════
   IDENTITY, JOURNAL, EVOLUTION — MODULE PAGES
   ═══════════════════════════════════════════════════════════ */

.identity-vision-card {
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.iv-accent {
  font-size: 18px;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.iv-text {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-style: italic;
  border-left: 3px solid var(--gold-primary);
  padding-left: 1.25rem;
}

.iv-gap {
  margin-top: 1rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-left: 1.25rem;
}

/* Journal entries */
.journal-entry {
  padding: 1.5rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--border-glass);
  transition: all var(--dur-normal) var(--ease-out-expo);
}

.journal-entry:hover {
  border-left-color: var(--ai-primary);
}

.journal-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.journal-entry-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.journal-mood-tag {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.journal-entry-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

.journal-analysis-bar {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.analysis-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.analysis-label {
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.analysis-bar-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  max-width: 200px;
}

.analysis-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--dur-slowest) var(--ease-out-expo);
}

/* Evolution arc */
.evolution-arc {
  padding: 2rem;
  text-align: center;
}

.arc-title {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.arc-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════
   AI CHAT — LUXURY SHELL
   ═══════════════════════════════════════════════════════════ */

.chat-container {
  height: calc(100vh - var(--topbar-height) - 4rem);
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-context-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.chat-context-tag {
  background: rgba(123,104,238,0.1);
  border: 1px solid rgba(123,104,238,0.2);
  color: var(--ai-bright);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', monospace;
}

.msg-bubble {
  max-width: 80%;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  line-height: 1.6;
  animation: fadeUp var(--dur-slow) var(--ease-out-expo);
}

.msg-user {
  align-self: flex-end;
  background: rgba(200,169,110,0.1);
  border: 1px solid rgba(200,169,110,0.15);
  color: var(--text-primary);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
}

.msg-ai {
  align-self: flex-start;
  background: rgba(123,104,238,0.07);
  border: 1px solid rgba(123,104,238,0.12);
  color: var(--text-primary);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
}

.msg-timestamp {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 0.25rem;
  opacity: 0.6;
}

.chat-input-area {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  transition: all var(--dur-fast) var(--ease-out-expo);
}

.chat-input-row:focus-within {
  border-color: rgba(123,104,238,0.3);
  box-shadow: 0 0 0 3px rgba(123,104,238,0.08);
}

.chat-textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  resize: none;
  max-height: 120px;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   AI CHAT — Full Layout + Messages + Streaming
   ═══════════════════════════════════════════════════════════ */

.chat-page { padding: 0 !important; }

.chat-layout {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.chat-sidebar {
  width: 260px;
  min-width: 260px;
  border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  background: rgba(10,10,15,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.chat-sidebar-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, rgba(255,255,255,0.45));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-new-btn {
  font-size: 0.75rem !important;
  padding: 0.3rem 0.7rem !important;
}

.chat-convo-count {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-muted, rgba(255,255,255,0.3));
}

.chat-sidebar-search {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.chat-search-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  color: var(--text-primary, #fff);
  font-size: 0.78rem;
  outline: none;
  font-family: inherit;
}

.chat-search-input::placeholder { color: var(--text-muted, rgba(255,255,255,0.35)); }
.chat-search-input:focus { border-color: rgba(123,104,238,0.4); }

.chat-convo-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.chat-convo-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted, rgba(255,255,255,0.35));
  font-size: 0.82rem;
}

.chat-convo-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.chat-convo-item:hover {
  background: rgba(255,255,255,0.03);
}

.chat-convo-item.active {
  background: rgba(123,104,238,0.08);
  border-left-color: var(--ai-bright, #7b68ee);
}

.chat-convo-item-inner {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chat-convo-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-convo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.chat-convo-time {
  font-size: 0.68rem;
  color: var(--text-muted, rgba(255,255,255,0.35));
}

.chat-convo-delete {
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.25));
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
}

.chat-convo-rename {
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.25));
  cursor: pointer;
  font-size: 0.65rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
}
.chat-convo-item:hover .chat-convo-rename,
.chat-convo-item:hover .chat-convo-delete { opacity: 1; }
.chat-convo-rename:hover { color: var(--accent, #7b68ee); background: rgba(123,104,238,0.1); }
.chat-convo-delete:hover { color: var(--danger, #f87171); background: rgba(248,113,113,0.1); }

/* ── Chat Main Area ─────────────────────────────── */

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  scroll-behavior: smooth;
}

.chat-messages-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, rgba(255,255,255,0.35));
  font-size: 0.85rem;
}

/* ── Messages ───────────────────────────────────── */

.chat-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 0;
  animation: chatFadeIn 0.25s ease-out;
}

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

.chat-msg-user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(123,104,238,0.12);
  color: var(--ai-bright, #7b68ee);
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-msg-content {
  flex: 1;
  min-width: 0;
  max-width: 85%;
}

.chat-msg-bubble {
  padding: 0.7rem 1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-primary, #fff);
  word-break: break-word;
}

.chat-msg-user .chat-msg-bubble {
  background: rgba(200,169,110,0.1);
  border: 1px solid rgba(200,169,110,0.12);
  border-radius: 16px 16px 4px 16px;
}

.chat-msg-ai .chat-msg-bubble {
  background: rgba(123,104,238,0.06);
  border: 1px solid rgba(123,104,238,0.08);
  border-radius: 16px 16px 16px 4px;
}

.chat-msg-time {
  font-size: 0.65rem;
  color: var(--text-muted, rgba(255,255,255,0.3));
  margin-top: 0.2rem;
  padding: 0 0.25rem;
}

.chat-msg-user .chat-msg-time { text-align: right; }

.chat-msg-error-bubble {
  background: rgba(248,113,113,0.1) !important;
  border-color: rgba(248,113,113,0.2) !important;
  color: var(--danger, #f87171) !important;
}

/* ── Message Actions ────────────────────────────── */

.chat-msg-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.3rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.chat-msg:hover .chat-msg-actions { opacity: 1; }

.chat-msg-action-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted, rgba(255,255,255,0.4));
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-msg-action-btn:hover {
  background: rgba(123,104,238,0.1);
  border-color: rgba(123,104,238,0.25);
  color: var(--ai-bright, #7b68ee);
}

.chat-msg-action-btn.copied {
  color: var(--success, #4ade80);
  border-color: rgba(74,222,128,0.3);
}

/* ── Typing Indicator ───────────────────────────── */

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ai-bright, #7b68ee);
  opacity: 0.4;
  animation: chatTyping 1.4s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatTyping {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* ── Typing label ──────────────────────────────── */
.chat-typing-label {
  font-size: 0.72rem;
  color: var(--text-muted, rgba(255,255,255,0.35));
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
  animation: chatFadeIn 0.3s ease-out;
}

/* ── Streaming cursor ───────────────────────────── */

.chat-streaming-cursor::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ai-bright, #7b68ee);
  margin-left: 2px;
  animation: chatBlink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes chatBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ── Chat Input ─────────────────────────────────── */

.chat-input-wrap {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  background: rgba(10,10,15,0.4);
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  color: var(--text-primary, #fff);
  font-size: 0.88rem;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 160px;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: rgba(123,104,238,0.4);
  box-shadow: 0 0 0 2px rgba(123,104,238,0.08);
}

.chat-input::placeholder {
  color: var(--text-muted, rgba(255,255,255,0.35));
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: var(--ai-bright, #7b68ee);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: #6c5ce7; transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Welcome Screen ─────────────────────────────── */

.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 0.75rem;
}

.chat-welcome-icon {
  font-size: 2.5rem;
  color: var(--ai-bright, #7b68ee);
  margin-bottom: 0.5rem;
}

.chat-welcome h2 {
  font-size: 1.3rem;
  color: var(--text-primary, #fff);
  font-weight: 600;
  margin: 0;
}

.chat-welcome p {
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 0.88rem;
  max-width: 480px;
  margin: 0;
  line-height: 1.6;
}

.chat-starters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  max-width: 520px;
  width: 100%;
  margin-top: 1rem;
}

.chat-starter-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary, rgba(255,255,255,0.8));
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.45;
}

.chat-starter-btn:hover {
  background: rgba(123,104,238,0.08);
  border-color: rgba(123,104,238,0.25);
  color: var(--ai-bright, #7b68ee);
}

.chat-starter-icon {
  margin-right: 0.15rem;
}

.chat-starters-loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

/* ── Welcome input (send from welcome screen) ──── */
.chat-welcome-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 520px;
  width: 100%;
  margin-top: 1.5rem;
}

.chat-welcome-input-wrap .chat-input {
  flex: 1;
  min-height: 38px;
}

/* ── Sidebar toggle (mobile) ──────────────────── */
.chat-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.45));
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-sidebar-toggle:hover { color: var(--text-primary, #fff); background: rgba(255,255,255,0.05); }

/* ── Markdown in Chat ───────────────────────────── */

.chat-msg-bubble h1,
.chat-msg-bubble h2,
.chat-msg-bubble h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin: 1rem 0 0.4rem;
  line-height: 1.3;
}

.chat-msg-bubble h1:first-child,
.chat-msg-bubble h2:first-child,
.chat-msg-bubble h3:first-child { margin-top: 0; }

.chat-msg-bubble h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin: 0.8rem 0 0.3rem;
}

.chat-msg-bubble strong { color: var(--text-primary, #fff); }

.chat-msg-bubble ul, .chat-msg-bubble ol {
  margin: 0.4rem 0;
  padding-left: 1.4rem;
}

.chat-msg-bubble li {
  margin-bottom: 0.2rem;
  line-height: 1.6;
}

.chat-msg-bubble a {
  color: var(--ai-bright, #7b68ee);
  text-decoration: underline;
  text-decoration-color: rgba(123,104,238,0.3);
  text-underline-offset: 2px;
}

.chat-msg-bubble a:hover { text-decoration-color: var(--ai-bright, #7b68ee); }

.chat-msg-bubble blockquote {
  border-left: 3px solid rgba(123,104,238,0.3);
  margin: 0.6rem 0;
  padding: 0.3rem 0 0.3rem 0.8rem;
  color: var(--text-secondary, rgba(255,255,255,0.65));
  font-style: italic;
}

.chat-msg-bubble hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0.8rem 0;
}

.chat-msg-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0;
  font-size: 0.82rem;
}

.chat-msg-bubble th, .chat-msg-bubble td {
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.chat-msg-bubble th {
  background: rgba(255,255,255,0.04);
  font-weight: 600;
  color: var(--text-primary, #fff);
}

/* ── Code Blocks ────────────────────────────────── */

.chat-code-block {
  position: relative;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  margin: 0.6rem 0;
  overflow: hidden;
}

.chat-code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.7rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
}

.chat-code-copy-btn {
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.4));
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.chat-code-copy-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.chat-code-copy-btn.copied { color: var(--success, #4ade80); }

.chat-code-block pre {
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #e6e6e6;
}

.chat-code-block code { font-family: inherit; }

.chat-code-inline {
  background: rgba(255,255,255,0.07);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  color: #e0b0ff;
}

/* ── Syntax colors (basic token highlighting) ──── */
.chat-code-block .tok-kw { color: #c792ea; }
.chat-code-block .tok-str { color: #c3e88d; }
.chat-code-block .tok-num { color: #f78c6c; }
.chat-code-block .tok-cm { color: #546e7a; font-style: italic; }
.chat-code-block .tok-fn { color: #82aaff; }
.chat-code-block .tok-op { color: #89ddff; }
.chat-code-block .tok-type { color: #ffcb6b; }
.chat-code-block .tok-bool { color: #ff5370; }
.chat-code-block .tok-dec { color: #c792ea; font-style: italic; }

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
  .chat-layout { flex-direction: column; }

  .chat-sidebar-toggle { display: block; }

  .chat-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    transition: max-height 0.25s ease;
  }

  .chat-sidebar.collapsed {
    max-height: 44px;
    overflow: hidden;
  }

  .chat-sidebar.collapsed .chat-convo-list,
  .chat-sidebar.collapsed .chat-sidebar-search { display: none; }

  .chat-main { flex: 1; min-height: 0; }

  .chat-msg-content { max-width: 92%; }

  .chat-starters { grid-template-columns: 1fr; }

  .chat-input-wrap { padding: 0.5rem 0.75rem 0.75rem; }

  .chat-convo-item { padding: 0.45rem 0.75rem; }

  /* On mobile, show rename/delete buttons always since hover doesn't work on touch */
  .chat-convo-rename,
  .chat-convo-delete { opacity: 0.6 !important; }

  /* On mobile, always show message actions */
  .chat-msg-actions { opacity: 0.8 !important; }

  .chat-welcome-input-wrap { max-width: 100%; }

  .chat-sidebar-polsia { display: none; }

  .chat-sidebar.collapsed .chat-sidebar-polsia { display: none; }
}

@media (max-width: 400px) {
  .chat-msg-bubble { font-size: 0.84rem; padding: 0.55rem 0.8rem; }
  .chat-welcome h2 { font-size: 1.1rem; }
  .chat-welcome-input-wrap .chat-input { font-size: 0.84rem; }
}

/* ── Polsia Partnership Card ────────────────────── */
.chat-sidebar-polsia {
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  margin-top: auto;
}

.polsia-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(135deg, rgba(123,104,238,0.08), rgba(99,179,237,0.06));
  border: 1px solid rgba(123,104,238,0.15);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.polsia-card:hover {
  background: linear-gradient(135deg, rgba(123,104,238,0.14), rgba(99,179,237,0.1));
  border-color: rgba(123,104,238,0.3);
  transform: translateY(-1px);
}

.polsia-card-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.polsia-card-body {
  flex: 1;
  min-width: 0;
}

.polsia-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  line-height: 1.3;
}

.polsia-card-desc {
  font-size: 0.62rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
  line-height: 1.3;
  margin-top: 0.1rem;
}

.polsia-card-arrow {
  color: var(--ai-bright, #7b68ee);
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.6;
  transition: all 0.15s;
}

.polsia-card:hover .polsia-card-arrow { opacity: 1; transform: translateX(2px); }

/* ── Welcome Input Primary (input-first layout) ── */
.chat-welcome-input-primary {
  margin-top: 1rem;
  margin-bottom: 0;
}

.chat-welcome-input-primary .chat-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(123,104,238,0.2);
  font-size: 0.92rem;
  padding: 0.75rem 1rem;
}

.chat-welcome-input-primary .chat-input:focus {
  border-color: rgba(123,104,238,0.5);
  box-shadow: 0 0 0 3px rgba(123,104,238,0.1);
}

.chat-starters-label {
  font-size: 0.72rem;
  color: var(--text-muted, rgba(255,255,255,0.3));
  margin-top: 1.25rem;
  margin-bottom: -0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ── Strikethrough ─────────────────────────────── */
.chat-msg-bubble del {
  color: var(--text-muted, rgba(255,255,255,0.45));
  text-decoration: line-through;
}

/* ── H5/H6 in chat ────────────────────────────── */
.chat-msg-bubble h5 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin: 0.6rem 0 0.25rem;
}
.chat-msg-bubble h6 {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary, rgba(255,255,255,0.7));
  margin: 0.5rem 0 0.2rem;
}

/* ── Footnotes ────────────────────────────────── */
.chat-footnote {
  font-size: 0.7em;
  color: var(--ai-bright, #7b68ee);
  cursor: default;
  vertical-align: super;
  padding: 0 0.1em;
}

/* ── Chat File Upload ──────────────────────────── */

.chat-attach-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted, rgba(255,255,255,0.4));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-attach-btn:hover {
  background: rgba(123,104,238,0.1);
  border-color: rgba(123,104,238,0.25);
  color: var(--ai-bright, #7b68ee);
}

.chat-file-preview {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  background: rgba(123,104,238,0.06);
  border: 1px solid rgba(123,104,238,0.12);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.chat-file-thumb { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.chat-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chat-file-thumb-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; background: rgba(255,255,255,0.05); border-radius: 6px; flex-shrink: 0; }
.chat-file-info { flex: 1; min-width: 0; }
.chat-file-name { display: block; font-size: 0.78rem; font-weight: 500; color: var(--text-primary, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-file-size { display: block; font-size: 0.68rem; color: var(--text-muted, rgba(255,255,255,0.4)); }
.chat-file-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 0.2rem 0.35rem; border-radius: 4px; transition: all 0.15s; }
.chat-file-remove:hover { color: var(--danger, #f87171); background: rgba(248,113,113,0.1); }

.chat-file-attachment { margin-bottom: 0.4rem; }
.chat-file-img { max-width: 260px; max-height: 200px; border-radius: 8px; cursor: pointer; transition: opacity 0.15s; border: 1px solid rgba(255,255,255,0.08); }
.chat-file-img:hover { opacity: 0.85; }
.chat-file-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--ai-bright, #7b68ee); text-decoration: none; padding: 0.3rem 0.6rem; background: rgba(123,104,238,0.08); border-radius: 6px; transition: all 0.15s; }
.chat-file-link:hover { background: rgba(123,104,238,0.15); }

.chat-dragover { outline: 2px dashed rgba(123,104,238,0.4); outline-offset: -4px; background: rgba(123,104,238,0.03) !important; }

/* ── Chat Mode Toggle ─────────────────────────── */

.chat-mode-btn {
  padding: 0.45rem 1.1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-muted, rgba(255,255,255,0.45));
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chat-mode-btn:first-child { border-radius: 8px 0 0 8px; }
.chat-mode-btn:last-child { border-radius: 0 8px 8px 0; border-left: none; }

.chat-mode-btn.active {
  background: rgba(123,104,238,0.12);
  border-color: rgba(123,104,238,0.2);
  color: var(--ai-bright, #7b68ee);
}

.chat-mode-btn:hover:not(.active) {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary, #fff);
}

/* ═══════════════════════════════════════════════════════════
   PROFILE CARD (used in Identity module)
   ═══════════════════════════════════════════════════════════ */

.profile-card {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.pc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.pc-icon { font-size: 18px; }

.pc-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.pc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.pc-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pc-val {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.pc-chips-row {
  padding: 0.5rem 0;
}

.pc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.chip-tag {
  font-size: var(--text-xs);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chip-tag.success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(74,222,128,0.2);
}

.chip-tag.warning {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(251,191,36,0.2);
}

.chip-tag.danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.2);
}

/* ═══════════════════════════════════════════════════════════
   WORLD / ENVIRONMENTAL / SOCIAL INTELLIGENCE MODULES
   ═══════════════════════════════════════════════════════════ */

.intelligence-zone {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.iz-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.iz-title {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.iz-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin-left: auto;
}

.iz-statement {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-style: italic;
}

.iz-recommendation {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(200,169,110,0.05);
  border: 1px solid rgba(200,169,110,0.1);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.iz-recommendation-icon {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--gold-primary);
}

/* ═══════════════════════════════════════════════════════════
   FOUNDEROS SPECIFIC
   ═══════════════════════════════════════════════════════════ */

.founder-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.founder-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.founder-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.founder-kpi {
  padding: 1rem 1.25rem;
  text-align: center;
}

.founder-kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
}

.founder-kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════════════
   NAV (DESKTOP — OLD, now in sidebar)
   ═══════════════════════════════════════════════════════════ */

.app-nav {
  /* Deprecated — replaced by lux-sidebar + lux-topbar */
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS — LUXURY SYSTEM
   ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: 'Syne', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out-expo);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gold-gradient);
  color: #07070d;
  box-shadow: 0 0 20px rgba(200,169,110,0.2);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(200,169,110,0.35);
  color: #07070d;
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  border-color: var(--border-active);
  background: rgba(255,255,255,0.07);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.btn-success {
  background: var(--success);
  color: #07070d;
}

.btn-success:hover {
  background: #6ee7a7;
  color: #07070d;
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.2);
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: var(--text-base);
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-base);
  transition: all var(--dur-fast) var(--ease-out-expo);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(200,169,110,0.4);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.06);
  background: rgba(255,255,255,0.05);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6762' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES — LUXURY UPGRADE
   ═══════════════════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  animation: fadeUp var(--dur-slow) var(--ease-out-expo);
}

.auth-card .logo-text {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 0.35rem;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.auth-card h2 {
  text-align: center;
  color: var(--text-primary);
  font-size: var(--text-xl);
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover { color: var(--gold-bright); }

/* ═══════════════════════════════════════════════════════════
   ERROR / SUCCESS MESSAGES
   ═══════════════════════════════════════════════════════════ */

.error-msg {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(248,113,113,0.15);
  display: none;
}

.error-msg.visible { display: block; }

/* ═══════════════════════════════════════════════════════════
   SECTION / MODULE CONTAINERS
   ═══════════════════════════════════════════════════════════ */

.db-section {
  margin-bottom: 2rem;
}

.db-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.db-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .db-two-col { grid-template-columns: 1fr; }
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-glass);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: glyphSpinConic 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   ONBOARDING PAGES
   ═══════════════════════════════════════════════════════════ */

.onboarding-page {
  min-height: 100vh;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.onboarding-progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.onboarding-progress .dot {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  transition: background var(--dur-normal);
}

.onboarding-progress .dot.active {
  background: var(--gold-gradient);
  box-shadow: 0 0 8px rgba(200,169,110,0.3);
}

/* ═══════════════════════════════════════════════════════════
   ONBOARDING CHOICE CHIPS
   ═══════════════════════════════════════════════════════════ */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 169, 110, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary, #aaa);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.4;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text-primary, #e0d9c8);
  background: rgba(200, 169, 110, 0.08);
}

.chip.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #0d0b09;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(200, 169, 110, 0.25);
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS / PROFILE
   ═══════════════════════════════════════════════════════════ */

.settings-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 700px;
}

.settings-section {
  padding: 1.75rem;
}

.settings-section-title {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.settings-row:last-child { border-bottom: none; }

.settings-row-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.settings-row-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  transition: all var(--dur-normal) var(--ease-out-expo);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  left: 2px;
  top: 2px;
  transition: all var(--dur-normal) var(--ease-out-expo);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px rgba(200,169,110,0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #07070d;
}

/* ═══════════════════════════════════════════════════════════
   MODULE-SPECIFIC: Calendar, Leaderboard, Achievements, etc.
   ═══════════════════════════════════════════════════════════ */

/* Calendar strip (compact) */
.calendar-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.calendar-strip::-webkit-scrollbar { display: none; }

.calendar-day {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-fast);
  min-width: 44px;
}

.calendar-day:hover { background: rgba(255,255,255,0.04); }

.calendar-day.active {
  background: rgba(200,169,110,0.08);
  border: 1px solid rgba(200,169,110,0.15);
}

.calendar-day-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-secondary);
}

.calendar-day.active .calendar-day-num { color: var(--gold-primary); }

.calendar-day-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day-dots {
  display: flex;
  gap: 2px;
}

.calendar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-dim);
}

.calendar-dot.completed { background: var(--gold-primary); }

/* Leaderboard */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.35rem;
  border-radius: var(--radius-md);
  transition: all var(--dur-fast);
}

.leaderboard-row:hover {
  background: rgba(255,255,255,0.03);
}

.lb-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.lb-rank.top-3 { color: var(--gold-primary); background: rgba(200,169,110,0.1); }
.lb-rank.top-1 { color: #e8d5a3; background: rgba(232,213,163,0.15); }

.lb-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.lb-xp {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
}

/* Achievements */
.achievement-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  transition: all var(--dur-normal);
}

.achievement-card.locked {
  opacity: 0.4;
}

.achievement-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.achievement-info { flex: 1; }

.achievement-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.achievement-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Guilds */
.guild-card {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.guild-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.guild-name {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.guild-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* DMs */
.dm-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--dur-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.dm-row:hover { background: rgba(255,255,255,0.03); }
.dm-row:last-child { border-bottom: none; }

.dm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-deep), var(--ai-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #f0ede8;
  flex-shrink: 0;
}

.dm-name { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.dm-preview { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.dm-time { font-family: 'JetBrains Mono', monospace; font-size: var(--text-xs); color: var(--text-muted); }

/* Feed */
.post-card {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-deep), var(--ai-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #f0ede8;
  flex-shrink: 0;
}

.post-author { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.post-time { font-size: var(--text-xs); color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

.post-content {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Documents */
.doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  transition: all var(--dur-fast);
  cursor: pointer;
}

.doc-item:hover { background: rgba(255,255,255,0.03); }

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--ai-glow);
  border: 1px solid var(--border-ai);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }

/* Teach AI */
.teach-section {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.teach-prompt {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Privacy vault */
.privacy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.privacy-label { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.privacy-value { font-size: var(--text-sm); color: var(--text-muted); }

/* Announcement banner */
.announcement-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(200,169,110,0.05);
  border: 1px solid rgba(200,169,110,0.15);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  animation: fadeUp var(--dur-slow) var(--ease-out-expo);
}

.announcement-icon { font-size: 18px; flex-shrink: 0; }
.announcement-body { flex: 1; }
.announcement-title { font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); margin-bottom: 0.2rem; }
.announcement-content { font-size: var(--text-sm); color: var(--text-muted); }
.announcement-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 14px;
  border-radius: 4px;
  transition: all var(--dur-fast);
}

.announcement-dismiss:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* Streak milestone banner */
.streak-milestone-banner {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin: 0.75rem 0;
  font-size: var(--text-sm);
  font-weight: 600;
}

.streak-milestone-banner.tier-1 {
  background: rgba(200,169,110,0.08);
  border: 1px solid rgba(200,169,110,0.2);
  color: var(--gold-bright);
}

.streak-milestone-banner.tier-2 {
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.3);
  color: #e8d5a3;
}

/* Ref invite banner */
.ref-invite-banner {
  background: rgba(200,169,110,0.08);
  border: 1px solid rgba(200,169,110,0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  text-align: center;
}

/* Founder badge */
.nav-founder-badge, .nav-mobile-founder-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.2rem 0.6rem;
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* User badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

.user-badge .level {
  background: var(--gold-gradient);
  color: #07070d;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn var(--dur-fast);
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  animation: fadeUp var(--dur-slow) var(--ease-out-expo);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

/* Evolution report */
.ev-report-card {
  padding: 1.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all var(--dur-normal);
}

.ev-report-card:hover {
  border-color: rgba(200,169,110,0.2);
}

.ev-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ev-week-label {
  font-family: 'Syne', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.ev-date-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.ev-stats-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.ev-stat {
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 65px;
  text-align: center;
}

.ev-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.ev-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.ev-preview-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Evolution modal */
.ev-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.ev-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.ev-modal-week { font-size: var(--text-base); font-weight: 700; color: var(--text-primary); }
.ev-modal-date { font-size: var(--text-xs); color: var(--text-muted); margin-top: 0.2rem; }

.ev-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all var(--dur-fast);
}

.ev-modal-close:hover { color: var(--text-primary); }

.ev-id-grid {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* EV identity dimension pill */
.ev-id-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ev-id-pill.starter { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.ev-id-pill.active  { background: rgba(200,169,110,0.1); color: var(--gold-primary); border: 1px solid rgba(200,169,110,0.2); }
.ev-id-pill.vision  { background: rgba(123,104,238,0.1); color: var(--ai-bright); border: 1px solid rgba(123,104,238,0.2); }

/* Evolution past items */
.ev-past-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
}

.ev-past-week { font-family: 'JetBrains Mono', monospace; font-size: var(--text-xs); color: var(--text-muted); flex-shrink: 0; }
.ev-past-text { font-size: var(--text-sm); color: var(--text-secondary); flex: 1; }
.ev-past-link { font-size: var(--text-xs); color: var(--gold-primary); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤900px) / MOBILE (≤640px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .lux-sidebar { display: none; }
  .lux-topbar { left: 0; }
  .app-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem 1.25rem;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
  }
  .mobile-dock { display: block; }

  .topbar-context-value { display: none; }
  .topbar-context-label { display: none; }
  .topbar-left { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE HIGH-DPI / RETINA CRISPNESS FIXES
   Reduces blur, adds GPU compositing, tightens spacing
   Target: 375px (iPhone SE) through 639px
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .app-content {
    padding: 1.25rem 1rem;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
  }

  .greeting-name {
    font-size: var(--text-2xl);
  }

  .state-zones {
    grid-template-columns: 1fr;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-page {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }

  .auth-card {
    padding: 1.75rem 1.5rem;
  }

  .founder-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dock-btn-label { display: none; }
  .dock-btn { min-width: 44px; }
  .dock-inner { max-width: 100%; }

  .onboarding-page { padding: 2rem 1rem; }

  /* ── Glass surfaces: reduce blur for iOS Safari performance ── */
  .glass-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
  }

  .glass-card-elevated {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-lg);
  }

  .glass-surface {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
  }

  /* ── Grain texture: lighter on mobile to avoid subpixel muddiness ── */
  body::before {
    background-size: 160px 160px;
  }

  /* ── AI orb: ensure GPU compositing is active on mobile ── */
  .dock-ai-orb {
    transform: translateZ(0);
    will-change: transform;
  }

  /* ── Glass card shadows: less elaborate on mobile ── */
  .glass-card {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3),
                0 12px 40px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(200, 169, 110, 0.04);
  }

  .glass-card-elevated {
    box-shadow: 0 0 20px rgba(200, 169, 110, 0.04),
                0 20px 50px rgba(0, 0, 0, 0.45);
  }

  /* ── Icon/button elements: GPU-composited for sharp edges ── */
  .dock-btn,
  .founder-kpi-card,
  .module-card,
  .quest-card,
  .state-zone {
    transform: translateZ(0);
    will-change: transform;
  }

  /* ── Smooth scroll on mobile ── */
  * { -webkit-overflow-scrolling: touch; }

  /* ── Subpixel text fix: ensure small text stays crisp ── */
  .mono, code, pre {
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* ── iPhone SE specific (≤375px): further reduce complexity ── */
  @media (max-width: 375px) {
    .glass-card {
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    .glass-card-elevated {
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    .app-content {
      padding: 1rem 0.875rem;
      padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
    }

    .state-zone { padding: 1.25rem; }

    .founder-kpi-grid {
      grid-template-columns: 1fr 1fr;
      gap: 0.5rem;
    }
  }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */

.container {
  max-width: 800px;
  margin: 0 auto;
}

.text-gold { color: var(--gold-primary); }
.text-muted { color: var(--text-muted); }
.text-ai { color: var(--ai-primary); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Fade animations applied via JS */
.fade-in {
  animation: fadeIn var(--dur-slow) var(--ease-out-expo);
}

.slide-in {
  animation: slideInLeft var(--dur-slow) var(--ease-out-expo);
}