/* Layout: eine ruhige Spalte fürs Handy/Tablet, große Schrift, oben das Haus, darunter "reicht's?", dann Bausteine und Belege */
:root {
  --bg: #f2f4f3;          /* helles Deichgrau */
  --surface: #ffffff;
  --ink: #1d2a2e;         /* Schiefer */
  --muted: #56666b;
  --line: #d6dddb;
  --accent: #1f5f73;      /* Rheinblau */
  --accent-soft: #e3eef1;
  --brick: #8c4a36;       /* Niederrhein-Klinker, nur fürs Haus */
  --roof: #3c4a4e;
  --ok: #2e7d4f;  --ok-soft: #e4f2ea;
  --warn: #9a6200; --warn-soft: #fbf0d9;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --fs: 18px;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141c1e; --surface: #1c2629; --ink: #e8eeee; --muted: #a3b2b5; --line: #2f3c40;
  --accent: #7cc3d6; --accent-soft: #1f343a; --brick: #b56a52; --roof: #6d7f84;
  --ok: #6fcf97; --ok-soft: #1c3326; --warn: #f0b54a; --warn-soft: #3a2e15; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141c1e; --surface: #1c2629; --ink: #e8eeee; --muted: #a3b2b5; --line: #2f3c40;
  --accent: #7cc3d6; --accent-soft: #1f343a; --brick: #b56a52; --roof: #6d7f84;
  --ok: #6fcf97; --ok-soft: #1c3326; --warn: #f0b54a; --warn-soft: #3a2e15; color-scheme: dark; }
:root.gross { --fs: 21px; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--fs); line-height: 1.5; }
.wrap { max-width: 720px; margin: 0 auto; padding-block: 12px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px; }
h1, h2 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; margin: 0; line-height: 1.15; }
h1 { font-size: 1.75em; }
h2 { font-size: 1.3em; }
p { margin: 0; }
.muted { color: var(--muted); }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
button, summary { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Kopfzeile */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wer { font-size: .85em; color: var(--muted); }
.wer b { color: var(--ink); }
.btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; min-height: 44px; }
.btn:hover { border-color: var(--accent); }
.entwurf { font-size: .75em; letter-spacing: .06em; text-transform: uppercase; color: var(--warn);
  background: var(--warn-soft); padding: 3px 10px; border-radius: 999px; font-weight: 700; }

/* Haus */
.haus { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.foto { aspect-ratio: 16 / 9; max-width: 100%; width: 100%; background: var(--accent-soft); position: relative; display: grid; place-items: center; }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto svg { width: 46%; max-width: 280px; height: auto; }
.foto .hinweis { position: absolute; left: 12px; bottom: 10px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8em; color: var(--muted); }
.haus-text { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; }

/* Ampel */
.ampel { border-radius: var(--radius); padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; border: 2px solid var(--warn); background: var(--warn-soft); }
.ampel .status { display: flex; gap: 12px; align-items: flex-start; }
.punkt { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--warn); margin-top: 4px; }
.ampel h2 { font-size: 1.25em; }
.vergleich { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: .95em; }
.vergleich .zahl { text-align: right; font-weight: 700; }
.balken { height: 14px; background: var(--surface); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.balken span { display: block; height: 100%; background: var(--warn); }

/* Strompreis */
.strom { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.strom svg { flex: none; width: 34px; height: 34px; }
.strom .preis { font-size: 1.35em; font-weight: 700; }
.strom .klein { font-size: .8em; color: var(--muted); }

/* Kostenbausteine */
.bausteine { display: flex; flex-direction: column; gap: 10px; }
details.baustein { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.baustein[open] { border-color: var(--accent); }
details.baustein summary { list-style: none; cursor: pointer; padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
details.baustein summary::-webkit-details-marker { display: none; }
.b-name { font-weight: 700; }
.b-betrag { font-weight: 700; text-align: right; }
.b-leiste { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.b-leiste span { display: block; height: 100%; background: var(--accent); }
.b-monat { grid-column: 1 / -1; font-size: .8em; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.b-monat .mehr::after { content: " ▾"; }
details[open] .b-monat .mehr::after { content: " ▴"; }
.b-detail { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; font-size: .92em; border-top: 1px solid var(--line); padding-top: 14px; margin: 0 0 0; }
.rechnung { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.rechnung .zahl { text-align: right; }
.rechnung .summe { font-weight: 700; border-top: 1px solid var(--line); padding-top: 4px; }
.b-detail .belege { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .85em; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--bg); color: var(--ink); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

/* Abrechnung */
.abrechnung { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.abrechnung .rechnung { font-size: 1em; }
.abrechnung .ergebnis { font-size: 1.15em; }

/* Dokumente */
.ordner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pfad { padding: 12px 18px; font-size: .8em; color: var(--muted); background: var(--accent-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pfad code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); overflow-wrap: anywhere; }
.gruppe { padding: 10px 18px 4px; font-size: .75em; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.doc { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: var(--ink); cursor: pointer; }
.doc:hover { background: var(--bg); }
.doc svg { width: 26px; height: 30px; }
.doc .titel { min-width: 0; }
.doc .titel small { display: block; color: var(--muted); font-size: .8em; }
.status-ok { color: var(--ok); font-size: .8em; font-weight: 700; white-space: nowrap; }
.status-folgt { color: var(--warn); font-size: .8em; font-weight: 700; white-space: nowrap; }
.doc[aria-disabled="true"] { cursor: default; }
.doc[aria-disabled="true"] .titel { color: var(--muted); }
.meldung { margin: 0 18px 14px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: .85em; }

footer { font-size: .8em; color: var(--muted); text-align: center; display: flex; flex-direction: column; gap: 4px; }
@media (prefers-reduced-motion: no-preference) { details.baustein, .btn, .chip { transition: border-color .15s; } }

/* ── Ergänzungen fürs echte Portal ── */
.ampel.gut { border-color: var(--ok); background: var(--ok-soft); } .ampel.gut .punkt, .ampel.gut .balken span { background: var(--ok); }
.login { max-width: 420px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; display: flex; flex-direction: column; gap: 16px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.login input { font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); min-height: 48px; }
.btn.haupt { background: var(--accent); color: var(--surface); border-color: var(--accent); font-weight: 700; }
.fehler { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
a.doc { text-decoration: none; }
.leer { padding: 16px 18px; color: var(--muted); border-top: 1px solid var(--line); }
table.ueb { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.ueb th, table.ueb td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.ueb td.zahl, table.ueb th.zahl { text-align: right; }
table.ueb a { color: var(--accent); font-weight: 700; }
.tabwrap { overflow-x: auto; }
.jahre { display: flex; gap: 8px; flex-wrap: wrap; }
.jahre a { text-decoration: none; }
.jahre a[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
form.inline { display: inline; }

/* ── Zugänge ── */
.erfolg { background: var(--ok-soft); color: var(--ink); border: 1.5px solid var(--ok); padding: 12px 16px; border-radius: 10px; }
section.erfolg { display: flex; flex-direction: column; gap: 6px; }
.pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.4em; font-weight: 700; letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }
.zeile { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spalte { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.wahl { display: flex; gap: 8px; align-items: center; font-weight: 400; min-height: 36px; }
.wahl input { width: 22px; height: 22px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 12px; margin: 0; display: flex; flex-direction: column; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.feld { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.feld input, .feld select { font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); min-height: 48px; max-width: 100%; }
.feld small { font-weight: 400; }
.btn.gefahr { border-color: var(--warn); color: var(--warn); }
.wer a { color: var(--accent); }

/* ── QR-Code ── */
.qr-karte { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }
.qr-rahmen { background: #ffffff; padding: 10px; border-radius: 14px; width: min(100%, 380px); }
.qr { display: block; width: 100%; height: auto; max-width: 100%; }
.qr-link { align-self: stretch; text-align: left; }
.qr-link summary { cursor: pointer; color: var(--accent); font-weight: 700; }
