/* Dark Mode — aktiv via html[data-theme="dark"]. Default (System/hell) setzt das Head-Script.
   Attribut-Selektor > plain class → ueberschreibt style.css, enhance.css UND inline <style>-Klassen. */
html[data-theme="dark"]{
  color-scheme:dark;
  --blue:#60a5fa; --blue2:#3b82f6; --ink:#e6e8ec; --muted:#9aa6b8;
  --line:#273244; --soft:#0f1626; --white:#121a2b; --green:#34d399; --violet:#a78bfa;
}
html[data-theme="dark"] body{background:#0b1220;color:var(--ink)}
html[data-theme="dark"] a{color:inherit}

/* Navigation */
html[data-theme="dark"] .nav{background:rgba(11,18,32,.86);border-bottom:1px solid rgba(255,255,255,.08)}
html[data-theme="dark"] .nav nav a{color:#cbd5e1}
html[data-theme="dark"] .nav nav a:hover{color:var(--blue)}
html[data-theme="dark"] .nav nav.open{background:#0b1220;border-bottom-color:var(--line)}
html[data-theme="dark"] .nav-toggle{color:var(--ink)}

/* Hero / Page-Head Verlaeufe */
html[data-theme="dark"] .hero{background:radial-gradient(circle at 50% 0,#13213f 0,transparent 44%),linear-gradient(180deg,#0e1830,#0b1220)}
html[data-theme="dark"] .page-head{background:linear-gradient(180deg,#0e1830,#0b1220)}
html[data-theme="dark"] .hero p,html[data-theme="dark"] .page-head p{color:var(--muted)}

/* Karten / Flaechen */
html[data-theme="dark"] .feature-grid article,
html[data-theme="dark"] .model-card,
html[data-theme="dark"] .legal-grid article,
html[data-theme="dark"] .compare-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .cmp-metric,
html[data-theme="dark"] .search-res,
html[data-theme="dark"] .gsearch-panel,
html[data-theme="dark"] .chartmodal-panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .score-ring i{background:#121a2b;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .feature-grid article,html[data-theme="dark"] .model-card{box-shadow:0 2px 10px rgba(0,0,0,.35)}

/* Buttons */
html[data-theme="dark"] .button{background:#1b2435;border-color:var(--line);color:var(--blue)}
html[data-theme="dark"] .button.primary{background:var(--blue2);border-color:var(--blue2);color:#fff}

/* Formular-Elemente */
html[data-theme="dark"] .filters select,html[data-theme="dark"] .filters input,
html[data-theme="dark"] .compare-form select,
html[data-theme="dark"] .lbf-bar input,html[data-theme="dark"] .lbf-bar select,
html[data-theme="dark"] select,html[data-theme="dark"] input,html[data-theme="dark"] textarea{background:#121a2b;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] ::placeholder{color:#64748b}

/* Tabellen */
html[data-theme="dark"] th{background:#0f1626;color:#9aa6b8}
html[data-theme="dark"] td{border-top-color:var(--line)}
html[data-theme="dark"] .cmp-table tbody tr:hover{background:#0f1626}
html[data-theme="dark"] .cmp-table tbody tr:has(.cmp-cb:checked){background:#132038}

/* Chips / Typ-Badges / helle Tints */
html[data-theme="dark"] .chips span,html[data-theme="dark"] .type{background:#1e2a4a;color:#bcd0ff}
html[data-theme="dark"] .type.performance{background:#2a1e4a;color:#d8c8ff}
html[data-theme="dark"] .type.harness{background:#0b2e40;color:#9fdcff}
html[data-theme="dark"] .bmtitle,html[data-theme="dark"] .chip-bench{background:#1e2a4a;color:#bcd0ff;border-color:var(--line)}

/* Prose / Text */
html[data-theme="dark"] .prose p,html[data-theme="dark"] .prose{color:#cbd5e1}
html[data-theme="dark"] .section-head h2,html[data-theme="dark"] .feature-grid h3{color:var(--ink)}

/* Globale Suche */
html[data-theme="dark"] .gsearch-input:focus-within,
html[data-theme="dark"] .hero-search-box,
html[data-theme="dark"] .nav .gsearch.gs-open .gsearch-input{background:#121a2b}
html[data-theme="dark"] .gsearch-input kbd{background:#1b2435;color:var(--muted);border-color:var(--line)}
html[data-theme="dark"] .gsearch-item .ic,html[data-theme="dark"] .search-res .ic{background:#1b2435}

/* User-Dropdown (im dunklen .powered-Bar, in beiden Modi) */
html[data-theme="dark"] .powered .nav-user-menu{background:#121a2b;border-color:var(--line)}
html[data-theme="dark"] .powered .nav-user-menu a{color:var(--ink)}
html[data-theme="dark"] .powered .nav-user-menu a:hover{background:#0f1626}

/* Config-Hinweise */
html[data-theme="dark"] .cfg-hint.info{background:#0b2e40;color:#cde9ff}
html[data-theme="dark"] .cfg-hint.warn{background:#3a2a12;color:#ffe3b0}

/* Theme-Toggle (liegt im dunklen .powered-Bar) */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:30px;height:22px;border:1px solid rgba(255,255,255,.18);border-radius:7px;background:rgba(255,255,255,.08);color:#e2e8f0;cursor:pointer;font-size:13px;line-height:1;padding:0}
.theme-toggle:hover{background:rgba(255,255,255,.16)}
html[data-theme="dark"] .theme-toggle .ti-dark{display:none}
html:not([data-theme="dark"]) .theme-toggle .ti-light{display:none}

/* Nachtrag: inline-gestylte Homepage-Karten (.tmc) + Leaderboard-Metrik-Umschalter */
html[data-theme="dark"] .tmc{background:#121a2b;border-color:var(--line)}
html[data-theme="dark"] .tmc-tags span,html[data-theme="dark"] .tmc-rank{color:#9aa6b8}
html[data-theme="dark"] .lbf-metric,html[data-theme="dark"] .lbf-hmetric{background:#121a2b}
html[data-theme="dark"] .lbf-metric button,html[data-theme="dark"] .lbf-hmetric button{background:#121a2b;color:var(--muted);border-left-color:var(--line)}
html[data-theme="dark"] .lbf-metric button.on,html[data-theme="dark"] .lbf-hmetric button.on{background:var(--blue2);color:#fff}

/* Detailseite / Vergleich / Economics — weitere inline-/enhance-Flaechen */
html[data-theme="dark"] .bub-card,
html[data-theme="dark"] .contrib-card,
html[data-theme="dark"] .eco-bd-c,
html[data-theme="dark"] .eco-bd-ext,
html[data-theme="dark"] .eco-chart,
html[data-theme="dark"] .eco-cfg{background:#121a2b;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .run-contrib,
html[data-theme="dark"] .cmp-mark{background:#1b2435;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .run-note{background:#0b2238;border-color:#1e3a5f;color:#cfe3ff}
html[data-theme="dark"] .eco-bd-ext-fz,
html[data-theme="dark"] .eco-note.eco-util-hint{background:#0b2238;color:#cfe3ff}
html[data-theme="dark"] .chip-bench{background:#231a3a;color:#d8c8ff;border-color:var(--line)}
html[data-theme="dark"] .hl{background:#3a2f12;color:#ffe9b0}
html[data-theme="dark"] .cmp-delta.up{background:#0e2e1e;color:#86efac}
html[data-theme="dark"] .cmp-delta.down{background:#3a1620;color:#fca5a5}
html[data-theme="dark"] .cmp-row-fill{background:#334155}
/* Economics/Detail: Text in umgefaerbten Containern hell halten */
html[data-theme="dark"] .eco-bd-c *,html[data-theme="dark"] .eco-bd-ext *,html[data-theme="dark"] .contrib-card *,html[data-theme="dark"] .bub-card *{border-color:var(--line)}

/* Economics/Detail Feinschliff: dunkler Text auf dunklen Karten + inline-gefaerbte Chips */
html[data-theme="dark"] .eco-bd-c b,html[data-theme="dark"] .eco-bd-c span,html[data-theme="dark"] .eco-bd-c .num,
html[data-theme="dark"] .eco-bd-ext b,html[data-theme="dark"] .eco-bd-ext span,html[data-theme="dark"] .eco-bd-ext .num,
html[data-theme="dark"] .bub-card b,html[data-theme="dark"] .bub-card span,html[data-theme="dark"] .bub-card .num,
html[data-theme="dark"] .contrib-card b,html[data-theme="dark"] .contrib-card span,
html[data-theme="dark"] .eco-api-lab,html[data-theme="dark"] .eco-cfg b,html[data-theme="dark"] .eco-cfg span{color:#e6e8ec}
html[data-theme="dark"] .apexcharts-legend-text{color:#cbd5e1 !important}
html[data-theme="dark"] .apexcharts-text,html[data-theme="dark"] .apexcharts-yaxis text,html[data-theme="dark"] .apexcharts-xaxis text{fill:#9aa6b8 !important}
html[data-theme="dark"] .chip-bench{background:#231a3a !important;color:#d8c8ff !important}
html[data-theme="dark"] .hl{background:#3a2f12 !important;color:#ffe9b0 !important}
html[data-theme="dark"] .cmp-mark{background:#1b2435 !important;color:var(--ink) !important;border-color:var(--line) !important}
html[data-theme="dark"] .eco-settings-card,html[data-theme="dark"] .eco2-wrap{background:#121a2b;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .eco-bar-val,html[data-theme="dark"] .eco-settings-card b,html[data-theme="dark"] .eco-settings-card span,html[data-theme="dark"] .eco2-wrap b,html[data-theme="dark"] .eco2-wrap span,html[data-theme="dark"] .eco2-wrap .num{color:#e6e8ec}

/* Logo-Swap: im Dark Mode helle Logo-Variante zeigen */
.brand-logo-dark{display:none}
html[data-theme="dark"] .brand-logo:not(.brand-logo-dark){display:none}
html[data-theme="dark"] .brand-logo-dark{display:block}

/* Mobile: Theme-Toggle + Sprache/Login in EINER Zeile oben halten (nicht umbrechen) */
@media(max-width:640px){
  .powered{flex-wrap:nowrap!important;overflow-x:auto;justify-content:flex-start!important}
  .powered .pw-credits{flex:0 0 auto;order:2}
  .powered .nav-acc{flex:0 0 auto;order:0}
  .theme-toggle{flex:0 0 auto}
}

/* Detail Feinschliff II (WCAG-Kontrast) */
/* Verteilungs-Balken: Wert-/Prozent-Labels je Ziel lesbar (vorher Label-Farbe = Marker-Farbe) */
html[data-theme="dark"] .cmp-dist-bar{background:linear-gradient(90deg,#1e3a5f,#3b2e6b)}
html[data-theme="dark"] .cmp-dist .mark{background:#64748b}
html[data-theme="dark"] .cmp-dist .mark span{color:#aeb9cc}
html[data-theme="dark"] .cmp-dist .mark.this{background:#a78bfa}
html[data-theme="dark"] .cmp-dist .mark.this span{color:#c4b5fd}
html[data-theme="dark"] .cmp-dist-head{color:var(--muted)}
/* Profil-Badge (Administrator o.ae.) */
html[data-theme="dark"] .prof-badge{background:#312a5e;color:#c7d2fe}
/* Bubble-Legende + Highlight */
html[data-theme="dark"] .bub-leg{color:#9aa6b8}
html[data-theme="dark"] .bub-leg b{color:#e6e8ec}
html[data-theme="dark"] .bub-leg .hl,html[data-theme="dark"] .bub-leg .hl em{color:#fbbf24}
/* cfg-hint Info-Icon dunkler, damit weisses i kontrastiert */
html[data-theme="dark"] .cfg-hint-ic{background:#1e3a5f}
/* TOC/Level aktiver Tab: helleres Blau auf dunkel */
html[data-theme="dark"] [class*="lvl"].on{color:#93c5fd}
/* Legende "dieser Lauf" + cfg-hint Icons lesbar */
html[data-theme="dark"] .cmp-you{color:#c4b5fd}
html[data-theme="dark"] .cfg-hint-ic{color:#fff}
html[data-theme="dark"] .cfg-hint.warn .cfg-hint-ic{background:#9a3412}
html[data-theme="dark"] .cfg-hint.info .cfg-hint-ic{background:#1e40af}
html[data-theme="dark"] .cmp-you{background:#2a1e4a!important;color:#c4b5fd!important}
html[data-theme="dark"] .cfg-hint.warn .cfg-hint-ic{background:#9a3412;color:#fff}
html[data-theme="dark"] .cfg-hint.info .cfg-hint-ic{color:#fff}
/* Economics: segmentierte Umschalter + Chart-Zoom-Button */
html[data-theme="dark"] .eco-chart-tg button{background:#121a2b;color:var(--muted);border-color:var(--line)}
html[data-theme="dark"] .eco-chart-tg button.on{background:var(--blue2);color:#fff;border-color:var(--blue2)}
html[data-theme="dark"] .chart-zoom-btn{background:#121a2b;border-color:var(--line);color:var(--muted)}
/* Hardware: GPU/CPU-Umschalter (.hwsw) */
html[data-theme="dark"] .hwsw,html[data-theme="dark"] .hwsw-bar{background:transparent}
html[data-theme="dark"] .hwsw{background:#121a2b;border-color:var(--line)}
html[data-theme="dark"] .hwsw button{background:#121a2b;color:var(--muted);border-color:var(--line)}
html[data-theme="dark"] .hwsw button.on{background:var(--blue2);color:#fff;border-color:var(--blue2)}
/* Tabellen: Concurrency-Spalte (hartkodiert dunkel) */
html[data-theme="dark"] .conc-col{color:var(--muted)}
html[data-theme="dark"] .conc-col b{color:var(--ink)}
/* Hersteller-/HW-Stat-Karten + Param-Badge */
html[data-theme="dark"] .mf-card,html[data-theme="dark"] .mf-stat,html[data-theme="dark"] .hwstat-card{background:#121a2b;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .mf-stat small,html[data-theme="dark"] .hwstat-card small{color:var(--muted)}
html[data-theme="dark"] .mf-stat b,html[data-theme="dark"] .mf-stat strong,html[data-theme="dark"] .hwstat-card b,html[data-theme="dark"] .hwstat-card strong{color:var(--ink)}
html[data-theme="dark"] .param-badge{background:#1e2a4a;color:#bcd0ff;border-color:var(--line)}
/* Hero-Arena (dekoratives Widget): aktiver Umschalter + Rang-Ziffer lesbar */
html[data-theme="dark"] .arena-toggle button.active{background:#fff;color:#0f172a}
html[data-theme="dark"] .arena .rk{color:#f1d9a0}
