/* Design „Petrol“: mobil zuerst, helle Karten ohne Rahmen auf grauem Grund, Petrol als einziger Akzent.
   Bernstein trägt Hinweise und Fixkosten, Rostrot Verluste. Breitere Bildschirme bekommen mehr Luft, aber dieselbe
   Gliederung. Schriften: Space Grotesk für Titel und große Beträge, sonst Inter (beide OFL, unter /static/fonts). */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f5f5;
  --karte: #ffffff;
  --karte-rand: #e1e4e5;          /* Rahmen von Knöpfen und Feldern */
  --linie: #e9ebec;               /* Trenner in Listen */
  --kachel: #f4f5f5;
  --text: #14191b;
  --leise: #566067;
  --akzent: #0f766e;              /* Petrol */
  --akzent-hell: #ddf1ee;         /* Icon-Kachel, aktiver Tab, Fläche unter Linien */
  --akzent-mittel: #5fb3a9;
  --akzent-zart: #b5ded8;
  --segment-grund: #e5e8e9;
  --segment-aktiv: #ffffff;
  --schatten: 0 1px 2px rgba(20, 25, 27, .04), 0 8px 24px rgba(20, 25, 27, .05);
  --schatten-segment: 0 1px 3px rgba(20, 25, 27, .12);
  --knopf: #14191b; --knopf-text: #ffffff;
  --hinweis-bg: #fff0d4; --hinweis-text: #5c3200; --hinweis-leise: #8a4b00;
  --fixkosten: #e09a1f;
  --plus: #0f766e;
  --minus: #9a3412;
  --minus-bg: #fbe9e1;
  --fehler-bg: #fbe9e1;
  --fehler: #9a3412;
  --veraltet: #8a4b00;
  --warnung: #8a4b00;
  --chip-warnung-bg: #fff0d4; --chip-warnung: #8a4b00;
  --chip-blau-bg: #e5e8e9; --chip-blau: #14191b;
  --chip-gruen-bg: #ddf1ee; --chip-gruen: #0f766e;
  --chip-rot-bg: #fbe9e1; --chip-rot: #9a3412;
  --chip-grau-bg: #e5e8e9; --chip-grau: #14191b;
  /* Diagramme: Petrol-Stufen, dazu Bernstein und Rost für Bedeutung, Achsen und Gitter */
  --d-petrol: #0f766e; --d-petrol-mittel: #5fb3a9; --d-petrol-zart: #b5ded8;
  --d-bernstein: #e09a1f; --d-rost: #9a3412; --d-grau: #566067;
  --d-tinte: #14191b; --d-text: #566067; --d-gitter: #e9ebec; --d-null: #c9cfd1;
  --d-flaeche: rgba(15, 118, 110, .16); --d-markierung: rgba(20, 25, 27, .045); --d-grund: #ffffff;
  --radius: 4px;
  --radius-klein: 3px;
  --rand: max(1.25rem, env(safe-area-inset-left));
  --rand-rechts: max(1.25rem, env(safe-area-inset-right));
  --titel: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

/* Dunkel: dieselben Stufen auf dunklem Grund, Petrol aufgehellt (Kontrast über 4,5:1) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1314;
    --karte: #182022;
    --karte-rand: #2e393c;
    --linie: #263033;
    --kachel: #1f282a;
    --text: #e6ebeb;
    --leise: #9ba7ab;
    --akzent: #4cb8ac;
    --akzent-hell: #183633;
    --akzent-mittel: #2f8a80;
    --akzent-zart: #22504b;
    --segment-grund: #222b2d;
    --segment-aktiv: #34403f;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --schatten-segment: 0 1px 3px rgba(0, 0, 0, .4);
    --knopf: #e6ebeb; --knopf-text: #0e1314;
    --hinweis-bg: #3a2a10; --hinweis-text: #fbddaa; --hinweis-leise: #f0b661;
    --fixkosten: #e8a838;
    --plus: #4cb8ac;
    --minus: #f0875a;
    --minus-bg: #3d1e14;
    --fehler-bg: #3d1e14;
    --fehler: #f0875a;
    --veraltet: #f0b661;
    --warnung: #f0b661;
    --chip-warnung-bg: #3a2a10; --chip-warnung: #f0b661;
    --chip-blau-bg: #263033; --chip-blau: #e6ebeb;
    --chip-gruen-bg: #183633; --chip-gruen: #4cb8ac;
    --chip-rot-bg: #3d1e14; --chip-rot: #f0875a;
    --chip-grau-bg: #263033; --chip-grau: #e6ebeb;
    --d-petrol: #4cb8ac; --d-petrol-mittel: #8ad3ca; --d-petrol-zart: #3c7a73;
    --d-bernstein: #e8a838; --d-rost: #f0875a; --d-grau: #9ba7ab;
    --d-tinte: #e6ebeb; --d-text: #9ba7ab; --d-gitter: #263033; --d-null: #3d494c;
    --d-flaeche: rgba(76, 184, 172, .16); --d-markierung: rgba(255, 255, 255, .05); --d-grund: #182022;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--akzent); text-decoration: none; }
h1, h2, h3 { font-family: var(--titel); letter-spacing: -.02em; }
h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.15; margin: 0 0 .2rem; }
h2 { font-size: 1rem; font-weight: 600; line-height: 1.5; margin: 0 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: .9rem; font-weight: 600; margin: 1rem 0 .3rem; letter-spacing: 0; }
code { font-size: .9em; }
small { font-size: .8rem; }
strong { font-weight: 600; }

/* Kopf: kleine Zeile über großem Titel, rechts die Statusanzeigen, darunter die Unterseiten als Segment-Schalter.
   Er scrollt mit der Seite, damit auf dem Telefon Platz für den Inhalt bleibt. */
.kopf { padding-top: calc(env(safe-area-inset-top) + .75rem); background: var(--bg); }
.kopf-zeile, .segmente {
  max-width: 860px; margin: 0 auto;
  padding-left: var(--rand); padding-right: var(--rand-rechts);
}
.kopf-zeile { display: flex; align-items: center; gap: .75rem; min-height: 3.25rem; }
.kopf-text { display: grid; gap: .1rem; min-width: 0; }
.kopf-klein { color: var(--leise); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-titel { margin: 0; font-family: var(--titel); font-size: 1.625rem; line-height: 1.875rem; font-weight: 700;
  letter-spacing: -.02em; overflow-wrap: anywhere; }
.kopf-zurueck { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--karte-rand); border-radius: var(--radius-klein); background: var(--karte); color: var(--text); }
.kopf-zurueck .icon { width: 1.25rem; height: 1.25rem; }

.icon { width: 1.25rem; height: 1.25rem; flex: none; }

.status { margin-left: auto; display: flex; gap: .3rem; flex: none; }
.chip { display: inline-flex; align-items: center; gap: .3rem; height: 1.75rem; padding: 0 .6rem;
  border-radius: 2px; font-weight: 600; font-size: .8rem; background: var(--chip-grau-bg); color: var(--chip-grau); }
.chip .icon { width: .9rem; height: .9rem; }
.chip-warnung { background: var(--chip-warnung-bg); color: var(--chip-warnung); }
.chip-blau { background: var(--chip-blau-bg); color: var(--chip-blau); }
.chip-gruen { background: var(--chip-gruen-bg); color: var(--chip-gruen); }
.chip-rot { background: var(--chip-rot-bg); color: var(--chip-rot); }

/* Segment-Schalter: gleich breite Felder, 44 px hoch, das aktive weiß mit Schatten */
.segmente { display: block; margin-top: 1rem; }
.segmente-felder { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px;
  background: var(--segment-grund); border-radius: var(--radius); }
.segmente a { display: flex; align-items: center; justify-content: center; min-width: 0; height: 2.75rem;
  padding: 0 .25rem; border-radius: var(--radius-klein); color: var(--leise); font-size: .8125rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmente a[aria-current="page"] { background: var(--segment-aktiv); color: var(--text); box-shadow: var(--schatten-segment); }

/* Tab-Leiste unten, über der Home-Leiste des iPhones */
.tabbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 4px;
  padding: .5rem max(.75rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
  background: var(--karte); border-top: 1px solid var(--karte-rand);
}
.tabbar a { flex: 1 1 0; max-width: 7rem; min-width: 0; height: 3.5rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .25rem; border-radius: var(--radius-klein);
  color: var(--leise); font-size: .6875rem; font-weight: 600; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .icon { width: 1.25rem; height: 1.25rem; stroke-width: 1.8; }
.tabbar a[aria-current="page"] { color: var(--akzent); background: var(--akzent-hell); }

.inhalt {
  max-width: 860px; margin: 0 auto; overflow-wrap: break-word;
  padding: 1rem var(--rand-rechts) 1.25rem var(--rand);
}
/* Abschnittstitel zwischen Karten und Listen */
.inhalt > h2, .abschnitt { margin: 1.5rem 0 .6rem; color: var(--text); font-size: 1rem; font-weight: 600; }
.inhalt > h2:first-child { margin-top: 0; }

/* Formulare. Eingabefelder bleiben bei 16 px, sonst vergrößert Safari beim Antippen. */
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem; border: 1px solid var(--karte-rand);
  border-radius: var(--radius-klein); background: var(--karte); font-size: 1rem;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
button {
  min-height: 2.75rem; padding: .55rem 1rem; border: 0; border-radius: var(--radius-klein); cursor: pointer;
  background: var(--knopf); color: var(--knopf-text); font-weight: 600; font-size: .875rem;
}
button.leise { min-height: 0; background: transparent; color: var(--fehler); padding-left: 0; padding-right: 0; font-weight: 500; }
button.link { min-height: 0; background: none; color: var(--akzent); padding: 0; font-weight: 400; }
button:disabled { opacity: .5; cursor: not-allowed; }
.knopf { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .55rem 1rem;
  border-radius: var(--radius-klein); background: var(--knopf); color: var(--knopf-text); font-weight: 600;
  font-size: .875rem; }
.knopf.zweitrangig, button.zweitrangig-knopf { background: var(--karte); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--karte-rand); }
.knopf.klein, button.klein { min-height: 2.5rem; padding: .4rem .8rem; font-size: .8125rem; }
.knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
/* Aktionen einer Seite: eine Zeile kleiner Knöpfe unter dem Kopf */
.leiste { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.leiste form { display: contents; }

/* minmax(0, 1fr): sonst macht die Eigenbreite des Datei-Felds in Safari das Formular breiter als die Karte */
.formular { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.formular label { display: grid; gap: .3rem; color: var(--leise); font-size: .8125rem; }
.formular.reihe { grid-template-columns: minmax(0, 1fr) auto; }
.formular h2 { margin: .5rem 0 0; }
.formular h2:first-child { margin-top: 0; }
fieldset.auswahl { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
fieldset.auswahl legend { color: var(--leise); font-size: .8125rem; margin-bottom: .25rem; }
fieldset.auswahl label, label.haken { display: flex; gap: .55rem; align-items: baseline; color: var(--text);
  font-size: .9375rem; }
fieldset.auswahl input, label.haken input { width: auto; min-height: 0; accent-color: var(--akzent); }
/* Datei-Feld ohne eigene Gestaltung: iOS öffnet die Auswahl sonst teils nicht. */
input[type="file"].datei-nativ { width: auto; max-width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0;
  background: none; font-size: 1rem; }

.suche { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.suche input[type="search"] { flex: 1 1 12rem; width: auto; }
.suche input[type="month"] { flex: 1 1 8rem; width: auto; }
.suche button { flex: none; }

.anmeldung { max-width: 22rem; margin: 12vh auto 0; }
.anmeldung h1 { font-size: 1.625rem; margin-bottom: 1.25rem; }

.meldung { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: var(--radius); background: var(--akzent-hell);
  color: var(--text); font-size: .875rem; }
.meldung.fehler { background: var(--fehler-bg); color: var(--fehler); }
.leerhinweis { color: var(--leise); font-size: .875rem; }
.quelle { color: var(--leise); font-size: .75rem; margin: .5rem 0 0; }

/* Karten: weiß, ohne Rahmen, weicher Schatten */
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 1.25rem; margin-bottom: 1rem; }
.karte > :last-child { margin-bottom: 0; }
details.karte { padding-top: 1rem; padding-bottom: 1rem; }
details.karte summary { cursor: pointer; font-weight: 600; font-size: .9375rem; color: var(--text); }
details.karte[open] summary { margin-bottom: .75rem; }
details summary { cursor: pointer; color: var(--akzent); font-size: .875rem; }

/* Gruppierte Liste: Icon-Kachel, Name mit Nebenzeile, Betrag rechts, dann Pfeil */
.liste { list-style: none; margin: 0 0 1rem; padding: 0 1rem; background: var(--karte); border-radius: var(--radius);
  box-shadow: var(--schatten); }
.karte .liste { margin: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.zeile { display: flex; align-items: center; gap: .75rem; min-height: 4.25rem; padding: .7rem 0;
  border-top: 1px solid var(--linie); }
.zeile:first-child { border-top: 0; }
.zeile-name { flex: 1; min-width: 0; display: grid; gap: .15rem; color: var(--text); }
.zeile-name > span, .zeile-name > small { overflow-wrap: anywhere; }
.zeile-name > span { font-size: .9375rem; font-weight: 600; }
.zeile-name small, .typ { color: var(--leise); font-size: .75rem; }
.zeile-kurs { flex: none; max-width: 55%; text-align: right; }
.zeile-umbruch { flex-wrap: wrap; }
.zeile > .icon:last-child, .zeile-pfeil { flex: none; width: 1rem; height: 1rem; color: var(--leise); }
.aktionen { margin: 0; font-size: .8125rem; }
.zeile-umbruch .aktionen { flex-basis: 100%; }
/* Buchungen wie im Entwurf: Ausgaben in Textfarbe, Eingänge in Petrol */
.umsaetze .zeile-kurs strong { font-family: var(--titel); font-size: .9375rem; }
.umsaetze .zeile-kurs strong.minus { color: var(--text); }
.zeile > .fortschritt { flex-basis: 100%; margin-top: .1rem; }

/* Icon-Kachel: 44 px, Hell-Petrol, Icon in Petrol mit feinem Strich */
.icon-kachel { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-klein); background: var(--akzent-hell); color: var(--akzent); }
.icon-kachel .icon { width: 1.25rem; height: 1.25rem; stroke-width: 1.8; }
.icon-kachel.klein { width: 2.5rem; height: 2.5rem; }

.kurs { display: inline-grid; gap: .15rem; text-align: inherit; }
.kurs strong { font-family: var(--titel); font-size: 1rem; font-weight: 600; white-space: nowrap; }
.kurs small { color: var(--leise); font-size: .75rem; font-weight: 500; }
.kurs small.plus { color: var(--plus); font-weight: 600; }
.kurs small.minus { color: var(--minus); font-weight: 600; }
.kurs.veraltet strong, .kurs.veraltet small { color: var(--veraltet); }
.kurs.leer { color: var(--leise); }

/* Kopf einer Detailseite: Name, eine kurze Zeile darunter und der große Betrag */
.wp-kopf { margin: 0 0 1rem; }
.wp-kopf h1 { font-size: 1.375rem; }
.wp-meta { color: var(--leise); margin: 0; font-size: .8125rem; }
.wp-kurs { margin-top: .5rem; }
/* Große Beträge mit proportionalen Ziffern: die schmale 1 von Space Grotesk reißt sonst eine Lücke */
.wp-kurs .kurs strong { font-size: 2.125rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: proportional-nums; }
.wp-kurs .kurs small { font-size: .8125rem; }

/* Kennzahlen: auf dem Telefon als Zeilen (Name links, Wert rechts), breiter als Raster */
.kennzahlen { display: grid; margin: 0; }
.kennzahlen > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .6rem 0; border-top: 1px solid var(--linie); }
.kennzahlen > div:first-child { border-top: 0; padding-top: 0; }
.kennzahlen > div:last-child { padding-bottom: 0; }
* + .kennzahlen > div:first-child { border-top: 1px solid var(--linie); padding-top: .6rem; }
h2 + .kennzahlen > div:first-child, .karte-kopf + .kennzahlen > div:first-child { border-top: 0; }
h2 + .kennzahlen > div:first-child { padding-top: 0; }
.kennzahlen dt { color: var(--leise); font-size: .8125rem; }
.kennzahlen dd { margin: 0; text-align: right; font-weight: 600; font-size: .9375rem; }
.kennzahlen dd small { display: block; color: var(--leise); font-weight: 400; font-size: .75rem; }
@media (min-width: 640px) {
  .kennzahlen { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem 1.25rem; }
  .kennzahlen > div, * + .kennzahlen > div:first-child { display: block; padding: 0; border: 0; }
  * + .kennzahlen { margin-top: 1rem; }
  .kennzahlen dt { font-size: .75rem; }
  .kennzahlen dd { text-align: left; }
}

.plus { color: var(--plus); }
.minus { color: var(--minus); }

/* Tabellen: klein, Zahlen rechtsbündig; auf dem Telefon fallen Nebenspalten (.opt) weg */
.tabelle-rahmen { overflow-x: auto; margin: 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.tabelle th, .tabelle td { text-align: left; padding: .45rem .5rem; border-top: 1px solid var(--linie);
  vertical-align: top; }
.tabelle th:first-child, .tabelle td:first-child { padding-left: 0; }
.tabelle th:last-child, .tabelle td:last-child { padding-right: 0; }
.tabelle th { color: var(--leise); font-weight: 500; font-size: .75rem; border-top: 0; white-space: nowrap; }
.tabelle .n { text-align: right; white-space: nowrap; }
.tabelle td small { font-size: .75rem; color: var(--leise); }
.tabelle tr.vergangen td { color: var(--leise); }
.tabelle tr.markiert td { font-weight: 600; }
@media (max-width: 599px) { .opt { display: none; } }

/* Diagramme */
.zeitraum { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-bottom: .5rem; }
.zeitraum button { min-height: 2.75rem; padding: 0; background: transparent; color: var(--leise);
  font-size: .8125rem; font-weight: 600; }
.zeitraum button[aria-pressed="true"] { background: var(--akzent-hell); color: var(--akzent); }
.chart { position: relative; height: 210px; }
.chart.verlauf { height: 190px; margin-top: .75rem; }
.chart-balken { height: 150px; }
.chart-balken svg { display: block; touch-action: pan-y; }
@media (min-width: 640px) { .chart { height: 260px; } .chart-balken { height: 180px; } }
/* Punkt bei „heute“: Petrol mit weißem Ring, per Skript über das Diagramm gelegt */
.heute-punkt { position: absolute; z-index: 3; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  border-radius: 50%; background: var(--d-petrol); box-shadow: 0 0 0 2px var(--d-grund); pointer-events: none; }
.heute-punkt.leer { background: var(--d-grund); box-shadow: inset 0 0 0 2px var(--d-petrol); }
.legende { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; }
.legende span { display: inline-flex; align-items: center; gap: .35rem; }
.strich { display: inline-block; width: .9rem; height: 2px; border-radius: 1px; }
.strich.depot { background: var(--d-petrol); }
.strich.referenz { background: var(--d-bernstein); }
.strich.eingezahlt { height: 0; border-top: 1px dashed var(--d-grau); }
.strich.prognose { height: 0; border-top: 2px dashed var(--d-petrol); }
.punkt-marke { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--d-petrol); }
.punkt-marke.leer { background: none; box-shadow: inset 0 0 0 2px var(--d-petrol); }
.wp-kopf .fortschritt { margin-top: .75rem; }

/* Legende mit Werten: Monat in der ersten Zeile, darunter zwei Spalten, damit die Höhe beim Tippen gleich bleibt */
.legende-werte { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .2rem 1rem;
  margin: 0 0 .75rem; font-size: .75rem; color: var(--leise); }
.legende-werte span { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.legende-werte strong { margin-left: auto; color: var(--text); font-weight: 600; white-space: nowrap; }
.legende-werte strong.plus { color: var(--plus); }
.legende-werte strong.minus { color: var(--minus); }
.legende-datum { grid-column: 1 / -1; color: var(--text); font-family: var(--titel); font-size: .875rem; font-weight: 600; }
.marke { display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: 1px; }
.marke-leer { background: none; }
.marke-linie { display: inline-block; flex: none; width: .8rem; height: 2px; border-radius: 1px; }

/* Fortschritt (getilgt): 8-px-Balken als SVG, damit die Breite ohne Inline-Style auskommt */
.fortschritt { display: block; width: 100%; height: 8px; border-radius: 1px; overflow: hidden; }
.fortschritt.gross { height: 10px; }
.fortschritt .spur { fill: var(--segment-grund); }
.fortschritt .wert { fill: var(--akzent); }

/* Mehr: Kacheln mit Icon und Beschriftung */
.karte-titel { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: 1rem; font-weight: 600;
  margin-bottom: .75rem; }
.karte-titel .icon { width: 1.1rem; height: 1.1rem; color: var(--akzent); stroke-width: 1.8; }
.karte-titel.warnung, .karte-titel.warnung .icon { color: var(--hinweis-text); }
.kacheln { display: grid; grid-template-columns: minmax(0, 1fr); }
.kachel { display: flex; align-items: center; gap: .75rem; min-width: 0; min-height: 3.75rem; padding: .5rem 0;
  width: 100%; border: 0; border-top: 1px solid var(--linie); border-radius: 0; background: none;
  color: var(--text); font-size: .9375rem; font-weight: 600; text-align: left; }
.kacheln > :first-child, .kacheln > .kachel-form:first-child > .kachel { border-top: 0; }
.kachel span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kachel::after { content: ""; flex: none; width: .45rem; height: .45rem; margin-right: .3rem;
  border: solid var(--leise); border-width: 2px 2px 0 0; transform: rotate(45deg); }
button.kachel { min-height: 3.75rem; color: var(--text); background: none; font-weight: 600; }
.kachel-form { display: contents; }
@media (min-width: 640px) {
  .kacheln { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); column-gap: 1.5rem; }
  .kacheln > .kachel:nth-child(-n+2) { border-top: 0; }
}
.kachel-icon { flex: none; box-sizing: content-box; width: 1.25rem; height: 1.25rem; padding: .75rem;
  border-radius: var(--radius-klein); background: var(--akzent-hell); color: var(--akzent); stroke-width: 1.8; }

/* Übersicht: Nettovermögen mit Verlauf, darunter die drei Teile als Legende */
.held-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.held-label { display: inline-flex; align-items: center; gap: .45rem; color: var(--leise); font-size: .8125rem; }
.held-label .marke-linie { background: var(--d-petrol); height: 2.5px; }
.held-datum { color: var(--leise); font-size: .75rem; }
.held-wert { margin: .25rem 0 .75rem; font-family: var(--titel); font-size: 2.25rem; line-height: 2.625rem;
  font-weight: 700; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: proportional-nums; }
.held .chart { height: 180px; margin: 0 0 .5rem; }
.held-teile { display: grid; }
.held-teile a { display: flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: .35rem 0;
  color: var(--text); border-top: 1px solid var(--linie); }
.held-teile a span { flex: 1; color: var(--leise); font-size: .8125rem; }
.held-teile strong { font-size: .9375rem; }
.held-teile .icon { width: 1rem; height: 1rem; color: var(--leise); }
.marke-konten { background: var(--d-petrol-mittel); }
.marke-depot { background: var(--d-bernstein); }
.marke-darlehen { background: var(--d-rost); }
@media (min-width: 640px) { .held .chart { height: 240px; } }

.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem;
  align-items: start; margin-bottom: 1rem; }
.raster .karte, .raster .gruppe { margin-bottom: 0; }

/* Gruppe: Titel über einer Karte, wie in den Entwürfen (Konten, Depot, Darlehen) */
.gruppe { margin-bottom: 1rem; }
.gruppe-kopf { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; color: var(--text); }
.gruppe-kopf h2 { flex: 1; margin: 0; }
.gruppe-kopf .icon { width: 1rem; height: 1rem; color: var(--leise); }
.gruppe > .karte { margin-bottom: 0; }
.gruppe > .karte + .karte { margin-top: .75rem; }
.karte.liste-karte { padding: .25rem 1rem; }

.karte-kopf { display: flex; align-items: center; gap: .5rem; color: var(--text); padding-bottom: .6rem;
  margin-bottom: .1rem; border-bottom: 1px solid var(--linie); }
.karte-kopf h2 { flex: 1; margin: 0; font-size: 1rem; }
.karte-kopf > .icon:last-child { color: var(--leise); width: 1rem; height: 1rem; }
.karte-icon { color: var(--akzent); width: 1.1rem; height: 1.1rem; stroke-width: 1.8; }
.karte h3 { font-family: var(--titel); font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; color: var(--text);
  margin: 1.25rem 0 .5rem; }
.karte h3:first-child { margin-top: 0; }
.kurzliste { list-style: none; margin: 0; padding: 0; }
.kurzliste li { border-top: 1px solid var(--linie); }
.kurzliste li:first-child { border-top: 0; }
.kurzliste li > a, .kurzliste li > span { display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  min-height: 3rem; padding: .6rem 0; color: var(--text); }
.kurzliste li > a > span:first-child:not(.icon-kachel), .kurzliste .kurz-name { display: grid; gap: .15rem; min-width: 0; flex: 1; }
.kurzliste li > a > span:first-child:not(.icon-kachel) > *, .kurzliste .kurz-name > * { overflow-wrap: anywhere; }
.kurzliste small { color: var(--leise); font-size: .75rem; }
.kurzliste .kurz-name > small { white-space: normal; }
.kurzliste strong, .kurzliste .kurs { flex: none; white-space: nowrap; text-align: right; }
.kurzliste strong { font-family: var(--titel); font-size: 1rem; }
.kurzliste .icon-kachel + .kurz-name > :first-child { font-weight: 600; }
.kurzliste li > a > .icon:last-child { display: none; }
@media (min-width: 640px) { .kurzliste li > a > .icon:last-child { display: block; width: 1rem; height: 1rem; color: var(--leise); } }
.kurzliste .icon-kachel { width: 2.5rem; height: 2.5rem; }
.kurzliste .fortschritt { margin: -.15rem 0 .75rem; }
.kurzliste + .kennzahlen { border-top: 1px solid var(--linie); padding-top: .6rem; }
.kurzliste + .kennzahlen > div:first-child { border-top: 0; padding-top: 0; }

/* Hinweis in Bernstein */
.karte.hinweis { background: var(--hinweis-bg); color: var(--hinweis-text); box-shadow: none; }
.karte.hinweis .karte-titel { color: var(--hinweis-text); }
.karte.hinweis .karte-titel .icon { color: var(--hinweis-leise); }
.karte.hinweis .kurzliste li { border-top-color: rgba(138, 75, 0, .18); }
.karte.hinweis .kurzliste li > a { color: var(--hinweis-text); font-size: .875rem; font-weight: 500; min-height: 2.75rem; }
.karte.hinweis .kurzliste li > a::after { content: "›"; color: var(--hinweis-leise); font-size: 1.1rem; }

/* Analyse-Vorschläge */
.vorschlag-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; margin-bottom: .5rem; }
.vorschlag-kopf small { color: var(--leise); }
.marke-aktion { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: .15rem .5rem; border-radius: 2px; background: var(--segment-grund); color: var(--text); }
.aktion-kaufen .marke-aktion { background: var(--chip-gruen-bg); color: var(--chip-gruen); }
.aktion-verkaufen .marke-aktion { background: var(--fehler-bg); color: var(--fehler); }
.vorschlag p { margin: .4rem 0; font-size: .9375rem; }
.gegen { color: var(--leise); }
.quellen { margin: .4rem 0 0; padding-left: 1.2rem; font-size: .75rem; word-break: break-all; }
.kennzahlen + .knopfreihe, .kennzahlen + p { margin-top: .75rem; }
.karte > details { margin-top: .75rem; }
.karte > details > .tabelle-rahmen, .karte > details > .formular { margin-top: .5rem; }
