/* ==========================================================================
   StörungAktuell.de — German Civic & Engineering Telemetry Design System
   High-Precision, High-Contrast, DSGVO-Compliant, Ultra-Fast, 100% Responsive
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-main: #f8fafc;
  --bg-header: #ffffff;
  --bg-hero: linear-gradient(180deg, #0b1120 0%, #1e293b 100%);
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-soft: #64748b;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --brand-primary: #1d4ed8;
  --brand-primary-hover: #1e40af;
  --brand-primary-soft: #eff6ff;
  --brand-primary-border: #bfdbfe;
  --signal-red: #dc2626;
  --signal-red-soft: #fef2f2;
  --signal-red-border: #fecaca;
  --signal-green: #059669;
  --signal-green-soft: #ecfdf5;
  --signal-green-border: #a7f3d0;
  --signal-amber: #d97706;
  --signal-amber-soft: #fffbeb;
  --signal-amber-border: #fde68a;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

html.dark {
  --bg-page: #070b14;
  --bg-surface: #0f172a;
  --bg-card: #131d31;
  --bg-subtle: #1e293b;
  --bg-main: #0b0f19;
  --bg-header: #070b14;
  --bg-hero: linear-gradient(180deg, #070b14 0%, #0f172a 100%);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --text-inverse: #ffffff;
  --border-color: #1e293b;
  --border-strong: #334155;
  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-primary-soft: rgba(59, 130, 246, 0.15);
  --brand-primary-border: rgba(59, 130, 246, 0.35);
  --signal-red: #ef4444;
  --signal-red-soft: rgba(239, 68, 68, 0.15);
  --signal-red-border: rgba(239, 68, 68, 0.35);
  --signal-green: #10b981;
  --signal-green-soft: rgba(16, 185, 129, 0.15);
  --signal-green-border: rgba(16, 185, 129, 0.35);
  --signal-amber: #f59e0b;
  --signal-amber-soft: rgba(245, 158, 11, 0.15);
  --signal-amber-border: rgba(245, 158, 11, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   Container & Layout Constraint (No edge-to-edge stretching, proper margins)
   -------------------------------------------------------------------------- */
.de-container, .container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

@media (max-width: 768px) {
  .de-container, .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* --------------------------------------------------------------------------
   Top Live Status Strip
   -------------------------------------------------------------------------- */
.de-status-strip {
  background: #040711;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 0;
  font-size: 12px;
  color: #94a3b8;
}
.de-status-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Prominent Geometric DE / EN Language Switcher (OutageCanada Architecture)
   -------------------------------------------------------------------------- */
.de-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  flex-shrink: 0;
}
.de-lang-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.de-lang-opt:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}
.de-lang-opt.is-active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.de-lang-sep {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  user-select: none;
}

/* --------------------------------------------------------------------------
   Header & Main Navigation
   -------------------------------------------------------------------------- */
.de-header {
  background-color: var(--bg-header);
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.de-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}
.de-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  flex-shrink: 0;
}
html:not(.dark) .de-brand-logo-dark, [data-theme="light"] .de-brand-logo-dark { display: none !important; }
html:not(.dark) .de-brand-logo-light, [data-theme="light"] .de-brand-logo-light { display: block !important; }
html.dark .de-brand-logo-dark, [data-theme="dark"] .de-brand-logo-dark { display: block !important; }
html.dark .de-brand-logo-light, [data-theme="dark"] .de-brand-logo-light { display: none !important; }

/* Light Theme Navigation & Header Colors */
html:not(.dark) .de-status-strip {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
}
html:not(.dark) .de-status-strip strong {
  color: #0f172a;
}
html:not(.dark) .de-nav-ribbon {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}
html:not(.dark) .de-nav-link {
  color: #334155;
}
html:not(.dark) .de-nav-link:hover,
html:not(.dark) .de-nav-link.active {
  color: #1d4ed8;
  background: #e2e8f0;
}
html:not(.dark) .de-nav-link-tkg, [data-theme="light"] .de-nav-link-tkg {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1.5px solid #bfdbfe !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.08);
}
html:not(.dark) .de-nav-link-tkg:hover, [data-theme="light"] .de-nav-link-tkg:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}
html:not(.dark) .de-footer-tkg-link, [data-theme="light"] .de-footer-tkg-link {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}
html:not(.dark) .de-footer-tkg-link:hover, [data-theme="light"] .de-footer-tkg-link:hover {
  color: #1e40af !important;
  text-decoration: underline;
}
html:not(.dark) .de-topbar .de-search-input {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}
html:not(.dark) .de-topbar .de-search-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}
html:not(.dark) .de-topbar .de-search-btn {
  color: #64748b;
}
html:not(.dark) .de-lang-switch {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
html:not(.dark) .de-lang-opt {
  color: #64748b;
}
html:not(.dark) .de-lang-opt.is-active {
  background: #1d4ed8;
  color: #ffffff;
}
html:not(.dark) .de-lang-sep {
  color: #94a3b8;
}

/* Light Theme Form Controls */
html:not(.dark) input.de-search-input,
html:not(.dark) select.de-search-input,
html:not(.dark) textarea.de-search-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html:not(.dark) input.de-search-input:focus,
html:not(.dark) select.de-search-input:focus,
html:not(.dark) textarea.de-search-input:focus {
  border-color: #2563eb !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Remove number input spin buttons across Chrome, Safari, Edge, Firefox */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Light Theme Footer & Brand Logo Visibility */
html:not(.dark) .de-footer, [data-theme="light"] .de-footer {
  background: #ffffff !important;
  color: #475569 !important;
  border-top: 1px solid #e2e8f0 !important;
}
html:not(.dark) .de-footer-col h4, [data-theme="light"] .de-footer-col h4 {
  color: #0f172a !important;
}
html:not(.dark) .de-footer-links a, [data-theme="light"] .de-footer-links a {
  color: #64748b !important;
}
html:not(.dark) .de-footer-links a:hover, [data-theme="light"] .de-footer-links a:hover {
  color: #1d4ed8 !important;
}
html:not(.dark) .de-footer p, [data-theme="light"] .de-footer p {
  color: #64748b !important;
}
html:not(.dark) .de-footer-bottom, [data-theme="light"] .de-footer-bottom {
  border-top: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}
html:not(.dark) .de-footer-bottom a, [data-theme="light"] .de-footer-bottom a {
  color: #475569 !important;
}
html:not(.dark) .de-footer-bottom a:hover, [data-theme="light"] .de-footer-bottom a:hover {
  color: #1d4ed8 !important;
}

.de-logo-badge {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}
.de-brand-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.de-brand-text span {
  color: #93c5fd;
  font-weight: 400;
}
.de-brand-sub {
  font-size: 10.5px;
  color: #94a3b8;
  display: block;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Header Action Controls */
.de-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.de-theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  width: 38px;
  height: 38px;
  color: #fbbf24;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.de-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}
.de-theme-icon-sun { display: inline-flex; color: #fbbf24; }
.de-theme-icon-moon { display: none; color: #38bdf8; }

html:not(.dark) .de-theme-toggle,
[data-theme="light"] .de-theme-toggle {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0284c7;
}
html:not(.dark) .de-theme-icon-sun,
[data-theme="light"] .de-theme-icon-sun { display: none; }
html:not(.dark) .de-theme-icon-moon,
[data-theme="light"] .de-theme-icon-moon { display: inline-flex; }

/* Mobile Hamburger Toggle */
.de-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
}

/* Category Ribbon */
.de-nav-ribbon {
  background: #141f32;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.de-nav-ribbon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0;
}
.de-nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.de-nav-link:hover, .de-nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* TKG § 58 Statutory Rights Badge in Ribbon (Dark Mode Default) */
.de-nav-link-tkg {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  padding: 5px 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.de-nav-link-tkg:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}

.de-footer-tkg-link {
  color: #93c5fd !important;
  font-weight: 600 !important;
}
.de-footer-tkg-link:hover {
  color: #ffffff !important;
  text-decoration: underline;
}

/* 16 Bundesländer State Bar */
.de-state-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}
.de-state-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.8;
  text-align: center;
}
.de-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.de-state-pill:hover, .de-state-pill.active {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border-color: var(--brand-primary-border);
}
.de-state-pill-code {
  font-weight: 800;
  font-size: 10.5px;
  color: var(--text-main);
  background: var(--bg-surface);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.de-hero {
  background: var(--bg-hero);
  color: #ffffff;
  padding: 48px 0 40px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.de-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #93c5fd;
  margin-bottom: 18px;
}
.de-hero-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 14px 0;
  letter-spacing: -0.6px;
}
.de-hero-lead {
  font-size: 16px;
  color: #cbd5e1;
  max-width: 760px;
  margin: 0 auto 28px auto;
  line-height: 1.55;
}

/* Search Form Component */
.de-search-form {
  position: relative;
  width: 100%;
}
.de-search-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.de-search-input:focus {
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}
.de-search-input::placeholder {
  color: #94a3b8;
}
.de-search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 16px;
}
.de-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.de-search-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

/* Sidebar Layout Architecture */
.de-layout-sidebar {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 991px) {
  .de-layout-sidebar {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Quick PLZ Tags */
.de-quick-plz {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-top: 16px;
}
.de-quick-plz-tag {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.de-quick-plz-tag:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* --------------------------------------------------------------------------
   National Telemetry Metrics Bar
   -------------------------------------------------------------------------- */
.de-metrics-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
}
.de-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}
.de-stat-card {
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
}
.de-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.de-stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.de-stat-sub {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.de-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.de-section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text-main);
  letter-spacing: -0.3px;
}
.de-section-subtitle {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Category Grid (3 Columns on Desktop, 2 on Tablet, 1 on Mobile)
   -------------------------------------------------------------------------- */
.de-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
}
.de-cat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.de-cat-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}
.de-cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.de-cat-card-icon {
  font-size: 26px;
  line-height: 1;
}
.de-cat-card-title {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-main);
}
.de-cat-card-desc {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Live Outages Feed & Incident Rows (Direct Link to Dedicated HTML Pages)
   -------------------------------------------------------------------------- */
.de-outage-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.de-outage-row {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.15s ease;
  position: relative;
}
.de-outage-row:last-child {
  border-bottom: none;
}
.de-outage-row:hover {
  background: var(--bg-subtle);
}
.de-outage-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 260px;
}
.de-outage-icon {
  font-size: 24px;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}
.de-outage-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.de-outage-pname {
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  font-size: 15px;
}
.de-outage-pname:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}
.de-outage-desc {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.45;
  display: block;
  margin-top: 2px;
}
.de-outage-desc:hover {
  color: var(--text-main);
}
.de-outage-right {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: right;
  flex-shrink: 0;
}
.de-outage-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.de-outage-affected {
  font-weight: 700;
  color: var(--signal-amber);
  font-size: 14px;
}
.de-outage-time {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 2px;
}
.de-outage-btn {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.de-outage-btn:hover {
  background: var(--brand-primary-hover);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.35);
}

/* --------------------------------------------------------------------------
   Provider Grid (4 Columns on Desktop, 2 on Tablet, 1 on Mobile)
   -------------------------------------------------------------------------- */
.de-provider-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.de-provider-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.de-provider-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}
.de-provider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.de-provider-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.de-provider-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-soft);
  gap: 8px;
}

/* Status Indicators */
.de-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.de-status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.de-status-indicator.is-operational {
  color: var(--signal-green);
}
.de-status-indicator.is-operational .de-status-indicator-dot {
  background: var(--signal-green);
}
.de-status-indicator.is-warning {
  color: var(--signal-amber);
}
.de-status-indicator.is-warning .de-status-indicator-dot {
  background: var(--signal-amber);
}
.de-status-indicator.is-danger {
  color: var(--signal-red);
}
.de-status-indicator.is-danger .de-status-indicator-dot {
  background: var(--signal-red);
}

/* --------------------------------------------------------------------------
   Federal States Grid (4 Columns)
   -------------------------------------------------------------------------- */
.de-state-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.de-state-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
}
.de-state-card:hover {
  border-color: var(--brand-primary);
  background: var(--bg-subtle);
}

/* --------------------------------------------------------------------------
   Buttons & Badges
   -------------------------------------------------------------------------- */
.de-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.de-btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
}
.de-btn-primary:hover {
  background: var(--brand-primary-hover);
  color: #ffffff;
}
.de-btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.de-btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--text-soft);
}
.de-btn-danger {
  background: var(--signal-red);
  color: #ffffff;
}
.de-btn-danger:hover {
  background: #b91c1c;
  color: #ffffff;
}
.de-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.de-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.de-badge.success, .de-badge-success {
  background: var(--signal-green-soft);
  color: var(--signal-green);
  border: 1px solid var(--signal-green-border);
}
.de-badge.warning, .de-badge-warning {
  background: var(--signal-amber-soft);
  color: var(--signal-amber);
  border: 1px solid var(--signal-amber-border);
}
.de-badge.danger, .de-badge-danger {
  background: var(--signal-red-soft);
  color: var(--signal-red);
  border: 1px solid var(--signal-red-border);
}
.de-badge-info {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary-border);
}

/* Pulse Dot */
.de-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal-green);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}
.de-pulse-dot.is-alert, .de-pulse-dot.danger {
  background: var(--signal-amber);
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7);
  animation: pulse-amber 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-amber {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

/* --------------------------------------------------------------------------
   Cards, Prose & Common UI
   -------------------------------------------------------------------------- */
.de-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.de-card:hover {
  box-shadow: var(--shadow-md);
}
.de-prose {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-muted);
}
.de-prose p { margin-top: 0; margin-bottom: 18px; }
.de-prose h2 { font-size: 22px; font-weight: 800; color: var(--text-main); margin: 36px 0 14px 0; letter-spacing: -0.015em; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.de-prose h3 { font-size: 18px; font-weight: 700; color: var(--text-main); margin: 28px 0 10px 0; }
.de-prose ul, .de-prose ol { margin: 0 0 22px 24px; padding: 0; }
.de-prose li { margin-bottom: 8px; line-height: 1.65; }
.de-prose strong { color: var(--text-main); font-weight: 700; }
.de-prose a { color: var(--signal-amber); text-decoration: underline; text-underline-offset: 3px; }
.de-prose a:hover { color: #f59e0b; }
.de-prose blockquote { border-left: 4px solid var(--signal-amber); margin: 24px 0; padding: 12px 20px; background: rgba(245, 158, 11, 0.05); border-radius: 0 8px 8px 0; font-style: italic; color: var(--text-main); }
.de-prose table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 14px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.de-prose th, .de-prose td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); text-align: left; }
.de-prose th { background: var(--bg-hover); font-weight: 700; color: var(--text-main); font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }
.de-prose tr:last-child td { border-bottom: none; }
.de-prose figure { margin: 32px 0; text-align: center; }
.de-prose figure img { max-width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--border-color); display: block; margin: 0 auto; }
.de-prose figcaption { font-size: 13px; color: var(--text-soft); margin-top: 10px; font-style: italic; text-align: center; line-height: 1.4; }
.de-prose .de-callout { background: rgba(59, 130, 246, 0.08); border-left: 4px solid #3b82f6; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 24px 0; }
.de-prose .de-callout-warning { background: rgba(245, 158, 11, 0.08); border-left-color: var(--signal-amber); }
.de-prose .de-faq-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 18px 22px; margin-bottom: 14px; }
.de-prose .de-faq-box h3 { margin-top: 0; font-size: 16.5px; }

/* --------------------------------------------------------------------------
   Footer & Legal Compliance (§ 5 DDG & DSGVO)
   -------------------------------------------------------------------------- */
.de-footer {
  background: #070b14;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px 0 24px 0;
  margin-top: auto;
  font-size: 13px;
}
.de-footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.de-footer-col h4 {
  color: #f8fafc;
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 16px 0;
}
.de-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.de-footer-links li {
  margin-bottom: 9px;
}
.de-footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}
.de-footer-links a:hover {
  color: #ffffff;
}
.de-footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Legacy OutageCanada (.oc-*) Class Mapping (Full Backwards Compatibility)
   -------------------------------------------------------------------------- */
.oc-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; }
.oc-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); }
.oc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.oc-btn-primary { background: var(--brand-primary); color: #ffffff; }
.oc-btn-secondary { background: var(--bg-surface); color: var(--text-main); border-color: var(--border-strong); }
.oc-btn-sm { padding: 5px 10px; font-size: 12px; }
.oc-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 700; }
.oc-badge-info { background: var(--brand-primary-soft); color: var(--brand-primary); border: 1px solid var(--brand-primary-border); }
.oc-alert-box { background: var(--signal-amber-soft); border: 1px solid var(--signal-amber-border); color: var(--text-main); padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 20px; }
.oc-field { margin-bottom: 16px; }
.oc-label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text-main); }
.oc-input, .oc-select, .oc-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-main); font-size: 14px; }
.oc-input:focus, .oc-select:focus, .oc-textarea:focus { outline: none; border-color: var(--brand-primary); }
.oc-prose { font-size: 15px; line-height: 1.7; color: var(--text-muted); }
.oc-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* --------------------------------------------------------------------------
   Responsive Media Queries (Desktop, Tablet, Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .de-cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .de-provider-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .de-state-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .de-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .de-mobile-toggle {
    display: inline-flex;
  }
  .de-topbar .de-search-form {
    display: none; /* In mobile, search is in hero or drawer */
  }
  .de-hero-title {
    font-size: 26px;
    letter-spacing: -0.4px;
  }
  .de-hero-lead {
    font-size: 14.5px;
    margin-bottom: 20px;
  }
  .de-search-input {
    font-size: 14.5px;
    padding: 12px 44px 12px 14px !important;
  }
  .de-metric-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .de-stepper-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .de-cat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .de-provider-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .de-state-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .de-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .de-footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .de-outage-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .de-outage-right {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }
  .de-outage-stats {
    align-items: flex-start;
  }
  .de-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .de-provider-grid {
    grid-template-columns: 1fr;
  }
  .de-state-grid {
    grid-template-columns: 1fr;
  }
  .de-metrics-grid {
    grid-template-columns: 1fr;
  }
  .de-hero-title {
    font-size: 22px;
  }
  .de-status-strip-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Additional Helper & Legacy Aliases */
.hidden { display: none !important; }
.is-success { color: var(--signal-green) !important; }
.de-tkg-box {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.oc-card-title { font-size: 18px; font-weight: 700; color: var(--text-main); margin: 0 0 12px 0; }
.oc-section-head { font-size: 22px; font-weight: 800; color: var(--text-main); margin: 0 0 6px 0; }
.oc-section-sub { font-size: 14px; color: var(--text-soft); margin: 0 0 18px 0; }
.oc-muted { color: var(--text-muted); }
.oc-soft { color: var(--text-soft); }
.oc-comment-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; }
.oc-upvote-btn { background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.uv-count { font-weight: 700; color: var(--text-main); margin-left: 4px; }
.oc-grid { display: grid; gap: 16px; }
.oc-subhero-photo { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 12px; }
.oc-subhero-photo-cap { font-size: 13px; color: var(--text-soft); font-style: italic; }

/* --------------------------------------------------------------------------
   Light Mode Contrast & Button Visibility Fix
   -------------------------------------------------------------------------- */
html:not(.dark) .de-btn-primary,
[data-theme="light"] .de-btn-primary {
  background: #f59e0b !important;
  color: #0b0f19 !important;
  border-color: #d97706 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
html:not(.dark) .de-btn-primary:hover,
[data-theme="light"] .de-btn-primary:hover {
  background: #d97706 !important;
  color: #ffffff !important;
}
html:not(.dark) .de-btn-secondary,
[data-theme="light"] .de-btn-secondary {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
html:not(.dark) .de-btn-secondary:hover,
[data-theme="light"] .de-btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}
html:not(.dark) input[type="text"],
html:not(.dark) input[type="email"],
html:not(.dark) textarea,
html:not(.dark) select,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html:not(.dark) .de-card,
[data-theme="light"] .de-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
