/* Radar-Dunkelmodus – Kern-Styles (sofort beim Laden, kein helles Aufblitzen).
   Aktiv über html[data-nhr-theme="dark"]: folgt dem System-Dunkelmodus, umschaltbar per 🌙/☀️.
   Alles, was hier nicht steht, färbt neelix-harm-alerts-dark.js anhand der echten Farben um. */

html[data-nhr-theme="dark"] {
    color-scheme: dark;
    --nhrd-bg: #0f0e1a;
    --nhrd-surface: #1a1830;
    --nhrd-surface-2: #231f3d;
    --nhrd-border: rgba(255, 255, 255, 0.1);
    --nhrd-text: #ece9f6;
    --nhrd-muted: #b4aecd;
    --nhrd-accent: #ff6cc8;
    /* Plugin-/Vorlagen-Variablen umbiegen → viele Regeln färben sich automatisch mit */
    --nhr-bg: var(--nhrd-bg);
    --nhr-ink: var(--nhrd-text);
    --nhr-navy: #ffffff;
    --nhr-muted: var(--nhrd-muted);
    --nhr-card: var(--nhrd-surface);
    --nhr-border: var(--nhrd-border);
    --nhr-accent: var(--nhrd-accent);
    --nhrp-ink: var(--nhrd-text);
    --nhrp-soft: var(--nhrd-muted);
    --nhrp-card-bg: var(--nhrd-surface);
    --nhrp-border: var(--nhrd-border);
    --nhrp-text-primary: var(--nhrd-text);
    --nhrp-text-secondary: var(--nhrd-muted);
    background: var(--nhrd-bg) !important;
}

/* Seite, Kopf, Fuß */
html[data-nhr-theme="dark"] body,
html[data-nhr-theme="dark"] #page,
html[data-nhr-theme="dark"] .nhrp-shell,
html[data-nhr-theme="dark"] .nhrp-main {
    background: var(--nhrd-bg) !important;
    color: var(--nhrd-text);
}
html[data-nhr-theme="dark"] .site-header {
    background: #15132a !important;
    box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.6) !important;
}
html[data-nhr-theme="dark"] .site-title,
html[data-nhr-theme="dark"] .site-title a { color: #ffffff !important; }
html[data-nhr-theme="dark"] .site-description { color: var(--nhrd-muted) !important; }
html[data-nhr-theme="dark"] .site-footer { background: #13112a !important; color: var(--nhrd-muted); }

/* Überschriften + Fließtext im Radar */
html[data-nhr-theme="dark"] .nhrp-shell :is(h1, h2, h3, h4) { color: #ffffff !important; }
html[data-nhr-theme="dark"] .nhrp-shell :is(p, li, dd, label, summary) { color: var(--nhrd-text); }
html[data-nhr-theme="dark"] .nhr-summary,
html[data-nhr-theme="dark"] .nhrp-lead { color: #d6d1e8 !important; }

/* Flächen: Hero, Panels, Karten, Kästen */
html[data-nhr-theme="dark"] :is(.nhrp-hero, .nhrp-panel, .nhr-search, .nhr-a11y-bar, .nhr-quickfilter, .nhr-collapse,
    .nhr-lr-top .box, .nhr-melde-hub, .nhr-lr-block, .nhr-group, .nhr-tools-group details, .nhr-side-hot, .nhr-side-help) {
    background: var(--nhrd-surface) !important;
    border-color: var(--nhrd-border) !important;
    box-shadow: none !important;
}
html[data-nhr-theme="dark"] .nhr-card {
    background: var(--nhrd-surface) !important;
    border-color: var(--nhrd-border) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}
html[data-nhr-theme="dark"] :is(.nhr-steckbrief, .nhr-card-more, .nhr-livebar, .nhr-confirm, .nhr-crit-item, .nhr-search-input) {
    background: var(--nhrd-surface-2) !important;
    border-color: var(--nhrd-border) !important;
}
html[data-nhr-theme="dark"] .nhr-card-tip {
    background: rgba(249, 115, 22, 0.12) !important;
    color: #fbd5b5 !important;
}
html[data-nhr-theme="dark"] .nhr-risk-mini { background: rgba(255, 255, 255, 0.1) !important; }

/* „Jetzt lebensgefährlich" */
html[data-nhr-theme="dark"] .nhr-crit-banner {
    background: linear-gradient(180deg, #2a1123, #200e1c) !important;
    border-color: #6b1f4c !important;
}
html[data-nhr-theme="dark"] .nhr-crit-banner-title { color: #ff8fd6 !important; }
html[data-nhr-theme="dark"] .nhr-crit-banner-sub,
html[data-nhr-theme="dark"] .nhr-crit-item-meta { color: #e7b6d3 !important; }
html[data-nhr-theme="dark"] .nhr-crit-item-title { color: #ffffff !important; }
html[data-nhr-theme="dark"] .nhr-crit-intl-note { background: transparent !important; color: #e7b6d3 !important; border-color: #6b1f4c !important; }
html[data-nhr-theme="dark"] .nhr-crit-intl { background: rgba(167, 139, 250, 0.16) !important; color: #d4c6ff !important; }

/* Badges: getönt statt Pastellweiß */
html[data-nhr-theme="dark"] .nhr-sev-critical { background: rgba(224, 17, 157, 0.2) !important; color: #ff9bdb !important; border-color: rgba(224, 17, 157, 0.45) !important; }
html[data-nhr-theme="dark"] .nhr-sev-high { background: rgba(249, 115, 22, 0.18) !important; color: #ffbe8a !important; border-color: rgba(249, 115, 22, 0.42) !important; }
html[data-nhr-theme="dark"] .nhr-sev-medium { background: rgba(234, 179, 8, 0.16) !important; color: #fde68a !important; border-color: rgba(234, 179, 8, 0.4) !important; }
html[data-nhr-theme="dark"] .nhr-sev-low { background: rgba(59, 130, 246, 0.18) !important; color: #a8c8ff !important; border-color: rgba(59, 130, 246, 0.42) !important; }
html[data-nhr-theme="dark"] .nhr-badge-geo { background: rgba(255, 255, 255, 0.08) !important; color: #d7e7ec !important; border-color: rgba(255, 255, 255, 0.16) !important; }
html[data-nhr-theme="dark"] .nhr-badge-substance { background: rgba(224, 17, 157, 0.16) !important; color: #ffa6df !important; border-color: rgba(224, 17, 157, 0.38) !important; }

/* Knöpfe, Chips, Formulare */
html[data-nhr-theme="dark"] .nhr-links a {
    background: var(--nhrd-accent) !important;
    color: #1a0b16 !important;
}
html[data-nhr-theme="dark"] :is(.nhr-filter-btn, .nhr-qtile, .nhr-search-chip, .nhr-a11y-btn, .nhr-a11y-chip, .nhr-confirm-btn, .nhr-quickfilter-chips a, .nhrp-trust span) {
    background: var(--nhrd-surface-2) !important;
    color: var(--nhrd-text) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}
html[data-nhr-theme="dark"] .nhr-filter-btn.is-active {
    background: #7c3aed !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
}
html[data-nhr-theme="dark"] .nhrp-shell :is(select, input, textarea) {
    background: var(--nhrd-surface-2) !important;
    color: var(--nhrd-text) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}
html[data-nhr-theme="dark"] .nhrp-shell a:not([class]) { color: #ff8fd6; }

/* Karten (Leaflet): Kacheln abdunkeln, Fotos minimal dimmen */
html[data-nhr-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.92); }
html[data-nhr-theme="dark"] .leaflet-container { background: #1b1a2b !important; }
html[data-nhr-theme="dark"] .nhrp-shell img:not(.leaflet-tile) { filter: brightness(0.93); }

/* Umschalt-Knopf in der Übersetzen/Vorlesen-Leiste */
.nhr-a11y-theme {
    width: 40px;
    height: 40px;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    margin-left: auto;
}
