/* liquiditaet.css — „Wann wird das Konto knapp?“ (nur diese Seite).
   Richtung „Horizont“: heller, kühler Grund, tiefes Marineblau und Messing als Hausfarben,
   Lachsrot nur für „im Minus“ und immer mit Wort. Zahlen in IBM Plex Mono. Bewusst nur hell. */

@font-face { font-family: "Bricolage Grotesque"; src: url("../../schrift/muster/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../schrift/muster/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../schrift/muster/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../schrift/muster/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../schrift/muster/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../../schrift/muster/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../../schrift/muster/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root, :root[data-theme="light"] {
  color-scheme: light;
  --flaeche-0: #f2f5fa;          /* kühler, heller Grund */
  --flaeche-1: #ffffff;
  --flaeche-2: #e4eaf3;
  --linie: #c9d3e3;
  --raster: #e3e9f2;
  --text-1: #0f1d36;
  --text-2: #3a4862;
  --text-3: #5a6680;
  --akzent: #16305c;
  --akzent-text: #16305c;
  --marine: #16305c;
  --marine-2: #2f5390;
  --marine-hell: #d5e0f1;
  --messing: #b68a2f;
  --messing-tief: #7a5a12;
  --messing-hell: #efe1bf;
  --lachs: #e66f55;
  --lachs-tief: #ad3c25;
  --lachs-hell: #fbdcd3;
  /* feste Farben je Sache: Einnahmen Marine, Ausgaben Messing */
  --ein: #16305c; --aus: #b68a2f;
  --f1: #16305c; --f2: #7f9fd0; --f3: #b68a2f; --f4: #6c4a1c; --f5: #8b5c9e;
  --s1: #16305c; --s2: #b68a2f; --s3: #7f9fd0; --s4: #6c4a1c; --s5: #8b5c9e; --s6: #2f5390; --s7: #5a6680; --s8: #e66f55;
  --gut-text: #16305c; --kritisch-text: #ad3c25;
  --schatten: 0 1px 0 rgb(15 29 54 / .05), 0 12px 28px -18px rgb(15 29 54 / .35);
  --ziffern: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --kopfschrift: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
}

html { overflow-x: clip; }
body { overflow-x: clip; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 16px; }
:focus-visible { outline: 2px solid var(--messing-tief); outline-offset: 2px; border-radius: 4px; }
a:focus-visible, button:focus-visible, .knopf:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--messing-tief); outline-offset: 2px; }
.knopf:has(input:focus-visible) { outline: 2px solid var(--messing-tief); outline-offset: 2px; }
input[type=range]:focus-visible { outline-offset: 4px; }
.breite { width: min(100% - 32px, 1600px); }

/* ---------- Kopfleiste und Titel ---------- */
.a-kopf { background: var(--marine); border-bottom: 3px solid var(--messing); }
.a-kopf .a-zurueck { color: #d5e0f1; }
.a-kopf .a-zurueck:hover { color: #fff; }
.a-kopf .a-name { color: #fff; font-family: var(--kopfschrift); font-weight: 650; }
.a-kopf :focus-visible { outline-color: var(--messing-hell); }

.h-kopf { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 24px 56px; align-items: end; padding: 44px 0 26px; }
.h-marke { margin: 0 0 12px; font: 500 13px/1.2 var(--ziffern); color: var(--messing-tief); letter-spacing: .02em; }
.a-titel h1 { font-family: var(--kopfschrift); font-weight: 760; font-size: clamp(36px, 5.2vw, 70px); line-height: .98; letter-spacing: -.03em; color: var(--marine); max-width: 14ch; margin-bottom: 18px; }
.a-titel p { font-size: 17.5px; max-width: 60ch; }
.a-titel p.h-marke { font-size: 13px; color: var(--messing-tief); }
.a-schild { border-radius: 4px; background: var(--flaeche-1); border: 1px solid var(--linie); }
.a-schild i { background: var(--messing); }
.a-schild.eigen i { background: var(--marine); }
.a-titel p.h-rechenhilfe { margin: 0; padding: 14px 16px; font-size: 14px; line-height: 1.5; color: var(--text-2); background: var(--flaeche-1); border: 1px solid var(--linie); border-left: 4px solid var(--messing); border-radius: 4px; max-width: none; }
.h-rechenhilfe b { color: var(--text-1); display: block; margin-bottom: 2px; }
@media (max-width: 900px) { .h-kopf { grid-template-columns: 1fr; padding-top: 28px; } }

.ablage { border-radius: 6px; border-color: var(--linie); }
.ablage svg { color: var(--messing-tief); }
.knopf { border-radius: 6px; background: var(--marine); }
.knopf.leise { background: var(--flaeche-1); color: var(--marine); border-color: var(--linie); }
.knopf.leise:hover { background: var(--flaeche-2); filter: none; }
.vorlage-satz { display: block; margin-top: 6px; color: var(--text-1) !important; }
.h-hinweis { margin: -14px 0 22px; padding: 10px 14px; border-radius: 6px; background: var(--messing-hell); color: var(--text-1); font-size: 14px; }

/* ---------- Bühne: Inhalt links, Regler rechts ---------- */
.h-buehne { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.h-haupt { min-width: 0; display: grid; gap: 12px; }
.h-leiste { position: sticky; top: 76px; background: var(--flaeche-1); border: 1px solid var(--linie); border-top: 4px solid var(--marine); border-radius: 6px; padding: 16px 16px 18px; display: grid; gap: 14px; }
.h-leiste h2 { margin: 0; font: 700 18px/1.2 var(--kopfschrift); color: var(--marine); }
.h-leiste-unter { margin: -10px 0 0; font-size: 13px; color: var(--text-3); }
.h-leiste small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.35; margin-top: 2px; }
.h-feld, .h-regler { display: grid; gap: 4px; font-size: 14px; color: var(--text-2); }
.h-feld > span:first-child, .h-regler > span:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.h-feld b { font-weight: 600; color: var(--text-1); }
.h-regler output { font: 500 14px/1.2 var(--ziffern); color: var(--text-1); white-space: nowrap; }
.h-eingabe { display: flex; align-items: center; border: 1px solid var(--linie); border-radius: 6px; background: var(--flaeche-1); }
.h-eingabe input { flex: 1; min-width: 0; min-height: 42px; border: 0; background: transparent; padding: 0 10px; font: 500 16px var(--ziffern); color: var(--text-1); border-radius: 6px; }
.h-eingabe i { font-style: normal; padding-right: 10px; color: var(--text-3); }
.h-eingabe:has(input:focus-visible) { outline: 2px solid var(--messing-tief); outline-offset: 2px; }
.h-eingabe input:focus-visible { outline: none; }
input[type=range] { width: 100%; min-height: 32px; accent-color: var(--marine); margin: 0; }
.h-gruppe { margin: 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--raster); display: grid; gap: 8px; min-width: 0; }
.h-gruppe legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--text-1); float: left; width: 100%; margin-bottom: 6px; }
.h-gruppe select.feld { width: 100%; min-width: 0; border-radius: 6px; }
.h-leiste .wahl { width: 100%; }
.h-leiste .wahl button { flex: 1; padding: 0 8px; font-size: 13px; }
.wahl { border-radius: 6px; }
.wahl button { border-radius: 4px; }
.wahl button[aria-pressed="true"] { background: var(--marine); color: #fff; box-shadow: none; }
.h-zurueck { width: 100%; }
@media (max-width: 1020px) {
  .h-buehne { grid-template-columns: 1fr; }
  .h-leiste { position: static; }
}

/* ---------- Kennzahlen als Leiste ---------- */
.h-zahlen { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--flaeche-1); border: 1px solid var(--linie); border-radius: 6px; }
.h-zahl { padding: 14px 16px 14px; border-left: 1px solid var(--raster); min-width: 0; }
.h-zahl:first-child { border-left: 0; }
.h-zahl dt { font-size: 13px; color: var(--text-2); }
.h-zahl dd { margin: 4px 0 0; font: 500 clamp(20px, 2vw, 27px)/1.15 var(--ziffern); color: var(--text-1); letter-spacing: -.02em; white-space: nowrap; }
.h-zahl dd.minus { color: var(--lachs-tief); }
.h-zahl .h-neben { display: block; margin-top: 3px; font: 400 12.5px/1.35 "IBM Plex Sans", sans-serif; color: var(--text-3); letter-spacing: 0; white-space: normal; }
@media (max-width: 760px) { .h-zahlen { grid-template-columns: 1fr 1fr; } .h-zahl:nth-child(3) { border-left: 0; } .h-zahl:nth-child(n+3) { border-top: 1px solid var(--raster); } }

/* ---------- Karten ---------- */
.karte { border-radius: 6px; border-color: var(--linie); }
.karte-kopf h2 { font-family: var(--kopfschrift); font-weight: 700; font-size: 18px; color: var(--marine); }
.karte-kopf .tabelle-knopf { border-radius: 6px; color: var(--marine); }
.abschnitt > h2 { font-family: var(--kopfschrift); font-weight: 750; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.02em; color: var(--marine); }
.einsicht { font-size: 14.5px; }
.einsicht b { font-weight: 600; }
.h-zwischen { margin: 16px 0 6px; font: 600 14px/1.3 "IBM Plex Sans", sans-serif; color: var(--text-1); }
.h-wisch { display: none; margin: 0 0 6px; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 760px) { .h-wisch { display: block; } }

/* Legende des Horizonts */
.h-leg i { width: 14px; height: 10px; border-radius: 2px; }
.h-leg .h-l-flaeche { background: linear-gradient(to bottom, var(--marine-hell) 50%, var(--lachs-hell) 50%); border-top: 2px solid var(--marine); }
.h-leg .h-l-band { background: color-mix(in srgb, var(--messing) 30%, #fff); }
.h-leg .h-l-vors { height: 0; border-top: 2px dotted var(--messing-tief); border-radius: 0; }
.h-leg .h-l-guen { height: 0; border-top: 1.5px solid var(--messing-tief); border-radius: 0; }
.h-leg .h-l-rahmen { height: 0; border-top: 2px dashed var(--lachs-tief); border-radius: 0; }

/* ---------- Horizont-Diagramm ---------- */
.h-dia svg { display: block; width: 100%; height: auto; overflow: visible; }
.h-dia .h-himmel { fill: var(--flaeche-1); }
.h-dia .h-boden { fill: color-mix(in srgb, var(--lachs) 7%, #fff); }
.h-dia .h-oben { fill: color-mix(in srgb, var(--marine-2) 17%, #fff); }
.h-dia .h-unten { fill: color-mix(in srgb, var(--lachs) 55%, #fff); }
.h-dia .h-band { fill: color-mix(in srgb, var(--messing) 26%, transparent); }
.h-dia .h-erw { fill: none; stroke: var(--marine); stroke-width: 2.4; stroke-linejoin: round; }
.h-dia .h-vors { fill: none; stroke: var(--messing-tief); stroke-width: 1.6; stroke-dasharray: 2 3; }
.h-dia .h-guen { fill: none; stroke: var(--messing-tief); stroke-width: 1.4; }
.h-dia .h-null { stroke: var(--marine); stroke-width: 1.5; }
.h-dia .h-rahmen { stroke: var(--lachs-tief); stroke-width: 1.6; stroke-dasharray: 8 5; }
.h-dia .h-rahmen-text { fill: var(--lachs-tief); font-size: 11.5px; font-weight: 600; }
.h-dia .h-monat line { stroke: var(--raster); }
.h-dia .h-tief circle { stroke: #fff; stroke-width: 2; }
.h-dia .h-tief-box { fill: #fff; stroke: var(--linie); }
.h-dia .h-tief-text { font: 500 11.5px var(--ziffern); fill: var(--text-1); }
.h-dia .h-tief-text tspan.minus { fill: var(--lachs-tief); }
.h-dia .h-tief-strich { stroke: var(--text-3); stroke-width: 1; }
.h-dia .achse text { fill: var(--text-3); font-size: 11px; font-family: var(--ziffern); }

/* ---------- Wochen-Ampel ---------- */
.h-fall { margin: 0 0 12px; }
.h-wochen { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.h-woche { position: relative; display: grid; gap: 2px; padding: 8px 8px 9px; border-radius: 4px; border: 1px solid transparent; min-width: 0; font-size: 12px; line-height: 1.25; cursor: default; }
.h-woche .kw { font: 500 11px var(--ziffern); opacity: .85; }
.h-woche .stand { font: 500 14px/1.2 var(--ziffern); letter-spacing: -.02em; white-space: nowrap; }
.h-woche .wort { font-weight: 600; font-size: 12.5px; }
.h-woche.reicht { background: var(--marine); color: #fff; }
.h-woche.knapp { background: var(--messing-hell); color: var(--text-1); border-color: var(--messing); }
.h-woche.minus { background: var(--lachs-hell); color: #6e1f10; border-color: var(--lachs); }
.h-woche.rahmen { background: var(--lachs); color: #2b0700; border-color: var(--lachs-tief); }
.h-woche.rahmen .wort::before, .h-woche.minus .wort::before { content: "– "; }
.h-woche.leer { background: var(--flaeche-2); color: var(--text-3); }
@media (max-width: 520px) { .h-wochen { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Listen mit Balken (HTML) ---------- */
.h-liste { display: grid; gap: 2px; }
.h-zeile { display: grid; grid-template-columns: minmax(0, var(--nb, 220px)) minmax(40px, 1fr) auto; align-items: center; gap: 10px; min-height: 34px; padding: 3px 0; border-bottom: 1px solid var(--raster); }
.h-zeile:last-child { border-bottom: 0; }
.h-name { font-size: 13.5px; color: var(--text-1); min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.h-name small { display: block; font-size: 12px; color: var(--text-3); }
.h-spur { position: relative; height: 14px; }
.h-spur i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 3px 3px 0; }
.h-wert { font: 500 13px var(--ziffern); color: var(--text-1); text-align: right; white-space: nowrap; }
.h-wert small { display: block; font: 400 11.5px "IBM Plex Sans", sans-serif; color: var(--text-3); }
.h-marke-klumpen { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px; background: var(--messing-hell); color: var(--messing-tief); font-size: 11.5px; font-weight: 600; }
.h-leer { margin: 6px 0; font-size: 14px; color: var(--text-3); }
@media (max-width: 600px) {
  .h-zeile { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n w" "s s"; gap: 2px 10px; padding: 6px 0; }
  .h-name { grid-area: n; } .h-wert { grid-area: w; } .h-spur { grid-area: s; height: 10px; }
}

/* Hebel */
.h-hebel { display: grid; gap: 8px; }
.h-hebel-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--raster); border-radius: 6px; }
.h-hebel-zeile p { margin: 0; font-size: 14px; line-height: 1.4; }
.h-hebel-zeile p small { display: block; color: var(--text-3); font-size: 12.5px; }
.h-hebel-zeile .h-plus { font: 500 15px var(--ziffern); color: var(--marine); white-space: nowrap; text-align: right; }
.h-hebel-zeile .h-plus.null { color: var(--text-3); }
.h-hebel-zeile .knopf { min-height: 36px; padding: 0 12px; font-size: 13.5px; grid-column: 2; justify-self: end; }
.h-hebel-spur { grid-column: 1 / -1; height: 6px; background: var(--flaeche-2); border-radius: 3px; position: relative; overflow: hidden; }
.h-hebel-spur i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--marine-2); border-radius: 3px; }

/* Tabellen */
.h-tabelle { position: relative; overflow: auto; max-height: 460px; border: 1px solid var(--raster); border-radius: 6px; }
.h-tabelle table.daten td.z, .h-tabelle table.daten th.z, .als-tabelle td.z { font-family: var(--ziffern); }
table.daten td.ein { color: var(--marine); }
table.daten td.aus { color: var(--messing-tief); }
.als-tabelle .tabelle-huelle { position: relative; }

.h-punkte { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.h-punkte li::marker { color: var(--messing); }
.h-punkte b { color: var(--text-1); font-weight: 600; }

.h-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.status.knapp { color: var(--messing-tief); }
.status.minus { color: var(--lachs-tief); }
.status.reicht { color: var(--marine); }

.tipp { border-radius: 6px; }
.tipp .t-zeile b { font-family: var(--ziffern); font-weight: 500; }
.tipp .t-trenn { margin: 4px 0 2px; padding-top: 4px; border-top: 1px solid var(--raster); font-size: 12px; color: var(--text-3); }
.karte:has(.als-tabelle:not([hidden])) .h-zwischen { display: none; }
.a-titel h1, .abschnitt > h2 { text-wrap: balance; }
.knopf:active, .wahl button:active, .h-hebel-zeile .knopf:active { transform: translateY(1px); }
input[type=range]:disabled { opacity: .45; cursor: not-allowed; }
.h-knoepfe .knopf { white-space: nowrap; }

/* Verweis auf „Datei erkennen lassen“ */
.erkennen-satz { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.erkennen-satz a { color: var(--akzent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
