/* Wärmepumpen-Check – schlicht und sachlich */
:root {
  --text: #1f2328;
  --text-2: #57606a;
  --hinter: #ffffff;
  --flaeche: #f6f7f8;
  --linie: #d8dee4;
  --akzent: #1f6f5c;
  --akzent-hell: #e6f2ef;
  --alt: #8c959f;
  --neu: #b5651d;
  --wp: #1f6f5c;
  --gruen: #2e7d32;
  --gelb: #c49000;
  --rot: #c62828;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e6edf3; --text-2: #9da7b3; --hinter: #0f1419; --flaeche: #171d24;
    --linie: #2d3640; --akzent: #4fb39a; --akzent-hell: #16302a;
    --alt: #8b949e; --neu: #e0904a; --wp: #4fb39a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text: #e6edf3; --text-2: #9da7b3; --hinter: #0f1419; --flaeche: #171d24;
  --linie: #2d3640; --akzent: #4fb39a; --akzent-hell: #16302a;
  --alt: #8b949e; --neu: #e0904a; --wp: #4fb39a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--hinter); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
.rahmen { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.kopf { border-bottom: 1px solid var(--linie); padding: 28px 0 20px; }
.kopf h1 { font-size: 1.75rem; }
.untertitel { margin: 6px 0 0; color: var(--text-2); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 24px; padding-bottom: 40px; }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .ergebnis { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
}

/* Formular */
.abschnitt { border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.abschnitt h2 { font-size: 1.1rem; margin-bottom: 12px; }
details.abschnitt > summary { cursor: pointer; list-style: none; }
details.abschnitt > summary::-webkit-details-marker { display: none; }
details.abschnitt > summary h2 { display: inline; margin: 0; }
details.abschnitt > summary::after { content: " +"; color: var(--text-2); }
details.abschnitt[open] > summary::after { content: " −"; }
details.abschnitt[open] > summary { margin-bottom: 12px; }

.felder { display: grid; gap: 14px; }
@media (min-width: 560px) { .felder { grid-template-columns: 1fr 1fr; } }
.feld label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.feld-janein { align-self: end; }
.feld .check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.eingabe { display: flex; align-items: stretch; }
.eingabe input, .eingabe select {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--hinter);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 7px 9px;
}
.eingabe input { text-align: right; }
.eingabe input:has(+ .einheit) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.einheit {
  display: flex; align-items: center; padding: 0 9px; font-size: .85rem; color: var(--text-2);
  background: var(--flaeche); border: 1px solid var(--linie); border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; white-space: nowrap;
}
.eingabe input:focus, .eingabe select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
input.ungueltig { border-color: var(--rot); }
.hilfe { margin: 4px 0 0; font-size: .8rem; color: var(--text-2); }
.feld[hidden] { display: none; }

.knopf {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius);
  padding: 9px 16px; border: 1px solid var(--akzent); background: var(--akzent); color: #fff;
}
.knopf.zweitrangig { background: transparent; color: var(--text-2); border-color: var(--linie); font-weight: 400; }
.aktionen { margin: 16px 0 0; }

/* Ergebnis */
.ergebnis h3 { font-size: 1rem; margin: 24px 0 8px; }
.druckkopf { display: none; }
.fazit {
  display: flex; gap: 14px; padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--linie); border-left-width: 6px; background: var(--flaeche);
}
.fazit h2 { font-size: 1.15rem; }
.fazit p { margin: 6px 0 0; }
.ampel { flex: none; width: 22px; height: 22px; border-radius: 50%; margin-top: 2px; }
.fazit-gruen { border-left-color: var(--gruen); } .fazit-gruen .ampel { background: var(--gruen); }
.fazit-gelb  { border-left-color: var(--gelb); }  .fazit-gelb .ampel  { background: var(--gelb); }
.fazit-rot   { border-left-color: var(--rot); }   .fazit-rot .ampel   { background: var(--rot); }

.kennzahlen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0 0; }
@media (min-width: 560px) { .kennzahlen { grid-template-columns: repeat(4, 1fr); } }
.kennzahlen div { border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px; }
.kennzahlen dt { font-size: .78rem; color: var(--text-2); }
.kennzahlen dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.tabelle-rahmen { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.vergleich th, .vergleich td { padding: 7px 8px; border-bottom: 1px solid var(--linie); text-align: right; vertical-align: top; }
.vergleich thead th { font-weight: 600; font-size: .82rem; color: var(--text-2); }
.vergleich tbody th { text-align: left; font-weight: 400; }
.vergleich td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vergleich .wp { background: var(--akzent-hell); }
.vergleich .summe th, .vergleich .summe td { font-weight: 700; }
.klein { font-size: .82rem; color: var(--text-2); margin: 8px 0 0; }

.legende { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0 0 6px; font-size: .85rem; }
.legende li { display: flex; align-items: center; gap: 6px; }
.strich { display: inline-block; width: 18px; height: 0; border-top: 3px solid; }
.strich.l-alt { border-color: var(--alt); } .strich.l-neu { border-color: var(--neu); } .strich.l-wp { border-color: var(--wp); }
.strich.markierung { border-top: 2px dashed var(--text-2); }
.diagramm svg { width: 100%; height: auto; display: block; }
.diagramm .gitter { stroke: var(--linie); stroke-width: 1; }
.diagramm .achse { fill: var(--text-2); font-size: 12px; }
.diagramm .linie { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.diagramm .l-alt { stroke: var(--alt); } .diagramm .l-neu { stroke: var(--neu); } .diagramm .l-wp { stroke: var(--wp); }
.diagramm .markierung { stroke: var(--text-2); stroke-dasharray: 4 4; }

.hinweise { padding-left: 20px; margin: 0; font-size: .9rem; }
.hinweise li { margin-bottom: 6px; }
.rechenweg { margin-top: 24px; border-top: 1px solid var(--linie); padding-top: 12px; }
.rechenweg summary { cursor: pointer; font-weight: 600; }
.angaben { margin-top: 10px; font-size: .85rem; }
.angaben th, .angaben td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--linie); font-weight: 400; }
.angaben td { text-align: right; }
.angaben .gruppe th { font-weight: 600; padding-top: 12px; }
.fehler { color: var(--rot); }

.fuss { border-top: 1px solid var(--linie); color: var(--text-2); font-size: .85rem; padding: 16px 0 32px; }

/* Druck / PDF */
@media print {
  :root { --text: #000; --text-2: #444; --hinter: #fff; --flaeche: #f4f4f4; --linie: #bbb; --akzent-hell: #eef6f3; --wp: #1f6f5c; --neu: #b5651d; --alt: #888; }
  @page { margin: 15mm; }
  body { font-size: 11pt; }
  .kopf, .formular, .aktionen, .fuss { display: none !important; }
  .layout { display: block; padding: 0; }
  .ergebnis { position: static; max-height: none; overflow: visible; }
  .druckkopf { display: block; margin-bottom: 12px; }
  .druckkopf h1 { font-size: 18pt; }
  .druckkopf p { margin: 2px 0 0; color: var(--text-2); }
  .fazit, .kennzahlen, .vergleich, .block-diagramm { break-inside: avoid; }
  .rechenweg summary { list-style: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
