/* ═══════════════════════════════════════════════════════════════════════════
   Energie-Infokarte Österreich – Stylesheet
   Dunkles Grundthema (beamertauglich), heller Druck.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0b1220;
  --bg-2:      #111b2e;
  --panel:     #16233b;
  --panel-2:   #1c2c48;
  --line:      #27395c;
  --text:      #e8eefb;
  --muted:     #9bb0d3;
  --accent:    #4ade80;
  --accent-2:  #38bdf8;

  --wasser:    #60a5fa;
  --wind:      #38bdf8;
  --pv:        #facc15;
  --biomasse:  #84cc16;
  --gas:       #f87171;
  --kohle:     #94a3b8;
  --oel:       #c084fc;
  --abfall:    #fb923c;
  --speicher:  #2dd4bf;
  --waerme:    #fda4af;
  --geothermie:#a3e635;
  --atom:      #e879f9;
  --sonstige:  #64748b;

  --fs: 16px;
  --radius: 14px;
}

body.present { --fs: 19px; }

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font: var(--fs)/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent-2); }
button { font: inherit; }

.muted { color: var(--muted); }
.small { font-size: .85em; }

/* ───────────────────────────────── Kopfzeile ───────────────────────────── */

.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .55rem 1.1rem;
  background: linear-gradient(180deg, #142035, #0e1729);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 1200;
}

.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; flex-shrink: 1; }
.brand-mark {
  font-size: 1.6rem; line-height: 1;
  filter: drop-shadow(0 0 10px rgba(74,222,128,.5));
}
.brand h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; }
.brand-sub { margin: 0; font-size: .76rem; color: var(--muted); white-space: nowrap; }

.tabs { display: flex; gap: .25rem; margin-left: auto; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: .45rem .95rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: .15s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.tab.is-active { background: var(--accent); color: #06240f; font-weight: 600; }

.topbar-tools { display: flex; align-items: center; gap: .5rem; }

.global-search { position: relative; }
.global-search input {
  width: 270px; padding: .5rem .8rem; border-radius: 999px;
  background: #0c1729; color: var(--text);
  border: 1px solid var(--line); outline: none;
}
.global-search input:focus { border-color: var(--accent-2); }

.search-results {
  position: absolute; top: calc(100% + .4rem); right: 0; width: 460px; max-height: 60vh;
  overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,.55); padding: .4rem;
}
.search-results .sr {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: .55rem .7rem; border-radius: 9px; cursor: pointer;
}
.search-results .sr:hover { background: var(--panel-2); }
.search-results .sr b { display: block; font-weight: 600; }
.search-results .sr span { color: var(--muted); font-size: .84em; }
.search-results .srhead { padding: .5rem .7rem .2rem; color: var(--muted); font-size: .76em; text-transform: uppercase; letter-spacing: .08em; }

.tool-btn {
  background: #0c1729; border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: .42rem .7rem; cursor: pointer; font-weight: 700;
}
.tool-btn:hover { color: var(--text); }
body.present .tool-btn { background: var(--accent); color: #06240f; border-color: var(--accent); }


/* ───────────────────────────────── Ansichten ───────────────────────────── */

/* --kopf wird in app.js aus der tatsächlichen Höhe der Kopfzeile gesetzt –
   die bricht bei schmalen Fenstern um und ist dann höher. */
.view {
  display: none;
  /* --kopf und --buehne werden in app.js aus den tatsächlichen Höhen gesetzt.
     Die Untergrenze verhindert, dass die Ansicht bei kleinen Fenstern und
     eingeschaltetem Vortragsmodus auf null zusammenfällt. */
  height: max(240px, calc(100vh - var(--kopf, 58px) - var(--buehne, 0px)));
}
.view.is-active { display: flex; }

.scroller { flex: 1; overflow-y: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.4rem 5rem; }

/* ───────────────────────────────── Karte ───────────────────────────────── */

.mapside {
  width: 320px; flex: none; min-height: 0; overflow-y: auto;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 1rem;
}
.mapwrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; background: #0a1120; }
/* Bei heller Hintergrundkarte volle Farbigkeit – nichts abdunkeln, nichts ausbleichen */
body.karte-hell #map { background: #eef1f5; }

.mapnote {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: rgba(11,18,32,.92); border: 1px solid var(--line);
  border-radius: 9px; font-size: .78rem; color: var(--muted);
  max-width: 46ch; backdrop-filter: blur(6px);
}
.mapnote > summary {
  list-style: none; cursor: pointer; padding: .35rem .7rem; user-select: none; white-space: nowrap;
}
.mapnote > summary::-webkit-details-marker { display: none; }
.mapnote > summary:hover { color: var(--text); }
.mapnote[open] > summary { border-bottom: 1px solid var(--line); }
.mapnote > div { padding: .55rem .7rem; }
body.karte-hell .mapnote { background: rgba(255,255,255,.94); color: #33425c; border-color: #c8d2e2; }
body.karte-hell .mapnote > summary:hover { color: #0f172a; }
body.karte-hell .mapnote b { color: #0f172a; }

.panel { margin-bottom: 1.3rem; }
.panel h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .6rem; }

.layerlist { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .5rem; }
.lyr {
  display: flex; align-items: center; gap: .55rem; padding: .34rem .45rem;
  border-radius: 8px; cursor: pointer; user-select: none;
}
.lyr:hover { background: rgba(255,255,255,.05); }
.lyr input { accent-color: var(--accent); margin: 0; }
.lyr .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.lyr .nm { flex: 1; }
.lyr .ct { color: var(--muted); font-size: .82em; font-variant-numeric: tabular-nums; }
.lyr.off .nm, .lyr.off .ct { opacity: .45; }

.switch { display: flex; align-items: center; gap: .55rem; padding: .34rem .45rem; cursor: pointer; border-radius: 8px; }
.switch:hover { background: rgba(255,255,255,.05); }
.switch input { accent-color: var(--accent); margin: 0; }
.switch em { color: var(--muted); font-style: normal; font-size: .82em; }

input[type=range] { width: 100%; accent-color: var(--accent); }
.rangeout { font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.rangeout b { color: var(--text); }

select {
  width: 100%; padding: .5rem .6rem; border-radius: 10px;
  background: #0c1729; color: var(--text); border: 1px solid var(--line);
}

.blstats { margin-top: .7rem; display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; }
.blstats .row { display: flex; justify-content: space-between; gap: .6rem; padding: .25rem .1rem; border-bottom: 1px dashed rgba(255,255,255,.07); }
.blstats .row b { font-variant-numeric: tabular-nums; }

.legend-sizes { display: flex; gap: .9rem; align-items: center; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend-sizes i { display: inline-block; background: var(--accent-2); border-radius: 50%; vertical-align: middle; margin-right: .3rem; opacity: .7; }
.legend-sizes i.ring { background: none; border: 1.5px solid var(--accent-2); opacity: .9; }

/* Leaflet-Popup im dunklen Look */
.leaflet-popup-content-wrapper {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
}
.leaflet-popup-tip { background: var(--panel); border: 1px solid var(--line); }
.leaflet-popup-content { margin: .8rem .95rem; font-size: .9rem; line-height: 1.55; }
.leaflet-popup-content h3 { font-size: 1rem; margin: 0 0 .35rem; }
.leaflet-popup-content .kv { color: var(--muted); }
.leaflet-popup-content .leistung { margin: .5rem 0 .35rem; }
.leaflet-popup-content .leistung b { font-size: 1.08em; }
.leaflet-popup-content .leistung .kv { display: block; font-size: .84em; }
/* fehlende Angabe: als Datenlücke kennzeichnen, nicht als Aussage */
.leaflet-popup-content .fehlt {
  margin: .5rem 0 .35rem; color: var(--muted); font-size: .86em; font-style: italic;
  border-left: 2px solid var(--line); padding-left: .55rem;
}
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel-2); }
.leaflet-control-attribution { background: rgba(11,18,32,.85) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--accent-2) !important; }

.bl-label {
  background: none; border: 0; box-shadow: none;
  color: rgba(232,238,251,.5); font-size: .72rem; font-weight: 600;
  text-shadow: 0 1px 3px #000; white-space: nowrap; pointer-events: none;
}

/* ───────────────────────────────── Karten/Cards ─────────────────────────── */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem;
}
.card h2 { font-size: 1.15rem; }
.card.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .card.two { grid-template-columns: 1fr; } }

.year { font-size: .72rem; font-weight: 500; color: var(--muted); background: var(--panel-2); padding: .15rem .55rem; border-radius: 999px; vertical-align: middle; margin-left: .4rem; }
.lead { color: var(--muted); margin: 0 0 1rem; }
.src { color: var(--muted); font-size: .8rem; margin: 1rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); }
.hint { color: var(--muted); font-size: .85rem; }
.big { font-size: 1.05rem; margin-top: .8rem; }
.big b { color: var(--accent); }

.hero-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.hero {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1.05rem 1.15rem;
}
.hero h3 { font-size: .98rem; margin-bottom: .4rem; }
.hero p { margin: 0; font-size: .89rem; color: var(--muted); }

/* Balken */
.bars { display: flex; flex-direction: column; gap: .55rem; }
.bar { display: grid; grid-template-columns: minmax(130px, 30%) 1fr auto; gap: .8rem; align-items: center; font-size: .9rem; }
.bar .lb { color: var(--text); }
.bar .tr { display: block; background: rgba(255,255,255,.07); border-radius: 999px; height: 15px; overflow: hidden; position: relative; }
.bar .fl { display: block; height: 100%; min-width: 3px; border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.3,1); }
.bar .vl { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 72px; text-align: right; }
.bars.co2 .bar .vl { min-width: 92px; }
.bar .fl.range { background: linear-gradient(90deg, rgba(255,255,255,.25), currentColor); }

.mixgrid { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: center; }
@media (max-width: 760px) { .mixgrid { grid-template-columns: 1fr; } }
.donut { display: block; margin: 0 auto; }
.donut-mid { fill: var(--text); font-weight: 700; }
.donut-sub { fill: var(--muted); font-size: 11px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(255,255,255,.03); }

.deflist { display: flex; flex-direction: column; gap: .8rem; }
.deflist .df { border-left: 2px solid var(--line); padding-left: .9rem; }
.deflist .df b { display: block; }
.deflist .df span { color: var(--muted); font-size: .9rem; }

.techgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.tech { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; border-top: 3px solid var(--line); }
.tech h3 { font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.tech h3 small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.tech dl { margin: .5rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .85rem; }
.tech dt { color: var(--muted); }
.tech dd { margin: 0; }
.tech .note { margin: .7rem 0 0; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .6rem; }

/* ───────────────────────────────── Wiki ────────────────────────────────── */

.intro .filterbar { display: flex; flex-direction: column; gap: .8rem; }
.filterbar input {
  width: 100%; padding: .7rem .9rem; border-radius: 11px; font-size: 1rem;
  background: #0c1729; color: var(--text); border: 1px solid var(--line); outline: none;
}
.filterbar input:focus { border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: .3rem .8rem; border-radius: 999px; cursor: pointer; font-size: .84rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: #0b1220; border-color: var(--text); font-weight: 600; }

.wikimeta { margin-top: .9rem; font-size: .84rem; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--accent-2); cursor: pointer; padding: 0; text-decoration: underline; }

.wikilist { display: flex; flex-direction: column; gap: .8rem; }

.entry { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.entry.open { border-color: var(--accent); }
.entry > summary {
  list-style: none; cursor: pointer; padding: 1rem 1.2rem;
  display: grid; grid-template-columns: 4px 1fr auto; gap: .9rem; align-items: start;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary:hover { background: var(--panel-2); }
.entry .katbar { width: 4px; align-self: stretch; border-radius: 2px; min-height: 100%; }
.entry .q { font-weight: 600; font-size: 1.02rem; }
.entry .claim { color: var(--muted); font-size: .86rem; margin-top: .2rem; }
.entry .chev { color: var(--muted); transition: transform .2s; }
.entry[open] .chev { transform: rotate(180deg); }

.entry-body { padding: 0 1.2rem 1.3rem 2.1rem; }

.answer { border-left: 3px solid var(--accent); background: rgba(74,222,128,.07); padding: .85rem 1rem; border-radius: 0 10px 10px 0; margin-bottom: 1.1rem; }
.answer .tagline { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin-bottom: .3rem; }
.answer p { margin: 0; font-size: 1.02rem; }

.longtext { font-size: .95rem; }
.longtext p { margin: 0 0 .85rem; }
.longtext strong { color: #fff; }
.longtext table { margin: .6rem 0 1rem; }
.longtext ol, .longtext ul { margin: 0 0 .85rem; padding-left: 1.3rem; }
.longtext li { margin-bottom: .3rem; }

.admit { border-left: 3px solid var(--pv); background: rgba(250,204,21,.07); padding: .8rem 1rem; border-radius: 0 10px 10px 0; margin: 1.1rem 0; }
.admit .tagline { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--pv); font-weight: 700; margin-bottom: .3rem; }
.admit p { margin: 0; font-size: .93rem; }

.facts { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0; }
.facts span { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .7rem; font-size: .84rem; font-variant-numeric: tabular-nums; }

.entry-src { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .7rem; }
.entry-src a { margin-right: .8rem; display: inline-block; }

.quellen { display: flex; flex-direction: column; gap: .1rem; }
.qrow { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .65rem .3rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.qrow a { font-weight: 500; }
.qrow .st { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ──────────────────────── Wirkungsprofil (Overlay) ─────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(4, 9, 18, .72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3vh 1rem;
}
.overlay[hidden] { display: none; }

.overlay-box {
  position: relative; width: min(860px, 100%); max-height: 94vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 40px 90px rgba(0,0,0,.6); padding: 1.6rem 1.8rem 2.4rem;
}
.overlay-zu {
  position: sticky; float: right; top: .3rem; z-index: 2; margin-left: 1rem;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1.2rem; line-height: 1;
  box-shadow: 0 6px 18px rgba(4, 9, 18, .75);
}
.overlay-zu:hover { color: var(--text); background: var(--panel-2); }

#profilInhalt > h2 { font-size: 1.5rem; margin-bottom: .2rem; padding-right: 3rem; }
#profilInhalt > .lead { margin-bottom: 1.2rem; }

.pblock { margin-bottom: 1.6rem; }
.pblock h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: .45rem; margin-bottom: .9rem;
}
.pblock h4 { font-size: .92rem; margin: 1.1rem 0 .4rem; }
.pblock.methode h3 { color: var(--muted); }
.pblock.methode { opacity: .85; font-size: .92em; }

.kzgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: .7rem; }
.kz {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2); border-radius: 10px; padding: .65rem .85rem;
}
.kz-l { display: block; font-size: .78rem; color: var(--muted); }
.kz-w { display: block; font-size: 1.22rem; font-weight: 650; font-variant-numeric: tabular-nums; margin: .1rem 0; }
.kz-z { display: block; font-size: .78rem; color: var(--muted); line-height: 1.4; }

.pfazit {
  margin: .9rem 0 0; padding: .75rem .95rem; font-size: .95rem;
  background: rgba(74,222,128,.09); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
.pfazit b { color: #fff; }

.stufen { display: flex; flex-direction: column; gap: .8rem; }
.stufe { border-left: 2px solid var(--line); padding-left: .95rem; }
.stufe b { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stufe p { margin: .2rem 0 0; font-size: .93rem; }

.risiken { margin: 0; padding-left: 1.2rem; font-size: .92rem; color: var(--muted); }
.risiken li { margin-bottom: .35rem; }

.uebersehen {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: .9rem 1.05rem; margin-bottom: .8rem;
}
.uebersehen > b { display: block; margin-bottom: .35rem; }
.uebersehen p { margin: 0; font-size: .93rem; color: var(--muted); }
.uebersehen .facts { margin: .7rem 0 0; }
.uebersehen .src { margin-top: .7rem; }

.profil-btn {
  display: block; width: 100%; margin-top: .8rem;
  background: var(--accent); color: #06240f; border: 0; border-radius: 9px;
  padding: .5rem .7rem; font-weight: 650; font-size: .86rem; cursor: pointer; text-align: left;
}
.profil-btn:hover { filter: brightness(1.08); }

.leaflet-popup-content .leistung.ist-schaetzung b { border-bottom: 2px dotted var(--pv); }

/* Kennzeichnung für nicht offizielle, aus der Lage gebildete Bezeichnungen */
.namensmarke {
  display: inline-block; vertical-align: middle; margin-left: .4rem; cursor: help;
  font-size: .58rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .1rem .45rem;
}
.namenshinweis {
  margin: -.5rem 0 1rem; padding-left: .7rem; border-left: 2px solid var(--line);
}

/* ─────────────────────────── Ortsabfrage / Szenario ────────────────────── */

.punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .45rem; vertical-align: baseline; }

.panel.tipp {
  background: rgba(74,222,128,.07); border: 1px solid rgba(74,222,128,.25);
  border-radius: 11px; padding: .8rem .9rem;
}
.panel.tipp h2 { color: var(--accent); margin-bottom: .4rem; }
.panel.tipp p { margin: 0 0 .4rem; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.panel.tipp p:last-child { margin-bottom: 0; }
.panel.tipp b { color: var(--text); }

.fehlt-gross { color: var(--muted); font-style: italic; border-left: 2px solid var(--line); padding-left: .9rem; margin: 0; }

.deckung { display: flex; flex-direction: column; gap: 1rem; }
.dz { display: grid; gap: .3rem; }
.dz-l { font-size: .85rem; color: var(--muted); }
.dz-w { font-size: .95rem; }
.dz-w b { font-size: 1.15rem; color: var(--text); }
.dz-z { font-size: .78rem; color: var(--muted); }
.obar { display: block; height: 14px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.obar > span { display: block; height: 100%; border-radius: 999px; transition: width .4s cubic-bezier(.2,.8,.3,1); }

.regler { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: .5rem; }
.regler label { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.regler label > span { color: var(--muted); }
.regler input {
  width: 84px; padding: .4rem .55rem; border-radius: 9px; font-size: 1rem;
  background: #0c1729; color: var(--text); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.regler input:focus { outline: none; border-color: var(--accent); }
.regler em { font-style: normal; color: var(--muted); font-size: .85rem; }

/* ───────────────────────────────── Loader ──────────────────────────────── */

.loader { position: fixed; inset: 0; background: var(--bg); display: grid; place-content: center; justify-items: center; gap: 1rem; z-index: 9999; }
.loader.hide { display: none; }
.loader p { color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.errorbox { max-width: 620px; text-align: left; background: var(--panel); border: 1px solid var(--gas); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.errorbox code { background: #0c1729; padding: .15rem .4rem; border-radius: 5px; display: inline-block; }
.errorbox pre { background: #0c1729; padding: .8rem; border-radius: 9px; overflow-x: auto; }

/* ─────────────────── Bundesland-Mix und Europavergleich ────────────────── */

.stapel { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.07); }
.stapel > span { display: block; height: 100%; }

.blmix { display: flex; flex-direction: column; gap: 1.1rem; }
.blm-kopf { display: flex; align-items: baseline; flex-wrap: wrap; gap: .6rem; margin-bottom: .35rem; font-size: .9rem; }
.blm-wert { color: var(--muted); font-variant-numeric: tabular-nums; }
.blm-posten { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .4rem; font-size: .78rem; color: var(--muted); }
.blm-posten span { display: inline-flex; align-items: center; gap: .3rem; }
.blm-posten i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.blm-posten b { color: var(--text); font-variant-numeric: tabular-nums; }

.eu-schalter { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.eu { display: flex; flex-direction: column; gap: .5rem; }
.eu-zeile {
  display: grid; grid-template-columns: 110px 1fr 74px 74px 62px; gap: .7rem;
  align-items: center; font-size: .85rem; padding: .3rem .4rem; border-radius: 8px;
}
.eu-zeile.hervor { background: rgba(74,222,128,.1); outline: 1px solid rgba(74,222,128,.3); }
.eu-zeile.hervor .eu-land { color: var(--accent); font-weight: 650; }
.eu-wert { text-align: right; font-variant-numeric: tabular-nums; }
.eu-wert em { display: block; font-style: normal; font-size: .68rem; color: var(--muted); }

/* ──────────────────────────── Vortragsleiste ───────────────────────────── */

.buehne {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1rem;
  background: linear-gradient(180deg, rgba(11,18,32,.9), var(--bg));
  border-top: 1px solid var(--accent);
  box-shadow: 0 -14px 40px rgba(4,9,18,.6);
}
.buehne[hidden] { display: none; }
.buehne-mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.buehne-mitte b { font-size: 1.15rem; }
.buehne-zaehler {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.buehne-text { font-size: .9rem; color: var(--muted); }
.buehne-btn {
  flex: none; width: 46px; height: 46px; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 1.5rem; line-height: 1;
}
.buehne-btn:hover { border-color: var(--accent); color: var(--accent); }
.buehne-aus { width: 38px; height: 38px; font-size: 1rem; color: var(--muted); }

/* Im Vortrag stört alles, was nicht der Inhalt ist. */
body.buehne-an .brand-sub,
body.buehne-an .global-search,
body.buehne-an .mapnote { display: none; }
body.buehne-an .tab { font-size: 1.02rem; }
/* Die Kopfzeile darf im Vortrag nicht mitwachsen, sonst bleibt für die Karte
   auf kleinen Bildschirmen nichts übrig. */
body.buehne-an .topbar { font-size: 15px; }
body.buehne-an .brand h1 { font-size: 1rem; }

/* ──────────────────────── Schmale Fenster / Beamer ─────────────────────── */
/* Muss am Ende stehen, damit diese Regeln die Grundregeln überschreiben. */

@media (max-width: 1180px) {
  .brand-sub { display: none; }
  .global-search input { width: 200px; }
}

@media (max-width: 980px) {
  .topbar { gap: .6rem; }
  .brand h1 { font-size: .95rem; }
  .tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .topbar-tools { margin-left: auto; }
  .global-search input { width: 190px; }
  .search-results { width: min(92vw, 460px); }
  .mapside { width: 264px; }
  .wrap { padding: 1.2rem 1rem 4rem; }
}

@media (max-width: 720px) {
  .view.is-active { flex-direction: column; }
  .eu-zeile { grid-template-columns: 88px 1fr 58px; font-size: .78rem; }
  .eu-zeile .eu-wert:nth-of-type(3), .eu-zeile .eu-wert:nth-of-type(4) { display: none; }
  .buehne { flex-wrap: wrap; padding: .5rem .7rem; }
  .buehne-mitte { order: -1; width: 100%; }
  .buehne-btn { width: 52px; }
  /* Am Handy zählt die Karte – die Seitenleiste bekommt weniger Platz und
     der lange Erklärtext des Tipps entfällt. */
  .mapside { flex-basis: 34%; }
  .panel.tipp p:first-of-type { font-size: .8rem; }
  .panel.tipp p:last-child { display: none; }
  .wrap { padding: 1rem .8rem 3rem; }
  .jv-legende { font-size: .74rem; }
  .kzgrid { grid-template-columns: 1fr; }
  .overlay { padding: 0; }
  .overlay-box { max-height: 100vh; border-radius: 0; padding: 1.1rem 1rem 2rem; }
  .regler { gap: .5rem; }
  .regler label { flex: 1 1 42%; }
  .regler input { width: 100%; }
  /* min-height:0 ist Pflicht – sonst wächst die scrollbare Seitenleiste
     auf ihre Inhaltshöhe und schiebt die Karte aus dem Bild. */
  .mapside {
    width: 100%; flex: 0 0 40%; min-height: 0;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .mapwrap { flex: 1 1 60%; min-height: 0; }
  .card.two { grid-template-columns: 1fr; }
  .bar { grid-template-columns: minmax(96px, 40%) 1fr auto; font-size: .82rem; }
  .entry-body { padding-left: 1.2rem; }
}

/* ───────────────────────────────── Druck ───────────────────────────────── */

@media print {
  :root { --bg: #fff; --panel: #fff; --panel-2: #f4f6fa; --line: #ccd4e2; --text: #10161f; --muted: #4b5a72; }
  html, body { overflow: visible; height: auto; background: #fff; color: #10161f; }
  .topbar, .mapside, .loader, .wikimeta, .filterbar, #view-karte, .chev { display: none !important; }
  .view { display: block !important; height: auto; }
  .scroller { overflow: visible; }
  .card, .entry { break-inside: avoid; border: 1px solid #ccd4e2; }
  /* auch zugeklappte Einträge mitdrucken */
  details > *:not(summary) { display: block !important; }
  .entry-body { display: block !important; }
  .answer { background: #f0fdf4; }
  .admit { background: #fefce8; }
  a { color: #10161f; text-decoration: underline; }
  .entry-src a::after { content: " (" attr(href) ")"; font-size: .8em; color: #4b5a72; }

  /* Neue Blöcke im Handout: nicht mitten im Element umbrechen, Diagramm
     bleibt lesbar, Bedienelemente entfallen. */
  .jv-schalter, .eu-schalter, .tech-mehr, .profil-btn, .regler, .overlay, .buehne { display: none !important; }
  .eu-zeile, .blm { break-inside: avoid; }
  .stapel { border: 1px solid #ccd4e2; }
  .jv-svg { max-width: 100%; }
  .jv-last { stroke: #10161f !important; }
  .jv-achse { fill: #4b5a72 !important; }
  .jv-gitter { stroke: #ccd4e2 !important; }
  .ziel, .uebersehen, .kz, .hero, .tech { break-inside: avoid; }
  .kernbox { background: #f0fdf4; break-inside: avoid; }
  .obar { border: 1px solid #ccd4e2; }
  .ziel-status.gut { background: #dcfce7; color: #166534; }
  .ziel-status.schlecht { background: #fee2e2; color: #991b1b; }
}

/* ─────────────────────── Jahresverlauf der Erzeugung ───────────────────── */

.jv-schalter { display: flex; gap: .4rem; margin-bottom: .8rem; }
.jvbtn {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: .28rem .8rem; border-radius: 999px; cursor: pointer; font-size: .84rem;
  font-variant-numeric: tabular-nums;
}
.jvbtn:hover { color: var(--text); }
.jvbtn.on { background: var(--accent); color: #06240f; border-color: var(--accent); font-weight: 650; }

.jv-svg { width: 100%; height: auto; display: block; }
.jv-gitter { stroke: var(--line); stroke-width: 1; opacity: .5; }
.jv-achse { fill: var(--muted); font-size: 11px; }
.jv-last { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linejoin: round; opacity: .95; }

.jv-legende { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .8rem; font-size: .82rem; color: var(--muted); }
.jv-leg { display: inline-flex; align-items: center; gap: .4rem; }
.jv-leg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.jv-leg i.linie { height: 0; border-top: 2.5px solid var(--text); border-radius: 0; width: 16px; }

/* ───────────────────────────── Ausbauziele ─────────────────────────────── */

.ziele { display: flex; flex-direction: column; gap: 1.1rem; }
.ziel-kopf { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin-bottom: .35rem; }
.ziel-wert { color: var(--muted); font-variant-numeric: tabular-nums; }
.ziel-status { font-size: .74rem; padding: .1rem .55rem; border-radius: 999px; font-weight: 600; }
.ziel-status.gut { background: rgba(74,222,128,.16); color: var(--accent); }
.ziel-status.schlecht { background: rgba(248,113,113,.16); color: var(--gas); }
.ziel-text { margin: .4rem 0 0; font-size: .89rem; color: var(--muted); }

/* ───────────────────────── Strompreis / Kernbox ────────────────────────── */

.untertitel { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.6rem 0 .7rem; }
.kernbox {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1rem 1.15rem;
}
.kb-l { display: block; font-size: .78rem; color: var(--muted); }
.kb-w { display: block; font-size: 1.6rem; font-weight: 700; margin: .15rem 0 .4rem; }
.kb-z { display: block; font-size: .88rem; color: var(--muted); line-height: 1.5; }

.tech-mehr {
  display: block; width: 100%; margin-top: .8rem;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: .45rem .7rem; font-size: .82rem; cursor: pointer; text-align: left;
}
.tech-mehr:hover { border-color: var(--accent); color: var(--accent); }

/* ────────────────────────────── Netz-Auswahl ───────────────────────────── */
.switch.netzwahl { display: block; padding: .34rem .45rem; }
.switch.netzwahl > span { display: block; margin-bottom: .3rem; }
.netzlegende { display: flex; flex-direction: column; gap: .3rem; padding: .5rem .55rem; margin-top: .3rem;
  background: rgba(255,255,255,.04); border-radius: 8px; font-size: .78rem; color: var(--muted); }
.netzlegende .nl { display: flex; align-items: center; gap: .5rem; }
.netzlegende .nl i { display: inline-block; width: 22px; border-radius: 2px; flex: none; }
