:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1f241f;
  --grau: #6d7269;
  --linie: #e3e0d8;
  --gruen: #2f4739;
  --gruen-hell: #e8efe6;
  --ein: #2f7d52;
  --aus: #b5533c;
  --gelb: #e6b455;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(31, 36, 31, .06), 0 6px 18px rgba(31, 36, 31, .05);
  --nav-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161815;
    --card: #1f231e;
    --text: #eceee6;
    --grau: #9aa093;
    --linie: #2e332c;
    --gruen: #cfe3c9;
    --gruen-hell: #26302a;
    --ein: #6fc48d;
    --aus: #e0846c;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: inherit; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.02rem; letter-spacing: .01em; }
.grau { color: var(--grau); }
.klein { font-size: .82rem; }
.gross { font-size: 2rem; }
.r { text-align: right; }

/* ---------- Kopf */
.kopf { position: sticky; top: 0; z-index: 20; background: var(--gruen); color: #fff; }
@media (prefers-color-scheme: dark) { .kopf { color: #161815; } }
.kopf-inner {
  max-width: 880px; margin: 0 auto; padding: .55rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: .4rem; letter-spacing: .01em; }
.huf { font-size: 1.05rem; }
.nav-oben { display: flex; gap: 1.1rem; }
.nav-oben a { text-decoration: none; font-size: .9rem; opacity: .72; padding: .2rem 0; border-bottom: 2px solid transparent; }
.nav-oben a.aktiv, .nav-oben a:hover { opacity: 1; border-color: currentColor; }

/* ---------- Inhalt */
.inhalt { max-width: 880px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.seiten-titel { margin: 0 0 .9rem; }
.zurueck { text-decoration: none; color: var(--grau); font-size: .9rem; display: inline-block; margin-bottom: .2rem; }
.karte {
  background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1rem; margin: 0 0 .85rem; box-shadow: var(--schatten);
}
.karte > h2:first-child { margin-top: 0; }
.leise-box summary { cursor: pointer; color: var(--grau); font-size: .9rem; }
.leer { color: var(--grau); margin: .3rem 0; }
.fussnote { color: var(--grau); font-size: .85rem; margin-top: 1.2rem; }
.fussnote a { color: var(--grau); }

/* ---------- Monatsleiste */
.monatsleiste {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius);
  margin-bottom: .85rem; overflow: hidden; box-shadow: var(--schatten);
}
.monatsleiste .pfeil {
  padding: .95rem 1.15rem; text-decoration: none; font-size: 1.5rem; line-height: 1;
  color: var(--grau); min-width: 48px; text-align: center;
}
.monatsleiste .pfeil:active { background: var(--gruen-hell); }
.monat-name { text-align: center; display: flex; flex-direction: column; }
.monat-name small { color: var(--grau); font-size: .72rem; }

/* ---------- Kacheln */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .85rem; }
.kachel {
  background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .8rem .9rem; box-shadow: var(--schatten);
  display: flex; flex-direction: column; gap: .15rem;
}
.kachel .label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grau); }
.kachel strong { font-size: 1.28rem; font-variant-numeric: tabular-nums; }
.kachel.ein strong { color: var(--ein); }
.kachel.aus strong { color: var(--aus); }
.kachel.saldo { grid-column: 1 / -1; background: var(--gruen-hell); border-color: transparent; }
.kachel.saldo.plus strong { color: var(--ein); }
.kachel.saldo.minus strong { color: var(--aus); }

/* ---------- Tabelle */
.tab { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tab th {
  text-align: left; font-weight: 600; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--grau); padding: .3rem .35rem; border-bottom: 1px solid var(--linie);
}
.tab td { padding: .5rem .35rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tab tr:last-child td { border-bottom: 0; }
.tab td small { display: block; font-size: .78rem; }
.tab a { text-decoration: none; }
.tab .offen { color: var(--aus); font-weight: 600; }
.tab .ok { color: var(--ein); }
.pferde-tab td { vertical-align: middle; }
tr.inaktiv { opacity: .45; }
.stift { text-decoration: none; color: var(--grau); }

/* ---------- Balken */
.balken { list-style: none; margin: 0; padding: 0; }
.balken li + li { margin-top: .6rem; }
.balken-kopf { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .22rem; }
.balken-kopf strong { font-variant-numeric: tabular-nums; }
.balken-spur { height: 8px; background: var(--linie); border-radius: 99px; overflow: hidden; }
.balken-spur i { display: block; height: 100%; background: var(--aus); border-radius: 99px; opacity: .75; }

/* ---------- Verlauf */
.verlauf { display: flex; align-items: flex-end; gap: .5rem; height: 110px; margin: .4rem 0 .1rem; }
.monatssaeule { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: .3rem; }
.saeulen { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; }
.saeulen i { width: 42%; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 2px; }
.s-ein { background: var(--ein); opacity: .85; }
.s-aus { background: var(--aus); opacity: .85; }
.monatssaeule span { font-size: .68rem; color: var(--grau); }
.monatssaeule.jetzt span { color: var(--text); font-weight: 700; }
.legende { font-size: .75rem; color: var(--grau); display: flex; align-items: center; gap: .3rem; margin-top: .5rem; }
.legende i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-left: .5rem; }
.p-ein { background: var(--ein); }
.p-aus { background: var(--aus); }

/* ---------- Buchungsliste */
.liste { display: flex; flex-direction: column; }
.zeile {
  display: flex; justify-content: space-between; gap: .7rem; align-items: center;
  padding: .6rem .1rem; border-bottom: 1px solid var(--linie);
}
.zeile:last-child { border-bottom: 0; }
.z-haupt { display: flex; flex-direction: column; min-width: 0; }
.z-titel { font-weight: 600; font-size: .94rem; }
.z-sub { color: var(--grau); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-datum { color: var(--grau); font-size: .75rem; margin-top: .1rem; }
.z-rechts { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.betrag { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.betrag.einnahme { color: var(--ein); }
.betrag.ausgabe { color: var(--aus); }
.beleg-pill {
  font-size: .68rem; text-decoration: none; color: var(--grau);
  border: 1px solid var(--linie); border-radius: 99px; padding: .12rem .45rem;
}
.summenzeile {
  display: flex; gap: .8rem; align-items: baseline; justify-content: space-between;
  padding: .1rem .2rem .8rem; font-size: .92rem; font-variant-numeric: tabular-nums;
}
.summenzeile .ein { color: var(--ein); }
.summenzeile .aus { color: var(--aus); }
.summenzeile .plus { color: var(--ein); }
.summenzeile .minus { color: var(--aus); }
.knopf-zeile {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--linie);
  font: inherit; color: inherit; text-align: left; cursor: pointer; padding: .5rem .1rem;
}
.knopf-zeile:last-child { border-bottom: 0; }

/* ---------- Formular */
.formular { display: flex; flex-direction: column; gap: .85rem; }
.feld { display: flex; flex-direction: column; gap: .3rem; }
.feld > label { font-size: .82rem; font-weight: 600; color: var(--grau); }
.reihe { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
input[type=text], input[type=password], input[type=date], select, input[type=file] {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--linie); border-radius: 10px; padding: .7rem .75rem; width: 100%;
  min-height: 46px;
}
input:focus, select:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }
input[type=file] { padding: .55rem; font-size: .86rem; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--grau); }
.check input { width: auto; min-height: 0; }

.segmente { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.segment { position: relative; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
  display: block; text-align: center; padding: .7rem .5rem; border-radius: 10px;
  border: 1px solid var(--linie); background: var(--bg); font-weight: 600; font-size: .92rem;
  cursor: pointer; min-height: 46px;
}
.segment input:checked + span { border-color: var(--aus); color: var(--aus); background: color-mix(in srgb, var(--aus) 10%, transparent); }
.segment.ein input:checked + span { border-color: var(--ein); color: var(--ein); background: color-mix(in srgb, var(--ein) 10%, transparent); }

.beleg-feld { border-top: 1px dashed var(--linie); padding-top: .85rem; }
.beleg-feld .knopf { margin-top: .35rem; }
.datei-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.datei-wahl {
  display: flex; align-items: center; gap: .55rem; justify-content: center;
  border: 1.5px dashed var(--linie); border-radius: 11px; padding: .85rem 1rem;
  background: var(--bg); font-weight: 600; font-size: .92rem; cursor: pointer;
  min-height: 52px; text-align: center; word-break: break-all;
}
.datei-wahl:hover { border-color: var(--gruen); }
.datei-input:focus-visible + .datei-wahl { outline: 2px solid var(--gruen); outline-offset: 2px; }
.datei-icon { font-size: 1.1rem; }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.ocr-box { background: var(--gruen-hell); border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.beleg-bild { width: 100%; border-radius: 8px; max-height: 320px; object-fit: contain; background: #fff; }
.ocr-hinweis { margin: 0; font-size: .88rem; }
.ocr-text pre { white-space: pre-wrap; font-size: .74rem; color: var(--grau); margin: .4rem 0 0; max-height: 220px; overflow: auto; }
.ocr-text summary { font-size: .82rem; color: var(--grau); cursor: pointer; }

/* ---------- Knoepfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; background: var(--gruen); color: #fff;
  border: 1px solid transparent; border-radius: 11px; padding: .75rem 1rem;
  text-decoration: none; cursor: pointer; min-height: 48px;
}
@media (prefers-color-scheme: dark) { .knopf { color: #161815; } }
.knopf:active { transform: translateY(1px); }
.knopf.breit { display: flex; width: 100%; margin-bottom: .85rem; }
.knopf.gross { min-height: 54px; font-size: 1.02rem; }
.knopf.leise { background: var(--bg); color: var(--text); border-color: var(--linie); }
.knopf.gefahr { background: none; color: var(--aus); border-color: color-mix(in srgb, var(--aus) 40%, transparent); }
.link { background: none; border: 0; font: inherit; color: var(--grau); text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- Belege */
.beleg-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; }
.beleg-karte {
  text-decoration: none; border: 1px solid var(--linie); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; background: var(--bg);
}
.beleg-thumb { width: 100%; height: 110px; object-fit: cover; background: #fff; display: block; }
.beleg-thumb.pdf {
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  color: var(--grau); letter-spacing: .08em; font-size: .9rem;
}
.beleg-info { padding: .45rem .5rem; display: flex; flex-direction: column; gap: .05rem; font-size: .82rem; }
.beleg-info .betrag { font-size: .85rem; }

/* ---------- Geraete-Links */
.formular-inline { display: flex; gap: .5rem; align-items: stretch; }
.formular-inline input { flex: 1; min-width: 0; }
.geraet-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.geraet-kopf h2 { margin: 0; }
.link-block + .link-block { margin-top: .5rem; }
.link-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grau); }
.link-zeile { display: flex; gap: .4rem; margin: .2rem 0 .1rem; align-items: stretch; }
.link-zeile input { flex: 1; min-width: 0; font-size: .76rem; padding: .5rem .55rem; }
.klein-knopf { min-height: 42px; padding: .35rem .75rem; font-size: .8rem; white-space: nowrap; }
.qr-box { margin-top: .3rem; }
.qr-box summary { cursor: pointer; color: var(--grau); font-size: .85rem; }
.qr-bild { display: block; width: 168px; height: 168px; margin: .6rem 0 .25rem;
  border-radius: 10px; background: #fff; padding: 6px; }
@media (max-width: 420px) {
  .formular-inline { flex-direction: column; }
  .link-zeile input { font-size: .7rem; }
}

.hinweis { background: var(--gruen-hell); padding: .6rem .8rem; border-radius: 10px; margin-bottom: .8rem; }
.fehler { background: color-mix(in srgb, var(--aus) 14%, transparent); color: var(--aus);
  padding: .6rem .8rem; border-radius: 10px; margin-bottom: .8rem; font-size: .9rem; font-weight: 600; }

/* ---------- Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.2rem; }
.login-karte {
  background: var(--card); border: 1px solid var(--linie); border-radius: 18px;
  padding: 1.6rem 1.3rem; width: 100%; max-width: 380px; box-shadow: var(--schatten); text-align: center;
}
.login-karte h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.login-karte form { text-align: left; margin-top: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.login-karte .feld label { text-align: left; }
.login-karte code { font-size: .8rem; background: var(--bg); padding: .1rem .3rem; border-radius: 4px; }
.abmelden { margin: 0; }

/* ---------- Navigation unten (Handy) */
.nav-unten { display: none; }
@media (max-width: 720px) {
  .nav-oben { display: none; }
  .nav-unten {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--linie);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  .nav-unten a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .1rem; text-decoration: none; font-size: .66rem; color: var(--grau); padding-top: .3rem;
  }
  .nav-unten a span { font-size: 1.15rem; line-height: 1; }
  .nav-unten a.aktiv { color: var(--gruen); font-weight: 700; }
  .nav-unten a.mitte span {
    background: var(--gruen); color: #fff; border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-top: -14px;
    box-shadow: var(--schatten);
  }
  @media (prefers-color-scheme: dark) { .nav-unten a.mitte span { color: #161815; } }
  .kopf-inner { padding: .6rem .9rem; }
  .kachel strong { font-size: 1.15rem; }
}
@media (max-width: 380px) {
  .kacheln { grid-template-columns: 1fr; }
  .reihe { grid-template-columns: 1fr; }
}

/* ---------- Weide: Zucker im Gras ---------- */
.kopfzeile { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.kopfzeile .seiten-titel { margin: 0 0 .9rem; }
.stufe-gruen { --stufe-farbe: var(--ein); --stufe-text: var(--ein); }
.stufe-gelb { --stufe-farbe: #c9a227; --stufe-text: #9a7a00; }
.stufe-orange { --stufe-farbe: #b4531a; --stufe-text: #b4531a; }
.stufe-rot { --stufe-farbe: var(--aus); --stufe-text: var(--aus); }
.weide-heute {
  background: var(--card); border: 1px solid var(--linie); border-left: 8px solid var(--stufe-farbe);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: .85rem; box-shadow: var(--schatten);
}
.weide-label { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--grau); margin-bottom: .35rem; }
.weide-stufe { display: block; font-size: 2.3rem; font-weight: 700; line-height: 1.05;
  color: var(--stufe-text); letter-spacing: -.02em; }
.weide-grund { margin: .6rem 0 0; max-width: 60ch; }
.weide-hinweis { margin: .7rem 0 0; padding: .6rem .8rem; background: var(--bg); border-radius: 10px; }
.weide-legende { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .78rem;
  color: var(--grau); margin: 0 0 .9rem; }
.weide-legende .lp { width: .6rem; height: .6rem; border-radius: 50%; background: var(--stufe-farbe);
  display: inline-block; margin-left: .55rem; }
.weide-legende .lp:first-child { margin-left: 0; }
.w-kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: .85rem; }
.w-kachel { background: var(--card); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .75rem .85rem; box-shadow: var(--schatten); }
.w-zahl { display: block; font-size: 1.28rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.w-etikett { display: block; font-size: .75rem; color: var(--grau); margin-top: .15rem; }
.w-kachel.warnung .w-zahl { color: var(--aus); }
.weide-tage { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .55rem; }
.weide-tag { border: 1px solid var(--linie); border-top: 4px solid var(--stufe-farbe); border-radius: 10px;
  padding: .55rem .6rem; display: flex; flex-direction: column; gap: .08rem; background: var(--bg); }
.wt-tag { font-weight: 700; font-size: .92rem; }
.wt-datum { font-size: .74rem; color: var(--grau); }
.wt-stufe { font-weight: 600; font-size: .86rem; color: var(--stufe-text); margin-top: .15rem; }
.wt-zahlen, .wt-detail { font-size: .72rem; color: var(--grau); }
.tipps { margin: .4rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .92rem; }
.karte summary { cursor: pointer; color: var(--grau); font-size: .92rem; }
@media (min-width: 720px) {
  .w-kacheln { grid-template-columns: repeat(4, 1fr); }
  .weide-tage { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* ---------- Rechte & Zustand ---------- */
.rechte-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .9rem; }
@media (max-width: 460px) { .rechte-grid { grid-template-columns: 1fr; } }
.recht { display: flex; align-items: center; gap: .6rem; font-size: .9rem; font-weight: 400;
  color: var(--text); min-height: 44px; padding: .25rem .1rem; cursor: pointer; border-radius: 8px; }
.recht:active { background: var(--gruen-hell); }
.recht input { width: auto; min-height: 0; }
.klein-titel { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--grau); margin: 1.1rem 0 .4rem; }
.geraet-block { border-top: 1px solid var(--linie); padding-top: .55rem; margin-top: .3rem; }
.neu-geraet { margin-top: .8rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .14rem .5rem;
  border-radius: 99px; white-space: nowrap; }
.badge.krank { background: color-mix(in srgb, var(--aus) 16%, transparent); color: var(--aus); }
.zustand-karte { border-left: 4px solid var(--gelb); }

/* ---------- Pferdefotos ---------- */
.pferd-kopf { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.pferd-kopf .seiten-titel { margin: 0 0 .15rem; }
.pferd-foto {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--gruen-hell); display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem; border: 1px solid var(--linie);
}
.mini-foto {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: flex;
  align-items: center; justify-content: center; background: var(--gruen-hell);
  font-size: .95rem; border: 1px solid var(--linie);
}
.foto-spalte { width: 46px; }
.foto-spalte .mini-foto { vertical-align: middle; }
textarea {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--linie);
  border-radius: 10px; padding: .7rem .75rem; width: 100%; resize: vertical;
}
textarea:focus { outline: 2px solid var(--gruen); outline-offset: 1px; }

/* ---------- Dashboard ---------- */
a.karte { display: block; text-decoration: none; color: inherit; }
a.karte:hover { border-color: var(--gruen); }
.block-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.block-kopf h2 { margin: 0 0 .5rem; }
.block-kopf .link { font-size: .82rem; color: var(--grau); text-decoration: none; white-space: nowrap; }
.meldungsliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.meldungsliste li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem; font-size: .92rem; }
.meldungsliste a { text-decoration: none; }
.meldung-notiz { flex-basis: 100%; color: var(--grau); font-size: .84rem; }
.todo-liste { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; }
.todo-liste li { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0;
  border-bottom: 1px solid var(--linie); }
.todo-liste li:last-child { border-bottom: 0; }
.todo-hak {
  width: 26px; height: 26px; min-height: 0; padding: 0; flex-shrink: 0; border-radius: 6px;
  border: 1.8px solid var(--grau); background: var(--card); cursor: pointer;
  margin-top: .15rem;
}
.todo-hak:hover, .todo-hak:focus-visible { border-color: var(--ein); color: var(--ein);
  background: color-mix(in srgb, var(--ein) 12%, transparent); }
.todo-text { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.ueberfaellig .todo-text strong { color: var(--aus); }
.todo-neu { display: flex; gap: .4rem; margin-top: .4rem; }
.todo-neu input[type=text] { flex: 1; min-width: 0; }
.todo-neu input[type=date] { width: 145px; }
.todo-neu .knopf { padding: .6rem .9rem; min-height: 46px; }
.kasse-mini { display: flex; gap: .9rem; align-items: baseline; flex-wrap: wrap; font-size: .95rem;
  font-variant-numeric: tabular-nums; margin: .15rem 0 .3rem; }
.kasse-mini .ein { color: var(--ein); }
.kasse-mini .aus { color: var(--aus); }
.kasse-mini .plus { color: var(--ein); }
.kasse-mini .minus { color: var(--aus); }
@media (max-width: 420px) {
  .todo-neu { flex-wrap: wrap; }
  .todo-neu input[type=date] { width: 100%; }
}

.todo-hak.voll { background: var(--ein); border-color: var(--ein); color: #fff;
  font-size: .85rem; line-height: 1; }
.todo-liste li.erledigt .todo-text strong { text-decoration: line-through; color: var(--grau); }
.todo-liste li.erledigt { opacity: .75; }

.todo-liste.eigene li .todo-text strong { color: var(--text); }
.todo-liste.eigene li { border-left: 3px solid var(--ein); padding-left: .6rem; margin-left: -.15rem; }

/* ---------- Umlagen ---------- */
.umlage-liste { display: grid; gap: .6rem; }
@media (min-width: 720px) { .umlage-liste { grid-template-columns: 1fr 1fr; } }
.umlage-zeile { margin: 0; }
.umlage-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.umlage-felder { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.umlage-felder label { display: flex; flex-direction: column; gap: .2rem;
  font-size: .74rem; color: var(--grau); font-weight: 600; }
.umlage-felder input { padding: .5rem .55rem; min-height: 42px; font-size: .92rem; }
.umlage-summe { margin-top: .55rem; padding-top: .45rem; border-top: 1px dashed var(--linie);
  display: flex; justify-content: space-between; font-size: .9rem; }
.umlage-summe strong { font-variant-numeric: tabular-nums; }
.umlage-neu { font-size: .68rem; color: var(--grau); border: 1px solid var(--linie);
  border-radius: 99px; padding: .1rem .45rem; }

.umlage-felder input { color: var(--text); font-weight: 600; }
.umlage-gesamt { display: flex; justify-content: space-between; align-items: baseline;
  padding: .7rem .9rem; margin-top: .8rem; background: var(--gruen-hell);
  border-radius: var(--radius); font-weight: 600; }
.umlage-gesamt strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* ---------- Umlage: Topf + berechneter Anteil ---------- */
.topf-karte { border-left: 4px solid var(--gelb); }
.umlage-anzeige {
  display: flex; flex-direction: column; gap: .2rem; justify-content: center;
  font-size: .74rem; color: var(--grau); font-weight: 600;
  padding: .45rem .55rem; background: var(--bg); border: 1px dashed var(--linie);
  border-radius: 10px;
}
.umlage-anzeige strong { font-size: .95rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Umlage: Kosten + Zahlungen ---------- */
.kosten-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 520px) { .kosten-grid { grid-template-columns: 1fr; } }
.kosten-grid small { font-size: .72rem; line-height: 1.3; }
.tabellen-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabellen-scroll .tab { min-width: 640px; }
.zahl-liste { display: flex; flex-direction: column; }
.zahl-zeile { display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  padding: .55rem 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.zahl-zeile:last-child { border-bottom: 0; }
.zahl-text { display: flex; flex-direction: column; }
.zahl-aktion { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badge.ok { background: color-mix(in srgb, var(--ein) 16%, transparent); color: var(--ein); }
.umlage-karte .betrag-gross { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Umlage: Aufteilung in Umlage + Heu ---------- */
.betrag-kopf {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .65rem 0 .15rem; margin-top: .5rem; border-top: 1px solid #e6e2d8;
}
.betrag-kopf:first-of-type { border-top: none; margin-top: 0; padding-top: .1rem; }
.betrag-kopf strong { font-size: 1rem; }
.teil-heu { padding-left: .9rem; border-left: 2px solid #d9cfae; }
.teil-heu .zahl-text > span:first-child { color: #7a6a3a; }
.mehr-zeile { margin: .35rem 0 .1rem; }

/* ---------- Löschen-Dialog: Herkunft je Buchung ---------- */
.loesch-zeile { align-items: flex-start; text-align: left; }
.loesch-zeile .z-haupt { display: flex; flex-direction: column; gap: .1rem; }
.loesch-zeile .z-sub.klein { font-size: .74rem; color: #6b6459; }
.loesch-zeile .z-haupt { min-width: 0; flex: 1 1 auto; }
.loesch-zeile .z-sub { white-space: normal; overflow: visible; text-overflow: clip; }

/* ---------- Zahnrad: Zugänge auch am Handy erreichbar ---------- */
.kopf-rad {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; margin-left: auto; flex: 0 0 auto;
  border-radius: 50%; text-decoration: none; font-size: 1.15rem; line-height: 1;
  opacity: .8;
}
.kopf-rad:hover, .kopf-rad.aktiv { opacity: 1; background: rgba(255, 255, 255, .16); }

/* Neue Person im Pferde-Formular */
.neue-person { margin: .2rem 0 .6rem; border: 1px dashed var(--linie); border-radius: 12px; padding: .5rem .7rem; }
.neue-person summary { cursor: pointer; font-size: .9rem; font-weight: 600; }
.neue-person[open] summary { margin-bottom: .5rem; }

/* Kopfzeile: Menü und Zahnrad rechts gruppiert */
.nav-oben { margin-left: auto; }
.kopf-rad { margin-left: 0; }
@media (max-width: 720px) {
  .kopf-rad { margin-left: auto; }
}

/* ---------- Tageszettel ---------- */
.zettel-karte h2 { margin: 0; }
.zettel-liste { list-style: none; margin: .3rem 0 .5rem; padding: 0; }
.zettel-liste li {
  display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
  padding: .45rem 0; border-bottom: 1px solid #eee9df;
}
.zettel-liste li:last-child { border-bottom: 0; }
.zettel-text { flex: 1 1 12rem; font-size: .95rem; line-height: 1.35; }
.zettel-meta { font-size: .74rem; color: #6b6459; white-space: nowrap; }
.zettel-weg {
  background: none; border: 0; padding: 0 .2rem; cursor: pointer;
  font-size: 1.05rem; line-height: 1; color: #a89f90;
}
.zettel-weg:hover { color: #b3261e; }
.zettel-neu { display: flex; gap: .4rem; margin-top: .4rem; }
.zettel-neu input[type=text] {
  flex: 1 1 auto; min-width: 0; padding: .6rem .7rem;
  border: 1px solid #d9d3c6; border-radius: 10px; font-size: .95rem;
}
.zettel-neu .knopf { flex: 0 0 auto; padding: 0 .95rem; }

/* ---------- Weide-Status im Header ---------- */
.weide-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem .3rem .5rem; border-radius: 999px; flex: 0 0 auto;
  text-decoration: none; font-size: .78rem; font-weight: 600;
  background: rgba(255, 255, 255, .14); color: inherit; white-space: nowrap;
}
.weide-pill-punkt {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--stufe-farbe); box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.weide-pill.stufe-gruen { --stufe-farbe: #8fd18a; }
.weide-pill.stufe-gelb { --stufe-farbe: #e8cc4a; }
.weide-pill.stufe-orange { --stufe-farbe: #e8894a; }
.weide-pill.stufe-rot { --stufe-farbe: #ee7a6a; }
@media (max-width: 420px) {
  .weide-pill { padding: .3rem .55rem .3rem .45rem; font-size: .72rem; }
}

/* Zettel: Eingabe mit Tagesumschalter */
.zettel-neu { display: block; margin-top: .4rem; }
.zettel-eingabe { display: flex; gap: .4rem; }
.zettel-eingabe input[type=text] {
  flex: 1 1 auto; min-width: 0; padding: .6rem .7rem;
  border: 1px solid #d9d3c6; border-radius: 10px; font-size: .95rem;
}
.zettel-eingabe .knopf { flex: 0 0 auto; padding: 0 .95rem; }
.zettel-tag { display: flex; gap: 1rem; margin-top: .35rem; font-size: .78rem; color: #6b6459; }
.zettel-tag label { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.zettel-tag input { width: auto; }
.zettel-trenner {
  margin: .7rem 0 .1rem; font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #8a7f6d;
}
.zettel-liste.morgen li { background: #fbf8ef; }

/* ============================================================
   Glass-Look: minimalistisch, transluzent, weiche Tiefe
   ============================================================ */
:root {
  --bg: #eef0ee;
  --card: rgba(255, 255, 255, .58);
  --text: #14181a;
  --grau: #5c636e;
  --linie: rgba(255, 255, 255, .58);
  --gruen: #1d3b2e;
  --gruen-hell: rgba(29, 59, 46, .07);
  --ein: #1f7a4d;
  --aus: #b0452f;
  --radius: 22px;
  --schatten: 0 1px 1px rgba(16, 24, 40, .04),
              0 10px 30px rgba(16, 24, 40, .07),
              0 2px 6px rgba(16, 24, 40, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1211;
    --card: rgba(38, 43, 41, .55);
    --text: #eef1ee;
    --grau: #9aa39d;
    --linie: rgba(255, 255, 255, .10);
    --gruen: #d5e6d9;
    --gruen-hell: rgba(255, 255, 255, .06);
    --ein: #63c78e;
    --aus: #e88a72;
    --schatten: 0 1px 1px rgba(0, 0, 0, .3),
                0 12px 34px rgba(0, 0, 0, .42);
  }
}

body {
  background:
    radial-gradient(1300px 900px at 2% -14%, #8fc7ac 0%, rgba(143, 199, 172, 0) 66%),
    radial-gradient(1100px 800px at 106% -10%, #f0c886 0%, rgba(240, 200, 134, 0) 64%),
    radial-gradient(1150px 900px at 48% 122%, #93bddc 0%, rgba(147, 189, 220, 0) 66%),
    linear-gradient(158deg, #d8e8de 0%, #f1e4c8 52%, #d6e5f2 100%);
  background-attachment: fixed;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(1250px 850px at 4% -12%, #1d4a3d 0%, rgba(29, 74, 61, 0) 64%),
      radial-gradient(1050px 750px at 104% -8%, #4a3820 0%, rgba(74, 56, 32, 0) 62%),
      radial-gradient(1100px 850px at 46% 118%, #16303f 0%, rgba(22, 48, 63, 0) 64%),
      linear-gradient(158deg, #0d1512 0%, #14130e 52%, #0e161d 100%);
  }
}

/* Kopf: Glas statt Massivholz */
.kopf {
  background: rgba(255, 255, 255, .58);
  color: var(--text);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}
@media (prefers-color-scheme: dark) {
  .kopf { color: var(--text); background: rgba(24, 29, 27, .62);
          border-bottom-color: rgba(255, 255, 255, .07); }
}
.kopf-inner { max-width: 1180px; }
.brand { letter-spacing: -.015em; }
.nav-oben a { font-size: .86rem; font-weight: 500; opacity: .62; border-bottom: 0; }
.nav-oben a.aktiv { opacity: 1; font-weight: 600; }

/* Karten: Milchglas */
.karte, .kachel, .monatsleiste {
  background: var(--card);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.karte { padding: 1.15rem 1.2rem; }
h1 { font-size: 1.6rem; letter-spacing: -.025em; font-weight: 650; }
h2 { font-size: 1.02rem; letter-spacing: -.01em; font-weight: 600; }
.seiten-titel { font-weight: 650; letter-spacing: -.025em; }

/* Buttons: ruhig, mit feinem Rand */
.knopf {
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .10);
  font-weight: 550;
}
.knopf.leise { box-shadow: none; }

/* Zweispaltig ab Laptop */
.inhalt { max-width: 1180px; padding: 1.4rem 1.25rem 2.5rem; }
.raster { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.raster > * { margin: 0; }
@media (min-width: 900px) {
  .raster { grid-template-columns: 1fr 1fr; gap: 1.15rem; }
  .raster > .breit { grid-column: 1 / -1; }
}

/* Untere Navigation: ebenfalls Glas, sonst scheint Text ungefiltert durch */
.nav-unten {
  background: rgba(255, 255, 255, .72);
  border-top: 1px solid rgba(255, 255, 255, .6);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow: 0 -1px 0 rgba(16, 24, 40, .05);
}
@media (prefers-color-scheme: dark) {
  .nav-unten { background: rgba(20, 25, 23, .78); border-top-color: rgba(255, 255, 255, .08); }
}

/* Untere Navigation: etwas opaker, damit beim Scrollen nichts durchscheint */
.nav-unten { background: rgba(255, 255, 255, .88); }
@media (prefers-color-scheme: dark) { .nav-unten { background: rgba(18, 22, 20, .9); } }
