/* Geteiltes Leid - Handy zuerst. Farben nur als Variablen, Dunkel folgt dem Geraet. */
:root {
  --grund: #f4f6f3;
  --flaeche: #ffffff;
  --flaeche-2: #eef2ee;
  --linie: #dde3dc;
  --text: #1f2a26;
  --leise: #66736d;
  --akzent: #2f6f5e;
  --akzent-text: #ffffff;
  --plus: #2f6f5e;        /* bekommt Geld */
  --minus: #b4552d;       /* schuldet */
  --hinweis-bg: #fff4dc;
  --hinweis-text: #6b4a00;
  --fehler-bg: #fde7e1;
  --fehler-text: #8a2b10;
  --ok-bg: #e2f1ea;
  --ok-text: #1d5040;
  --schatten: 0 1px 2px rgba(20, 40, 30, .06), 0 4px 14px rgba(20, 40, 30, .06);
  --rund: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #121816;
    --flaeche: #1b2320;
    --flaeche-2: #222c28;
    --linie: #2e3a35;
    --text: #e6ece9;
    --leise: #93a19a;
    --akzent: #5fb49a;
    --akzent-text: #0d1a15;
    --plus: #6cc3a8;
    --minus: #e3895f;
    --hinweis-bg: #3a2f14;
    --hinweis-text: #f3d99a;
    --fehler-bg: #3d1f16;
    --fehler-text: #f6b7a0;
    --ok-bg: #16332a;
    --ok-text: #a6e3cd;
    /* NICHT "none": in "var(--schatten), inset ..." waere das ungueltig, und der Browser verwirft die
       ganze Angabe (der gewaehlte Reiter verlor im Dunkeln seinen Rahmen, 26.09.2026). */
    --schatten: 0 0 0 transparent;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* hidden muss IMMER gewinnen: sonst ueberstimmt label.feld {display:block} das Ausblenden
   (bei "Ueberweisung" standen Beleg, "Wofuer?" und Kategorie noch da, 26.09.2026). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
a { color: var(--akzent); }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; text-wrap: balance; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--plus); }
.minus { color: var(--minus); }

.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf-innen { max-width: 720px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; justify-content: space-between; }
.marke { font-weight: 800; letter-spacing: -.01em; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.marke span { color: var(--akzent); }
.huelle { max-width: 720px; margin: 0 auto; padding: 16px; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund); padding: 16px; box-shadow: var(--schatten); margin-bottom: 14px; }
.karte > h2:first-child { margin-top: 0; }
.stand { font-size: 1.35rem; font-weight: 700; margin: .1rem 0 .3rem; }
.stand-wer { font-weight: 600; margin: .2rem 0 0; }
.stand-betrag { font-size: 2rem; font-weight: 750; margin: 0 0 .3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stand-betrag.plus { color: var(--plus); }
.stand-betrag.minus { color: var(--minus); }
.zurueck { display: inline-block; font-size: .9rem; text-decoration: none; font-weight: 600; margin-bottom: .2rem; }
.stand.plus { color: var(--plus); }
.stand.minus { color: var(--minus); }

.meldung { border-radius: 10px; padding: .7rem .9rem; margin-bottom: 12px; }
.meldung.ok { background: var(--ok-bg); color: var(--ok-text); }
.meldung.fehler { background: var(--fehler-bg); color: var(--fehler-text); }
.meldung.hinweis { background: var(--hinweis-bg); color: var(--hinweis-text); }

/* Liste von Eintraegen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { border-top: 1px solid var(--linie); }
.liste li:first-child { border-top: 0; }
.zeile { display: flex; gap: 12px; align-items: center; padding: .65rem 0; color: inherit; text-decoration: none; }
.zeile .was { flex: 1; min-width: 0; }
.zeile .was strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.zeile .was span { font-size: .85rem; color: var(--leise); }
.zeile .was strong.ganz { white-space: normal; }   /* Saetze mit Betrag nie abschneiden */
.zeile .wie { text-align: right; }
.zeile .wie span { display: block; font-size: .8rem; color: var(--leise); }
.symbol { width: 36px; height: 36px; border-radius: 10px; background: var(--flaeche-2); display: grid; place-items: center; font-size: .95rem; flex: none; }
.tag { font-size: .8rem; color: var(--leise); margin: 1rem 0 .2rem; font-weight: 600; }

/* Knoepfe */
.knopf, button { font: inherit; border: 0; border-radius: 12px; padding: .75rem 1.1rem; background: var(--akzent); color: var(--akzent-text); font-weight: 650; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.knopf.zweit, button.zweit { background: var(--flaeche-2); color: var(--text); }
.knopf.gefahr, button.gefahr { background: transparent; color: var(--minus); border: 1px solid var(--minus); }
.knopf.breit, button.breit { width: 100%; }
button:focus-visible, .knopf:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, label.chip:focus-within {
  outline: 3px solid var(--akzent); outline-offset: 2px; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Formular */
label.feld { display: block; margin: 14px 0 0; font-weight: 600; font-size: .92rem; }
label.feld small { font-weight: 400; color: var(--leise); }
input[type=text], input[type=date], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 10px; padding: .7rem .8rem; margin-top: 6px; font-weight: 400; }
/* Fragen ueber Knopfreihen, gesetzt wie die Feldbeschriftungen */
.frage { display: block; margin: 16px 0 0; font-weight: 600; font-size: .92rem; }
textarea { min-height: 70px; }
input.betrag { font-size: 2rem; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.reiter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--flaeche-2); padding: 4px; border-radius: 12px; }
.reiter label { text-align: center; padding: .55rem .2rem; border-radius: 9px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.reiter input { position: absolute; opacity: 0; pointer-events: none; }
.reiter label:has(input:checked) { background: var(--flaeche); box-shadow: var(--schatten), inset 0 0 0 1.5px var(--akzent); color: var(--akzent); }
.reiter label:has(input:focus-visible) { outline: 3px solid var(--akzent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
label.chip { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 999px; padding: .5rem .9rem; cursor: pointer; font-weight: 600; user-select: none; }
label.chip input { position: absolute; opacity: 0; pointer-events: none; }
label.chip:has(input:checked) { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
label.chip.gast { font-style: italic; }
button.chip-neu { background: transparent; color: var(--akzent); border: 1px dashed var(--akzent); border-radius: 999px; padding: .45rem .9rem; font-weight: 600; }
.teilung { margin-top: 10px; }
.teilung table { width: 100%; border-collapse: collapse; }
.teilung td { padding: 6px 0; }
.teilung td:last-child { width: 45%; }
.teilung input { margin-top: 0; text-align: right; }
.teilung .rest { font-weight: 600; margin-top: 6px; }
.scanner { display: flex; gap: 10px; align-items: center; background: var(--flaeche-2); border-radius: 12px; padding: 10px 12px; margin-top: 14px; }
.scanner input[type=file] { display: none; }
.scanner .text { flex: 1; font-size: .9rem; }
.scanner img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
/* Der Knopf lag farbgleich auf seinem Kasten und war unsichtbar */
.scanner .knopf { background: var(--flaeche); color: var(--akzent); border: 1px solid var(--akzent); flex: none; }
details.mehr { margin-top: 14px; }
details.mehr summary { cursor: pointer; color: var(--akzent); font-weight: 600; }

/* Balken (Zahlen) */
.balken { height: 10px; background: var(--flaeche-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.balken span { display: block; height: 100%; background: var(--akzent); border-radius: 99px; }
.kat { padding: .6rem 0; border-top: 1px solid var(--linie); }
.kat:first-child { border-top: 0; }
.kat .kopfzeile { display: flex; justify-content: space-between; gap: 10px; }
.kat .je { font-size: .82rem; color: var(--leise); margin-top: 4px; }
.monatsleiste { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.monatsleiste a { text-decoration: none; font-weight: 700; padding: .3rem .6rem; }

.bank { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .95rem; margin: 10px 0; }
.bank dt { color: var(--leise); }
.bank dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.girocode { text-align: center; }
.girocode img { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 10px; }
.pille { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; background: var(--flaeche-2); color: var(--leise); }
.pille.offen, .pille.teilweise { background: var(--hinweis-bg); color: var(--hinweis-text); }
.pille.bezahlt, .pille.quitt { background: var(--ok-bg); color: var(--ok-text); }

/* Untere Leiste */
.fuss { position: fixed; left: 0; right: 0; bottom: 0; background: var(--flaeche); border-top: 1px solid var(--linie);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.fuss a { text-align: center; text-decoration: none; color: var(--leise); font-size: .72rem; font-weight: 600; padding: 4px 0; }
.fuss a .zeichen { display: block; font-size: 1.2rem; line-height: 1.3; }
.fuss a.hier { color: var(--akzent); }
.fuss a.neu .zeichen { width: 48px; height: 48px; margin: -18px auto 0; border-radius: 50%; background: var(--akzent); color: var(--akzent-text);
  display: grid; place-items: center; font-size: 1.8rem; box-shadow: 0 4px 12px rgba(0,0,0,.18); }

@media (prefers-reduced-motion: no-preference) {
  .balken span { transition: width .4s ease; }
}
@media (min-width: 700px) {
  .huelle { padding: 24px 16px; }
}
