:root {
  --bg: #fffaf1;
  --bg-warm: #fff1d6;
  --surface: #ffffff;
  --surface-2: #fbf3e4;
  --text: #22201c;
  --text-muted: #5b5449;
  --border: #e6dac5;
  --accent: #a1500a;        /* Links, Schaltflächen: 5.9:1 auf Weiß */
  --accent-strong: #7a3c06;
  --on-accent: #ffffff;
  --sun: #f5b23c;
  --focus: #1c5cab;
  --site-public: #2a78d6;
  --site-big: #6a45b8;
  --district-line: #2f2b25;
  --area-line: #ffffff;
  --good: #2f7d4f;
  --shadow: 0 1px 2px rgb(60 40 10 / 0.06), 0 4px 16px rgb(60 40 10 / 0.07);
  --radius: 14px;
  --maxw: 1200px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a17;
    --bg-warm: #2a2418;
    --surface: #24221f;
    --surface-2: #2d2a26;
    --text: #f1ece3;
    --text-muted: #bdb5a7;
    --border: #48433b;
    --accent: #f5b867;
    --accent-strong: #fcd9a3;
    --on-accent: #1b1a17;
    --sun: #f5b867;
    --focus: #8fbdf3;
    --site-public: #6da7ec;
    --site-big: #b39cf0;
    --district-line: #f1ece3;
    --area-line: #24221f;
    --good: #7cc79a;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 2000;
  background: var(--surface); padding: 8px 12px; border-radius: var(--radius);
}
.skip:focus { top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 12px 20px; cursor: pointer;
  border-radius: 999px; border: 2px solid transparent; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-quiet {
  font: inherit; font-size: 0.95rem; padding: 6px 14px; cursor: pointer; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none;
}
.btn-quiet:hover { border-color: var(--accent); }

/* ---------- Kopfzeile ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.brand strong { color: var(--accent); }
.mainnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav a {
  padding: 6px 12px; border-radius: 999px; color: var(--text); text-decoration: none;
  font-size: 0.95rem; white-space: nowrap;
}
.mainnav a:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  html { scroll-padding-top: 100px; }
  .site-header { padding: 6px 12px; }
  .layers { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-inline-size: 0; min-width: 0; }
  .chip { white-space: nowrap; font-size: 0.85rem; padding: 5px 10px; }
  #map { height: 50vh; min-height: 300px; }
  .legend { bottom: 18px; font-size: 0.8rem; padding: 6px 8px; }
  .mainnav { width: 100%; margin: 0 -4px; }
  .mainnav a { padding: 4px 10px; font-size: 0.9rem; background: var(--surface-2); }
}

/* ---------- Einstieg ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--sun) 35%, transparent), transparent 55%),
    linear-gradient(180deg, var(--bg-warm), var(--bg));
  padding: 28px 16px 20px;
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center;
}
.hero-inner > * { min-width: 0; }
@media (min-width: 900px) {
  .hero { padding: 48px 24px 28px; }
  .hero-inner { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; }
}
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin: 0 0 12px; }
.lead { font-size: 1.1rem; color: var(--text-muted); margin: 0 0 20px; max-width: 46ch; }

.search label { display: block; font-weight: 600; margin-bottom: 6px; }
.search-row { display: flex; gap: 8px; max-width: 520px; }
.search input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 12px 18px;
  border: 2px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
}
.search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 40%, transparent); }
.search-msg { margin: 8px 0 0; font-size: 0.95rem; color: var(--text-muted); }
.search-msg:empty { display: none; }

.live-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 20px 18px 18px 92px; box-shadow: var(--shadow); min-height: 120px;
  overflow-wrap: anywhere;
}
.sun {
  position: absolute; left: 18px; top: 22px; width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, #ffe08a 0 40%, var(--sun) 41% 60%, transparent 61%);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--sun) 25%, transparent), 0 0 0 16px color-mix(in srgb, var(--sun) 12%, transparent);
}
.live-card.night .sun { background: radial-gradient(circle at 35% 35%, transparent 0 38%, #c9c3b6 39% 60%, transparent 61%); box-shadow: none; }
.live { margin: 0; }
.live-label { display: block; color: var(--text-muted); font-size: 0.95rem; }
.live-value { display: block; font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 700; line-height: 1.15; }
.live-extra { display: block; font-size: 0.95rem; margin-top: 2px; }
.live-note { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 6px; }

.stats {
  max-width: var(--maxw); margin: 24px auto 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
}
.stats li {
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
}
.stats .num-big { display: block; font-size: 1.35rem; font-weight: 700; }
.stats .num-label { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Abschnitte ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 36px 16px; }
@media (min-width: 900px) { .section { padding: 56px 24px; } }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 760px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 8px; }
.section-head p { margin: 0; color: var(--text-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--accent) !important; margin-bottom: 6px !important; }
.lead-small { font-size: 1.05rem; }
.subhead { font-size: 1.3rem; margin: 32px 0 14px; }
.small { font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Karte ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .map-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.mapcol { min-width: 0; }
.layers { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.92rem;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); flex: none; }
.dot-public { background: var(--site-public); }
.dot-big { background: var(--site-big); }
.line { width: 16px; border-top: 2px dashed var(--district-line); flex: none; }

.mapbox { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
#map { height: 62vh; min-height: 360px; max-height: 720px; background: var(--surface-2); }
@media (min-width: 900px) { #map { height: 640px; } }
.legend {
  position: absolute; left: 10px; bottom: 24px; z-index: 500;
  width: min(330px, calc(100% - 20px));
  padding: 8px 10px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); font-size: 0.85rem;
}
.legend h2 { font-size: 0.85rem; margin: 0 0 6px; font-weight: 600; }
.legend-scale { display: flex; gap: 3px; }
.legend-scale div { flex: 1; min-width: 0; }
.legend-scale .swatch { height: 12px; border-radius: 3px; }
.legend-scale .lbl { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 0.78rem; margin-top: 3px; white-space: nowrap; }
.map-hint {
  position: absolute; top: 10px; right: 10px; z-index: 500; margin: 0; max-width: calc(100% - 70px);
  background: var(--surface); color: var(--text-muted); font-size: 0.85rem; padding: 4px 12px;
  border-radius: 999px; border: 1px solid var(--border); pointer-events: none;
}

/* ---------- Infobox ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 4px; font-size: 1.35rem; }
.panel .sub { margin: 0 0 12px; color: var(--text-muted); font-size: 0.95rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.highlight {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); font-size: 0.98rem;
}
.highlight strong { font-size: 1.1rem; }
.howcalc { margin-top: 10px; font-size: 0.85rem; color: var(--text-muted); }
.howcalc summary { cursor: pointer; color: var(--accent); }
.howcalc p { margin: 6px 0 0; }
.panel .note { font-size: 0.85rem; color: var(--text-muted); margin: 10px 0 0; }
.panel .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.plz-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.plz-chips button { font: inherit; font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.cta {
  display: block; margin-top: 14px; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: color-mix(in srgb, var(--sun) 22%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--sun) 50%, var(--border));
}
.cta strong { color: var(--accent); }

/* ---------- Liste ---------- */
.list { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.list summary { cursor: pointer; font-weight: 600; }
.table-scroll { max-height: 380px; overflow: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { position: sticky; top: 0; background: var(--surface); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* ---------- Energy Sharing ---------- */
.how {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.how-step { display: flex; gap: 12px; align-items: flex-start; flex: 1; }
.how-step p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.how-step strong { color: var(--text); }
.how-icon { font-size: 1.8rem; line-height: 1; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); }
.how-arrow { text-align: center; color: var(--text-muted); font-size: 1.4rem; transform: rotate(90deg); }
@media (min-width: 760px) {
  .how { flex-direction: row; align-items: center; }
  .how-arrow { transform: none; }
}

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card h4 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-muted); }

.callout {
  margin-top: 20px; padding: 16px 18px; border-radius: var(--radius);
  border-left: 5px solid var(--sun); background: var(--surface-2);
}
.callout h4 { margin: 0 0 8px; font-size: 1.05rem; }
.callout ul { margin: 0; padding-left: 20px; }
.callout li + li { margin-top: 6px; }

/* ---------- Sparrechner ---------- */
.hero-links { margin: 14px 0 0; font-size: 0.98rem; }
.hero-links a { font-weight: 600; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 900px) { .calc { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; } }
.calc-form { display: grid; gap: 16px; }
.field label { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.field output { font-variant-numeric: tabular-nums; color: var(--accent); }
.field-hint { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.field input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.input-unit { display: flex; align-items: center; max-width: 260px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); overflow: hidden; }
.input-unit:focus-within { border-color: var(--accent); }
.input-unit input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.05rem; padding: 9px 12px; text-align: right; font-variant-numeric: tabular-nums; }
.input-unit input:focus { outline: none; }
.input-unit input[aria-invalid="true"] { background: color-mix(in srgb, #d33 12%, transparent); }
.input-unit span { padding: 0 12px; color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.preset { font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.preset:hover { border-color: var(--accent); }
.advanced { border-top: 1px solid var(--border); padding-top: 10px; }
.advanced summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.advanced .field + .field { margin-top: 16px; }
.calc-form > .btn-quiet { justify-self: start; }
.calc-result {
  background: var(--surface-2); border-radius: var(--radius); padding: 18px 20px;
  position: sticky; top: 80px;
}
.result-big { font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 700; margin: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result-big small { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.result-big.good { color: var(--good); }
.result-big.warn { color: var(--accent); }
.result-text { margin: 6px 0 14px; }
.bars { display: grid; gap: 8px; margin-bottom: 14px; }
.bar-row { display: grid; grid-template-columns: 8.5em 1fr auto; align-items: center; gap: 10px; font-size: 0.92rem; }
.bar-track { background: color-mix(in srgb, var(--border) 50%, transparent); border-radius: 4px; height: 14px; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 4px; }
.bar-now { background: color-mix(in srgb, var(--text-muted) 55%, transparent); }
.bar-new { background: var(--sun); }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 4.5em; text-align: right; }
.result-facts { margin: 0; padding-left: 18px; font-size: 0.95rem; }
.result-facts li + li { margin-top: 4px; }
.result-facts li:empty { display: none; }
.calc-note { margin-top: 16px; max-width: 80ch; }
.fair-price { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.fair-price:empty { display: none; }
.fair-price h3 { margin: 0 0 6px; font-size: 1.2rem; }
.fair-price > p { margin: 0 0 12px; max-width: 75ch; }
.fp-scale { position: relative; height: 18px; margin: 44px 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--border) 60%, transparent); }
.fp-zone { position: absolute; top: 0; bottom: 0; background: var(--good); border-radius: 999px; min-width: 4px; opacity: 0.85; }
.fp-mark { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--text); border-radius: 2px; }
.fp-mark span { position: absolute; bottom: calc(100% + 4px); font-size: 0.8rem; white-space: nowrap; color: var(--text-muted); }
.fp-lo span { right: 4px; }
.fp-hi span { left: 4px; }
.fp-hi { background: var(--accent); }
.fp-gap .fp-lo span { right: auto; left: 4px; }
.fp-gap .fp-hi span { left: auto; right: 4px; }
.fp-axis { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
@media (max-width: 899px) { .calc-result { position: static; } }
.cta-row { display: grid; gap: 8px; margin-top: 14px; }
.cta-row .cta { margin-top: 0; }

/* ---------- So geht's ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs [role="tab"] {
  font: inherit; font-weight: 600; padding: 10px 18px; cursor: pointer; border-radius: 999px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
}
.tabs [role="tab"][aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tabpane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tabpane h3 { margin: 0 0 12px; font-size: 1.15rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; } }

.checklist { list-style: none; padding: 0; margin: 0 0 10px; }
.checklist li { position: relative; padding-left: 32px; margin-bottom: 12px; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good);
}
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { position: relative; padding-left: 40px; margin-bottom: 14px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
  background: var(--accent); color: var(--on-accent);
}
.tip { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); font-size: 0.95rem; }

/* ---------- Fragen ---------- */
.faq { display: grid; gap: 8px; max-width: 860px; }


/* ---------- Fußzeile ---------- */
.foot { border-top: 1px solid var(--border); background: var(--surface); font-size: 0.85rem; color: var(--text-muted); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px 28px; }
.foot p { margin: 0 0 8px; max-width: 80ch; }
.sources { margin: 0 0 10px; padding-left: 18px; }
.legal { display: flex; gap: 16px; }
.noscript { padding: 16px; }

/* ---------- Leaflet ---------- */
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: 10px 12px; line-height: 1.4; font-size: 0.92rem; }
.leaflet-popup-content strong { display: block; }
.leaflet-tooltip { font: inherit; font-size: 0.85rem; }

@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
  .leaflet-container { background: #1b1a17; }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-tooltip,
  .leaflet-bar a, .leaflet-control-attribution { background: var(--surface) !important; color: var(--text) !important; }
  .leaflet-tooltip { border-color: var(--border); }
  .leaflet-control-attribution a { color: var(--accent) !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .dot, .legend-scale .swatch { forced-color-adjust: none; }
}

/* ---------- Unterseiten (Impressum, Datenschutz) ---------- */
.doc { max-width: 70ch; margin: 0 auto; padding: 16px; }
.doc h1 { font-size: 1.5rem; }
.doc h2 { font-size: 1.1rem; margin-top: 1.5em; }

/* ---------- Feinschliff: Layout und Bedienung ---------- */
.site-header { display: block; padding: 0; background: var(--surface); backdrop-filter: none; box-shadow: 0 1px 0 var(--border); border-bottom: 0; }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 8px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mainnav a[aria-current="true"] { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.hero { padding-left: 24px; padding-right: 24px; }

/* Abschnitte mit durchgehendem Hintergrundband gliedern die lange Seite. */
.section + .section { border-top: 0; }
.section.band { background: var(--surface); box-shadow: 0 0 0 100vmax var(--surface); clip-path: inset(0 -100vmax); }
.band .card, .band .how, .band .tabpane, .band .faq details { background: var(--bg); }
.band .callout, .band .tip { background: var(--bg-warm); }

.cta-row { grid-template-columns: 1fr 1fr; }
.cta { font-size: 0.92rem; padding: 10px 12px; }

.calc-sticky { display: none; }

@media (max-width: 640px) {
  html { scroll-padding-top: 64px; }
  .header-inner { padding: 6px 12px 6px 10px; gap: 8px; }
  .brand span { display: none; }
  .brand img { width: 30px; height: 30px; }
  .mainnav {
    width: auto; flex: 1; min-width: 0; margin: 0; justify-content: flex-start;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
            mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .mainnav a { padding: 6px 10px; font-size: 0.88rem; background: var(--surface-2); }

  .hero { padding: 22px 16px 18px; }
  .hero h1 { font-size: 1.7rem; }
  .lead { font-size: 1rem; margin-bottom: 16px; }
  .live-card { padding: 14px 14px 14px 70px; min-height: 0; }
  .sun { width: 38px; height: 38px; left: 16px; top: 18px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun) 25%, transparent), 0 0 0 10px color-mix(in srgb, var(--sun) 12%, transparent); }
  .live-value { font-size: 1.9rem; }
  .stats { margin-top: 16px; gap: 8px; }
  .stats li { padding: 8px 12px; }
  .stats .num-big { font-size: 1.15rem; }
  .stats .num-label { font-size: 0.82rem; line-height: 1.3; display: block; }

  .section { padding: 28px 16px; }
  .layers { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-inline-size: 0; min-width: 0; }
  .chip { white-space: nowrap; font-size: 0.85rem; padding: 5px 10px; }
  .map-hint { font-size: 0.78rem; padding: 3px 10px; }
  .legend { bottom: 30px; left: 8px; width: calc(100% - 16px); }
  .leaflet-control-attribution { font-size: 0.68rem; }
  .bar-row { grid-template-columns: 6.5em 1fr auto; }
  .panel { padding: 16px; }

  .tabs [role="tab"] { flex: 1 1 100%; text-align: left; padding: 10px 14px; }
  .tabpane { padding: 14px; }
  .calc-sticky {
    display: flex; justify-content: center; align-items: baseline; gap: 6px;
    position: sticky; bottom: 12px; z-index: 5; margin: 0 auto;
    padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 600;
    background: var(--text); color: var(--bg); box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
  }
  .calc-sticky .result-big { font-size: 1.1rem; color: inherit; }
  .calc-sticky small { color: inherit; font-weight: 400; }
}
/* Einstieg bündig mit Kopfzeile und Abschnitten (gleicher Innenabstand). */
@media (min-width: 641px) {
  .hero-inner, .stats { max-width: calc(var(--maxw) - 48px); }
}

/* ---------- Aufklappbare Elemente (FAQ, Liste, Annahmen) ---------- */
/* Eigenes Symbol statt Browser-Dreieck: sitzt immer im Kasten, überall gleich. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.faq, .list, .advanced, .howcalc { --chev: var(--accent); }
.faq summary, .list summary, .advanced summary, .howcalc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::after, .list summary::after, .advanced summary::after, .howcalc summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2.5px solid var(--chev); border-bottom: 2.5px solid var(--chev);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.15s ease;
}
details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.howcalc summary { justify-content: flex-start; }
.howcalc summary::after { width: 7px; height: 7px; border-width: 2px; }

.faq { display: grid; gap: 10px; max-width: 880px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.faq details:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.faq details[open] { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.faq summary { padding: 16px 18px; font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.faq summary:focus-visible { outline-offset: -3px; border-radius: 12px; }
.faq details > *:not(summary) { margin: 0; padding: 0 18px 16px; color: var(--text-muted); }
.faq details[open] summary { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  details > summary::after, .faq details { transition: none; }
}

.hero-eyebrow { margin: 0 0 8px; }

/* Marke: EnergySharing.app + Region */
.brand-name { white-space: nowrap; }
.brand-name strong { color: var(--accent); font-weight: 700; }
.brand-region {
  margin-left: 2px; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
@media (max-width: 640px) { .brand-name, .brand-region { display: none; } }

/* ---------- Pro-kWh-Vergleich im Rechner ---------- */
.kwh-title { margin: 18px 0 8px; font-size: 1rem; }
.kwh-stack { display: grid; gap: 8px; }
.kwh-row { display: grid; grid-template-columns: 8.5em 1fr 3.6em; align-items: center; gap: 10px; font-size: 0.92rem; }
.kwh-track { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--border) 40%, transparent); }
.kwh-part { display: block; height: 100%; }
.kwh-part + .kwh-part { border-left: 2px solid var(--surface-2); }
.kwh-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.k-energy { background: #9a8f7d; }
.k-sun { background: var(--sun); }
.k-service { background: #e5682a; }
.k-fix { background: color-mix(in srgb, var(--text-muted) 30%, var(--surface)); }
.kwh-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.kwh-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.kwh-note { margin: 10px 0 0; font-size: 0.92rem; }
.calc-warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #d33 12%, transparent); font-size: 0.92rem; }
@media (max-width: 640px) { .kwh-row { grid-template-columns: 6.5em 1fr 3.4em; } }

/* ---------- Teilen ---------- */
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.share-status { font-size: 0.88rem; color: var(--good); }
.share-status:empty { display: none; }
.panel .actions { align-items: center; }

/* =====================================================================
   Gestaltung: Schrift, Symbole, Skyline, Feinschliff
   ===================================================================== */
@font-face {
  font-family: "Figtree";
  src: url("vendor/figtree/figtree-latin-wght.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
body, button, input, select, textarea, .leaflet-container {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
h1, h2, h3, h4, .brand-name, .live-value, .result-big, .stats .num-big { letter-spacing: -0.02em; }
h1 { font-weight: 800; }
h2 { font-weight: 750; }

/* Symbole */
.ico {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ico-inline { width: 0.8em; height: 0.8em; vertical-align: 0; margin-left: 4px; }

/* Einstieg: Links als kleine Schaltflächen */
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--border);
  color: var(--accent); transition: border-color .15s ease, background .15s ease;
}
.hero-links a:hover { border-color: var(--accent); background: var(--surface); }
@media (max-width: 640px) { .hero-links { gap: 8px; } .hero-links a { padding: 6px 12px; font-size: 0.9rem; } }

.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); box-shadow: 0 2px 6px rgb(161 80 10 / 0.25); }
.btn-primary:hover { background: var(--accent-strong); }

/* Skyline mit Fernsehturm und Solardächern */
.hero { position: relative; overflow: hidden; padding-bottom: 84px; }
.hero-inner, .stats { position: relative; z-index: 1; }
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 96px; z-index: 0; pointer-events: none;
  background: url("icons/skyline.svg") repeat-x center bottom / auto 100%;
}
@media (prefers-color-scheme: dark) { .hero::after { opacity: 0.8; filter: brightness(1.6); } }
@media (max-width: 640px) { .hero { padding-bottom: 64px; } .hero::after { height: 64px; } }

/* "So funktioniert es" */
.how-icon {
  width: 52px; height: 52px; font-size: 26px; color: var(--accent);
  background: color-mix(in srgb, var(--sun) 28%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sun) 50%, transparent);
}
.how-arrow { display: grid; place-items: center; color: color-mix(in srgb, var(--accent) 60%, var(--border)); font-size: 22px; }

/* Vorteils-Karten */
.card { display: flex; flex-direction: column; gap: 4px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px;
  font-size: 22px; color: var(--accent); background: color-mix(in srgb, var(--sun) 26%, var(--surface));
}
.card h4 { margin-top: 0; }

/* Reiter und Teilen mit Symbolen */
.tabs [role="tab"] { display: inline-flex; align-items: center; gap: 8px; }
.share-btn .ico { font-size: 1.05em; }

/* Kennzahlen: dezente Akzentlinie */
.stats li { border-top: 3px solid color-mix(in srgb, var(--sun) 70%, var(--border)); }

@media (prefers-reduced-motion: reduce) {
  .card, .hero-links a { transition: none; }
  .card:hover { transform: none; }
}

/* 404-Seite */
.notfound { text-align: center; padding-top: 12vh; }
.notfound img { border-radius: 22px; box-shadow: var(--shadow); }
.notfound h1 { margin-top: 20px; }
.notfound-links { display: flex; gap: 10px; justify-content: center; align-items: stretch; flex-wrap: wrap; margin-top: 20px; }
.notfound-links a { display: inline-flex; align-items: center; padding: 10px 18px; }
