/* Finanzplaner-App - Grundgestaltung. Farben und Bedeutungen wie im Excel-Planer (mdlKern FARBEN). */
:root {
  --ink: #0f1b2b;          /* cInk */
  --primary: #265496;      /* cPrimary - Kredit und Haus */
  --accent: #188862;       /* cAccent - gruen: steigt, gut */
  --warn: #cd423a;         /* cWarn - rot: laufende Ausgaben, faellt */
  --gold: #c88c16;         /* cGold - Sparen */
  --petrol: #14808a;       /* cPetrol */
  --muted: #6b7a8c;        /* cMuted */
  --bg: #f5f7fa;           /* cBg */
  --card: #ffffff;         /* cCard */
  --grid: #e3e8ef;         /* cGrid */
  --input: #f0f8ec;        /* cInput - Ihre Eingaben */
  --calc: #f0f5fc;         /* cCalc - berechnet */
  --head: #28364c;         /* cHeadBg - dunkler Kopf */
  --einmal: #884ea0;       /* cEinmal - einmalige Ausgaben */
  --ohne: #788494;         /* cOhne - ohne Zuordnung (neutral) */
  --input-ink: #24623a; --calc-ink: #265496;
  --stand: #b9c2cd;        /* Anfangsstand (heute) - Hell(cMuted, 0.45) */
  --stand-ende: #28364c;   /* Endstand */
  --plan: #dfe4ea;         /* geplant (hellgrau) */
  --primary-hell: #7d98c0; /* Hell(cPrimary, 0.3) */
  --zins: #8ccbb5;         /* Zinsen - Hell(cAccent, 0.55) */
  --leben: #da7169;        /* Lebenshaltung - Hell(cWarn, 0.25) */
  --selten: #e49793;       /* seltener als monatlich - Hell(cWarn, 0.45) */
  --an: #dec08a;           /* an ein anderes Konto - Hell(cGold, 0.4) */
  --gold-hell: #f4e8d0;    /* Auswertungsjahr - Hell(cGold, 0.8) */
  --radius: 14px;
  --schatten: 0 1px 2px rgba(15, 27, 43, .06), 0 2px 8px rgba(15, 27, 43, .05);
  --leiste-h: 64px;
  --schrift: Aptos, "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--schrift); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
button { font: inherit; color: inherit; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--accent); } .minus { color: var(--warn); } .leise { color: var(--muted); }

/* ---------- Kopf ---------- */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--head); color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; display: flex; align-items: baseline; gap: 12px; }
.kopf h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: .1px; }
.kopf .stand { margin-left: auto; font-size: 12px; opacity: .75; text-align: right; }

/* ---------- Inhalt ---------- */
main { padding: 16px 16px calc(var(--leiste-h) + env(safe-area-inset-bottom) + 24px); max-width: 720px; margin: 0 auto; }
.raster { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.raster > * { min-width: 0; }
.karte { background: var(--card); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; }
.karte h2 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
.karte p { margin: 6px 0; }
.kachel { display: block; text-decoration: none; color: inherit; }
.kachel .titel { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: none; }
.kachel .wert { font-size: 28px; font-weight: 700; margin: 2px 0; letter-spacing: -.3px; }
.kachel .unter { font-size: 13px; color: var(--muted); }
.kachel.pfeil { position: relative; padding-right: 36px; }
.kachel.pfeil::after { content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; margin-top: -5px;
  border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); }
.band { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; }
.band.eingabe { background: #d6ecce; color: var(--input-ink); }
.band.berechnet { background: #d8e4f6; color: var(--calc-ink); }
.band.bald { background: #eef1f5; color: var(--muted); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--grid); background: var(--card); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.knopf.haupt { background: var(--primary); border-color: var(--primary); color: #fff; }
.knopf.gefahr { color: var(--warn); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hinweis { font-size: 13px; color: var(--muted); }
.meldung { padding: 10px 12px; border-radius: 10px; background: var(--calc); font-size: 14px; margin-top: 10px; }
.meldung.ok { background: #e3f3ec; color: #135c43; }
.meldung.fehler { background: #fbe9e8; color: #8f2a24; }

/* Listen (Konten, Mehr) */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--grid); }
.liste li:first-child { border-top: 0; }
.liste .name { flex: 1; min-width: 0; }
.liste .name small { display: block; color: var(--muted); font-size: 12px; }
.liste a.zeile { display: flex; align-items: center; gap: 12px; width: 100%; color: inherit; text-decoration: none; min-height: 28px; }
.liste .ziel::after { content: ""; display: block; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; }
.gruppe { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 0; }
.marke { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th, .tabelle td { padding: 8px 4px; border-top: 1px solid var(--grid); text-align: left; vertical-align: top; }
.tabelle td.z, .tabelle th.z { text-align: right; }
.ok-zeichen { color: var(--accent); font-weight: 700; }

.fett { font-weight: 700; }
.kopf .zurueck { color: inherit; text-decoration: none; font-size: 26px; line-height: 1; margin-right: -4px; padding: 0 8px 0 0; }

/* Kacheln oben auf einer Seite (Zusammenfassung) */
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kacheln .karte { padding: 12px 14px; }
.kacheln .gross { grid-column: 1 / -1; }
.kacheln .wert { font-size: 20px; }
.kacheln .gross .wert { font-size: 28px; }

/* Umschalter (Auszug | Zukunft | Rendite) und Zeitraum-Chips */
.umschalter { display: flex; background: #e9edf2; border-radius: 12px; padding: 3px; gap: 3px; }
.umschalter a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.umschalter a.aktiv { background: var(--card); color: var(--ink); box-shadow: var(--schatten); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--grid); background: var(--card); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chips a.aktiv { background: var(--head); border-color: var(--head); color: #fff; }
.chips .pfeil-knopf { padding: 6px 10px; }

/* Waagerechte Treppe */
.treppe-zeile { display: grid; grid-template-columns: minmax(76px, 26%) 1fr auto; align-items: center; gap: 8px; min-height: 30px; font-size: 14px; }
.treppe-bahn { position: relative; height: 14px; }
.treppe-balken { position: absolute; top: 0; height: 14px; border-radius: 3px; }
.treppe-wert { text-align: right; min-width: 7.5em; }

/* Balken je Konto: links abfliessend, rechts dazukommend */
.rb-zeile { display: grid; grid-template-columns: 30% 1fr auto; align-items: center; gap: 8px; min-height: 38px; color: inherit; text-decoration: none; border-top: 1px solid var(--grid); font-size: 14px; }
.rb-zeile:first-child { border-top: 0; }
.rb-bahn, .warum-bahn { position: relative; height: 16px; }
.rb-teil { position: absolute; top: 0; height: 16px; }
.rb-null, .warum-null { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--muted); }
.rb-wert { text-align: right; min-width: 7.5em; font-weight: 600; }
.rb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Warum: hinaus | herein */
.warum-kopf { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.warum-netto { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.warum-liste { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.warum-liste li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.warum-liste .name { flex: 1; }

/* SVG-Diagramme */
.grafik { width: 100%; height: auto; max-height: 380px; display: block; overflow: visible; }
.grafik text { font: 600 10px var(--schrift); fill: var(--ink); }
.grafik text.unter { font-weight: 500; fill: var(--ink); font-size: 9.5px; }
.grafik text.leise { fill: var(--muted); }
.grafik text.plus { fill: var(--accent); } .grafik text.minus { fill: var(--warn); }
.grafik .achse { stroke: var(--muted); stroke-width: .8; }
.grafik .verbinder { stroke: var(--muted); stroke-width: .6; stroke-dasharray: 2 2; }
.grafik .blass { opacity: .45; }
.grafik text.eng { font-size: 8.5px; letter-spacing: -.2px; }

/* Vertraege & Abos */
.kachel.art { border-top: 3px solid var(--muted); }
.wahl { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px 6px; align-items: start; }
.wahl .gruppe { margin: 7px 0 0; }
.vt-band { display: flex; justify-content: space-between; gap: 8px; margin: 14px -16px 0; padding: 8px 16px; font-weight: 700;
  border-top: 2px solid currentColor; }
.vt-kat { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0 2px; font-weight: 700; font-size: 14px; }
.vt-kat small { font-weight: 500; color: var(--muted); }
.zw-tab li { grid-template-columns: minmax(0, 1fr) auto; }
.zw-tab .reihen { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.zw-tab .reihen i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.zw-tab li.summe { font-weight: 700; border-top: 2px solid var(--ink); }
/* Rückfrage (fragen in ui.js) */
dialog.frage { border: 0; border-radius: var(--radius); padding: 18px; max-width: min(92vw, 440px); box-shadow: 0 10px 40px rgba(15, 27, 43, .25); color: var(--ink); background: var(--card); }
dialog.frage::backdrop { background: rgba(15, 27, 43, .45); }
dialog.frage p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
dialog.frage input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; min-height: 44px; padding: 0 12px; border: 1px solid var(--grid); border-radius: 10px; background: var(--input); margin-bottom: 12px; }

/* zwei Felder nebeneinander (von/bis, Abrechnung/Kosten) */
.zwei-felder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.zwei-felder input, .zwei-felder select { width: 100%; min-width: 0; }

/* Jahresplan: Monatskalender */
.kal { display: grid; gap: 4px; margin-top: 8px; }
.kal-kopf, .kal-woche { display: grid; grid-template-columns: 26px repeat(7, minmax(0, 1fr)); gap: 4px; }
.kal-kopf span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.kal-kw { font-size: 11px; color: var(--muted); align-self: center; text-align: center; }
.kal-tag { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 0 0 9px;
  border: 1px solid var(--grid); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.kal-tag b { font-size: 15px; font-weight: 600; }
.kal-tag small { font-size: 11px; font-weight: 700; line-height: 1; }
.kal-tag.we { background: #dee2e9; }
.kal-tag.feier { background: #f8d7d3; }
.kal-tag.bruecke { background: #fff3cd; }
.kal-tag.heute { outline: 2px solid var(--ink); outline-offset: 1px; }
.kal-tag.gewaehlt { box-shadow: inset 0 0 0 3px var(--ink); }
.kal-tag.ist-r::after, .kal-tag.ist-m::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 0; border-bottom: 2px solid currentColor; }
.kal-tag.ist-m::after { height: 3px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.kal-leer { min-height: 46px; }
.kal-einsatz { margin: -1px 0 2px 30px; font-size: 12px; font-weight: 600; color: var(--primary); }
.kal-einsatz.minus, .kal-einsatz.minus a { color: var(--warn); }
.code-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.code-knoepfe .knopf { min-height: 38px; padding: 0 10px; font-size: 13px; }
.mini-feld { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-left: 4px; }
.mini-feld.we { background: #dee2e9; } .mini-feld.feier { background: #f8d7d3; } .mini-feld.bruecke { background: #fff3cd; }
/* Jahresplan: Monat für Monat als Farbraster */
.hm { display: grid; gap: 3px; }
.hm-zeile { display: grid; grid-template-columns: 74px repeat(12, minmax(0, 1fr)) 30px; gap: 2px; align-items: center; font-size: 11.5px; }
.hm-kopf span { text-align: center; color: var(--muted); font-weight: 700; }
.hm-name { font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-feld { min-height: 20px; border-radius: 3px; background: #f1f3f6; text-align: center; line-height: 20px; font-weight: 600; }
.hm-summe { text-align: right; font-weight: 700; }

/* Immobilien: was es kostet, was es aufbaut */
.immo-zeile { padding: 8px 0; border-top: 1px solid var(--grid); font-size: 14px; }
.immo-zeile small { display: block; color: var(--muted); font-size: 12px; }
.immo-zeile small.plus { color: var(--accent); }
.immo-bahn { display: flex; height: 14px; margin: 4px 0; border-radius: 3px; overflow: hidden; background: #f1f3f6; }
/* Ziele: Fortschritt */
.ziel-bahn { display: block; height: 8px; margin: 5px 0 3px; border-radius: 4px; background: #e9ecf1; overflow: hidden; max-width: 220px; }
.ziel-bahn span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
/* Tilgungsplan: ein Block je Kredit und Jahr */
details.tg-jahr summary { cursor: pointer; }
details.tg-jahr summary small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
/* OneDrive: Hinweiszeile oben, nur wenn etwas zu tun ist */
.sync-leiste { margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius); background: #e7f1f8; color: #1d4a6e; font-size: 14px; border: 1px solid #c9dfee; }
.sync-leiste.ok { background: #e3f3ec; color: #135c43; border-color: #c4e5d6; }
.sync-leiste.fehler { background: #fbe9e8; color: #8f2a24; border-color: #f2cfcc; }
.sync-leiste button { font: inherit; font-weight: 700; color: var(--primary); background: none; border: 0; text-decoration: underline; padding: 0 0 0 4px; cursor: pointer; }
/* Hilfe: ⓘ an Kacheln (Erklärung aus Excel), Anleitung */
.kachel-i { border: 0; background: none; color: var(--petrol); font-size: 15px; line-height: 1; padding: 2px 4px; margin-left: 4px; cursor: pointer; vertical-align: 0; }
.kachel-hilfe { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--calc); color: var(--ink); font-size: 13px; font-weight: 400; line-height: 1.4; }
.hl-wann { margin-top: 14px; }
.hl-liste { margin: 0; }
.hl-liste dt { font-weight: 700; margin-top: 10px; }
.hl-liste dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.hl-suche { width: 100%; font: inherit; font-size: 16px; min-height: 44px; padding: 0 12px; border: 1px solid var(--grid); border-radius: 10px; margin-bottom: 6px; }
details.hl-begriff { border-top: 1px solid var(--grid); padding: 8px 0; }
details.hl-begriff p { margin: 6px 0 0; font-size: 14px; }
/* Einstellungen: je Bereich eine Zeile zum Aufklappen, Einheit hinter dem Feld, Auswahllisten als Marken */
details.ein-bereich > summary { padding: 2px 0; }
details.ein-bereich[open] > summary { margin-bottom: 10px; }
.mit-einheit { display: flex; align-items: center; gap: 8px; }
.mit-einheit input { flex: 1; min-width: 0; text-align: right; }
.mit-einheit span { color: var(--muted); font-weight: 600; min-width: 1em; }
.ein-liste { border-top: 1px solid var(--grid); padding-top: 10px; margin-top: 10px; }
.ein-liste h3 { margin: 0 0 2px; font-size: 15px; }
.ein-chips span { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; border-radius: 999px; border: 1px solid var(--grid); background: var(--input); font-size: 13px; font-weight: 600; }
.ein-chips span.fest { background: #eef1f5; color: var(--muted); padding-right: 12px; }
.ein-chips .weg { border: 0; background: none; color: var(--warn); font-size: 17px; line-height: 1; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.ein-neu { display: flex; gap: 8px; margin-top: 10px; }
.ein-neu input { flex: 1; min-width: 0; font: inherit; font-size: 16px; min-height: 40px; padding: 0 12px; border: 1px solid var(--grid); border-radius: 10px; background: var(--input); }
/* Jahresanalyse: je Jahr eine Zeile zum Aufklappen, Kategorien als Balken, Gold = Auswertungsjahr */
.ja-gold { color: var(--gold); }
details.ja-jahr { border-top: 1px solid var(--grid); }
details.ja-jahr:first-child { border-top: 0; }
details.ja-jahr summary { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; cursor: pointer; list-style: none; }
details.ja-jahr summary::-webkit-details-marker { display: none; }
details.ja-jahr.aj > summary { background: var(--gold-hell); border-radius: 8px; }
.ja-j { font-weight: 700; color: var(--primary); }
details.ja-jahr.aj .ja-j { color: var(--gold); }
.ja-bahn { height: 10px; background: #eef1f5; border-radius: 5px; overflow: hidden; }
.ja-bahn span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.ja-wert { text-align: right; font-size: 14px; font-weight: 600; }
.ja-wert small { display: block; font-size: 12px; font-weight: 500; }
.ja-werte { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; margin: 6px 6px 8px; font-size: 14px; }
.ja-werte dt { color: var(--muted); }
.ja-werte dd { margin: 0; text-align: right; }
.ja-werte .ja-trenner { border-top: 1px solid var(--grid); padding-top: 6px; margin-top: 4px; }
.ja-werte dt.ja-trenner { color: var(--ink); font-weight: 700; }
.ja-werte dd.ja-trenner { color: var(--muted); font-size: 13px; }
.ja-spar { margin-top: 8px; padding-top: 6px; border-top: 2px solid var(--gold); color: var(--gold); font-size: 12px; font-weight: 700; }
a.ja-kat { color: inherit; text-decoration: none; padding: 3px 0; }
.ja-tabelle tr.aj td { background: var(--gold-hell); }
.ja-jtaste { border: 0; background: none; color: var(--primary); font-weight: 700; padding: 2px 0; cursor: pointer; text-decoration: underline; }

/* Monatsabschluss */
.liste.check li { align-items: flex-start; font-size: 14px; flex-wrap: wrap; }
.liste.check .name { flex: 1 1 200px; }
.check-zeichen { width: 18px; flex: none; font-size: 16px; line-height: 1.2; text-align: center; }
.knopf.klein { min-height: 34px; padding: 0 12px; font-size: 13px; }
.liste.check .knopf.klein { margin-left: 30px; }
.liste.tipps li { font-size: 13.5px; }
.liste.tipps li::before { content: "›"; color: var(--muted); font-weight: 700; }
.auszug.abschluss li { align-items: center; }
.auszug.abschluss .betrag input { width: 120px; text-align: right; }
details.so-gerechnet summary { cursor: pointer; font-weight: 600; }
details.so-gerechnet p { margin: 6px 0 0; }

/* Kontoauszug */
.auszug { list-style: none; margin: 0; padding: 0; }
.auszug li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--grid); font-size: 14px; }
.auszug li:first-child { border-top: 0; }
.auszug .was small { display: block; color: var(--muted); font-size: 12px; }
.auszug .betrag { text-align: right; }
.auszug .betrag small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.auszug li.stand .was, .auszug li.stand .betrag { font-weight: 700; }
.auszug li.gemeldet { background: #fbf4e6; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.auszug li.heute { background: #e3f3ec; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.auszug li.trenner { display: block; color: var(--petrol); font-weight: 700; background: #e5f2f3; margin: 0 -16px; padding: 6px 16px; }
.auszug li.rechnung .was { font-style: italic; }
.auszug li.blass { color: var(--muted); }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini > div { border-top: 3px solid var(--primary); background: var(--bg); border-radius: 8px; padding: 8px; font-size: 12px; }
.mini b { display: block; font-size: 15px; margin: 2px 0; }

/* ---------- Dashboard ---------- */
h2.bereich { font-size: 15px; color: var(--primary); margin: 14px 0 -2px; }
.dband { padding: 12px 14px; font-size: 14px; }
.dband p { margin: 4px 0 10px; font-size: 13px; }
.dband.prog { background: #faecc8; }
.dband.depot { background: #e7eef7; }
.dband.voll { background: var(--gold); color: #fff; }
.dband .chips .leise { font-size: 12px; font-weight: 700; margin-right: 2px; }
.dband.voll .chips .leise { color: #fff; }
.grafik text.ring-gross { font-size: 19px; font-weight: 750; }
.grafik .gitter { stroke: var(--grid); stroke-width: .6; }
.grafik .marke rect { fill: #fff; stroke: var(--grid); }
.grafik .marke text { font-size: 8.5px; font-weight: 700; }
.ring { max-width: 300px; margin: 0 auto; }
.ring-legende { display: grid; gap: 10px; font-size: 13px; margin-top: 8px; }
.rl-kopf, .rl-konto { display: flex; align-items: center; gap: 6px; }
.rl-kopf .zahl, .rl-konto .zahl { margin-left: auto; }
.rl-konto { padding-left: 16px; color: var(--muted); }
.fs-zeile { display: grid; grid-template-columns: 34% 1fr; gap: 4px 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--grid); font-size: 13px; }
.fs-zeile:first-child { border-top: 0; }
.fs-name { font-weight: 600; }
.fs-bahn { height: 14px; background: #e9ecf1; border-radius: 4px; overflow: hidden; }
.fs-bahn span { display: block; height: 100%; border-radius: 4px; }
.fs-text { grid-column: 2; }
.fs-text small { display: block; color: var(--muted); font-size: 11.5px; }
.legende .marke { display: inline-block; margin: 0 3px 0 8px; vertical-align: -1px; }
.legende .marke:first-child { margin-left: 0; }
.bl-zeile { display: grid; grid-template-columns: 34% 1fr auto; gap: 8px; align-items: center; min-height: 28px; font-size: 13px; }
.bl-bahn { height: 14px; }
.bl-bahn span { display: block; height: 100%; border-radius: 2px; }
.bl-wert { min-width: 6.5em; text-align: right; }
.bl-unter { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: -4px; }
.tabelle-rollen { overflow-x: auto; }
.tabelle-rollen .tabelle { font-size: 13px; white-space: nowrap; }
.kreditstreifen { display: flex; gap: 2px; overflow-x: auto; }
.kreditstreifen > div { flex: 1; min-width: 44px; background: #4d74ad; color: #fff; border-radius: 3px; padding: 6px 4px; text-align: center; font-size: 12px; }
.kreditstreifen > div:nth-child(even) { background: #7a9dc4; }
.kreditstreifen > div.sonder { box-shadow: inset 0 -4px 0 var(--gold); }
.kreditstreifen small { display: block; opacity: .85; font-size: 10.5px; }
.extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.extra input { width: 7em; min-height: 40px; padding: 0 10px; border: 1px solid var(--gold); background: var(--input); border-radius: 10px; font: inherit; font-weight: 700; text-align: right; }

/* ---------- Start und Ihr Monat ---------- */
.fc { display: flex; align-items: center; gap: 14px; }
.fc-ringe { width: 120px; flex: none; }
.fc-liste { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.fc-liste li { display: flex; gap: 10px; align-items: flex-start; }
.fc-liste .marke { margin-top: 5px; }
.fc-liste small { display: block; color: var(--muted); font-size: 12px; }
.kopfzeile { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kopfzeile a { font-size: 13px; font-weight: 700; color: var(--petrol); text-decoration: none; }
.gehalt { margin: 8px 0 4px; }
.gb-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.gb-kopf b { color: var(--ink); }
.schild { background: #e7eaee; color: var(--ink); font-weight: 700; font-size: 12px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.gb-bahn { display: flex; height: 22px; margin: 6px 0; gap: 1px; }
.gehalt.knapp .gb-bahn { height: 9px; opacity: .6; }
.gb-teil { display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; font-size: 11px; white-space: nowrap; }
.gb-rest { background: var(--ohne); }
.gb-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.gb-legende i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.gehalt.knapp { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--grid); }
.toepfe { margin-top: 12px; border-top: 1px solid var(--grid); padding-top: 8px; }
.tp-kopf { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.tp-kopf span { color: var(--muted); font-size: 12px; }
.tp-zeile { display: grid; grid-template-columns: 76px 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 0; font-size: 14px; }
.tp-zeile small { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.tp-name a { color: var(--ink); font-weight: 700; text-decoration: none; }
.tp-name { font-weight: 700; }
.tp-wert { font-weight: 700; text-align: right; }
.tp-summe { text-align: right; margin: 8px 0 0; font-size: 14px; }
.tp-summe .zahl { color: var(--gold); font-weight: 800; font-size: 17px; }
.tp-summe.minus .zahl, .tp-summe .zahl.minus { color: var(--warn); }
.dm-zeile { font-size: 13px; margin: 8px 0 0; }
.an-karten { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 78%); gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.an-karten .karte { scroll-snap-align: start; }
.karte.an { border-top: 4px solid var(--gold); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.karte.an p { margin: 2px 0; flex: 1; }
.an-abstand { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.an-abstand.bald { background: #f4e2bb; color: #8c5f0a; }
.an-abstand.ueber { background: #f6d4d1; color: var(--warn); }
.an-link { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.liste.pc li { align-items: flex-start; font-size: 13.5px; }
.pc-symbol { font-weight: 700; width: 16px; flex: none; }
.pc-link { font-size: 12.5px; font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.monatswahl { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.monatswahl h2 { margin: 0; font-size: 18px; }
.monatswahl .knopf { min-height: 38px; padding: 0 14px; font-size: 18px; }
@media (min-width: 900px) { .an-karten { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }

/* ---------- Erfassen ---------- */
.geaendert { background: #fbf0d6; border: 1px solid #ecd39a; color: #6e4c06; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.geaendert button { margin-left: 6px; border: 0; background: none; color: var(--primary); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.formular { display: grid; gap: 10px; }
.formular label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.formular label[hidden] { display: none; }
.formular input, .formular select { font: inherit; font-size: 16px; color: var(--ink); font-weight: 500; min-height: 44px; padding: 0 12px; border: 1px solid var(--grid);
  border-radius: 10px; background: var(--input); width: 100%; }
.formular .feldfehler { border-color: var(--warn); box-shadow: 0 0 0 2px #f6d4d1; }
.formular .hinweis { margin: 0; }
.zeile-link { display: contents; color: inherit; text-decoration: none; }
.auszug li:has(.zeile-link) { cursor: pointer; }
.aufgaben { display: flex; flex-wrap: wrap; gap: 8px; }
.aufgaben .knopf { flex: 1 1 auto; }
[data-suche] input { font: inherit; width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--grid); border-radius: 10px; margin-top: 4px; }

/* ---------- Leiste unten (Handy) ---------- */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--grid); display: flex; padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.leiste a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--leiste-h); font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.leiste svg { width: 24px; height: 24px; }
.leiste a.aktiv { color: var(--primary); }
.leiste .marke-text { display: none; }

/* ---------- PC: Leiste links, Inhalt breiter ---------- */
@media (min-width: 900px) {
  body { padding-left: 232px; }
  .leiste { top: 0; right: auto; width: 232px; flex-direction: column; justify-content: flex-start; padding: 16px 12px; gap: 4px;
    background: var(--head); border: 0; }
  .leiste .marke-text { display: block; color: #fff; font-size: 18px; font-weight: 700; padding: 8px 12px 16px; }
  .leiste a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px;
    border-radius: 10px; font-size: 15px; color: rgba(255, 255, 255, .72); }
  .leiste a:hover { background: rgba(255, 255, 255, .07); }
  .leiste a.aktiv { color: #fff; background: rgba(255, 255, 255, .13); }
  .kopf { padding: 20px 32px 16px; background: var(--bg); color: var(--ink); position: static; max-width: 1120px; }
  .kopf h1 { font-size: 26px; }
  .kopf .stand { color: var(--muted); opacity: 1; }
  main { max-width: 1120px; margin: 0; padding: 8px 32px 40px; }
  .raster.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .raster .breit { grid-column: 1 / -1; }
  .kacheln { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .kacheln .gross { grid-column: auto; }
  .kacheln .gross .wert { font-size: 22px; }
}
