/* ==========================================================================
   index.css – "Die Wahl" Premium Design System
   🇩🇪 Deutsches Bürger-Design: Staatliches Vertrauen trifft modernes UX
   Farbpalette: Marine-Blau, Deutschland-Rot, Goldakzente
   ========================================================================== */

html {
  font-size: 18px;
}

/* --- Reset & Base Variables --- */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* ===== ☀️ HELL-MODUS: Klares, modernes Bürgerd Design ===== */

  /* Hintergrund: Warmes, papier-weiches Ivory mit Hauch von Grau */
  --bg-main: hsl(220, 20%, 97%);
  --bg-sidebar: hsl(0, 0%, 100%);
  --bg-card: hsl(0, 0%, 100%);
  --bg-phone: hsl(220, 18%, 98%);

  /* Grenzen: Klare, dezente Linien */
  --border-color: hsl(220, 15%, 90%);
  --border-glow: hsla(0, 78%, 40%, 0.08);

  /* Text: Charcoal-Dunkel für maximale Lesbarkeit */
  --text-primary: hsl(220, 25%, 10%);
  --text-secondary: hsl(220, 15%, 35%);
  --text-muted: hsl(220, 10%, 58%);

  /* Primärfarbe: Deutschland-Rot (desat, elegant) */
  --color-primary: hsl(0, 75%, 42%);         /* Bundesrot – edel & stark */
  --color-primary-glow: hsla(0, 75%, 42%, 0.14);
  --color-primary-hover: hsl(0, 75%, 34%);

  /* Akzentfarbe: Goldenes Amber (Bundesgold) */
  --color-accent: hsl(38, 88%, 48%);         /* Gold – wie auf dem Bundesadler */
  --color-accent-glow: hsla(38, 88%, 48%, 0.18);

  /* Semantische Farben */
  --color-success: hsl(142, 62%, 38%);
  --color-success-bg: hsl(142, 62%, 95%);
  --color-danger: hsl(0, 75%, 42%);
  --color-danger-bg: hsl(0, 90%, 96%);
  --color-warning: hsl(38, 88%, 48%);
  --color-info: hsl(210, 90%, 48%);

  /* Glassmorphism – Hell */
  --glass-blur: blur(24px);
  --glass-bg: hsla(0, 0%, 100%, 0.88);
  --glass-border: hsla(220, 25%, 10%, 0.05);

  /* Premium Schatten & Glows – Hell */
  --glow-primary: 0 4px 20px hsla(0, 75%, 42%, 0.12), 0 2px 6px hsla(0, 75%, 42%, 0.06);
  --glow-cyan: 0 4px 20px hsla(0, 75%, 42%, 0.12), 0 2px 6px hsla(0, 75%, 42%, 0.06);
  --glow-blue: 0 4px 20px hsla(210, 90%, 48%, 0.1);
  --glow-accent: 0 4px 20px hsla(38, 88%, 48%, 0.15);
  --glow-gold: 0 4px 20px hsla(38, 88%, 48%, 0.2);

  /* Übergänge */
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.18s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Smartphone & Komponenten */
  --bg-phone-frame: hsl(220, 15%, 18%);
  --border-phone-frame: hsl(220, 15%, 12%);
  --phone-status-bar-color: hsl(0, 0%, 100%);
  --app-header-bg: hsla(220, 18%, 98%, 0.95);
  --app-tabs-bg: hsl(220, 16%, 94%);
  --tab-btn-active-bg: hsl(0, 0%, 100%);
  --tab-btn-active-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  --tab-btn-active-color: var(--color-primary);
  --tab-btn-active-sub: var(--text-primary);

  /* Karten */
  --law-card-bg: hsl(0, 0%, 100%);
  --law-card-border: hsl(220, 15%, 92%);
  --law-card-shadow: 0 2px 12px rgba(20, 20, 60, 0.04), 0 1px 3px rgba(20, 20, 60, 0.02);
  --law-card-hover-border: var(--color-primary);
  --law-card-hover-shadow: 0 8px 30px hsla(0, 75%, 42%, 0.1), 0 2px 8px hsla(0, 75%, 42%, 0.06);

  --law-card-in-activism-bg: linear-gradient(135deg, hsl(0, 0%, 100%) 0%, hsla(0, 75%, 42%, 0.02) 100%);
  --law-card-in-activism-border: hsla(0, 75%, 42%, 0.22);
  --law-card-in-activism-shadow: 0 4px 20px hsla(0, 75%, 42%, 0.06);

  /* Status-Tags */
  --status-tag-critical-bg: hsl(0, 80%, 96%);
  --status-tag-critical-color: hsl(0, 75%, 38%);
  --status-tag-critical-border: hsla(0, 75%, 42%, 0.15);
  --status-tag-warning-bg: hsl(40, 95%, 93%);
  --status-tag-warning-color: hsl(35, 85%, 36%);
  --status-tag-warning-border: hsla(38, 88%, 48%, 0.15);
  --status-tag-info-bg: hsl(210, 90%, 94%);
  --status-tag-info-color: hsl(210, 90%, 35%);
  --status-tag-info-border: hsla(210, 90%, 48%, 0.15);

  /* Abstimmungsbuttons */
  --vote-btn-ja-bg: hsl(142, 62%, 95%);
  --vote-btn-ja-color: hsl(142, 62%, 30%);
  --vote-btn-ja-border: hsla(142, 62%, 38%, 0.22);
  --vote-btn-nein-bg: hsl(0, 80%, 96%);
  --vote-btn-nein-color: hsl(0, 75%, 38%);
  --vote-btn-nein-border: hsla(0, 75%, 42%, 0.22);
  --bar-chart-track: hsl(220, 16%, 92%);

  /* Kommentare & Debatte */
  --comment-card-bg: hsl(220, 18%, 97%);
  --comment-card-border: hsl(220, 14%, 91%);
  --comment-restricted-bg: hsl(220, 18%, 97%);
  --comment-restricted-border: hsl(220, 14%, 88%);
  --comment-input-bg: hsl(220, 18%, 97%);
  --comment-column-selector-bg: hsl(0, 0%, 100%);

  /* PIN-Tastatur */
  --pin-button-bg: hsl(220, 18%, 97%);
  --pin-button-color: var(--text-primary);
  --pin-button-border: hsl(220, 14%, 88%);

  /* Datenbank & Code */
  --db-pane-bg: hsl(220, 18%, 97%);
  --json-code-bg: hsl(0, 0%, 100%);
  --raw-doc-bg: hsl(220, 18%, 97%);

  /* Logo */
  --logo-url: url('Die Wahl App - Logo.png?v=1.0.5');
  --logo-size: 100%;
  --logo-pos: center;
  --logo-border: rgba(0, 0, 0, 0.15);
  --logo-shadow: 0 4px 16px hsla(0, 75%, 42%, 0.12);
  --logo-auth-shadow: 0 8px 28px hsla(0, 75%, 42%, 0.14), 0 4px 12px hsla(38, 88%, 48%, 0.08);
  --logo-bg: hsl(220, 20%, 12%);

  /* Header */
  --main-header-bg: hsla(220, 20%, 97%, 0.92);
  --main-header-shadow: 0 1px 0 var(--border-color), 0 4px 20px rgba(20, 20, 60, 0.04);
  --main-logo-gradient: linear-gradient(135deg, hsl(220, 25%, 10%) 0%, hsl(0, 75%, 42%) 100%);
}

/* ===== 🌙 DUNKEL-MODUS: Staatlich-Premium, Marine & Gold ===== */
body.dark-theme {
  /* Hintergrund: Tiefes Marine-Blau – Staatsautorität & Premium */
  --bg-main: hsl(222, 30%, 7%);
  --bg-sidebar: hsl(222, 28%, 10%);
  --bg-card: hsla(222, 28%, 12%, 0.8);
  --bg-phone: hsl(222, 32%, 6%);

  /* Grenzen: Dezent leuchtend */
  --border-color: hsla(220, 40%, 22%, 0.55);
  --border-glow: hsla(38, 88%, 48%, 0.12);

  /* Text: Sehr sauberes Weiß */
  --text-primary: hsl(220, 25%, 96%);
  --text-secondary: hsl(220, 18%, 70%);
  --text-muted: hsl(220, 12%, 48%);

  /* Primärfarbe: Deutschland-Rot leuchtend */
  --color-primary: hsl(0, 82%, 62%);       /* Helles leuchtendes Rot im Dunkel */
  --color-primary-glow: hsla(0, 82%, 62%, 0.28);
  --color-primary-hover: hsl(0, 82%, 52%);

  /* Akzent: Strahlendes Gold – Bundesadler-Gelb */
  --color-accent: hsl(40, 96%, 55%);       /* Premium-Gold */
  --color-accent-glow: hsla(40, 96%, 55%, 0.25);

  /* Semantische Farben */
  --color-success: hsl(142, 70%, 52%);
  --color-success-bg: hsla(142, 70%, 52%, 0.12);
  --color-danger: hsl(0, 85%, 62%);
  --color-danger-bg: hsla(0, 85%, 62%, 0.12);
  --color-warning: hsl(40, 96%, 55%);
  --color-info: hsl(210, 100%, 62%);

  /* Glassmorphism – Dunkel */
  --glass-bg: hsla(222, 30%, 10%, 0.6);
  --glass-border: hsla(0, 0%, 100%, 0.04);

  /* Premium Glows – Dunkel (Rot & Gold) */
  --glow-primary: 0 0 28px hsla(0, 82%, 62%, 0.22), 0 0 10px hsla(0, 82%, 62%, 0.1);
  --glow-cyan: 0 0 28px hsla(0, 82%, 62%, 0.22), 0 0 10px hsla(0, 82%, 62%, 0.1);
  --glow-blue: 0 0 25px hsla(210, 100%, 62%, 0.2), 0 0 10px hsla(210, 100%, 62%, 0.08);
  --glow-accent: 0 0 28px hsla(40, 96%, 55%, 0.3), 0 0 12px hsla(40, 96%, 55%, 0.12);
  --glow-gold: 0 0 30px hsla(40, 96%, 55%, 0.35), 0 0 15px hsla(40, 96%, 55%, 0.15);

  /* Komponenten */
  --bg-phone-frame: hsl(222, 40%, 4%);
  --border-phone-frame: hsl(222, 30%, 10%);
  --phone-status-bar-color: hsla(0, 0%, 100%, 0.9);
  --app-header-bg: hsla(222, 30%, 8%, 0.65);
  --app-tabs-bg: hsla(222, 30%, 6%, 0.6);
  --tab-btn-active-bg: var(--color-primary);
  --tab-btn-active-shadow: 0 3px 14px var(--color-primary-glow);
  --tab-btn-active-color: hsl(0, 0%, 100%);
  --tab-btn-active-sub: hsla(0, 0%, 100%, 0.9);

  /* Karten */
  --law-card-bg: hsla(222, 30%, 11%, 0.65);
  --law-card-border: var(--border-color);
  --law-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --law-card-hover-border: hsla(0, 82%, 62%, 0.45);
  --law-card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 15px hsla(0, 82%, 62%, 0.1);

  --law-card-in-activism-bg: linear-gradient(135deg, hsla(222, 30%, 11%, 0.65) 0%, hsla(0, 85%, 62%, 0.04) 100%);
  --law-card-in-activism-border: hsla(0, 85%, 62%, 0.42);
  --law-card-in-activism-shadow: 0 0 20px hsla(0, 85%, 62%, 0.1);

  /* Status-Tags */
  --status-tag-critical-bg: var(--color-danger-bg);
  --status-tag-critical-color: var(--color-danger);
  --status-tag-critical-border: transparent;
  --status-tag-warning-bg: hsla(40, 96%, 55%, 0.14);
  --status-tag-warning-color: var(--color-warning);
  --status-tag-warning-border: transparent;
  --status-tag-info-bg: hsla(210, 100%, 62%, 0.14);
  --status-tag-info-color: var(--color-info);
  --status-tag-info-border: transparent;

  /* Abstimmungsbuttons */
  --vote-btn-ja-bg: var(--color-success-bg);
  --vote-btn-ja-color: var(--color-success);
  --vote-btn-ja-border: hsla(142, 70%, 52%, 0.28);
  --vote-btn-nein-bg: var(--color-danger-bg);
  --vote-btn-nein-color: var(--color-danger);
  --vote-btn-nein-border: hsla(0, 85%, 62%, 0.28);
  --bar-chart-track: hsla(0, 0%, 100%, 0.06);

  /* Kommentare */
  --comment-card-bg: hsla(222, 30%, 11%, 0.6);
  --comment-card-border: var(--border-color);
  --comment-restricted-bg: hsla(0, 0%, 100%, 0.015);
  --comment-restricted-border: var(--border-color);
  --comment-input-bg: hsla(0, 0%, 0%, 0.28);
  --comment-column-selector-bg: var(--bg-sidebar);

  /* PIN */
  --pin-button-bg: hsla(0, 0%, 100%, 0.03);
  --pin-button-color: hsl(0, 0%, 100%);
  --pin-button-border: var(--border-color);

  /* Datenbank */
  --db-pane-bg: hsla(0, 0%, 0%, 0.25);
  --json-code-bg: hsl(222, 35%, 4%);
  --raw-doc-bg: hsl(222, 35%, 4%);

  /* Logo */
  --logo-url: url('Die Wahl App - Logo.png?v=1.0.5');
  --logo-size: 100%;
  --logo-pos: center;
  --logo-border: rgba(255, 255, 255, 0.06);
  --logo-shadow: 0 0 20px var(--color-primary-glow);
  --logo-auth-shadow: 0 0 30px hsla(40, 96%, 55%, 0.25), 0 0 15px var(--color-primary-glow);
  --logo-bg: hsl(222, 40%, 8%);

  /* Header */
  --main-header-bg: hsla(222, 30%, 7%, 0.92);
  --main-header-shadow: 0 1px 0 hsla(220, 40%, 22%, 0.4);
  --main-logo-gradient: linear-gradient(135deg, hsl(220, 25%, 96%) 0%, hsl(0, 82%, 68%) 100%);
}

/* --- 🤖 KI-Redaktion (AI Workspace) Styles --- */

.ai-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .ai-controls-grid {
    grid-template-columns: 1fr;
  }
}

.ai-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-select-wrapper label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-select-btn-group {
  display: flex;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  padding: 2px;
}

.ai-select-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ai-select-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.03);
}

.ai-select-btn.active {
  color: #fff;
  background-color: var(--color-primary);
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

.ai-select-btn.active.focus-sozial {
  background-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.ai-select-btn.active.focus-wirtschaft {
  background-color: var(--color-warning);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.ai-select-btn-sub {
  font-size: 0.6rem;
  opacity: 0.7;
}

/* AI Workspace Split Panel */
.ai-workspace {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  min-height: 380px;
  background-color: rgba(11, 15, 25, 0.45);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.03);
  position: relative;
  transition: var(--transition-smooth);
}

.ai-workspace.active {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.08), inset 0 0 30px rgba(37, 99, 235, 0.05);
}

@media (max-width: 800px) {
  .ai-workspace {
    grid-template-columns: 1fr;
  }
}

/* Left side: Terminal Agent Console */
.ai-agent-terminal {
  background-color: #030508;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.85rem;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.ai-terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.ai-terminal-dots {
  display: flex;
  gap: 4px;
}

.ai-terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ai-terminal-dot.red { background-color: #ef4444; }
.ai-terminal-dot.yellow { background-color: #f59e0b; }
.ai-terminal-dot.green { background-color: #10b981; }

.ai-terminal-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.ai-terminal-body {
  flex: 1;
  overflow-y: auto;
  font-size: 0.7rem;
  line-height: 1.45;
  color: #10b981; /* Default retro green */
  white-space: pre-wrap;
}

.ai-log-entry {
  margin-bottom: 0.35rem;
  animation: fadeIn 0.15s ease-out;
}
.ai-log-entry.info { color: #06b6d4; }
.ai-log-entry.success { color: #10b981; }
.ai-log-entry.warn { color: #f59e0b; }
.ai-log-entry.step { color: #a78bfa; font-weight: bold; }

/* Right side: Streaming sheet paper */
.ai-streaming-sheet {
  background-color: rgba(255, 255, 255, 0.95);
  color: #0f172a; /* Sleek slate dark text */
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-body);
  position: relative;
  transition: var(--transition-smooth);
}

.ai-streaming-sheet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.ai-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.4rem;
  margin-bottom: 0.25rem;
}

.ai-sheet-badge {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.ai-sheet-badge.level {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
}
.ai-sheet-badge.focus {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--color-accent);
}

.ai-sheet-title {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

.ai-sheet-content-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ai-sheet-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.ai-sheet-text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #1e293b;
  font-weight: 450;
  position: relative;
  min-height: 1.2rem;
}

/* Streaming Typewriter Cursor */
.ai-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--color-primary);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Phase 1: Real-world API Connections --- */
.api-integration-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background-image: radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.api-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.api-card-header h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.api-toggle-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.api-integration-card.collapsed .api-toggle-indicator {
  transform: rotate(-90deg);
}

.api-card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.25s ease;
  max-height: 800px;
  opacity: 1;
}

.api-integration-card.collapsed .api-card-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  pointer-events: none;
}

.api-key-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .api-key-input-row {
    grid-template-columns: 1fr;
  }
}

.api-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.api-status-badge.offline {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: var(--border-color);
}
.api-status-badge.online {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
  animation: pulse-green 2s infinite;
}

.api-fetch-results-row {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease-out;
}

.api-live-select {
  background-color: var(--bg-main) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  color: var(--text-primary) !important;
}

.api-live-select:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.25) !important;
}

.api-help-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
}

.api-help-link {
  color: var(--color-primary-hover);
  text-decoration: none;
  transition: var(--transition-smooth);
}
.api-help-link:hover {
  text-decoration: underline;
  color: #fff;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   PHASE 2 - DIE WAHRE DEMOKRATIE STYLES
   ========================================================================== */

/* Phase 2 Header & Status Badges */
.badge.phase-2 {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: #fff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 0 12px var(--color-accent-glow);
  animation: pulse-phase2 3s infinite alternate;
}

@keyframes pulse-phase2 {
  0% { box-shadow: 0 0 6px var(--color-accent-glow); }
  100% { box-shadow: 0 0 18px var(--color-accent-glow); }
}

.status-badge.status-direct-vote {
  background-color: var(--color-accent-glow) !important;
  color: var(--color-accent) !important;
  border: 1px solid var(--color-accent-glow) !important;
}

/* Phase 2 Reboot Upgrade Terminal */
.upgrade-terminal-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #020202;
  z-index: 9999;
  font-family: 'Courier New', Courier, monospace;
  color: #00ff66;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.2);
}

.terminal-matrix-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
}

.upgrade-terminal-screen .terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #00ff66;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.upgrade-terminal-screen .terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.upgrade-terminal-screen .terminal-dot.red { background-color: #ff5c5c; }
.upgrade-terminal-screen .terminal-dot.yellow { background-color: #ffbd2e; }
.upgrade-terminal-screen .terminal-dot.green { background-color: #27c93f; }

.upgrade-terminal-screen .terminal-title {
  font-size: 0.75rem;
  color: #00ff66;
  font-weight: bold;
  letter-spacing: 1px;
  margin-left: 6px;
}

.upgrade-terminal-screen .terminal-body {
  flex: 1;
  overflow-y: auto;
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Custom terminal animations */
.terminal-log-line {
  margin-bottom: 6px;
  opacity: 0;
  animation: terminalFadeIn 0.1s forwards;
}

@keyframes terminalFadeIn {
  to { opacity: 1; }
}

/* Phase 2 Direct Voting Graphic & Layout */
.direct-vote-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  backdrop-filter: var(--glass-blur);
}

.direct-vote-container h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.direct-vote-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.direct-vote-desc strong {
  color: #00ffc8;
}

.direct-vote-progress {
  height: 24px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.direct-vote-progress .bar-yes {
  background: linear-gradient(90deg, var(--color-success), hsl(142, 65%, 50%));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.25, 1);
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.direct-vote-progress .bar-no {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.25, 1);
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.direct-vote-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}

.direct-vote-legend .leg-yes {
  color: var(--color-success);
}

.direct-vote-legend .leg-no {
  color: var(--color-danger);
}

.direct-vote-info-box {
  background: rgba(0, 255, 200, 0.06);
  border: 1px dashed rgba(0, 255, 200, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #00ffc8;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- 🤖 KI-Avatar Chat Screen Styling --- */
.app-avatar-chat-view {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  bottom: 58px; /* Nav-Höhe: 58px */
  background-color: var(--bg-phone);
  z-index: 8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.avatar-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background-color: var(--app-header-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  z-index: 2;
}

.avatar-info-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-profile-pic-container {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(0, 255, 200, 0.35);
  box-shadow: 0 0 10px rgba(0, 255, 200, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-emoji {
  font-size: 18px;
}

.avatar-status-pulse {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  border: 1.5px solid var(--bg-phone);
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse-green-glow 2s infinite;
}

.avatar-profile-text h4 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.avatar-profile-text p {
  font-size: 0.6rem;
  color: var(--text-secondary);
  margin: 0;
}

.avatar-profile-text .status-lbl {
  color: var(--color-success);
  font-weight: 600;
}

.avatar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.avatar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.avatar-action-btn:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(0, 180, 140, 0.45);
  color: #008f70;
  background: rgba(0, 180, 140, 0.05);
  box-shadow: 0 4px 10px rgba(0, 180, 140, 0.15);
}

.avatar-action-btn:active {
  transform: scale(0.95);
}

.avatar-action-btn svg {
  transition: transform 0.2s ease, stroke-width 0.2s ease;
}

.avatar-action-btn:hover svg {
  stroke-width: 2.2px;
}

body.dark-theme .avatar-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .avatar-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 255, 200, 0.35);
  color: #00ffc8;
  box-shadow: 0 4px 12px rgba(0, 255, 200, 0.15);
}

.clear-chat-btn:hover {
  border-color: rgba(255, 59, 48, 0.45) !important;
  color: #ff5c5c !important;
  background: rgba(255, 59, 48, 0.08) !important;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.25) !important;
}

body.dark-theme .clear-chat-btn:hover {
  border-color: rgba(255, 59, 48, 0.65) !important;
  color: #ff5c5c !important;
  background: rgba(255, 59, 48, 0.15) !important;
  box-shadow: 0 0 14px rgba(255, 59, 48, 0.4) !important;
}

.tts-toggle-btn .icon-volume-on {
  display: none;
}

.tts-toggle-btn .icon-volume-off {
  display: block;
}

.tts-toggle-btn.tts-active .icon-volume-on {
  display: block;
}

.tts-toggle-btn.tts-active .icon-volume-off {
  display: none;
}

.tts-toggle-btn.tts-active {
  border-color: rgba(0, 180, 140, 0.45) !important;
  color: #008f70 !important;
  background: rgba(0, 180, 140, 0.08) !important;
  box-shadow: 0 0 10px rgba(0, 180, 140, 0.25) !important;
}

body.dark-theme .tts-toggle-btn.tts-active {
  border-color: rgba(0, 255, 200, 0.6) !important;
  color: #00ffc8 !important;
  background: rgba(0, 255, 200, 0.15) !important;
  box-shadow: 0 0 14px rgba(0, 255, 200, 0.4) !important;
}

.tts-toggle-btn.tts-speaking {
  animation: tts-speaking-pulse 1.2s infinite ease-in-out;
}

@keyframes tts-speaking-pulse {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(0, 255, 200, 0.2); }
  50% { transform: scale(1.08); box-shadow: 0 0 16px rgba(0, 255, 200, 0.55); }
  100% { transform: scale(1); box-shadow: 0 0 8px rgba(0, 255, 200, 0.2); }
}

/* Context Banner */
.avatar-context-banner {
  background-color: var(--color-primary-glow);
  border-bottom: 1px solid var(--color-primary-glow);
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slide-down-context 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.context-desc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-label {
  color: var(--text-muted);
  font-weight: 600;
}

.context-title {
  color: #008f70;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark-theme .context-title {
  color: #00ffc8;
}

.context-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}
.context-clear-btn:hover {
  color: #ff5c5c;
}

/* Message Thread */
.avatar-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(0, 255, 200, 0.02) 0%, transparent 60%);
}

.chat-message {
  display: flex;
  max-width: 82%;
  animation: pop-message 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.chat-message.avatar {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message .msg-bubble {
  padding: 0.65rem 0.8rem;
  font-size: 0.76rem;
  line-height: 1.45;
  border-radius: 14px;
}

.chat-message.avatar .msg-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.chat-message.user .msg-bubble {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  border: none;
  border-bottom-right-radius: 2px;
  color: #fff;
  box-shadow: 0 3px 12px var(--color-primary-glow);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 6px;
}
.typing-indicator span {
  width: 5px;
  height: 5px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: pulse-typing-dots 1.4s infinite;
  opacity: 0.5;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* Quick Replies Slider */
.avatar-quick-replies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0.5rem;
  background-color: rgba(11, 15, 25, 0.3);
  border-top: 1px solid var(--border-color);
  scrollbar-width: none; /* Firefox */
}
.avatar-quick-replies::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.quick-reply-btn {
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 16px;
  padding: 0.35rem 0.7rem;
  font-size: 0.64rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}
@media (hover: hover) {
  .quick-reply-btn:hover {
    background-color: var(--color-primary-glow);
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
}
.quick-reply-btn.hover-simulated {
  background-color: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Chat Input bar */
.avatar-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background-color: var(--app-header-bg);
  border-top: 1px solid var(--border-color);
  z-index: 2;
}

.avatar-chat-input-row input {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.45rem 0.95rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition-smooth);
}
.avatar-chat-input-row input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.chat-send-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--color-primary-glow);
  transition: var(--transition-smooth);
}
@media (hover: hover) {
  .chat-send-btn:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    transform: scale(1.05);
  }
}
.chat-send-btn.hover-simulated:not(:disabled) {
  background-color: var(--color-primary-hover);
  transform: scale(1.05);
}
.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  padding: 0;
}

.mic-btn:hover {
  transform: translateY(-1px) scale(1.05);
  border-color: rgba(0, 180, 140, 0.45);
  color: #008f70;
  box-shadow: 0 2px 8px rgba(0, 180, 140, 0.2);
}

body.dark-theme .mic-btn:hover {
  border-color: rgba(0, 255, 200, 0.45);
  color: #00ffc8;
  box-shadow: 0 2px 8px rgba(0, 255, 200, 0.25);
}

.mic-btn:active {
  transform: scale(0.95);
}

body.dark-theme .mic-btn {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.mic-btn.mic-recording {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35) !important;
  animation: mic-recording-pulse 1.2s infinite alternate;
}

@keyframes mic-recording-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* --- 🏢 Avatar Shortcut Banner inside Law Details --- */
.avatar-shortcut-banner {
  background: linear-gradient(135deg, var(--color-primary-glow) 0%, var(--color-accent-glow) 100%);
  border: 1px solid var(--color-primary-glow);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

@media (hover: hover) {
  .avatar-shortcut-banner:hover {
    background: linear-gradient(135deg, rgba(0, 255, 200, 0.1) 0%, rgba(37, 99, 235, 0.06) 100%);
    border-color: rgba(0, 255, 200, 0.45);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(0, 255, 200, 0.1);
  }
}
.avatar-shortcut-banner.hover-simulated {
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.1) 0%, rgba(37, 99, 235, 0.06) 100%);
  border-color: rgba(0, 255, 200, 0.45);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 255, 200, 0.1);
}

.avatar-shortcut-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-shortcut-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(0, 255, 200, 0.45);
  box-shadow: 0 0 8px rgba(0, 255, 200, 0.25);
  animation: gentle-avatar-bounce 3s ease-in-out infinite;
  display: block;
}

.avatar-shortcut-meta strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary);
}

.avatar-shortcut-meta p {
  font-size: 0.6rem;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.avatar-shortcut-arrow {
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}
@media (hover: hover) {
  .avatar-shortcut-banner:hover .avatar-shortcut-arrow {
    color: var(--color-primary);
    transform: translateX(3px);
  }
}
.avatar-shortcut-banner.hover-simulated .avatar-shortcut-arrow {
  color: var(--color-primary);
  transform: translateX(3px);
}

/* Animations */
@keyframes pulse-green-glow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-typing-dots {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes gentle-avatar-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pop-message {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-down-context {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}




* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Subtiler Deutschland-Gradient: Neutral-Grau mit Hauch von Marine */
  background-image:
    radial-gradient(ellipse at 15% 0%, hsla(220, 50%, 92%, 0.8) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, hsla(0, 60%, 95%, 0.6) 0%, transparent 50%);
  background-attachment: fixed;
}

body.dark-theme {
  /* Dunkel: Tiefes Marine mit sublimen Deutschland-Farb-Glows */
  background-image:
    radial-gradient(ellipse at 20% 0%, hsla(222, 60%, 14%, 0.9) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, hsla(0, 45%, 16%, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, hsla(38, 70%, 12%, 0.3) 0%, transparent 70%);
  background-attachment: fixed;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-glow);
}

/* --- Brand Header --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem;
  background-color: var(--main-header-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--main-header-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  /* Deutschland-Flaggenstreifen oben */
  border-top: 3px solid transparent;
  border-image: linear-gradient(
    to right,
    hsl(220, 20%, 10%) 0% 33.3%,
    hsl(0, 75%, 42%) 33.3% 66.6%,
    hsl(38, 88%, 48%) 66.6% 100%
  ) 1 0 0 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 8px;
  box-shadow: 0 0 15px var(--color-primary-glow);
  position: relative;
  overflow: hidden;
}
.logo-icon::before {
  content: '🗳️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
}

.logo-icon-container {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--logo-bg);
  background-image: var(--logo-url);
  background-size: var(--logo-size);
  background-position: var(--logo-pos);
  background-repeat: no-repeat;
  box-shadow: var(--logo-shadow);
  border: 1px solid var(--logo-border);
  display: block;
}
.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--main-logo-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.divider {
  color: var(--border-color);
}

/* Badges */
.badge {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge.phase-1 {
  background-color: hsla(142, 62%, 38%, 0.12);
  color: var(--color-success);
  border: 1px solid hsla(142, 62%, 38%, 0.25);
}

.user-unregistered {
  background-color: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.user-stufe-1 {
  background: hsla(210, 90%, 48%, 0.1);
  color: hsl(210, 90%, 48%);
  border: 1px solid hsla(210, 90%, 48%, 0.25);
}
.user-stufe-2 {
  background: linear-gradient(135deg, hsla(38, 88%, 48%, 0.15), hsla(0, 75%, 42%, 0.1));
  color: var(--color-accent);
  border: 1px solid hsla(38, 88%, 48%, 0.3);
  box-shadow: 0 0 10px hsla(38, 88%, 48%, 0.12);
}

/* --- Layout Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 2rem;
  max-width: 1500px;
  margin: 2rem auto;
  padding: 0 2rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.2px;
}
.text-center {
  text-align: center;
}

/* --- 📱 Smartphone Frame UI --- */
.phone-panel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.smartphone-frame {
  width: 375px;
  height: 760px;
  background-color: var(--bg-phone-frame);
  border: 10px solid var(--border-phone-frame);
  border-radius: 48px;
  box-shadow: 
    0 30px 70px -15px rgba(0,0,0,0.22),
    0 0 45px rgba(20, 164, 134, 0.08),
    inset 0 0 10px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.smartphone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 200%;
  height: 100%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 60%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 20;
}

.notch {
  width: 95px;
  height: 24px;
  background-color: hsl(220, 20%, 8%);
  border-radius: 20px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: var(--transition-smooth);
}

.notch::after {
  content: '';
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #0e122b 30%, #03040b 90%);
  border-radius: 50%;
  position: absolute;
  right: 14px;
  top: 9px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.15);
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-phone);
  overflow: hidden;
  position: relative;
}

/* Phone Status Bar */
.phone-status-bar {
  height: 48px;
  padding: 14px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--phone-status-bar-color);
  z-index: 5;
  letter-spacing: -0.2px;
}

.phone-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* App Viewport Container */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: relative;
}

.hidden {
  display: none !important;
}

/* --- App Stage 0: Auth Screen --- */
#screen-auth {
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 50% 0%, var(--color-primary-glow) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 100%, var(--color-accent-glow) 0%, transparent 60%);
}

.auth-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-icon-big {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px var(--color-primary-glow));
  animation: float 4s ease-in-out infinite;
}

.auth-logo-container {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background-color: var(--logo-bg);
  background-image: var(--logo-url);
  background-size: var(--logo-size);
  background-position: var(--logo-pos);
  background-repeat: no-repeat;
  margin-bottom: 1.5rem;
  box-shadow: var(--logo-auth-shadow);
  animation: float 4s ease-in-out infinite;
  border: 1px solid var(--logo-border);
  display: block;
}

.auth-box h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

#auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  background-color: var(--bg-sidebar);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.72rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus, input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.form-help {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  font-size: 14px;
  height: 100%;
  opacity: 0.7;
  transition: var(--transition-smooth);
  user-select: none;
}

.password-toggle-btn:hover {
  opacity: 1;
  color: var(--color-primary);
}


.btn {
  font-family: var(--font-heading);
  font-weight: 650;
  padding: 0.72rem 1.4rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  font-size: 0.85rem;
  box-sizing: border-box;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px var(--color-primary-glow);
  transform: translateY(-2px) scale(1.02);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline {
  background-color: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--text-primary);
  background-color: var(--color-primary-glow);
  transform: translateY(-1px);
}
.btn-outline.active {
  background-color: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger) 0%, hsl(0, 75%, 30%) 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px var(--color-primary-glow);
  transform: translateY(-2px) scale(1.02);
}

.btn-pulse {
  animation: pulse-danger-btn 2s infinite;
}

.btn-small {
  padding: 0.45rem 0.9rem;
  font-size: 0.72rem;
  border-radius: 8px;
}

.auth-legal-info {
  margin-top: 1.5rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* --- App Navigation Bar Top --- */
.app-header-bar {
  padding: 0.75rem 1.25rem 0.5rem;
  background-color: var(--app-header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
}

.app-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
#app-username {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.badge-role {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
}
.badge-role.level-1 {
  background-color: hsla(210, 90%, 48%, 0.1);
  color: hsl(210, 90%, 45%);
  border: 1px solid hsla(210, 90%, 48%, 0.22);
}
.badge-role.level-2 {
  background-color: hsla(38, 88%, 48%, 0.12);
  color: hsl(38, 88%, 40%);
  border: 1px solid hsla(38, 88%, 48%, 0.25);
  box-shadow: 0 1px 4px hsla(38, 88%, 48%, 0.1);
}

body.dark-theme .badge-role.level-1 {
  background-color: hsla(210, 100%, 62%, 0.12);
  color: hsl(210, 100%, 70%);
  border-color: hsla(210, 100%, 62%, 0.22);
}
body.dark-theme .badge-role.level-2 {
  background-color: hsla(40, 96%, 55%, 0.12);
  color: hsl(40, 96%, 65%);
  border-color: hsla(40, 96%, 55%, 0.25);
}

.app-location {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Geotargeting Tabs - iOS/ShareTheMeal Segmented Pill Style */
.app-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--app-tabs-bg);
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
  margin: 12px 14px;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 5;
}

.tab-slider-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(33.333% - 6px);
  border-radius: 12px;
  background-color: var(--tab-btn-active-bg);
  box-shadow: var(--tab-btn-active-shadow);
  z-index: 0;
  transition: var(--transition-smooth);
}

.app-tabs:has(#tab-bund.active) .tab-slider-indicator {
  transform: translateX(0);
}
.app-tabs:has(#tab-land.active) .tab-slider-indicator {
  transform: translateX(calc(100% + 4px));
}
.app-tabs:has(#tab-kommune.active) .tab-slider-indicator {
  transform: translateX(calc(200% + 8px));
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 0.25rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: var(--transition-fast);
  z-index: 1;
  position: relative;
}

.tab-btn:hover .tab-title {
  color: var(--text-primary);
}

.tab-btn.active .tab-title {
  color: var(--tab-btn-active-color);
  font-weight: 800;
}
.tab-btn.active .tab-sub {
  color: var(--tab-btn-active-sub);
  opacity: 0.9;
}

.tab-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
}
.tab-sub {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition-fast);
}

/* App Scroll Feed */
.app-feed-scroll {
  flex: 1;
  min-height: 0; /* KRITISCH: Erlaubt flex-child zu scrollen */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.75rem 72px; /* 72px = Nav (58px) + Puffer */
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  background-color: var(--bg-phone);
  position: relative;
  z-index: 3;
}

/* Scrollbar verstecken im Feed (sauberer Mobile-Look) */
.app-feed-scroll::-webkit-scrollbar {
  display: none;
}
.app-feed-scroll {
  scrollbar-width: none;
}

/* --- Pull to Refresh Premium Styling --- */
.pull-to-refresh {
  position: absolute;
  top: 104px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.25s ease, transform 0.25s ease, height 0.2s ease;
  gap: 4px;
}

.ptr-spinner-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptr-spinner-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ptr-spinner-track {
  stroke: rgba(255, 255, 255, 0.08);
}
body.light-theme .ptr-spinner-track {
  stroke: rgba(0, 0, 0, 0.05);
}

.ptr-spinner-fill {
  stroke: var(--color-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.ptr-arrow-icon {
  position: absolute;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.ptr-text {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: opacity 0.15s ease;
}

/* Refreshing States */
.pull-to-refresh.ptr-active {
  opacity: 1;
  transform: translateY(0);
}

.pull-to-refresh.ptr-refreshing .ptr-spinner-svg {
  animation: ptr-spin 0.8s linear infinite;
}

.pull-to-refresh.ptr-refreshing .ptr-arrow-icon {
  opacity: 0;
  transform: scale(0.5);
}

@keyframes ptr-spin {
  100% {
    transform: rotate(270deg);
  }
}

/* Feed Categories Layout */
.feed-category-section {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.feed-category-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-left: 0.15rem;
  margin-bottom: 0.15rem;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.feed-category-row {
  display: flex;
  flex-direction: row;
  gap: 0.85rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0.15rem 0.65rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar for clean mobile look */
}

.feed-category-row::-webkit-scrollbar {
  display: none;
}

/* Make law cards inside horizontal scroll behave correctly */
.feed-category-row .law-card {
  flex: 0 0 85%; /* Sleek card peeking effect */
  min-width: 285px; /* Ensures footer elements have enough breathing room */
  max-width: 315px; /* Increased from 295px for better spacing on modern viewports */
  scroll-snap-align: start;
  margin-bottom: 2px; /* Prevent shadow clipping */
}

/* Law card styles - ShareTheMeal Clean Cards */
.law-card {
  display: flex;
  flex-direction: column;
  background-color: var(--law-card-bg);
  border: 1px solid var(--law-card-border);
  border-radius: 16px;
  padding: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: var(--law-card-shadow);
}

@media (hover: hover) {
  .law-card:hover {
    border-color: var(--law-card-hover-border);
    transform: translateY(-2px);
    box-shadow: var(--law-card-hover-shadow);
  }
}
.law-card.hover-simulated {
  border-color: var(--law-card-hover-border);
  transform: translateY(-2px);
  box-shadow: var(--law-card-hover-shadow);
}

.law-card.in-activism {
  border-color: var(--law-card-in-activism-border);
  box-shadow: var(--law-card-in-activism-shadow);
  background: var(--law-card-in-activism-bg);
}

.law-card-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.status-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
}
.status-critical {
  background-color: var(--status-tag-critical-bg);
  color: var(--status-tag-critical-color);
  border: 1px solid var(--status-tag-critical-border);
}
.status-warning {
  background-color: var(--status-tag-warning-bg);
  color: var(--status-tag-warning-color);
  border: 1px solid var(--status-tag-warning-border);
}
.status-info {
  background-color: var(--status-tag-info-bg);
  color: var(--status-tag-info-color);
  border: 1px solid var(--status-tag-info-border);
}

.region-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.law-card h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.law-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.law-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px; /* Force spacing between left and right badges */
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.vote-pct-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  white-space: nowrap;
}

body.light-theme .vote-pct-badge {
  background-color: rgba(0, 0, 0, 0.03);
}

.vote-pct-badge.reject {
  background-color: var(--color-danger-bg);
  border-color: hsla(0, 85%, 62%, 0.2);
  color: var(--color-danger);
}
.vote-pct-badge--phase2 {
  background-color: var(--color-accent-glow);
  color: var(--color-accent);
  border: 1px solid var(--color-accent-glow);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

.activism-card-glowing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.6rem;
  background-color: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--color-danger);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.6rem;
  white-space: nowrap;
  animation: glow-red-pill 2s infinite ease-in-out;
}

@keyframes glow-red-pill {
  0%, 100% {
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.25);
  }
  50% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    border-color: rgba(239, 68, 68, 0.6);
  }
}

/* --- Law Detail Screen --- */
.app-detail-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 58px; /* Nav-Höhe: 58px */
  background-color: var(--bg-phone);
  z-index: 8;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.75rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-detail-view::-webkit-scrollbar {
  display: none;
}

.detail-header-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-phone);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 0.75rem;
  margin: 0 -0.75rem 1.25rem -0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: var(--law-card-shadow);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-radius 0.3s ease,
              background-color 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              transform 0.15s ease;
  outline: none;
  font-family: var(--font-body);
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
  margin-bottom: 0;
}
.back-btn .back-icon-svg {
  transition: transform 0.25s ease, color 0.25s ease;
  color: var(--text-muted);
  flex-shrink: 0;
  display: block;
}
.back-btn span {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  transition: max-width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease,
              margin-left 0.3s ease;
  margin-left: 0;
  display: block;
}
@media (hover: hover) {
  .back-btn:hover, .back-btn:focus-visible, .back-btn:focus {
    width: 175px;
    border-radius: 20px;
    color: var(--text-primary);
    border-color: var(--color-primary);
    background-color: var(--color-primary-glow);
    box-shadow: 0 4px 12px var(--color-primary-glow);
  }
  .back-btn:hover .back-icon-svg, .back-btn:focus-visible .back-icon-svg, .back-btn:focus .back-icon-svg {
    transform: translateX(-2px);
    color: var(--color-primary);
  }
  .back-btn:hover span, .back-btn:focus-visible span, .back-btn:focus span {
    max-width: 130px;
    opacity: 1;
    margin-left: 8px;
  }
}
.back-btn.hover-simulated {
  width: 175px;
  border-radius: 20px;
  color: var(--text-primary);
  border-color: var(--color-primary);
  background-color: var(--color-primary-glow);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}
.back-btn.hover-simulated .back-icon-svg {
  transform: translateX(-2px);
  color: var(--color-primary);
}
.back-btn.hover-simulated span {
  max-width: 130px;
  opacity: 1;
  margin-left: 8px;
}
.back-btn:active {
  transform: scale(0.95);
}

/* Pulsing warning zone */
.activism-banner-zone {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.05);
}

.pulsing-warning {
  color: var(--color-danger);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  letter-spacing: 0.5px;
}
.activism-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.quorum-progress-container {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.quorum-progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--color-danger), #f87171);
}
.quorum-details {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.detail-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.detail-metadata {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
}

.detail-metadata .status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.detail-metadata .region-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--color-primary-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.detail-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--law-card-shadow);
}

.card-heading {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.b1-text-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.summary-field {
  font-size: 0.75rem;
  line-height: 1.4;
}
.summary-field strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.75rem;
  margin-bottom: 0.1rem;
}

/* Debate protocol */
.debate-header {
  margin: 1.25rem 0 0.5rem;
}
.debate-header h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
}
.section-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.debate-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.debate-column-pro, .debate-column-contra {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 300px;
  box-sizing: border-box;
}

#detail-pros-list, #detail-contras-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: none;
}

#detail-pros-list::-webkit-scrollbar,
#detail-contras-list::-webkit-scrollbar {
  display: none;
}

.column-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-align: center;
  padding: 0.2rem 0;
  border-radius: 4px;
}
.column-title.pro {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}
.column-title.contra {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
}

.debate-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem;
}
.debate-card p {
  font-size: 0.65rem;
  line-height: 1.35;
}
.debate-card-author {
  display: block;
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Voting Box */
.voting-box {
  background-color: var(--law-card-bg);
  border: 1px solid var(--law-card-border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--law-card-shadow);
}
.voting-box h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.vote-level-info {
  background-color: hsla(38, 88%, 48%, 0.08);
  border: 1px solid hsla(38, 88%, 48%, 0.2);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}
.warning-text {
  font-size: 0.65rem;
  color: hsl(35, 85%, 32%);
  line-height: 1.35;
  text-align: center;
}

body.dark-theme .vote-level-info {
  background-color: hsla(38, 88%, 48%, 0.1);
  border-color: hsla(38, 88%, 48%, 0.22);
}
body.dark-theme .warning-text {
  color: var(--color-warning);
}

.vote-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-vote {
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.75rem 0;
  border-radius: 100px; /* ShareTheMeal Pill Style */
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-vote.btn-ja {
  background-color: var(--vote-btn-ja-bg);
  border: 1px solid var(--vote-btn-ja-border);
  color: var(--vote-btn-ja-color);
}
@media (hover: hover) {
  .btn-vote.btn-ja:hover {
    background-color: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  }
  .btn-vote.btn-nein:hover {
    background-color: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  }
}
.btn-vote.btn-ja.hover-simulated {
  background-color: #10b981;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-vote.btn-nein {
  background-color: var(--vote-btn-nein-bg);
  border: 1px solid var(--vote-btn-nein-border);
  color: var(--vote-btn-nein-color);
}
.btn-vote.btn-nein:hover {
  background-color: #ef4444;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.stats-display {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}
.stats-display h5 {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.mt-4 {
  margin-top: 0.75rem;
}

.bar-chart {
  height: 8px;
  background-color: var(--bar-chart-track);
  border-radius: 4px;
  display: flex;
  overflow: hidden;
}
.bar-ja {
  background-color: #10b981;
  height: 100%;
}
.bar-nein {
  background-color: #ef4444;
  height: 100%;
}

.bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Debattenraum */
.debattenraum-box {
  background-color: var(--law-card-bg);
  border: 1px solid var(--law-card-border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--law-card-shadow);
}

.debate-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.write-comment-container {
  margin: 0.75rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.comment-restricted-text {
  display: none; /* Replaced by the premium .debate-lock-card */
}

/* Lock Card */
.debate-lock-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  position: relative;
}

body.dark-theme .debate-lock-card {
  background: rgba(13, 17, 23, 0.45);
  border: 1px solid rgba(255, 59, 48, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 0 20px rgba(255, 59, 48, 0.03);
}

.lock-icon-glow {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.02) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.lock-emoji {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

.lock-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0;
}

.lock-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  max-width: 250px;
}

.btn-scan-id {
  background-color: #ef4444;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1.75rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-scan-id:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-scan-id:active {
  transform: translateY(1px);
}

/* Debate Segmented Tabs */
.debate-tabs-row {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0.85rem;
  background-color: rgba(0, 0, 0, 0.12);
  padding: 4px;
  border-radius: 10px;
}

.debate-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.55rem 0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.debate-tab-btn.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.dark-theme .debate-tab-btn.active {
  background-color: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-count {
  font-size: 0.65rem;
  background-color: rgba(255, 255, 255, 0.1);
  color: inherit;
  padding: 1px 6px;
  border-radius: 100px;
  font-weight: 600;
}

.debate-tab-btn.active .tab-count {
  background-color: var(--color-primary);
  color: #fff;
}

/* Agora comments feed container */
.agora-comments-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* Premium Comment Card Layout */
.agora-comment-card-premium {
  background-color: var(--comment-card-bg);
  border: 1px solid var(--comment-card-border);
  border-radius: 14px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.agora-comment-card-premium:hover {
  border-color: var(--color-primary-glow);
}

.comment-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comment-profile-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-avatar-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.comment-author-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.comment-eID-badge-premium {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.comment-text-premium {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

/* Premium Community Note Box */
.community-note-box-premium {
  background-color: rgba(217, 119, 6, 0.04);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: inset 0 0 10px rgba(217, 119, 6, 0.02);
}

.note-header-premium {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 800;
  color: #d97706;
  letter-spacing: 0.3px;
}

.note-text-premium {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0;
}

.note-divider {
  border: none;
  border-top: 1px dotted rgba(217, 119, 6, 0.25);
  margin: 0.25rem 0 0;
}

.note-helpful-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.btn-helpful-pill {
  background-color: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #d97706;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-helpful-pill:hover {
  background-color: rgba(217, 119, 6, 0.25);
  transform: scale(1.03);
}

.btn-helpful-pill.voted {
  background-color: #d97706;
  color: #fff;
  border-color: #d97706;
}

/* Comment Rating Row & Pills */
.comment-rating-row-premium {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 0.25rem;
}

.rating-pill-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.rating-pill-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.rating-pill-btn.up {
  color: rgba(16, 185, 129, 0.85);
  border-color: rgba(16, 185, 129, 0.25);
}

.rating-pill-btn.up:hover {
  background-color: rgba(16, 185, 129, 0.06);
  color: #10b981;
}

.rating-pill-btn.down:hover {
  background-color: rgba(239, 68, 68, 0.04);
  color: #ef4444;
}

.rating-pill-btn.correct-btn {
  color: var(--color-warning);
  border-color: rgba(217, 119, 6, 0.25);
  margin-left: auto;
}

.rating-pill-btn.correct-btn:hover {
  background-color: rgba(217, 119, 6, 0.06);
  color: #d97706;
}

/* Comment inputs inside Agora */
.comment-input-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.comment-input-textarea {
  width: 100%;
  height: 50px;
  background-color: var(--comment-input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.4rem;
  color: var(--text-primary);
  font-size: 0.7rem;
  resize: none;
}
.comment-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* Custom Segmented Comment Side Selector */
.comment-side-segmented {
  display: flex;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 3px;
  position: relative;
  gap: 2px;
}

body.dark-theme .comment-side-segmented {
  background-color: rgba(0, 0, 0, 0.25);
}

.segmented-btn {
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.68rem;
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.segmented-btn:hover {
  color: var(--text-secondary);
}

/* Pro active state */
.segmented-btn.active-pro {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

body.dark-theme .segmented-btn.active-pro {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Contra active state */
.segmented-btn.active-contra {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1);
}

body.dark-theme .segmented-btn.active-contra {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Dot design */
.side-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.side-dot.pro {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.side-dot.contra {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* Scale up the dot when active */
.segmented-btn.active-pro .side-dot {
  transform: scale(1.25);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
}

.segmented-btn.active-contra .side-dot {
  transform: scale(1.25);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
}


/* --- Bottom Nav --- */
.app-bottom-nav {
  height: 58px;
  border-top: 1px solid var(--border-color);
  /* Hell: Weiß mit Unschärfe */
  background-color: hsla(0, 0%, 100%, 0.95);
  backdrop-filter: blur(20px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9;
  box-shadow: 0 -1px 0 var(--border-color);
}

body.dark-theme .app-bottom-nav {
  /* Dunkel: Marine-Blau mit Glasmorphismus */
  background-color: hsla(222, 35%, 7%, 0.96);
  border-top-color: hsla(220, 40%, 22%, 0.5);
  box-shadow: 0 -1px 0 hsla(220, 40%, 22%, 0.4), 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  transition: color 0.18s ease, transform 0.18s ease;
  position: relative;
}

@media (hover: hover) {
  .nav-item:hover {
    color: var(--text-secondary);
    transform: translateY(-1px);
  }
  .nav-item:hover .nav-icon svg {
    transform: translateY(-1px);
  }
}
.nav-item.hover-simulated {
  color: var(--text-secondary);
  transform: translateY(-1px);
}
.nav-item.hover-simulated .nav-icon svg {
  transform: translateY(-1px);
}

/* Aktiver Tab: Dezenter Punkt-Indikator oben */
.nav-item.active {
  color: var(--color-primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: inherit;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.18s ease;
}

.nav-item.active .nav-icon svg {
  stroke-width: 2.2;
}

/* Nav avatar image styling (Justa image in bottom nav) */
.nav-avatar-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.2px solid var(--text-muted);
  opacity: 0.7;
  transition: border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

body.dark-theme .nav-avatar-img {
  border-color: hsla(220, 18%, 55%, 0.6);
}

.nav-item.active .nav-icon .nav-avatar-img {
  border-color: var(--color-primary);
  border-width: 1.6px;
  opacity: 1;
  box-shadow: 0 0 6px var(--color-primary-glow);
}

.nav-item:hover .nav-icon .nav-avatar-img,
.nav-item.hover-simulated .nav-icon .nav-avatar-img {
  border-color: var(--text-secondary);
  opacity: 0.95;
  transform: translateY(-1px);
}

.nav-item span:last-child {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Dunkles Thema: Aktiver Punkt leuchtet stärker */
body.dark-theme .nav-item.active::before {
  box-shadow: 0 0 10px var(--color-primary-glow), 0 0 4px var(--color-primary-glow);
}
body.dark-theme .nav-item {
  color: hsla(220, 18%, 55%, 1);
}
body.dark-theme .nav-item.active {
  color: var(--color-primary);
}


/* --- eID Modal Screen --- */
.eid-screen-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  background-color: var(--bg-phone);
  position: relative;
  justify-content: space-between;
  height: 100%;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  transition: var(--transition-smooth);
}
.close-modal-btn:hover {
  color: var(--text-primary);
}

.eid-header {
  text-align: center;
  margin-top: 1.5rem;
}

.bund-logo {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
  margin: 0 auto 0.75rem;
  position: relative;
}
.bund-logo::before {
  content: '🦅';
  font-size: 24px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.eid-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
}
.eid-header p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.eid-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
}

/* NFC Animation */
.nfc-scan-animation {
  width: 180px;
  height: 180px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-graphic {
  width: 70px;
  height: 120px;
  border: 4px solid var(--border-color);
  border-radius: 12px;
  background-color: #f8fafc;
  position: absolute;
  z-index: 2;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
}

.id-card-graphic {
  width: 100px;
  height: 64px;
  background: linear-gradient(135deg, hsl(200, 30%, 40%) 0%, hsl(220, 40%, 25%) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  transform: rotate(-10deg) translate(-20px, 15px);
  box-shadow: 5px 5px 15px rgba(0,0,0,0.4);
}
.id-card-graphic::after {
  content: '';
  width: 16px;
  height: 16px;
  background-color: var(--color-warning);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  left: 10px;
  opacity: 0.8;
}

.nfc-waves {
  position: absolute;
  width: 130px;
  height: 130px;
  z-index: 0;
}
.nfc-waves span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: nfc-wave 2s infinite;
  opacity: 0;
}
.nfc-waves span:nth-child(2) {
  animation-delay: 0.6s;
}
.nfc-waves span:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes nfc-wave {
  0% {
    width: 20px;
    height: 20px;
    opacity: 0.8;
  }
  100% {
    width: 140px;
    height: 140px;
    opacity: 0;
  }
}

.eid-instruction {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* PIN Keyboard */
.pin-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.pin-shield {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.pin-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.pin-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pin-dots {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
}
.pin-dots .dot {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  transition: var(--transition-smooth);
}
.pin-dots .dot.filled {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.pin-keyboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 220px;
}
.pin-keyboard button {
  background-color: var(--pin-button-bg);
  border: 1px solid var(--pin-button-border);
  color: var(--pin-button-color);
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.65rem 0;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.pin-keyboard button:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 10px rgba(84, 168, 209, 0.25);
}

/* Spinner step */
.spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.dual-ring-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid transparent;
  border-top-color: var(--color-primary);
  border-bottom-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner-box h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
}
.spinner-box p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Success screen */
.success-icon-box {
  font-size: 3rem;
  animation: bounce 1.5s infinite;
}

.eid-data-preview {
  background-color: var(--comment-restricted-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.eid-data-preview p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.eid-data-preview p strong {
  color: #fff;
}
.hash-text {
  font-family: monospace;
  color: var(--text-muted);
}
.success-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Concept / Notes View --- */
.dev-notes-container {
  padding: 2rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.dev-notes-container h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  text-align: center;
}
.notes-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.notes-content h5 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-primary-hover);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}
.notes-content p {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.notes-content ol {
  padding-left: 1.25rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
}

/* --- 🛠️ Simulation Panel & Sandbox --- */
.simulation-panel {
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  align-self: stretch;
  min-height: 760px;
}

.sandbox-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 0.25rem;
}
.sbox-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-smooth);
}
.sbox-tab:hover {
  color: var(--text-primary);
}
.sbox-tab.active {
  color: var(--color-primary-hover);
  border-bottom-color: var(--color-primary);
}

.sandbox-content-pane {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sandbox-content-pane h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-section {
  background-color: var(--comment-card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.panel-section h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.panel-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.inject-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Crypto visualizer */
.crypto-visualizer-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  align-items: center;
}

.crypto-step-box {
  background-color: rgba(21, 28, 48, 0.45);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: var(--transition-smooth);
}
.crypto-step-box.highlight {
  border-color: var(--color-primary-hover);
  box-shadow: 0 0 15px var(--color-primary-glow);
  transform: scale(1.02);
  background-color: rgba(37, 99, 235, 0.05);
}

.step-num {
  width: 18px;
  height: 18px;
  background-color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
}
.step-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}
.step-desc {
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.crypto-arrow-wrapper {
  width: 100%;
  height: 35px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.crypto-arrow-svg {
  width: 100%;
  height: 100%;
}

.arrow-path-flow {
  stroke-dashoffset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.crypto-visualizer-container:has(#cstep-1.highlight) #carrow-1 .arrow-path-flow {
  opacity: 1;
  animation: stroke-flow 1.2s linear infinite;
}

.crypto-visualizer-container:has(#cstep-2.highlight) #carrow-2 .arrow-path-flow {
  opacity: 1;
  animation: stroke-flow 1.2s linear infinite;
  stroke: var(--color-accent);
}

@keyframes stroke-flow {
  to {
    stroke-dashoffset: -24;
  }
}

.crypto-terminal-log {
  background-color: #05070a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--color-success);
  height: 130px;
  overflow-y: auto;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* Database Json viewer */
.db-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 800px) {
  .db-grid {
    grid-template-columns: 1fr;
  }
}

.db-table-pane {
  background-color: var(--db-pane-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.db-table-pane h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.table-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.json-code {
  background-color: var(--json-code-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem;
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--text-primary);
  height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Scraper styles */
.raw-doc-box {
  background-color: var(--raw-doc-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
}
.raw-doc-box h5 {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.raw-doc-content {
  font-family: monospace;
  font-size: 0.65rem;
  line-height: 1.4;
  color: var(--text-primary);
  height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.ai-processing-visual {
  border: 1px solid var(--color-primary-glow);
  background-color: rgba(37, 99, 235, 0.03);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.progress-bar-stripes {
  height: 4px;
  background-color: var(--color-primary);
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
  background-size: 40px 40px;
  animation: progress-bar-stripes-move 1.5s linear infinite;
  margin-bottom: 0.5rem;
  border-radius: 2px;
}
@keyframes progress-bar-stripes-move {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

.ai-processing-visual p {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Keyframes animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glow-red {
  0%, 100% {
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.4);
    background-color: var(--color-danger);
  }
  50% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.8);
    background-color: hsl(0, 90%, 65%);
  }
}

@keyframes pulse-danger-btn {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(239, 68, 68, 0.8);
  }
}

/* --- 🤖 KI-Redaktion (AI Workspace) Styles --- */

.ai-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .ai-controls-grid {
    grid-template-columns: 1fr;
  }
}

.ai-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-select-wrapper label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-select-btn-group {
  display: flex;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  padding: 2px;
}

.ai-select-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.ai-select-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.03);
}

.ai-select-btn.active {
  color: #fff;
  background-color: var(--color-primary);
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

.ai-select-btn.active.focus-sozial {
  background-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.ai-select-btn.active.focus-wirtschaft {
  background-color: var(--color-warning);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.ai-select-btn-sub {
  font-size: 0.6rem;
  opacity: 0.7;
}

/* AI Workspace Split Panel */
.ai-workspace {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  min-height: 380px;
  background-color: rgba(11, 15, 25, 0.45);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.03);
  position: relative;
  transition: var(--transition-smooth);
}

.ai-workspace.active {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.08), inset 0 0 30px rgba(37, 99, 235, 0.05);
}

@media (max-width: 800px) {
  .ai-workspace {
    grid-template-columns: 1fr;
  }
}

/* Left side: Terminal Agent Console */
.ai-agent-terminal {
  background-color: #030508;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.85rem;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.ai-terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.ai-terminal-dots {
  display: flex;
  gap: 4px;
}

.ai-terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ai-terminal-dot.red { background-color: #ef4444; }
.ai-terminal-dot.yellow { background-color: #f59e0b; }
.ai-terminal-dot.green { background-color: #10b981; }

.ai-terminal-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.ai-terminal-body {
  flex: 1;
  overflow-y: auto;
  font-size: 0.7rem;
  line-height: 1.45;
  color: #10b981; /* Default retro green */
  white-space: pre-wrap;
}

.ai-log-entry {
  margin-bottom: 0.35rem;
  animation: fadeIn 0.15s ease-out;
}
.ai-log-entry.info { color: #06b6d4; }
.ai-log-entry.success { color: #10b981; }
.ai-log-entry.warn { color: #f59e0b; }
.ai-log-entry.step { color: #a78bfa; font-weight: bold; }

/* Right side: Streaming sheet paper */
.ai-streaming-sheet {
  background-color: rgba(255, 255, 255, 0.95);
  color: #0f172a; /* Sleek slate dark text */
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-body);
  position: relative;
  transition: var(--transition-smooth);
}

.ai-streaming-sheet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.ai-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.4rem;
  margin-bottom: 0.25rem;
}

.ai-sheet-badge {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.ai-sheet-badge.level {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
}
.ai-sheet-badge.focus {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--color-accent);
}

.ai-sheet-title {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

.ai-sheet-content-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ai-sheet-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.ai-sheet-text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #1e293b;
  font-weight: 450;
  position: relative;
  min-height: 1.2rem;
}

/* Streaming Typewriter Cursor */
.ai-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--color-primary);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PREMIUM DESIGN UPGRADES & VISUAL WOW-EFFECTS
   ========================================================================== */

/* --- Premium Glowing Mesh Background --- */
.mesh-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.mesh-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  transition: var(--transition-smooth);
}

body.dark-theme .mesh-glow {
  opacity: 0.25;
}

.mesh-glow-1 {
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle at center, var(--color-primary) 0%, transparent 70%);
  top: -15vw;
  left: -15vw;
  animation: float-mesh-1 28s ease-in-out infinite alternate;
}

.mesh-glow-2 {
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle at center, var(--color-accent) 0%, transparent 70%);
  bottom: -20vw;
  right: -20vw;
  animation: float-mesh-2 34s ease-in-out infinite alternate;
}

.mesh-glow-3 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle at center, var(--color-success) 0%, transparent 65%);
  top: 30vh;
  left: 25vw;
  opacity: 0.05;
  animation: float-mesh-3 35s ease-in-out infinite alternate;
}

body.dark-theme .mesh-glow-3 {
  opacity: 0.12;
}

@keyframes float-mesh-1 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(12vw, 8vh) scale(1.15) rotate(180deg); }
  100% { transform: translate(-6vw, 15vh) scale(0.9) rotate(360deg); }
}

@keyframes float-mesh-2 {
  0% { transform: translate(0, 0) scale(1.05) rotate(360deg); }
  50% { transform: translate(-10vw, -12vh) scale(0.9) rotate(180deg); }
  100% { transform: translate(8vw, 4vh) scale(1.1) rotate(0deg); }
}

@keyframes float-mesh-3 {
  0% { transform: translate(0, 0) scale(0.95); }
  50% { transform: translate(-15vw, 10vh) scale(1.1); }
  100% { transform: translate(10vw, -8vh) scale(0.85); }
}

/* --- Smartphone Frame Premium Visual Overrides --- */
.smartphone-frame {
  box-shadow: 
    0 30px 70px -15px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(84, 168, 209, 0.08),
    inset 0 0 8px rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

body.dark-theme .smartphone-frame {
  box-shadow:
    0 30px 90px -15px rgba(0, 0, 0, 0.9),
    0 0 50px hsla(0, 82%, 62%, 0.06),
    0 0 25px hsla(40, 96%, 55%, 0.04),
    inset 0 0 12px rgba(255, 255, 255, 0.02);
  border-color: hsl(222, 30%, 10%);
}

/* Diagonal glass reflection on the screen */
.smartphone-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 40%, transparent 40.1%);
  pointer-events: none;
  z-index: 99;
}

body.dark-theme .smartphone-frame::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.005) 35%, transparent 35.1%);
}

/* --- Premium Glassmorphism & Neon Button Glows --- */
.btn-primary {
  transition: var(--transition-smooth);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--glow-cyan);
  transform: translateY(-1.5px);
}

.avatar-shortcut-banner:hover {
  box-shadow: var(--glow-cyan);
}

.sbox-tab.active {
  box-shadow: var(--glow-blue);
  border-color: rgba(37, 99, 235, 0.6);
}

body.dark-theme .sbox-tab.active {
  box-shadow: var(--glow-cyan);
  border-color: rgba(0, 255, 200, 0.6);
}

/* --- Active ZKP step boxes with neon borders and animation --- */
.crypto-step-box {
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.crypto-step-box.highlight {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.06) !important;
  box-shadow: var(--glow-blue);
}

body.dark-theme .crypto-step-box.highlight {
  border-color: #00ffc8;
  background-color: rgba(0, 255, 200, 0.04) !important;
  box-shadow: var(--glow-cyan);
}

/* Pulsing outline inside active steps */
.crypto-step-box.highlight::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 1.5px solid transparent;
  border-radius: inherit;
  background: linear-gradient(95deg, var(--color-primary), var(--color-accent)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: rotate-border-glow 4s linear infinite;
  pointer-events: none;
}

body.dark-theme .crypto-step-box.highlight::before {
  background: linear-gradient(95deg, #00ffc8, #0088ff) border-box;
}

@keyframes rotate-border-glow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* --- AI Agent Terminal Röhrenkrümmung & Scanlines --- */
.ai-agent-terminal {
  position: relative;
  overflow: hidden;
}

/* CRT Screen reflection overlay */
.ai-agent-terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.65;
}

.ai-terminal-body {
  text-shadow: 0 0 3px rgba(16, 185, 129, 0.4);
}

/* --- Premium Document Raster Grid on the Redaktionsblatt --- */
.ai-streaming-sheet {
  background-image: 
    radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  box-shadow: 
    0 10px 30px -5px rgba(0, 0, 0, 0.3),
    inset 0 0 40px rgba(0, 0, 0, 0.02);
}

body.dark-theme .ai-streaming-sheet {
  background-color: rgba(255, 255, 255, 0.98);
}

/* ==========================================================================
   🤖 KI-AVATAR "JUSTA" GROK-STYLE COMPANION STYLES
   ========================================================================== */

/* Companion trust/affection bar at the top of the chat */
.companion-trust-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1.5px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
}

.companion-trust-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.companion-level-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.companion-trust-points {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.companion-trust-bar-bg {
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

body.dark-theme .companion-trust-bar-bg {
  background: rgba(255, 255, 255, 0.08);
}

.companion-trust-bar {
  height: 100%;
  width: 20%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 10px var(--color-primary-glow);
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dynamic color gradients for trust levels */
.trust-lvl-1 .companion-trust-bar { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.trust-lvl-2 .companion-trust-bar { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.trust-lvl-3 .companion-trust-bar { background: linear-gradient(90deg, #2dd4bf, #14b8a6); }
.trust-lvl-4 .companion-trust-bar { background: linear-gradient(90deg, #f472b6, #ec4899); }
.trust-lvl-5 .companion-trust-bar { 
  background: linear-gradient(90deg, #fbbf24, #f59e0b); 
  animation: trust-bar-sparkle 2s infinite alternate;
}

@keyframes trust-bar-sparkle {
  0% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
  100% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.9); }
}

/* Level details under trust bar */
.companion-level-description {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-style: italic;
}

/* Floating Emoji Particle Effect */
.avatar-profile-pic-container {
  position: relative;
}

.floating-emoji-particle {
  position: absolute;
  font-size: 1.2rem;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 100;
  animation: floatUpAndFade 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes floatUpAndFade {
  0% {
    transform: translate(-50%, 0) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -15px) scale(1.1);
  }
  100% {
    transform: translate(calc(-50% + var(--rand-x, 0px)), -65px) scale(0.8);
    opacity: 0;
  }
}

/* Trust level dynamic glows on Justa's profile image border */
.avatar-profile-pic-container.trust-glow-1 {
  box-shadow: 0 0 0 2.5px var(--text-muted);
}
.avatar-profile-pic-container.trust-glow-2 {
  box-shadow: 0 0 10px hsla(200, 100%, 50%, 0.2), 0 0 0 2.5px hsla(200, 90%, 50%, 0.6);
}
.avatar-profile-pic-container.trust-glow-3 {
  box-shadow: 0 0 14px hsla(168, 76%, 36%, 0.35), 0 0 0 2.5px hsla(168, 76%, 36%, 0.7);
  animation: glow-pulse-3 2.5s infinite alternate;
}
.avatar-profile-pic-container.trust-glow-4 {
  box-shadow: 0 0 18px hsla(320, 100%, 50%, 0.4), 0 0 0 2.5px hsla(320, 100%, 50%, 0.7);
  animation: glow-pulse-4 1.8s infinite alternate;
}
.avatar-profile-pic-container.trust-glow-5 {
  box-shadow: 0 0 24px hsla(40, 100%, 50%, 0.5), 0 0 0 2.5px hsla(40, 100%, 55%, 0.8);
  animation: glow-pulse-5 1.2s infinite alternate;
}

@keyframes glow-pulse-3 {
  0% { box-shadow: 0 0 6px hsla(168, 76%, 36%, 0.25), 0 0 0 2.5px hsla(168, 76%, 36%, 0.5); }
  100% { box-shadow: 0 0 18px hsla(168, 76%, 36%, 0.6), 0 0 0 2.5px hsla(168, 76%, 36%, 0.85); }
}
@keyframes glow-pulse-4 {
  0% { box-shadow: 0 0 6px hsla(320, 100%, 50%, 0.3), 0 0 0 2.5px hsla(320, 100%, 50%, 0.5); }
  100% { box-shadow: 0 0 22px hsla(320, 100%, 50%, 0.7), 0 0 0 2.5px hsla(320, 100%, 50%, 0.9); }
}
@keyframes glow-pulse-5 {
  0% { box-shadow: 0 0 8px hsla(40, 100%, 50%, 0.4), 0 0 0 2.5px hsla(40, 100%, 50%, 0.6); }
  100% { box-shadow: 0 0 28px hsla(40, 100%, 50%, 0.8), 0 0 0 2.5px hsla(40, 100%, 55%, 0.95); }
}

/* Beautiful dynamic mood/expression indicator */
.avatar-expression-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark-theme .avatar-expression-badge {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}

.avatar-expression-badge.pop-in {
  transform: scale(1.3);
}

/* Level Up Milestone system message cards inside chat */
.chat-message.milestone-level-up {
  align-self: center;
  width: 90%;
  margin: 14px auto;
  text-align: center;
  animation: levelUpBounce 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.milestone-bubble {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.03) 100%);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.08);
  font-family: var(--font-body);
}

body.dark-theme .milestone-bubble {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(0, 0, 0, 0.3) 100%);
  border-color: rgba(251, 191, 36, 0.25);
}

.milestone-header {
  font-size: 0.8rem;
  font-weight: bold;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.milestone-title {
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: 6px;
}

.milestone-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

@keyframes levelUpBounce {
  0% {
    transform: scale(0.8) translateY(15px);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Custom Outfits for Justa based on Trust */
.companion-unlocked-outfit-badge {
  font-size: 0.55rem;
  font-weight: 700;
  background: var(--color-accent);
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
  text-transform: uppercase;
}

/* Sandbox Affection Inspector styles */
.sandbox-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Phase 2 UI Components additions */
.phase2-detail-banner {
  background: linear-gradient(135deg, var(--color-accent-glow) 0%, var(--color-primary-glow) 100%);
  border: 1px solid var(--color-accent-glow);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: 0 4px 15px var(--color-accent-glow);
  animation: pulse-phase2-glow 3s infinite alternate;
}
.phase2-detail-banner h5 {
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.25rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.phase2-detail-banner p {
  color: var(--text-secondary);
  font-size: 0.7rem;
  line-height: 1.4;
  margin: 0;
}
@keyframes pulse-phase2-glow {
  0% { border-color: var(--color-accent-glow); box-shadow: 0 4px 10px var(--color-accent-glow); }
  100% { border-color: var(--color-accent-glow); box-shadow: 0 4px 22px var(--color-accent-glow); }
}

.badge-phase-inline {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: #fff !important;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
  box-shadow: 0 0 8px var(--color-accent-glow);
}

/* --- Waveform Animation for TTS --- */
.tts-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  margin-right: 8px;
  align-self: center;
}
.tts-waveform.hidden {
  display: none !important;
}
.tts-waveform .bar {
  width: 3px;
  height: 100%;
  background-color: var(--color-primary);
  border-radius: 2px;
  animation: bounce-waveform 0.8s ease-in-out infinite alternate;
  transform-origin: bottom;
}
.tts-waveform .bar:nth-child(2) {
  animation-delay: 0.15s;
  height: 60%;
}
.tts-waveform .bar:nth-child(3) {
  animation-delay: 0.3s;
  height: 80%;
}
.tts-waveform .bar:nth-child(4) {
  animation-delay: 0.45s;
  height: 40%;
}
.tts-waveform .bar:nth-child(5) {
  animation-delay: 0.6s;
  height: 70%;
}

@keyframes bounce-waveform {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1.1); }
}

/* ==========================================================================
   🦉 JUSTA OWL AVATAR MICRO-ANIMATIONS & TRANSITION STYLES
   ========================================================================== */

.avatar-img {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
}

/* Thinking: Slow tilting back and forth */
.avatar-img.justa-thinking-anim {
  animation: justa-tilt 4s ease-in-out infinite;
}

@keyframes justa-tilt {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-5deg) scale(1.02); }
  75% { transform: rotate(5deg) scale(1.02); }
}

/* Happy / Loving: Friendly pulsing scale */
.avatar-img.justa-happy-anim,
.avatar-img.justa-loving-anim {
  animation: justa-pulse 2s ease-in-out infinite;
}

@keyframes justa-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Blushing: Shy breathing scale with a soft reddish glow overlay via drop-shadow */
.avatar-img.justa-blushing-anim {
  animation: justa-blush 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(236, 72, 153, 0.6)) sepia(10%);
}

@keyframes justa-blush {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Scholar: Zoom-in and slight tilt, analytic focus */
.avatar-img.justa-scholar-anim {
  transform: scale(1.12) rotate(-3deg);
}

/* --- RAG CITATIONS & NEUTRAL FACTS REPORT CARD STYLES --- */

/* Neutral Facts Box inside the chat bubble */
.neutral-facts-box {
  margin: 10px 0 5px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-primary-glow);
  border: 1px dashed var(--color-primary-glow);
  font-size: 0.78rem;
  color: var(--text-primary);
}

body.dark-theme .neutral-facts-box {
  background: var(--color-primary-glow);
  border-color: var(--color-primary-glow);
}

.neutral-facts-box-title {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

body.dark-theme .neutral-facts-box-title {
  color: #00ffc8;
}

/* RAG Citation Box */
.rag-citation-box {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.72rem;
  overflow: hidden;
}

.rag-citation-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: bold;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.rag-citation-body {
  padding: 6px 8px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

.rag-citation-speaker {
  font-weight: bold;
  color: var(--text-secondary);
  margin-bottom: 2px;
}



.hands-free-btn.active {
  background: rgba(255, 0, 85, 0.12) !important;
  border-color: #ff0055 !important;
  color: #ff0055 !important;
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.3) !important;
  animation: pulse-hands-free 1.5s infinite alternate;
}

body.dark-theme .hands-free-btn.active {
  background: rgba(255, 0, 85, 0.22) !important;
  border-color: #ff3b70 !important;
  color: #ff3b70 !important;
  box-shadow: 0 0 16px rgba(255, 59, 112, 0.4) !important;
}

@keyframes pulse-hands-free {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.status-lbl.listening {
  color: #ff0055 !important;
  font-weight: bold;
  animation: pulse-listening-text 1s infinite alternate;
}

@keyframes pulse-listening-text {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ==========================================================================
   ♿ BARRIEREFREIHEIT & ACCESSIBILITY OPTIONS FOR SENIOR CITIZENS
   ========================================================================== */

/* 1. Schriftgrößen-Skalierung (Font Scaling via root elements) */
html.a11y-font-large {
  font-size: 21px !important; /* +20% scaling of 18px */
}
html.a11y-font-xl {
  font-size: 25px !important; /* +40% scaling of 18px */
}

/* Make sure elements in smartphone frame are scrollable if they overflow */
html.a11y-font-large .smartphone-frame {
  width: 440px; /* Wider frame for larger fonts */
}
html.a11y-font-xl .smartphone-frame {
  width: 480px; /* Wider frame for larger fonts */
}

/* Adjust layout grid to make space for wider phone frame when font is large */
@media (min-width: 1100px) {
  html.a11y-font-large .dashboard-grid {
    grid-template-columns: 520px 1fr;
  }
  html.a11y-font-xl .dashboard-grid {
    grid-template-columns: 560px 1fr;
  }
}

/* 2. Klickflächen vergrößern (Enlarge click targets) */
body.a11y-large-targets .btn,
body.a11y-large-targets .nav-item,
body.a11y-large-targets .tab-btn,
body.a11y-large-targets .btn-vote,
body.a11y-large-targets .quick-reply-btn,
body.a11y-large-targets .theme-toggle-btn,
body.a11y-large-targets .a11y-toggle-btn,
body.a11y-large-targets .app-a11y-btn {
  padding-top: 0.9rem !important;
  padding-bottom: 0.9rem !important;
  min-height: 48px !important;
  font-weight: 700 !important; /* Bold text is easier to read */
}
body.a11y-large-targets .nav-item {
  gap: 6px !important;
}
body.a11y-large-targets .nav-icon {
  font-size: 1.4rem !important;
}
body.a11y-large-targets .app-tabs {
  height: auto !important;
  padding: 6px !important;
}

/* 3. Kontrast-Modi (Contrast Modes) */
/* Hoher Kontrast (Pure High Contrast) */
body.a11y-contrast-high {
  --bg-main: #000000 !important;
  --bg-sidebar: #000000 !important;
  --bg-card: #000000 !important;
  --bg-phone: #000000 !important;
  --bg-phone-frame: #000000 !important;
  --app-header-bg: #000000 !important;
  
  --border-color: #ffffff !important;
  --border-phone-frame: #ffffff !important;
  
  --text-primary: #ffffff !important;
  --text-secondary: #ffffff !important;
  --text-muted: #e5e5e5 !important;
  
  --color-primary: #00ffff !important;
  --color-primary-hover: #00cccc !important;
  --color-accent: #ff00ff !important;
  --color-success: #00ff00 !important;
  --color-danger: #ff0000 !important;
  
  background-image: none !important;
}

body.a11y-contrast-high .law-card,
body.a11y-contrast-high .detail-card,
body.a11y-contrast-high .comment-card,
body.a11y-contrast-high .db-table-pane,
body.a11y-contrast-high .raw-doc-box,
body.a11y-contrast-high .avatar-chat-messages,
body.a11y-contrast-high .agora-comment-card,
body.a11y-contrast-high .notes-content {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.a11y-contrast-high a,
body.a11y-contrast-high .api-help-link {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

/* Gelb-auf-Schwarz (Yellow on Black) */
body.a11y-contrast-yellow {
  --bg-main: #000000 !important;
  --bg-sidebar: #000000 !important;
  --bg-card: #000000 !important;
  --bg-phone: #000000 !important;
  --bg-phone-frame: #000000 !important;
  --app-header-bg: #000000 !important;
  
  --border-color: #ffff00 !important;
  --border-phone-frame: #ffff00 !important;
  
  --text-primary: #ffff00 !important;
  --text-secondary: #ffff00 !important;
  --text-muted: #ffff80 !important;
  
  --color-primary: #ffff00 !important;
  --color-primary-hover: #e6e600 !important;
  --color-accent: #ffff00 !important;
  --color-success: #ffff00 !important;
  --color-danger: #ffff00 !important;
  
  background-image: none !important;
}

body.a11y-contrast-yellow .law-card,
body.a11y-contrast-yellow .detail-card,
body.a11y-contrast-yellow .comment-card,
body.a11y-contrast-yellow .db-table-pane,
body.a11y-contrast-yellow .raw-doc-box,
body.a11y-contrast-yellow .avatar-chat-messages,
body.a11y-contrast-yellow .agora-comment-card,
body.a11y-contrast-yellow .notes-content {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
  box-shadow: none !important;
}

body.a11y-contrast-yellow a,
body.a11y-contrast-yellow .api-help-link {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.a11y-contrast-yellow .btn,
body.a11y-contrast-yellow .btn-vote,
body.a11y-contrast-yellow .tab-btn {
  background-color: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

body.a11y-contrast-yellow .btn:hover,
body.a11y-contrast-yellow .btn-vote:hover,
body.a11y-contrast-yellow .tab-btn.active {
  background-color: #ffff00 !important;
  color: #000000 !important;
}

/* Adjust avatar profile picture or indicators for yellow theme */
body.a11y-contrast-yellow .avatar-profile-pic-container {
  border-color: #ffff00 !important;
}

/* Add custom focus indicator for keyboard navigation */
body.a11y-contrast-high *:focus,
body.a11y-contrast-yellow *:focus {
  outline: 3px solid #ffff00 !important;
}

/* 4. Accessibility Modal / Settings UI */
.a11y-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: var(--transition-smooth);
}
.a11y-modal.hidden {
  opacity: 0;
  pointer-events: none;
}
.a11y-modal-content {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 480px;
  max-width: 90%;
  padding: 1.5rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
  animation: modal-zoom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--text-primary);
}
@keyframes modal-zoom {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.a11y-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.a11y-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.a11y-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}
.a11y-close-btn:hover {
  color: var(--color-danger);
}
.a11y-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.a11y-option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.a11y-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.a11y-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.a11y-button-row {
  display: flex;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  padding: 3px;
  gap: 4px;
}
.a11y-btn-select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  border-radius: 9px;
  transition: var(--transition-fast);
}
.a11y-btn-select:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.a11y-btn-select.active {
  background-color: var(--color-primary);
  color: #fff !important;
  box-shadow: 0 3px 10px var(--color-primary-glow);
}
.a11y-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* Toggle Switch Slider */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 24px;
}
.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}
.switch-toggle input:checked + .slider-round {
  background-color: var(--color-primary);
}
.switch-toggle input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* Custom speak button style */
.a11y-speak-btn {
  background-color: var(--color-primary-glow);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-glow);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}
.a11y-speak-btn:hover {
  background-color: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
}
.a11y-speak-btn.speaking {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: rgba(255, 92, 92, 0.35);
  animation: pulse-red-speak 2s infinite;
}
@keyframes pulse-red-speak {
  0% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(255, 92, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0); }
}

/* --- Justa AI Gamification Hiding --- */
#companion-trust-bar-panel,
#justa-outfit-badge,
#avatar-expression {
  display: none !important;
}
.avatar-profile-pic-container {
  box-shadow: 0 4px 15px var(--color-primary-glow) !important;
  border: 1px solid var(--color-primary-glow) !important;
}
.avatar-profile-pic-container::after {
  display: none !important;
}

/* --- Gen Z styled Stadtteilkarte (Interactive Map) --- */
.app-map-view {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  bottom: 58px; /* Nav-Höhe: 58px */
  background-color: hsl(222, 35%, 5%);
  overflow: hidden;
}

.map-header-bar {
  padding: 12px 16px;
  background: rgba(12, 15, 29, 0.85);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.map-header-bar h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.map-header-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.map-canvas-container {
  flex: 1;
  width: 100%;
  position: relative;
  background-color: #070913;
  overflow: hidden;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

.map-vector-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.map-markers-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.map-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.map-marker:hover {
  transform: scale(1.3);
  z-index: 10;
}

.map-marker-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: marker-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.map-marker-inner {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.map-marker.bund-level .map-marker-inner {
  background-color: hsl(0, 75%, 45%);   /* Bundesrot */
}
.map-marker.bund-level .map-marker-pulse {
  background-color: hsla(0, 75%, 45%, 0.4);
}

.map-marker.land-level .map-marker-inner {
  background-color: hsl(38, 88%, 48%);  /* Bundesgold */
}
.map-marker.land-level .map-marker-pulse {
  background-color: hsla(38, 88%, 48%, 0.4);
}

.map-marker.kommune-level .map-marker-inner {
  background-color: hsl(210, 90%, 55%); /* Info-Blau */
}
.map-marker.kommune-level .map-marker-pulse {
  background-color: hsla(210, 90%, 55%, 0.4);
}

.map-marker.activism .map-marker-inner {
  background-color: #ef4444 !important;
  border-color: #ffffff;
}
.map-marker.activism .map-marker-pulse {
  background-color: rgba(239, 68, 68, 0.5) !important;
}

@keyframes marker-ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(3.0); opacity: 0; }
}

.map-details-card {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(12, 15, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.map-details-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  justify-content: center;
  padding: 10px 0;
}

.map-details-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
  animation: pulse-green 2s infinite;
}

.map-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.map-details-level {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  background-color: var(--color-primary-glow);
  padding: 2px 6px;
  border-radius: 4px;
}

.map-details-stats {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.map-details-stats.reject {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}

.map-details-card h4 {
  margin: 0 0 6px 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.map-details-desc {
  margin: 0 0 14px 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.map-details-vote-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.map-details-vote-row .btn-vote {
  flex: 1;
  padding: 8px 0;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.map-details-vote-row .vote-completed {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: hsla(142, 62%, 38%, 0.1);
  color: var(--color-success);
  border-radius: 8px;
  border: 1px solid hsla(142, 62%, 38%, 0.2);
}

/* ==========================================================================
   🇩🇪 PREMIUM DESIGN ERWEITERUNGEN v2
   Tier 2 visual polish for german citizens — more presence, more clarity
   ========================================================================== */

/* --- Gesetz-Karten: Dezenter Bundesfarb-Akzent oben --- */
.law-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--color-primary) 30%,
    var(--color-accent) 70%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}
@media (hover: hover) {
  .law-card:hover::before {
    opacity: 1;
  }
}
.law-card.hover-simulated::before {
  opacity: 1;
}

/* --- Karten Einlauf-Animation --- */
@keyframes card-slide-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.law-card {
  animation: card-slide-in 0.35s ease-out both;
}
.law-card:nth-child(1) { animation-delay: 0.04s; }
.law-card:nth-child(2) { animation-delay: 0.08s; }
.law-card:nth-child(3) { animation-delay: 0.12s; }
.law-card:nth-child(4) { animation-delay: 0.16s; }
.law-card:nth-child(5) { animation-delay: 0.20s; }

/* --- Abstimmungsbuttons: Echte Micro-Interaktion --- */
.btn-vote {
  position: relative;
  overflow: hidden;
}
.btn-vote::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.18);
  border-radius: inherit;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}
.btn-vote:active::after {
  transform: translate(-50%, -50%) scale(2);
  opacity: 1;
  transition: 0s;
}

/* --- Primär-Button: Stärkerer Hover-Effekt --- */
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 25px var(--color-primary-glow), 0 3px 8px rgba(0,0,0,0.1);
  transform: translateY(-2px) scale(1.01);
}

/* --- Simulations-Panel: Dezente Trennlinie mit Akzentfarbe --- */
.sandbox-content-pane h3 {
  position: relative;
  padding-bottom: 0.6rem;
  margin-bottom: 0.2rem;
}
.sandbox-content-pane h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.5rem;
  height: 2px;
  background: linear-gradient(to right, var(--color-primary), var(--color-accent));
  border-radius: 2px;
}

/* --- Simulation Panel: Verbesserter Rahmen im Dark Mode --- */
body.dark-theme .simulation-panel {
  border-color: hsla(220, 40%, 22%, 0.6);
  background-image: radial-gradient(
    ellipse at 100% 0%,
    hsla(0, 75%, 42%, 0.03) 0%,
    transparent 60%
  );
}

/* --- Crypto Step Boxes: Schärferer Hell-Modus --- */
body:not(.dark-theme) .crypto-step-box {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}
body:not(.dark-theme) .step-title {
  color: var(--text-primary);
}
body:not(.dark-theme) .step-num {
  color: #fff;
}

/* --- Sbox Tabs: Aktiver Tab mit Akzent-Unterstrich --- */
.sbox-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 700;
}
body.dark-theme .sbox-tab.active {
  color: var(--color-primary);
  text-shadow: 0 0 12px var(--color-primary-glow);
}

/* --- Auth Screen: Vertrauens-Box --- */
.auth-legal-info {
  margin-top: 1.25rem;
  padding: 0.6rem 0.85rem;
  background: hsla(142, 62%, 38%, 0.06);
  border: 1px solid hsla(142, 62%, 38%, 0.15);
  border-radius: 10px;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.45;
}
body.dark-theme .auth-legal-info {
  background: hsla(142, 70%, 52%, 0.06);
  border-color: hsla(142, 70%, 52%, 0.15);
}

/* --- Agora-Debatte: Säulen stärker abgrenzen --- */
.agora-col.pro {
  border-left: 2.5px solid hsla(142, 62%, 38%, 0.3);
  padding-left: 0.4rem;
  border-radius: 0 8px 8px 0;
}
.agora-col.contra {
  border-right: 2.5px solid hsla(0, 75%, 42%, 0.3);
  padding-right: 0.4rem;
  border-radius: 8px 0 0 8px;
}

/* --- Navigations-Leiste: Aktiver Tab mit Rot-Unterstrich --- */
/* HINWEIS: Wird durch die Bottom-Nav ::before Regel gehandhabt */
.nav-item.active {
  color: var(--color-primary);
  position: relative;
}

/* --- Smartphone Frame: Stärkerer Hell-Modus Kontrast --- */
body:not(.dark-theme) .smartphone-frame {
  box-shadow:
    0 20px 60px -10px rgba(0, 0, 0, 0.15),
    0 4px 20px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px rgba(255,255,255,0.5);
  border-color: hsl(220, 15%, 22%);
}

/* --- Debatten-Karten: Hover Glow --- */
@media (hover: hover) {
  .agora-comment-card:hover {
    border-color: var(--color-primary-glow);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  }
  body.dark-theme .agora-comment-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }
}
.agora-comment-card.hover-simulated {
  border-color: var(--color-primary-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
body.dark-theme .agora-comment-card.hover-simulated {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* --- Voting Box: Premium Light Mode --- */
body:not(.dark-theme) .voting-box {
  border-color: hsl(220, 15%, 90%);
  box-shadow: 0 2px 16px rgba(20, 20, 60, 0.04);
}

/* --- Detail-View: Scrollbar anpassen --- */
.app-detail-view::-webkit-scrollbar {
  width: 3px;
}
.app-detail-view::-webkit-scrollbar-thumb {
  background: var(--color-primary-glow);
  border-radius: 3px;
}

/* --- Crypto Terminal: Bessere Lesbarkeit im Light Mode --- */
body:not(.dark-theme) .crypto-terminal-log {
  background-color: hsl(220, 25%, 10%);
}
body:not(.dark-theme) .ai-agent-terminal {
  background-color: hsl(220, 25%, 8%);
}

/* --- Logo Container: Verbesserter Hover --- */
.logo-icon-container {
  transition: var(--transition-smooth);
  cursor: pointer;
}
.header-logo:hover .logo-icon-container {
  transform: rotate(-5deg) scale(1.1);
  box-shadow: var(--glow-primary);
}

/* --- Bund/Land/Kommune Tabs: Hell-Modus Verbesserungen --- */
body:not(.dark-theme) .tab-btn.active .tab-title {
  color: var(--color-primary);
}
body:not(.dark-theme) .tab-slider-indicator {
  box-shadow: 0 2px 8px rgba(0, 75%, 42%, 0.08);
}

/* --- Phase 1 Status Badge: Stilvoller --- */
body:not(.dark-theme) .badge.phase-1 {
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* --- Panel Sections: Light Mode Polishing --- */
body:not(.dark-theme) .panel-section {
  background-color: hsl(220, 18%, 98%);
  border-color: hsl(220, 15%, 91%);
}
body:not(.dark-theme) .simulation-panel {
  background: hsl(0, 0%, 100%);
  border-color: hsl(220, 15%, 90%);
  box-shadow: 0 4px 30px rgba(20, 20, 60, 0.05);
}

/* --- Map Canvas: Dezentes Raster im deutschen Stil --- */
.map-canvas-container {
  background-image:
    linear-gradient(hsla(220, 40%, 22%, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, hsla(220, 40%, 22%, 0.5) 1px, transparent 1px);
  background-size: 32px 32px;
  background-color: hsl(222, 35%, 5%);
}

/* --- Responsive: Mobile Anpassungen --- */
@media (max-width: 768px) {
  .main-header {
    padding: 0.85rem 1.25rem;
  }
  .dashboard-grid {
    padding: 0 1rem;
    margin: 1.25rem auto;
    gap: 1.5rem;
  }
  .logo-text h1 {
    font-size: 1.2rem;
  }
  .logo-text p {
    display: none;
  }
  .header-status .divider {
    display: none;
  }
}

/* --- Letzter Schliff: Focus-Ring im deutschen Design --- */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Live Server Mode Styling --- */
.live-status-banner {
  background-color: hsl(222, 35%, 6%);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 10;
}
body:not(.dark-theme) .live-status-banner {
  background-color: hsl(220, 18%, 95%);
}
.live-status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-green 2s infinite;
}
.live-status-banner.offline .live-status-dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse-red 2s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Custom CSS Toggle Switch Slider */
.switch input:checked + .slider {
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

/* --- Custom Leaflet Dark Mode styling overrides --- */
.leaflet-container {
  background: hsl(222, 35%, 5%) !important;
  font-family: var(--font-body) !important;
}

.leaflet-control-attribution {
  background: rgba(7, 9, 19, 0.8) !important;
  color: rgba(255, 255, 255, 0.35) !important;
  font-size: 8px !important;
  border-top-left-radius: 4px;
}

.leaflet-control-attribution a {
  color: #3b82f6 !important;
}

.leaflet-bar {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
  border-radius: 6px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: #0d1117 !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.2s ease;
}

.leaflet-bar a:hover {
  background-color: #1f2937 !important;
  color: #3b82f6 !important;
}

.leaflet-bar a.leaflet-disabled {
  background-color: #070913 !important;
  color: rgba(255, 255, 255, 0.2) !important;
}

/* Ensure map-marker has no default Leaflet border or background overrides */
.leaflet-marker-icon.map-marker {
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

/* ==========================================================================
   📱 MOBILE WEBVIEW MODE OVERRIDES (?webview=true)
   Hides the outer simulator frame & desktop controls so the app runs full-screen
   ========================================================================== */
html.is-webview body,
body.is-webview {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background-color: var(--bg-phone) !important;
  width: 100vw !important;
  height: 100vh !important;
}

html.is-webview .mesh-bg-container,
body.is-webview .mesh-bg-container,
html.is-webview .main-header,
body.is-webview .main-header,
html.is-webview .simulation-panel,
body.is-webview .simulation-panel,
html.is-webview .phone-panel-wrapper > .section-title,
body.is-webview .phone-panel-wrapper > .section-title,
html.is-webview .notch,
body.is-webview .notch,
html.is-webview .phone-status-bar,
body.is-webview .phone-status-bar {
  display: none !important;
}

html.is-webview .dashboard-grid,
body.is-webview .dashboard-grid {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100vw !important;
  height: 100vh !important;
}

html.is-webview .phone-panel-wrapper,
body.is-webview .phone-panel-wrapper {
  width: 100vw !important;
  height: 100vh !important;
  display: block !important;
}

html.is-webview .smartphone-frame,
body.is-webview .smartphone-frame {
  width: 100vw !important;
  height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.is-webview .screen-content,
body.is-webview .screen-content {
  border-radius: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
}

/* Adjust paddings for native devices status-bar / notch area */
html.is-webview .app-header-bar,
body.is-webview .app-header-bar {
  padding-top: env(safe-area-inset-top, 24px) !important;
  height: auto !important;
}

html.is-webview .app-bottom-nav,
body.is-webview .app-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
}

html.is-webview #screen-eid,
body.is-webview #screen-eid,
html.is-webview #screen-dev-notes,
body.is-webview #screen-dev-notes,
html.is-webview .app-avatar-chat-view,
body.is-webview .app-avatar-chat-view {
  top: calc(env(safe-area-inset-top, 24px) + 38px) !important;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
}

html.is-webview .app-map-view,
body.is-webview .app-map-view {
  top: calc(env(safe-area-inset-top, 24px) + 38px) !important;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
}

html.is-webview .app-detail-view,
body.is-webview .app-detail-view {
  bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
}

html.is-webview .detail-header-bar,
body.is-webview .detail-header-bar {
  padding-top: calc(env(safe-area-inset-top, 0px) + 0.75rem) !important;
}

/* ==========================================================================
   👤 PROFILE & APPSETTINGS IN EID TAB
   ========================================================================== */
.eid-profile-view {
  padding: 1.5rem 1.25rem 2.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  box-sizing: border-box;
}

.profile-header-title {
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.profile-header-title h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
}

.profile-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  font-weight: 550;
}

/* Profile Card - ID Card Aesthetic */
.profile-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.profile-id-card-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  z-index: 0;
}

body.dark-theme .profile-id-card-bg {
  opacity: 0.07;
}

.id-card-eagle {
  font-size: 120px;
  position: absolute;
  right: -10px;
  bottom: -30px;
}

.id-card-chip {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 24px;
  background: linear-gradient(135deg, hsl(38, 88%, 70%) 0%, hsl(38, 88%, 45%) 100%);
  border-radius: 4px;
  opacity: 0.35;
}

.profile-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.profile-avatar-inner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.profile-name-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name-text {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  align-items: center;
}

.meta-lbl {
  color: var(--text-muted);
  font-weight: 500;
}

.meta-val {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Verification Card */
.eid-verification-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  flex-shrink: 0;
}

.eid-verification-card.verified {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.03) 100%);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

.verification-card-content h4 {
  margin: 0 0 0.3rem 0;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.eid-verification-card.verified h4 {
  color: var(--color-success);
}

.verification-card-content p {
  margin: 0 0 0.85rem 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.eid-verification-card.verified p {
  margin: 0;
}

/* Settings block */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.settings-card h4 {
  margin: 0 0 0.4rem 0;
  font-size: 0.92rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
}

.setting-row:last-of-type {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

@media (hover: hover) {
  .setting-row:hover {
    opacity: 0.95;
  }
}
.setting-row.hover-simulated {
  opacity: 0.95;
}

.setting-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.64rem;
  color: var(--text-muted);
}

.setting-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.profile-actions-row {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Position `#screen-eid` & `#screen-dev-notes` as full tab screens covering the feed filters */
#screen-eid, #screen-dev-notes {
  position: absolute;
  top: 38px; /* Cover BUND/LAND/KOMMUNE tabs, align with top header bar */
  left: 0;
  right: 0;
  bottom: 58px; /* Align above bottom navigation bar */
  height: auto !important; /* CRITICAL: Override .app-screen's height: 100% so top & bottom are respected and content doesn't overflow behind bottom nav */
  background-color: var(--bg-phone);
  z-index: 8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   📱 MOBILE VIEWPORT RESPONSIVENESS (SMARTPHONES & TABLETS)
   Automatically removes the simulator frame and scales the app fullscreen
   ========================================================================== */
@media (max-width: 1024px) {
  body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background-color: var(--bg-phone) !important;
    width: 100vw !important;
    height: 100vh !important;
  }

  .mesh-bg-container,
  .main-header,
  .simulation-panel,
  .phone-panel-wrapper > .section-title,
  .notch,
  .phone-status-bar {
    display: none !important;
  }

  .dashboard-grid {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100vw !important;
    height: 100vh !important;
  }

  .phone-panel-wrapper {
    width: 100vw !important;
    height: 100vh !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .smartphone-frame {
    width: 100vw !important;
    height: 100vh !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .screen-content {
    border-radius: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
  }

  .app-header-bar {
    padding-top: env(safe-area-inset-top, 24px) !important;
    height: auto !important;
  }

  .app-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Dynamically adjust top/bottom position of absolute screens to prevent overlap */
  #screen-eid,
  #screen-dev-notes,
  .app-avatar-chat-view,
  .app-map-view {
    top: calc(env(safe-area-inset-top, 24px) + 38px) !important;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .app-detail-view {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .detail-header-bar {
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.75rem) !important;
  }
}

/* ==========================================================================
   🔔 PUSH NOTIFICATION UI STYLES
   ========================================================================== */

/* In-App Toast Alert inside Smartphone Frame */
.notification-toast {
  position: absolute;
  top: -100px; /* Hidden initially, slides down */
  left: 10px;
  right: 10px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 17, 23, 0.85) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(0, 255, 200, 0.3) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  transform: translateY(0);
  opacity: 0;
  cursor: pointer;
}

.notification-toast:not(.hidden) {
  transform: translateY(65px); /* Positioned below status bar */
  opacity: 1;
}

.notification-toast .toast-bell-icon {
  font-size: 1.4rem;
  background: rgba(0, 255, 200, 0.1);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ffc8;
  animation: bellRingSim 2s infinite ease-in-out;
  flex-shrink: 0;
}

.notification-toast .toast-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notification-toast .toast-info h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-toast .toast-info p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-toast .toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.notification-toast .toast-close-btn:hover {
  color: #fff;
}

@keyframes bellRingSim {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50% { transform: rotate(15deg); }
  20%, 40% { transform: rotate(-15deg); }
  60% { transform: rotate(0); }
}

/* Notification settings extra styles */
.notifications-sub-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease;
  opacity: 1;
}

.notifications-sub-section.hidden {
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none !important;
}

.setting-checkbox-row:hover .checkbox-text span,
.setting-radio-row:hover .radio-text span {
  color: #00ffc8;
}

.checkbox-text small,
.radio-text small {
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Responsive adjustment for Mobile Webview notches */
.is-webview .notification-toast:not(.hidden) {
  transform: translateY(75px);
}

/* ==========================================================================
   🗺️ BUNDESRAT-HEBEL: LANDESQUOREN GRID & STATE CARDS
   ========================================================================== */
.bundesrat-hebel-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  margin-top: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body:not(.dark-theme) .bundesrat-hebel-container {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hebel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.state-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 8px;
  transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

body:not(.dark-theme) .state-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 2px solid rgba(0, 0, 0, 0.15);
}

.state-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body:not(.dark-theme) .state-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.state-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.state-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: 'Outfit', monospace;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body:not(.dark-theme) .state-badge {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.state-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.state-progress-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

body:not(.dark-theme) .state-progress-bg {
  background: rgba(0, 0, 0, 0.08);
}

.state-progress-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.1, 0.8, 0.25, 1);
}

/* Color codes for German State Quorums */
.state-card.state-open {
  border-left-color: rgba(139, 92, 246, 0.6); /* Violet for active gathering */
}
.state-card.state-open .state-progress-fill {
  background: linear-gradient(90deg, hsl(263, 90%, 65%) 0%, hsl(280, 90%, 65%) 100%);
}

.state-card.state-warning {
  border-left-color: #eab308; /* Pulsing amber/gold for >80% */
  background: rgba(234, 179, 8, 0.02);
  border-color: rgba(234, 179, 8, 0.15);
}
.state-card.state-warning .state-progress-fill {
  background: linear-gradient(90deg, #eab308 0%, #f97316 100%);
  animation: pulsingBarGlow 2s infinite alternate;
}

.state-card.state-reached {
  border-left-color: #10b981; /* Green/cyan for reached quorums */
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.25);
}
.state-card.state-reached .state-progress-fill {
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
}
.state-card.state-reached .state-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

.state-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-secondary);
  font-weight: 600;
}

.state-pct-label {
  font-weight: 800;
}
.state-card.state-reached .state-pct-label {
  color: #10b981;
}
.state-card.state-warning .state-pct-label {
  color: #eab308;
}

@keyframes pulsingBarGlow {
  0% { box-shadow: 0 0 2px rgba(234, 179, 8, 0.2); }
  100% { box-shadow: 0 0 8px rgba(234, 179, 8, 0.6); }
}

/* ==========================================================================
   📄 PRINTABLE LEGAL PETITION PREVIEW & OVERRIDES
   ========================================================================== */
#screen-petition-document table th {
  text-transform: uppercase;
  color: #555;
  border-bottom: 1.5px solid #000;
}
#screen-petition-document table td {
  border-bottom: 1px solid #ddd;
}
#screen-petition-document p, 
#screen-petition-document table, 
#screen-petition-document ol {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Print override CSS styling */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .mesh-bg-container,
  .main-header,
  .dashboard-grid section,
  .smartphone-frame,
  .screen-content > *:not(#screen-petition-document) {
    display: none !important;
    visibility: hidden !important;
  }
  
  #screen-petition-document {
    display: block !important;
    visibility: visible !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  
  #screen-petition-document .btn-close-petition,
  #screen-petition-document button {
    display: none !important;
    visibility: hidden !important;
  }
  
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }
  .no-print {
    display: none !important;
    visibility: hidden !important;
  }
}

/* ==========================================================================
   🛡️ SECURE ENCLAVE / HARDWARE KEYSTORE & BIOMETRICS STYLING
   ========================================================================== */
.biometric-overlay {
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.biometric-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.biometric-icon-container {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.biometric-pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid #00ffc8;
  border-radius: 50%;
  animation: biometricPulse 1.8s infinite cubic-bezier(0.25, 0, 0, 1);
}

@keyframes biometricPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

#faceid-svg {
  animation: faceidFocus 2.5s infinite ease-in-out alternate;
}

@keyframes faceidFocus {
  0% { filter: drop-shadow(0 0 2px rgba(0, 255, 200, 0.3)); transform: scale(0.96); }
  100% { filter: drop-shadow(0 0 10px rgba(0, 255, 200, 0.8)); transform: scale(1.02); }
}

.key-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.key-status-dot.connected {
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.key-status-dot.disconnected {
  background-color: #ff5c5c;
  box-shadow: 0 0 6px #ff5c5c;
}

/* ==========================================================================
   🌐 TOR / VPN ROUTING AND CRYPTO MATH ANIMATIONS
   ========================================================================== */
.tor-node {
  transition: all 0.4s ease-in-out;
  opacity: 0.4;
  filter: grayscale(80%);
}

.tor-node.active {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.1);
}

.tor-node.active .tor-icon {
  background: rgba(37, 99, 235, 0.25) !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.6) !important;
  animation: torPulse 1.5s infinite alternate ease-in-out;
}

.tor-node.hop-active {
  opacity: 1;
  filter: grayscale(0%);
}

.tor-node.hop-active .tor-icon {
  background: rgba(0, 255, 200, 0.2) !important;
  border-color: #00ffc8 !important;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.8) !important;
  transform: scale(1.15);
  animation: torHopPulse 1s infinite alternate ease-in-out;
}

@keyframes torPulse {
  0% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
  100% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.6); }
}

@keyframes torHopPulse {
  0% { box-shadow: 0 0 6px rgba(0, 255, 200, 0.3); }
  100% { box-shadow: 0 0 20px rgba(0, 255, 200, 0.9); }
}

/* Connective Flow Lines animation keyframes */
#tor-flow-line.flow-animating {
  background: linear-gradient(90deg, #2563eb, #00ffc8, #10b981) !important;
  box-shadow: 0 0 8px rgba(0, 255, 200, 0.6);
}

/* --- Segmented Authentication Tab Bar --- */
.auth-tabs {
  background: var(--bg-sidebar);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
}
.auth-tab-btn {
  font-family: var(--font-heading);
  text-align: center;
  transition: all 0.2s ease-in-out;
}
.auth-tab-btn.active {
  background-color: var(--color-primary-glow) !important;
  border-color: rgba(0, 255, 200, 0.25) !important;
  color: #00ffc8 !important;
  box-shadow: 0 2px 8px var(--color-primary-glow);
}
.auth-tab-btn:not(.active):hover {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.03);
}

/* Modal Overlay Styling */
.app-modal-overlay {
  transition: opacity 0.3s ease;
}

/* Info Banner Styling */
.eid-info-banner {
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.05);
  transition: var(--transition-smooth);
}
.eid-info-banner:hover {
  border-color: rgba(37, 99, 235, 0.45) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}