/* ============================================================
   EWI KFZ-Finanzierung Demo — Design System
   CRIF Brand: Dark Theme
   ============================================================ */

/* --- Custom Properties --- */
:root {
  /* CRIF Brand */
  --primary: #002B5C;
  --accent: #E87722;
  --bg-deep: #001B3D;
  --bg-surface: #002244;
  --bg-card: #003366;
  --bg-card-hover: #004080;
  --text-primary: #FFFFFF;
  --text-secondary: #B0BEC5;
  --text-muted: #607D8B;
  --border: #1a4a7a;
  --border-light: #2a5a8a;

  /* Severity */
  --success: #4CAF50;
  --warning: #FFC107;
  --danger: #F44336;
  --info: #29B6F6;

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

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(232,119,34,0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;

  /* Typography */
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 240px;
  --max-width: 1440px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Typography --- */
h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); font-weight: 600; }
h4 { font-size: var(--text-lg); font-weight: 500; }

.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* --- Layout --- */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(0, 27, 61, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-lg);
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-right: var(--sp-xl);
}

.header-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--text-sm);
}

.header-nav {
  display: flex;
  gap: var(--sp-xs);
  flex: 1;
  align-items: center;
}

.header-nav::-webkit-scrollbar { display: none; }

/* ── Nav Dropdowns ────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.nav-dropdown-trigger:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-dropdown.child-active .nav-dropdown-trigger {
  color: var(--accent);
  background: rgba(232,119,34,0.1);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 210px;
  background: rgba(0, 34, 68, 0.98);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  padding: var(--sp-xs) 0;
  z-index: 9999;
  backdrop-filter: blur(12px);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 0;
  padding: var(--sp-sm) var(--sp-md);
}

.nav-dropdown-menu .nav-link:hover {
  background: rgba(255,255,255,0.08);
}

.nav-dropdown-menu .nav-link.active {
  color: var(--accent);
  background: rgba(232,119,34,0.1);
}

/* ── Accent Nav Button ────────────────────────── */
.nav-link.nav-accent {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  border-radius: var(--radius-md);
}

.nav-link.nav-accent:hover {
  background: #d06a1a;
  color: #fff;
}

.nav-link.nav-accent.active {
  background: #d06a1a;
  color: #fff;
}

/* ── Mobile Nav Groups ────────────────────────── */
.mobile-nav-group-label {
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-top: var(--sp-sm);
}

.mobile-nav .nav-link.nav-accent {
  color: #fff;
  background: var(--accent);
  margin: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  text-align: center;
  border-bottom: none;
}

.nav-link {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: rgba(232,119,34,0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-left: var(--sp-md);
}

/* Main content */
.app-main {
  margin-top: var(--header-height);
  padding: var(--sp-lg);
  max-width: var(--max-width);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#app-content {
  animation: fadeIn var(--transition-normal);
}

/* --- Grid --- */
.grid { display: grid; gap: var(--sp-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.gap-xl { gap: var(--sp-xl); }

/* --- Card --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-accent {
  border-left: 3px solid var(--accent);
}

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

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

/* --- KPI Card --- */
.kpi-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(232,119,34,0.1) 0%, transparent 70%);
  border-radius: 0 0 0 100%;
}

.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-xs);
}

.kpi-value {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-unit {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: var(--sp-xs);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: var(--text-sm);
  margin-top: var(--sp-sm);
  padding: 2px var(--sp-sm);
  border-radius: var(--radius-full);
}

.kpi-trend.up { background: rgba(76,175,80,0.15); color: var(--success); }
.kpi-trend.down { background: rgba(244,67,54,0.15); color: var(--danger); }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 2px var(--sp-sm);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-risk { background: rgba(244,67,54,0.15); color: var(--danger); }
.badge-fraud { background: rgba(232,119,34,0.15); color: var(--accent); }
.badge-network { background: rgba(41,182,246,0.15); color: var(--info); }
.badge-success { background: rgba(76,175,80,0.15); color: var(--success); }
.badge-warning { background: rgba(255,193,7,0.15); color: var(--warning); }
.badge-severity-critical { background: rgba(244,67,54,0.2); color: #ff6659; border: 1px solid rgba(244,67,54,0.3); }
.badge-severity-high { background: rgba(232,119,34,0.2); color: var(--accent); border: 1px solid rgba(232,119,34,0.3); }
.badge-severity-medium { background: rgba(255,193,7,0.2); color: var(--warning); border: 1px solid rgba(255,193,7,0.3); }
.badge-severity-low { background: rgba(76,175,80,0.2); color: var(--success); border: 1px solid rgba(76,175,80,0.3); }

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #d06a1f;
  box-shadow: 0 0 12px rgba(232,119,34,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--sp-xs) var(--sp-sm);
}

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

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: rgba(232,119,34,0.12);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(232,119,34,0.2);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-accent:hover {
  background: #d06a1f;
  box-shadow: 0 0 12px rgba(232,119,34,0.3);
}

.btn-sm { padding: var(--sp-xs) var(--sp-sm); font-size: var(--text-xs); }
.btn-lg { padding: var(--sp-md) var(--sp-xl); font-size: var(--text-base); }

.btn-group {
  display: flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}

.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-right-width: 1px; }

/* --- Filter Pills --- */
.filter-pills {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.pill {
  padding: var(--sp-xs) var(--sp-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.pill.active {
  background: rgba(232,119,34,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Toggle --- */
.lang-toggle {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lang-btn {
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* --- Search --- */
.search-bar {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
}

.search-input {
  flex: 1;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,119,34,0.1);
}

.search-input::placeholder { color: var(--text-muted); }

.search-type-select {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* --- Gauge / Risk Score --- */
.gauge-container {
  width: 160px;
  height: 100px;
  position: relative;
}

.gauge-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-3xl);
  font-weight: 700;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--sp-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--sp-lg);
}

.timeline-dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-deep);
  z-index: 1;
}

.timeline-dot.risk { background: var(--danger); }
.timeline-dot.fraud { background: var(--accent); }
.timeline-dot.network { background: var(--info); }
.timeline-dot.ok { background: var(--success); }

.timeline-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-xs);
}

.timeline-content {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- Alert Feed Item --- */
.alert-item {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all var(--transition-fast);
  animation: slideDown var(--transition-normal);
}

.alert-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

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

.alert-icon.risk { background: rgba(244,67,54,0.15); }
.alert-icon.fraud { background: rgba(232,119,34,0.15); }
.alert-icon.network { background: rgba(41,182,246,0.15); }

.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--sp-xs); }
.alert-desc { font-size: var(--text-sm); color: var(--text-secondary); }
.alert-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--sp-xs); }
.alert-actions { display: flex; gap: var(--sp-xs); margin-top: var(--sp-sm); }

/* --- Pipeline --- */
.pipeline-container {
  display: flex;
  gap: var(--sp-lg);
  align-items: stretch;
  min-height: 400px;
  position: relative;
}

.pipeline-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.pipeline-stage.active {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.pipeline-stage-header {
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.pipeline-stage-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
}

.pipeline-stage-title {
  font-weight: 600;
  font-size: var(--text-base);
}

.pipeline-stage-body {
  padding: var(--sp-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-size: 24px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Pipeline particles */
.pipeline-flow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: particleFlow 3s linear infinite;
}

/* --- Code / JSON Display --- */
.code-block {
  background: #0a1628;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-secondary);
}

.code-block .key { color: #82AAFF; }
.code-block .string { color: #C3E88D; }
.code-block .number { color: #F78C6C; }
.code-block .boolean { color: #FFCB6B; }
.code-block .null { color: #546E7A; }
.code-block .bracket { color: #89DDFF; }

/* --- Network Graph --- */
.graph-container {
  width: 100%;
  height: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.graph-controls {
  position: absolute;
  top: var(--sp-md);
  right: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  z-index: 10;
}

.graph-legend {
  position: absolute;
  bottom: var(--sp-md);
  left: var(--sp-md);
  display: flex;
  gap: var(--sp-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  z-index: 10;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* --- Scenario Card --- */
.scenario-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.scenario-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.scenario-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.scenario-card.fraud::before { background: var(--accent); }
.scenario-card.network::before { background: var(--info); }
.scenario-card.risk::before { background: var(--warning); }

.scenario-letter {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: rgba(255,255,255,0.08);
  position: absolute;
  top: var(--sp-md);
  right: var(--sp-lg);
}

.scenario-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-md);
}

/* --- Step Progress --- */
.step-progress {
  display: flex;
  gap: var(--sp-xs);
  margin: var(--sp-md) 0;
}

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

.step-dot.active { background: var(--accent); transform: scale(1.3); }
.step-dot.done { background: var(--success); }

/* --- Narration Box --- */
.narration-box {
  background: rgba(232,119,34,0.05);
  border: 1px solid rgba(232,119,34,0.2);
  border-radius: var(--radius-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: var(--sp-md) 0;
}

/* --- Curtain / Behind the Scenes --- */
.curtain-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  gap: var(--sp-md);
  height: calc(100vh - var(--header-height) - 120px);
}

.curtain-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.curtain-panel-header {
  padding: var(--sp-sm) var(--sp-md);
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.curtain-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-md);
}

.curtain-event-log {
  grid-column: 1 / -1;
  max-height: 200px;
}

/* Engine trace entries */
.trace-entry {
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  margin-bottom: var(--sp-xs);
  animation: slideRight var(--transition-fast);
  display: flex;
  gap: var(--sp-sm);
  align-items: flex-start;
}

.trace-entry.rule-fire {
  background: rgba(232,119,34,0.1);
  border-left: 2px solid var(--accent);
}

.trace-entry.score-update {
  background: rgba(244,67,54,0.1);
  border-left: 2px solid var(--danger);
}

.trace-entry.network-edge {
  background: rgba(41,182,246,0.1);
  border-left: 2px solid var(--info);
}

.trace-entry.cluster-detect {
  background: rgba(76,175,80,0.1);
  border-left: 2px solid var(--success);
}

.trace-timestamp {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 65px;
}

.trace-message {
  color: var(--text-secondary);
  word-break: break-word;
}

/* --- Channel Comparison --- */
.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  text-align: center;
  transition: all var(--transition-normal);
}

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

.channel-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--sp-md);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(232,119,34,0.1);
}

.channel-name {
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--sp-sm);
}

.channel-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.channel-detail {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-xs) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.channel-detail:last-child { border: none; }
.channel-detail-label { color: var(--text-muted); }
.channel-detail-value { color: var(--text-primary); font-weight: 500; }

/* --- Section --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 600;
}

.section-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-xs);
}

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

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

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes particleFlow {
  0% { opacity: 0; transform: translateX(-20px); }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { opacity: 0; transform: translateX(calc(100vw + 20px)); }
}

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

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(232,119,34,0.2); }
  50% { box-shadow: 0 0 20px rgba(232,119,34,0.4); }
}

.animate-fade-in { animation: fadeIn var(--transition-normal) both; }
.animate-slide-up { animation: slideUp var(--transition-normal) both; }
.animate-pulse { animation: pulse 2s ease infinite; }
.animate-glow { animation: glow 2s ease infinite; }

.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* --- Tooltip --- */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 50;
}

.tooltip:hover::after { opacity: 1; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pipeline-container { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); justify-content: center; }
  .curtain-split { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root {
    --sp-lg: 16px;
    --sp-xl: 24px;
    --header-height: 56px;
  }

  .app-main { padding: var(--sp-md); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .kpi-value { font-size: var(--text-2xl); }

  .header-logo span { display: none; }
  .section-title { font-size: var(--text-xl); }
}

/* --- Mobile Menu --- */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 20px;
  margin-right: var(--sp-sm);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,27,61,0.98);
  backdrop-filter: blur(12px);
  z-index: 99;
  padding: var(--sp-lg);
  flex-direction: column;
  gap: var(--sp-xs);
}

.mobile-nav.open { display: flex; }

.mobile-nav .nav-link {
  padding: var(--sp-md);
  font-size: var(--text-lg);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
}

/* --- Utilities --- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.p-md { padding: var(--sp-md); }
.p-lg { padding: var(--sp-lg); }

/* --- Demo Disclaimer --- */
.demo-disclaimer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-xs) var(--sp-md);
  background: rgba(0,27,61,0.95);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  z-index: 100;
}

/* --- Loading Spinner --- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Tab Navigation --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-lg);
}

.tab {
  padding: var(--sp-sm) var(--sp-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Indicator Mini Card --- */
.indicator-mini {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.2);
  font-size: var(--text-sm);
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Subject List Item --- */
.subject-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.subject-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.subject-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.subject-avatar.person { background: rgba(41,182,246,0.2); color: var(--info); }
.subject-avatar.company { background: rgba(232,119,34,0.2); color: var(--accent); }
.subject-avatar.vehicle { background: rgba(76,175,80,0.2); color: var(--success); }

/* ============================================================
   AVM-IQ Specific Components
   ============================================================ */

/* --- Property Card --- */
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  display: flex;
  gap: var(--sp-lg);
  transition: var(--transition-normal);
  cursor: pointer;
}
.property-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.property-photo {
  width: 120px;
  height: 90px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-2xl);
  flex-shrink: 0;
}
.property-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}
.property-address {
  font-weight: 600;
  font-size: var(--text-base);
}
.property-stats {
  display: flex;
  gap: var(--sp-lg);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.property-stat-label {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* --- Confidence Tier Badges --- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier-green {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.tier-amber {
  background: rgba(255, 193, 7, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 193, 7, 0.3);
}
.tier-red {
  background: rgba(244, 67, 54, 0.15);
  color: var(--danger);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* --- SHAP Waterfall Chart Container --- */
.shap-chart {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  margin: var(--sp-md) 0;
}
.shap-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
}
.shap-label {
  width: 140px;
  text-align: right;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.shap-bar-track {
  flex: 1;
  height: 20px;
  background: rgba(255,255,255,0.03);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.shap-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.shap-bar-positive { background: var(--success); }
.shap-bar-negative { background: var(--danger); }
.shap-value {
  width: 60px;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

/* --- EPC Thermometer --- */
.epc-thermometer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 280px;
}
.epc-row {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: var(--transition-normal);
  opacity: 0.4;
}
.epc-row.active {
  opacity: 1;
  transform: scaleX(1.05);
  box-shadow: 0 0 12px rgba(255,255,255,0.1);
}
.epc-a { background: #1B8A2E; }
.epc-b { background: #3FA535; }
.epc-c { background: #8DC63F; }
.epc-d { background: #FFC107; }
.epc-e { background: #F9A825; }
.epc-f { background: #F57C00; }
.epc-g { background: #E64A19; }
.epc-h { background: #C62828; }
.epc-label { margin-left: auto; color: rgba(255,255,255,0.8); }

/* --- Review Card (HiL) --- */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  border-left: 4px solid var(--warning);
  transition: var(--transition-normal);
}
.review-card.tier-green-border { border-left-color: var(--success); }
.review-card.tier-amber-border { border-left-color: var(--warning); }
.review-card.tier-red-border   { border-left-color: var(--danger); }
.review-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--border);
}

/* --- Market Sparkline (inline) --- */
.sparkline-inline {
  display: inline-block;
  vertical-align: middle;
  margin-left: var(--sp-sm);
}

/* --- Stress Test Slider --- */
.stress-slider-container {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}
.stress-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.stress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(232,119,34,0.4);
}
.stress-value {
  font-size: var(--text-lg);
  font-weight: 700;
  min-width: 60px;
  text-align: center;
}

/* --- Pipeline Flow (Architecture view) --- */
.arch-pipeline-flow {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-lg);
  overflow-x: auto;
}
.pipeline-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-md) var(--sp-lg);
  text-align: center;
  min-width: 120px;
  transition: var(--transition-normal);
  position: relative;
}
.pipeline-node.active {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.pipeline-node-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-xs);
}
.arch-pipeline-arrow {
  color: var(--text-muted);
  font-size: var(--text-lg);
  flex-shrink: 0;
}
.pipeline-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: archParticleFlow 1.5s ease-in-out infinite;
}
@keyframes archParticleFlow {
  0%   { left: -10px; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: calc(100% + 10px); opacity: 0; }
}

/* --- Map Container (Leaflet) --- */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-container .leaflet-container {
  background: var(--bg-deep);
}

/* --- Compliance Status Grid --- */
.compliance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.compliance-status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: var(--text-sm);
  font-weight: 600;
}
.compliance-pass { color: var(--success); }
.compliance-warn { color: var(--warning); }
.compliance-fail { color: var(--danger); }
.compliance-pending { color: var(--text-muted); }

/* --- Value Display (large formatted) --- */
.value-display {
  font-size: var(--text-4xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.value-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

/* --- Audit Trail Timeline --- */
.audit-entry {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.audit-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-width: 140px;
  font-family: var(--font-mono);
}
.audit-action {
  font-size: var(--text-sm);
}
.audit-user {
  color: var(--accent);
  font-weight: 600;
}

/* --- Responsive: Mobile adjustments for AVM components --- */
@media (max-width: 768px) {
  .property-card { flex-direction: column; }
  .property-photo { width: 100%; height: 120px; }
  .property-stats { flex-wrap: wrap; }
  .shap-label { width: 100px; font-size: var(--text-xs); }
  .epc-thermometer { width: 100%; }
  .arch-pipeline-flow { flex-direction: column; }
  .arch-pipeline-arrow { transform: rotate(90deg); }
  .map-container { height: 300px; }
  .review-actions { flex-wrap: wrap; }
}

/* ============================================================
   Landing Page — USP & Platform Overview
   ============================================================ */

.landing-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Hero --- */
.landing-hero {
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--sp-2xl) var(--sp-lg);
}

/* Animated gradient mesh background */
.landing-hero::before {
  content: '';
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(232,119,34,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 30%, rgba(41,182,246,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(76,175,80,0.05) 0%, transparent 50%);
  animation: landingMesh 25s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes landingMesh {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3%, -2%) scale(1.05); }
  100% { transform: translate(-2%, 1%) scale(1); }
}

/* Dot grid overlay */
.landing-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 1;
}

.landing-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
}

.landing-badge {
  display: inline-block;
  padding: 6px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--sp-lg);
  animation: landingFadeUp 0.7s ease both;
}

.landing-title {
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  white-space: pre-line;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--sp-md);
  animation: landingFadeUp 0.7s ease 0.08s both;
}

.landing-subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-lg);
  animation: landingFadeUp 0.7s ease 0.16s both;
}

.landing-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto var(--sp-xl);
  line-height: 1.7;
  animation: landingFadeUp 0.7s ease 0.24s both;
}

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

/* --- CTA Buttons --- */
.landing-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
  animation: landingFadeUp 0.7s ease 0.32s both;
}

.landing-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--accent), #cc6015);
  color: #fff;
  font-size: var(--text-lg);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 24px rgba(232,119,34,0.3);
}

.landing-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232,119,34,0.45);
}

.landing-cta-arrow {
  font-size: var(--text-sm);
}

.landing-cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
}

.landing-cta-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Metrics Bar --- */
.landing-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-md);
  padding: var(--sp-lg) 0;
  margin-bottom: var(--sp-xl);
}

.landing-metric {
  text-align: center;
  padding: var(--sp-lg) var(--sp-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.landing-metric-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: var(--sp-xs);
}

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

/* --- Section Structure --- */
.landing-section {
  margin-bottom: var(--sp-2xl);
}

.landing-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent)44);
  border-radius: var(--radius-full);
  margin: 0 auto var(--sp-md);
}

.landing-section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--sp-xs);
}

.landing-section-sub {
  font-size: var(--text-base);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--sp-xl);
}

/* --- Capabilities Grid (12 views) --- */
.landing-cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-md);
}

.landing-cap-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.landing-cap-card:hover {
  transform: translateY(-3px);
}

.landing-cap-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.landing-cap-num {
  font-size: var(--text-3xl);
  font-weight: 800;
  opacity: 0.15;
  line-height: 1;
  margin-bottom: var(--sp-xs);
}

.landing-cap-title {
  font-size: var(--text-base);
  font-weight: 700;
}

.landing-cap-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.landing-cap-link {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--sp-sm);
}

/* --- Technology Grid --- */
.landing-tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-md);
}

.landing-tech-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  text-align: center;
}

.landing-tech-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: var(--sp-xs);
  font-family: var(--font-mono);
}

.landing-tech-label {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}

.landing-tech-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Module Cards (USP) --- */
.landing-modules {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.landing-module {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-lg);
  padding: var(--sp-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.landing-module:hover {
  transform: translateY(-3px);
}

.landing-module-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.landing-module-letter {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  align-self: start;
}

.landing-module-body {
  min-width: 0;
}

.landing-module-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 2px;
}

.landing-module-tagline {
  font-size: var(--text-base);
  font-style: italic;
  margin-bottom: var(--sp-sm);
}

.landing-module-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-md);
}

.landing-module-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-module-point {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-left: 22px;
  position: relative;
  line-height: 1.4;
}

.landing-module-point::before {
  content: '\2713';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--check-color, var(--accent));
}

.landing-module-metric {
  text-align: center;
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: start;
}

.landing-module-metric-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.2;
}

.landing-module-metric-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--sp-xs);
  max-width: 120px;
}

.landing-module-gap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: rgba(244,67,54,0.05);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.landing-gap-icon {
  color: var(--danger);
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Comparison Table --- */
.landing-compare {
  margin-bottom: var(--sp-2xl);
}

.landing-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-md);
}

.landing-compare-table th,
.landing-compare-table td {
  padding: var(--sp-sm) var(--sp-md);
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.landing-compare-table th {
  background: var(--bg-card);
  font-weight: 600;
}

.landing-th-crif {
  background: rgba(232,119,34,0.12) !important;
  color: var(--accent) !important;
}

.landing-compare-table th:first-child,
.landing-compare-table td:first-child {
  text-align: left;
}

.landing-compare-table tr:last-child td {
  border-bottom: none;
}

.landing-compare-table td:nth-child(2) {
  background: rgba(232,119,34,0.03);
}

.landing-tr-even td {
  background-color: rgba(0,0,0,0.1);
}

.landing-tr-even td:nth-child(2) {
  background-color: rgba(232,119,34,0.06);
}

.lc-yes { color: var(--success); font-weight: 700; font-size: var(--text-lg); }
.lc-no  { color: var(--danger);  font-weight: 700; font-size: var(--text-lg); }
.lc-partial { color: var(--warning); font-weight: 700; font-size: var(--text-lg); }

.landing-compare-summary {
  text-align: center;
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(232,119,34,0.06);
  border: 1px solid rgba(232,119,34,0.15);
  border-radius: var(--radius-md);
}

.landing-compare-highlight {
  font-weight: 700;
  color: var(--accent);
}

.landing-compare-detail {
  color: var(--text-muted);
}

/* --- Bottom CTA --- */
.landing-bottom-cta {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  background: linear-gradient(135deg, rgba(232,119,34,0.06), rgba(41,182,246,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-lg);
}

.landing-bottom-cta-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-sm);
}

.landing-bottom-cta-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: var(--sp-lg);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Responsive: Landing page --- */
@media (max-width: 1024px) {
  .landing-cap-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .landing-hero { min-height: 60vh; padding: var(--sp-xl) var(--sp-md); }
  .landing-metrics { grid-template-columns: repeat(2, 1fr); }
  .landing-cap-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-tech-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-module { grid-template-columns: 1fr; }
  .landing-module-letter { width: 44px; height: 44px; font-size: var(--text-xl); }
  .landing-module-metric { flex-direction: row; gap: var(--sp-md); min-width: auto; padding: var(--sp-sm) var(--sp-md); }
  .landing-cta-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .landing-cap-grid { grid-template-columns: 1fr; }
  .landing-tech-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Search & AI View
   ============================================================ */
.search-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--sp-lg);
  min-height: calc(100vh - 180px);
}

.search-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--sp-xs);
}

.search-results-list::-webkit-scrollbar { width: 4px; }
.search-results-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.search-result-item {
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--sp-xs);
}

.search-result-item:hover { background: var(--bg-card-hover); border-color: var(--border); }
.search-result-item.active { background: var(--bg-card); border-color: var(--accent); box-shadow: 0 0 12px rgba(232,119,34,0.15); }

/* Detail panel tabs */
.detail-tabs {
  display: flex;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-md);
}

.detail-tab {
  padding: var(--sp-xs) var(--sp-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  font-family: inherit;
}

.detail-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.detail-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Chat interface */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 300px);
  min-height: 400px;
}

.chat-chips {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-sm);
}

.chat-chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.chat-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-sm) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  max-width: 85%;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  animation: chatFadeIn 0.3s ease;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: var(--radius-sm);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.chat-msg-time {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.chat-typing {
  align-self: flex-start;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 4px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: chatTyping 1.2s infinite;
}

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

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

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

.chat-input-row {
  display: flex;
  gap: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  padding: var(--sp-sm) var(--sp-md);
  border: none;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover { background: #d06a1c; transform: scale(1.05); }

/* Summary report sections */
.summary-section {
  padding: var(--sp-md);
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-md);
}

.summary-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-sm);
}

/* ESG & Risk tab styles */
.view-tabs {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.2);
  padding: 3px;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-lg);
}

.view-tab {
  flex: 1;
  padding: var(--sp-sm) var(--sp-md);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.view-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.view-tab.active { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }

/* Document upload zone */
.doc-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-xl);
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
  margin-bottom: var(--sp-lg);
}

.doc-upload-zone:hover { border-color: var(--accent); background: rgba(232,119,34,0.05); }

.doc-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-md);
}

.doc-type-card {
  padding: var(--sp-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.doc-type-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.doc-type-card.processed { border-color: var(--success); }

.doc-type-icon { font-size: 2rem; margin-bottom: var(--sp-sm); }

/* AI processing animation */
.ai-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: var(--sp-sm) 0;
}

.ai-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--info));
  border-radius: 2px;
  width: 0;
  transition: width 0.5s ease;
}

/* Extraction results */
.extraction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: var(--text-sm);
}

.extraction-label { color: var(--text-muted); }
.extraction-value { font-weight: 600; }
.extraction-confidence {
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Value impact bars */
.impact-bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}

.impact-bar-label { width: 160px; flex-shrink: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.impact-bar-track { flex: 1; height: 20px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; position: relative; }
.impact-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.impact-bar-value { width: 80px; flex-shrink: 0; text-align: right; font-size: var(--text-sm); font-weight: 600; }

/* Risk triangle */
.risk-triangle-container {
  position: relative;
  width: 340px;
  height: 300px;
  margin: var(--sp-lg) auto;
}

.risk-triangle-node {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  background: var(--bg-card);
  z-index: 2;
  transition: all var(--transition-normal);
}

.risk-triangle-node:hover { transform: scale(1.08); box-shadow: var(--shadow-lg); }

.risk-triangle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.risk-triangle-line {
  position: absolute;
  background: var(--border);
  z-index: 1;
}

/* PSD2 transaction list */
.transaction-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: var(--text-sm);
}

.transaction-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.transaction-amount { margin-left: auto; font-weight: 600; white-space: nowrap; }
.transaction-amount.positive { color: var(--success); }
.transaction-amount.negative { color: var(--text-secondary); }

/* Household budget bar */
.budget-bar {
  display: flex;
  height: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--sp-sm);
}

.budget-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #fff;
  transition: width 0.8s ease;
  min-width: 0;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 900px) {
  .search-layout { grid-template-columns: 1fr; }
  .search-panel { max-height: 300px; }
  .chat-container { height: 400px; min-height: 300px; }
  .risk-triangle-container { width: 280px; height: 250px; }
  .risk-triangle-node { width: 70px; height: 70px; }
}

@media (max-width: 600px) {
  .view-tabs { flex-wrap: wrap; }
  .doc-type-grid { grid-template-columns: 1fr 1fr; }
  .detail-tabs { flex-wrap: wrap; }
}

/* ── Wizard Stepper ───────────────────────────── */
.wizard-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto var(--sp-xl);
  position: relative;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  flex: 1;
  position: relative;
  z-index: 1;
}

.wizard-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  border: 2px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.wizard-step.active .wizard-step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(232, 119, 34, 0.4);
}

.wizard-step.completed .wizard-step-circle {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.wizard-step-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.wizard-step.active .wizard-step-label {
  color: var(--accent);
  font-weight: 600;
}

.wizard-step.completed .wizard-step-label {
  color: var(--success);
}

.wizard-connector {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.wizard-connector-fill {
  height: 100%;
  background: var(--success);
  transition: width var(--transition-normal);
}

/* ── Wizard Forms ─────────────────────────────── */
.wizard-form {
  display: grid;
  gap: var(--sp-md);
}

.wizard-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}

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

.wizard-field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.wizard-field input,
.wizard-field select {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.wizard-field input:focus,
.wizard-field select:focus {
  border-color: var(--accent);
}

.wizard-field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-sm);
}

.wizard-field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ── Document Upload Cards (Wizard) ───────────── */
.wizard-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-md);
}

.wizard-doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.wizard-doc-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.wizard-doc-card.uploaded {
  border-color: var(--success);
  background: rgba(76, 175, 80, 0.06);
}

.wizard-doc-card.processing {
  border-color: var(--info);
}

.wizard-doc-icon {
  font-size: 1.5rem;
}

.wizard-doc-name {
  font-weight: 600;
  font-size: var(--text-sm);
}

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

/* ── PSD2 Bank Selection ──────────────────────── */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-md);
}

.bank-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.bank-card:hover {
  border-color: var(--info);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.bank-card.selected {
  border-color: var(--success);
  background: rgba(76, 175, 80, 0.08);
}

.bank-logo {
  font-size: 1.8rem;
}

.bank-name {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ── Processing Animation ─────────────────────── */
.processing-phases {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.processing-phase {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  opacity: 0.3;
  transition: opacity var(--transition-normal);
}

.processing-phase.active,
.processing-phase.done {
  opacity: 1;
}

.processing-phase-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
}

.processing-phase.active .processing-phase-icon {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 1s ease infinite;
}

.processing-phase.done .processing-phase-icon {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 119, 34, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(232, 119, 34, 0); }
}

.processing-phase-text {
  font-size: var(--text-sm);
  flex: 1;
}

.processing-phase-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex: 1;
  max-width: 100px;
}

.processing-phase-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Result Hero Card ─────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(232, 119, 34, 0.08) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--sp-xl);
  text-align: center;
  margin-bottom: var(--sp-lg);
}

.result-hero .market-value {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--accent);
  margin: var(--sp-sm) 0;
}

.result-hero .confidence-range {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* ── Bodenrichtwerte Table ────────────────────── */
.brw-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.brw-value.high { color: var(--danger); }
.brw-value.medium { color: var(--warning); }
.brw-value.low { color: var(--info); }

.brw-category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.brw-category-badge.metropole { background: rgba(244, 67, 54, 0.15); color: var(--danger); }
.brw-category-badge.grossstadt { background: rgba(232, 119, 34, 0.15); color: var(--accent); }
.brw-category-badge.mittelstadt { background: rgba(41, 182, 246, 0.15); color: var(--info); }
.brw-category-badge.kleinstadt { background: rgba(76, 175, 80, 0.15); color: var(--success); }
.brw-category-badge.laendlich { background: rgba(96, 125, 139, 0.15); color: var(--text-muted); }

/* ── Reference Sales ──────────────────────────── */
.sales-filters {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}

.sales-filters select {
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  outline: none;
}

.sales-filters select:focus {
  border-color: var(--accent);
}

.city-avg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-sm);
}

.city-avg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-sm) var(--sp-md);
  text-align: center;
}

.city-avg-card .city-name {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-xs);
}

.city-avg-card .city-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
}

/* ── Wizard Responsive ────────────────────────── */
@media (max-width: 900px) {
  .wizard-stepper { gap: var(--sp-xs); }
  .wizard-step-label { font-size: 0.65rem; }
  .wizard-step-circle { width: 32px; height: 32px; font-size: var(--text-xs); }
  .wizard-form-row { grid-template-columns: 1fr; }
  .wizard-doc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .bank-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 600px) {
  .wizard-stepper { flex-wrap: wrap; gap: var(--sp-sm); justify-content: center; }
  .wizard-connector { display: none; }
  .wizard-doc-grid { grid-template-columns: 1fr 1fr; }
}

/* --- BORIS Map Popup --- */
.boris-popup .leaflet-popup-content-wrapper {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  padding: 0;
}
.boris-popup .leaflet-popup-content {
  margin: 12px 14px;
}
.boris-popup .leaflet-popup-tip {
  background: #fff;
}
#boris-map .leaflet-control-zoom a {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
#boris-map .leaflet-control-attribution {
  background: rgba(0,27,61,0.85);
  color: var(--text-muted);
  font-size: 10px;
}
#boris-map .leaflet-control-attribution a {
  color: var(--accent);
}
