/* Verträge – Erscheinungsbild „Aktenordner“: Papier, Tinte, farbige Register je Bereich */
:root {
  --grund: #f4f1ea;
  --flaeche: #fffdf8;
  --tinte: #1d2430;
  --tinte-2: #5b6372;
  --linie: #e1dccf;
  --akzent: #24406b;          /* Tintenblau: Hauptknöpfe */
  --akzent-text: #ffffff;
  --rot: #b3261e;
  --rot-hell: #fbe7e4;
  --gelb: #9a6700;
  --gelb-hell: #fdf3d7;
  --gruen: #2f6b3a;
  --gruen-hell: #e6f1e6;
  --grau-hell: #ece9e1;
  --r-privat: #3f8a5a;
  --r-buero: #2f5f9e;
  --r-gmbh: #7a4b8f;
  --r-objekt: #b8792a;
  --radius: 16px;
  --schatten: 0 1px 2px rgba(60, 45, 20, .04), 0 4px 14px rgba(60, 45, 20, .05);
  --blau-hell: #e7eef8; --orange: #b8792a; --orange-hell: #f8ecdb; --lila: #7a4b8f; --lila-hell: #f0e8f4;
  --schrift-titel: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #14171c; --flaeche: #1d2128; --tinte: #ebe7dd; --tinte-2: #a3a9b5; --linie: #2e333c;
    --akzent: #8fb0e3; --akzent-text: #10141a; --rot: #f08a80; --rot-hell: #3a1f1d; --gelb: #e2b54a; --gelb-hell: #352b14;
    --gruen: #8cc79a; --gruen-hell: #1c2c20; --grau-hell: #262a31;
    --schatten: none; --blau-hell: #1d2a3d; --orange: #e0a65a; --orange-hell: #33281a; --lila: #c193d6; --lila-hell: #2c2333;
    --r-privat: #6cbf88; --r-buero: #7aa6e6; --r-gmbh: #c193d6; --r-objekt: #e0a65a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--tinte);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--akzent); }
h1, h2, h3 { font-family: var(--schrift-titel); font-weight: 600; letter-spacing: .01em; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h2 small { font: 600 .8rem system-ui, sans-serif; color: var(--tinte-2); margin-left: .3rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.laden { position: relative; min-height: 340px; color: transparent; font-size: 0; }
.laden::before, .laden::after { content: ""; position: absolute; left: 0; right: 0; border-radius: var(--radius); background: linear-gradient(90deg, var(--grau-hell) 0%, var(--flaeche) 50%, var(--grau-hell) 100%) 0 0 / 200% 100%; animation: schimmer 1.3s linear infinite; }
.laden::before { top: 0; height: 120px; }
.laden::after { top: 136px; height: 200px; }
@keyframes schimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .laden::before, .laden::after { animation: none; } }
.klein { font-size: .85rem; color: var(--tinte-2); }
.mitte { text-align: center; }
.ruhig { color: var(--tinte-2); font-style: italic; margin: .2rem 0; }
.fehlertext { color: var(--rot); min-height: 1.2em; margin: .4rem 0 0; }
.warn { color: var(--rot); }
.warnung { background: var(--rot-hell); color: var(--rot); padding: .5rem .7rem; border-radius: 10px; font-size: .9rem; margin: -.3rem 0 .6rem; }
.hinweis { background: var(--gelb-hell); color: var(--tinte); border-left: 4px solid var(--gelb); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; margin: .8rem 0 0; }

/* Kopf und Leiste */
.kopf {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem;
  padding: calc(.55rem + env(safe-area-inset-top)) 16px .55rem; background: color-mix(in srgb, var(--grund) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--linie);
}
.kopf h1 { flex: 1; margin: 0; font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .zurueck, .kopf .hilfe {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; text-decoration: none;
  color: var(--tinte); border: 1px solid var(--linie); background: var(--flaeche); font-size: 1.3rem; flex: none;
}
.kopf .hilfe { font-size: 1rem; font-weight: 700; color: var(--tinte-2); }
.inhalt { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; }
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-around; align-items: center;
  background: var(--flaeche); border-top: 1px solid var(--linie); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.leiste a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--tinte-2); text-decoration: none; padding: 4px 0 2px; -webkit-tap-highlight-color: transparent; }
.leiste a .ico { width: 24px; height: 24px; }
.leiste a.aktiv { color: var(--akzent); font-weight: 650; }
.leiste a.aktiv .ico { stroke-width: 2.2; }
.leiste a.plus { padding: 0; }
.leiste .plus-knopf {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; background: var(--akzent); color: var(--akzent-text);
  margin-top: -20px; box-shadow: 0 6px 18px color-mix(in srgb, var(--akzent) 40%, transparent); transition: transform .15s;
}
.leiste .plus-knopf .ico { width: 26px; height: 26px; stroke-width: 2.2; }
.leiste a.plus:active .plus-knopf { transform: scale(.94); }

/* Blöcke & Karten */
.block { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--schatten); }
.karte {
  display: block; position: relative; text-decoration: none; color: inherit; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px 10px 18px; margin: 0 0 8px; overflow: hidden;
}
.block .karte { background: var(--grund); }
.karte::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--reiter, var(--linie)); }
.reiter-privat { --reiter: var(--r-privat); } .reiter-buero { --reiter: var(--r-buero); }
.reiter-gmbh { --reiter: var(--r-gmbh); } .reiter-objekt { --reiter: var(--r-objekt); }
.k-oben, .k-unter, .k-fuss { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.k-titel { font-weight: 650; }
.k-unter { color: var(--tinte-2); font-size: .88rem; }
.betrag { color: var(--tinte); font-weight: 600; white-space: nowrap; }
.betrag small { font-weight: 400; color: var(--tinte-2); }
.k-frist { font-size: .88rem; margin-top: 2px; }
.k-fuss { justify-content: flex-start; flex-wrap: wrap; font-size: .78rem; color: var(--tinte-2); margin-top: 4px; gap: .8rem; }
.reiter { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--reiter, var(--tinte-2)); }
.marke { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.marke.rot { background: var(--rot); color: #fff; } .marke.gelb { background: var(--gelb-hell); color: var(--gelb); }
.marke.grau { background: var(--grau-hell); color: var(--tinte-2); } .marke.hell { background: var(--grau-hell); color: var(--tinte-2); }
.marke.dunkel { background: var(--akzent); color: var(--akzent-text); }
.mehrlink { display: block; text-align: right; font-size: .9rem; }
.leer p { margin: 0; }

/* Kosten */
.summe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.summe b { display: block; font-family: var(--schrift-titel); font-size: 1.35rem; }
.summe small { color: var(--tinte-2); font-size: .78rem; }
.balken { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; gap: 2px; }
.balken span { background: var(--reiter); min-width: 4px; }
.bereichsliste, .bereichsliste ul { list-style: none; margin: 0; padding: 0; }
.bereichsliste > li > a { display: flex; align-items: center; gap: .5rem; padding: 7px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--linie); }
.bereichsliste a span, .bereichsliste li li span { margin-left: auto; font-variant-numeric: tabular-nums; }
.bereichsliste small { color: var(--tinte-2); }
.bereichsliste li li { display: flex; padding: 2px 0 2px 1.4rem; font-size: .88rem; color: var(--tinte-2); }
.punkt { width: 10px; height: 10px; border-radius: 3px; background: var(--reiter); display: inline-block; }

/* Filter */
.filter { position: sticky; top: 58px; z-index: 4; background: var(--grund); padding-bottom: 8px; }
.filter-reihe { display: flex; gap: 6px; margin-top: 6px; overflow-x: auto; }
.filter-reihe select { flex: 1 0 auto; width: auto; font-size: .88rem; padding: 7px 8px; }
.summenzeile { text-align: center; color: var(--tinte-2); font-size: .88rem; padding: 10px 0; font-variant-numeric: tabular-nums; }

/* Eintrag */
.kopfkarte { border-top: 6px solid var(--reiter); }
.kopfkarte h2 { font-size: 1.4rem; margin: .2rem 0 .2rem; }
.anbieter { margin: 0; color: var(--tinte-2); }
.nr { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }
.fristbox { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--grau-hell); }
.fristbox:empty { display: none; }
.fristbox span { font-size: .9rem; }
.z-bald, .z-verpasst { background: var(--rot-hell); } .z-bald b, .z-verpasst b { color: var(--rot); }
.z-ok, .z-jederzeit, .z-unbefristet, .z-befristet { background: var(--gruen-hell); } .z-ok b, .z-jederzeit b { color: var(--gruen); }
.z-unbekannt { background: var(--gelb-hell); } .z-unbekannt b { color: var(--gelb); }
dl { margin: 0; }
.zeile { display: grid; grid-template-columns: 8.5rem 1fr; gap: .8rem; padding: 7px 0; border-top: 1px solid var(--linie); }
.zeile:first-child { border-top: 0; }
dt { color: var(--tinte-2); font-size: .88rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.zeile.ernst dd { font-weight: 600; }
.doks { list-style: none; padding: 0; margin: 0 0 10px; }
.doks li { display: flex; gap: .6rem; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--linie); }
.doks li:first-child { border-top: 0; }
.doks a { flex: 1; overflow-wrap: anywhere; }
.verlauf summary { cursor: pointer; font-weight: 600; }
.verlauf ul { padding-left: 1rem; font-size: .88rem; }

/* Formulare */
input, select, textarea {
  width: 100%; font: inherit; color: var(--tinte); background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 10px; padding: 10px 11px; margin-top: 4px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: transparent; }
label { display: block; font-size: .88rem; color: var(--tinte-2); margin-bottom: 10px; }
label small { font-size: .78rem; }
.haken { display: flex; gap: .5rem; align-items: center; color: var(--tinte); }
.haken input { width: auto; margin: 0; }
.formular fieldset { border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); margin: 0 0 14px; padding: 12px 14px 4px; }
.formular legend { font-family: var(--schrift-titel); font-weight: 600; padding: 0 .3rem; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zwei > [hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips label { margin: 0; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span { display: inline-block; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--linie); background: var(--grund); color: var(--tinte); font-size: .9rem; }
.chips input:checked + span { background: var(--reiter, var(--akzent)); border-color: transparent; color: #fff; font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--akzent); }
#ber input:checked + span { background: var(--reiter); }

/* Knöpfe */
.haupt, .zweit, button.link {
  display: inline-flex; justify-content: center; align-items: center; gap: .4rem; font: inherit; font-weight: 600; text-decoration: none;
  border-radius: 11px; padding: 11px 16px; cursor: pointer; border: 1px solid transparent;
}
.haupt { background: var(--akzent); color: var(--akzent-text); }
.zweit { background: var(--flaeche); color: var(--tinte); border-color: var(--linie); }
.zweit.rot, .link.rot { color: var(--rot); }
button.link { background: none; padding: 0; color: var(--akzent); font-weight: 500; font-size: .9rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.knoepfe.klebend { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--grund) 90%, transparent); padding: 8px 0; margin: 0; }
.knoepfe .haupt { flex: 1; }
form > .haupt, .karte-form .haupt, .menue + .zweit { width: 100%; }
.datei-knopf { cursor: pointer; margin: 0; }
.datei-knopf.haupt { color: var(--akzent-text); }

/* Mehr */
.menue { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.menue a { padding: 13px 14px; color: var(--tinte); text-decoration: none; border-top: 1px solid var(--linie); }
.menue a:first-child { border-top: 0; }
.menue a::after { content: "›"; float: right; color: var(--tinte-2); }
.ich { margin: 0 0 10px; }
.geraete { list-style: none; margin: 0; padding: 0; }
.geraete li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: 7px 0; border-top: 1px solid var(--linie); }
.geraete li:first-child { border-top: 0; }
.geraete small { display: block; color: var(--tinte-2); font-size: .78rem; }
.b-kopf { display: flex; gap: .5rem; align-items: center; }
.benutzer.aus { opacity: .6; }
.objekt small { display: block; color: var(--tinte-2); }
.kopierzeile { display: flex; gap: 8px; align-items: center; }
.kopierzeile code { flex: 1; overflow-wrap: anywhere; background: var(--grund); padding: 8px; border-radius: 8px; font-size: .8rem; }
.tabelle-rahmen { overflow-x: auto; }
table { border-collapse: collapse; font-size: .8rem; }
th, td { border: 1px solid var(--linie); padding: 4px 6px; text-align: left; white-space: nowrap; }
.anleitung p, .anleitung li { line-height: 1.55; }

/* Anmeldung */
.vorraum { max-width: 420px; margin: 0 auto; padding: calc(2rem + env(safe-area-inset-top)) 16px 2rem; }
.logo { text-align: center; margin-bottom: 1.2rem; }
.logo img { width: 76px; height: 76px; border-radius: 18px; }
.logo h1 { margin: .4rem 0 0; font-size: 1.8rem; }
.karte-form { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.karte-form h2 { margin-top: 0; }
.code { font-size: 1.6rem; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.qr-rahmen { display: grid; place-items: center; margin: 8px 0; }
.qr { width: 220px; height: 220px; image-rendering: pixelated; border-radius: 6px; }
.schluessel { display: inline-block; margin-top: 4px; user-select: all; font-size: .95rem; letter-spacing: .05em; }
.codes { columns: 2; font-size: 1.05rem; padding-left: 1.4rem; }
.codes li { margin-bottom: 4px; }

/* Dialog & Meldung */
.dialog { border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); color: var(--tinte); width: min(560px, calc(100vw - 32px)); padding: 16px; }
.dialog::backdrop { background: rgba(0,0,0,.35); }
.dialog h2 { margin-top: 0; }
.meldung {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--tinte); color: var(--grund); padding: 10px 16px; border-radius: 12px; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.meldung.fehler { background: var(--rot); color: #fff; }


/* ---------- 2.0: neue Ansichten ---------- */
.hinweisliste a { display: block; padding: 8px 0; border-top: 1px solid var(--linie); color: var(--tinte); text-decoration: none; font-size: .93rem; }
.hinweisliste a:first-of-type { border-top: 0; }
.nf-kachel { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--tinte); border-left: 6px solid var(--rot); }
.nf-kachel small { display: block; color: var(--tinte-2); font-size: .85rem; }
.ring { --p: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: radial-gradient(closest-side, var(--flaeche) 74%, transparent 75% 100%), conic-gradient(var(--gruen) calc(var(--p) * 1%), var(--grau-hell) 0); }
.mieteinnahmen { text-align: center; color: var(--tinte-2); font-size: .9rem; margin: 8px 0 0; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--tinte); text-decoration: none; white-space: nowrap; font-size: .9rem; }
.tabs a.aktiv { background: var(--akzent); color: var(--akzent-text); border-color: transparent; font-weight: 600; }
.tabs.gross a { flex: 1; text-align: center; padding: 11px; font-size: 1rem; }
.klein-knopf { padding: 7px 11px; font-size: .85rem; }
.hinweiszeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linie); flex-wrap: wrap; }
.hinweiszeile:first-of-type { border-top: 0; }
.hinweiszeile small, .zeile-link small { display: block; color: var(--tinte-2); font-size: .82rem; }
.hinweiszeile .knoepfe { margin: 0; }
.zeile-link { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid var(--linie); color: var(--tinte); text-decoration: none; }
.umsatzliste { list-style: none; margin: 0; padding: 0; }
.umsatz { display: grid; grid-template-columns: 5.2rem 1fr auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--linie); align-items: start; }
.umsatzliste.gross .umsatz { cursor: pointer; }
.umsatz:first-child { border-top: 0; }
.u-dat { color: var(--tinte-2); font-size: .82rem; font-variant-numeric: tabular-nums; }
.u-text { min-width: 0; }
.u-text b { display: block; font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.u-text small { display: block; color: var(--tinte-2); font-size: .78rem; overflow-wrap: anywhere; }
.u-zu { color: var(--gruen) !important; }
.u-betrag { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.umsatz.ein .u-betrag { color: var(--gruen); }
.wahl { max-height: 55vh; overflow-y: auto; margin: 8px 0; }
.wahlzeile { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--linie); padding: 9px 4px; color: var(--tinte); font: inherit; cursor: pointer; }
.wahlzeile small { display: block; color: var(--tinte-2); font-size: .8rem; }
.einheiten { list-style: none; padding: 0; margin: 6px 0; }
.einheiten li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--linie); font-size: .9rem; }
.einheiten small { display: block; color: var(--tinte-2); font-size: .78rem; }
.ki-ergebnis { background: var(--grund); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.ki-ergebnis small { display: block; color: var(--tinte-2); font-size: .82rem; margin-top: 2px; }
.eingang .b-kopf a { font-weight: 600; overflow-wrap: anywhere; }
.miete-ist { padding: 8px 0; border-top: 1px solid var(--linie); }
.monate { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.monate span { flex: 1 0 3.6rem; text-align: center; font-size: .72rem; padding: 4px 2px; border-radius: 6px; background: var(--grau-hell); }
.monate span small { display: block; font-size: .7rem; }
.monate .ok { background: var(--gruen-hell); } .monate .fehlt { background: var(--rot-hell); color: var(--rot); } .monate .offen { background: var(--gelb-hell); }
.vorschlag { background: var(--gruen-hell); border-radius: 10px; padding: 9px 11px; margin: 6px 0; }
.vorschlag small { display: block; color: var(--tinte-2); font-size: .8rem; margin: 3px 0 6px; }
.verlaufliste { list-style: none; padding: 0; margin: 6px 0; }
.verlaufliste li { display: grid; grid-template-columns: 6.5rem 6rem 1fr auto; gap: 6px; padding: 5px 0; border-top: 1px solid var(--linie); font-size: .85rem; align-items: baseline; }
.verlaufliste small { color: var(--tinte-2); }
.vpi { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.vpi span { font-size: .75rem; color: var(--tinte-2); background: var(--grund); border-radius: 8px; padding: 4px 8px; }
.vpi b { display: block; color: var(--tinte); font-size: .9rem; }
.nf-kopf .fortschritt { height: 10px; background: var(--grau-hell); border-radius: 99px; overflow: hidden; margin: 10px 0 2px; }
.nf-kopf .fortschritt span { display: block; height: 100%; background: var(--gruen); }
.nf-phase h2 { border-bottom: 2px solid var(--tinte); padding-bottom: 4px; }
.nf-aufgabe { display: grid; grid-template-columns: 36px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--linie); }
.nf-aufgabe:first-of-type { border-top: 0; }
.nf-aufgabe p { margin: 4px 0 0; font-size: .92rem; }
.nf-aufgabe small { display: block; color: var(--tinte-2); font-size: .82rem; }
.nf-aufgabe.erledigt .nf-inhalt > b { text-decoration: line-through; color: var(--tinte-2); }
.nf-haken { margin: 2px 0 0; }
.nf-haken input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nf-haken span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--linie); background: var(--flaeche); cursor: pointer; }
.nf-haken input:checked + span { background: var(--gruen); border-color: var(--gruen); }
.nf-haken input:checked + span::after { content: "✓"; color: #fff; font-weight: 700; }
.nf-haken input:focus-visible + span { outline: 2px solid var(--akzent); }
.nf-knoepfe { display: flex; gap: 8px; margin-top: 6px; }
.nf-block { border-left: 6px solid var(--rot); }
.ampel-punkt { padding: 7px 0; border-top: 1px solid var(--linie); }
.ampel-punkt summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.ampel-punkt summary small { margin-left: auto; color: var(--tinte-2); }
.punkt-farbe { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--rot); }
.ampel-punkt.gelb .punkt-farbe { background: var(--gelb); } .ampel-punkt.gruen .punkt-farbe { background: var(--gruen); }
.pfad { font-size: .88rem; margin-bottom: 8px; }
.ordner { display: block; width: 100%; text-align: left; padding: 9px 6px; border: 0; border-top: 1px solid var(--linie); background: none; color: var(--tinte); font: inherit; cursor: pointer; }
.tanbild { max-width: 240px; background: #fff; padding: 6px; border-radius: 8px; }
.dialog.breit { width: min(760px, calc(100vw - 32px)); }
.freigabe { border: 2px solid var(--akzent); }
.anleitung-kurz li { margin-bottom: 4px; }
.anleitung-kurz code { overflow-wrap: anywhere; }
.zugang .b-kopf, .ort .b-kopf, .person .b-kopf { flex-wrap: wrap; }
@media (max-width: 420px) {
  .verlaufliste li { grid-template-columns: 5.5rem 1fr auto; }
  .verlaufliste li small { grid-column: 1 / -1; }
  .umsatz { grid-template-columns: 4.4rem 1fr auto; }
}

/* Notfallmappe */
.notfall header h2 { font-size: 1.3rem; margin: 0; }
.notfall header p { margin: .2rem 0 1rem; color: var(--tinte-2); font-size: .9rem; }
.nf-text { background: var(--gelb-hell); border-left: 4px solid var(--gelb); padding: 10px 12px; border-radius: 8px; margin-bottom: 1rem; }
.notfall h3 { border-bottom: 2px solid var(--tinte); padding-bottom: 3px; margin-top: 1.4rem; }
.nf-eintrag { padding: 8px 0; border-bottom: 1px solid var(--linie); break-inside: avoid; }
.nf-kopf b { display: block; }
.nf-kopf span { font-size: .85rem; color: var(--tinte-2); }
.nf-eintrag dl { display: grid; grid-template-columns: 7rem 1fr; gap: 2px 10px; margin-top: 4px; font-size: .9rem; }
.nf-eintrag .ernst { font-weight: 600; }

@media (min-width: 720px) {
  .inhalt { padding-top: 20px; }
}
@media (max-width: 380px) {
  .zwei { grid-template-columns: 1fr; }
  .zeile { grid-template-columns: 1fr; gap: 0; }
}
@media print {
  :root { --grund: #fff; --flaeche: #fff; --tinte: #000; --tinte-2: #444; --linie: #bbb; }
  body { padding: 0; font-size: 11pt; }
  .kopf, .leiste, .nicht-drucken, .meldung, .menue { display: none !important; }
  .inhalt { max-width: none; padding: 0; }
  .vorraum .logo, .vorraum .knoepfe, .vorraum .haupt { display: none; }
  .karte-form { border: 0; }
}

/* ---------- 2.1: Auswertungen, Nebenkosten, Übergabe, Urkunden ---------- */
.drei { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 8px; margin-bottom: 6px; }
.inhalt .zwei input, .drei input { min-width: 0; }
table.auswertung { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.auswertung td, table.auswertung th { padding: 6px 4px; border-bottom: 1px solid var(--linie); vertical-align: top; text-align: left; }
table.auswertung td small { display: block; color: var(--tinte-2); font-size: .78rem; }
table.auswertung .r, table.auswertung th.r, td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.auswertung tr.zsumme td { font-weight: 600; border-bottom-width: 2px; }
table.auswertung tr.gross td { font-size: 1.02rem; }
table.auswertung td.ein { color: var(--gruen); }
td.warn, b.warn, small.warn { color: var(--rot); }
b.gruen { color: var(--gruen); }
.nk-pos { border: 1px solid var(--linie); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--grund); }
.nk-pos .zwei { margin-bottom: 6px; }
.nk-pos .direkt { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 6px 0; }
.nk-mieter { border-top: 1px solid var(--linie); padding: 10px 0; }
.nk-mieter:first-child { border-top: 0; }
.nf-urkunden .hinweiszeile { align-items: flex-start; gap: 12px; }
.nf-urkunden .hinweiszeile > span:last-child { text-align: right; }
dialog.breit { width: min(720px, calc(100vw - 24px)); }
.kopierzeile code { word-break: break-all; }
@media (max-width: 420px) { .drei { grid-template-columns: 1fr 1fr; } .drei input:last-child { grid-column: span 2; } }


/* ---------- 2.2: Symbole, Startseite, Mehr ---------- */
.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.inhalt.breit { max-width: 1080px; }
.hallo { padding: 6px 2px 4px; }
.hallo-datum { margin: 0; color: var(--tinte-2); font-size: .85rem; }
.hallo h2 { font-size: 1.75rem; margin: 0 0 8px; line-height: 1.15; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; padding: 5px 11px 5px 8px; border-radius: 99px; }
.status .ico { width: 17px; height: 17px; }
.status.gruen { background: var(--gruen-hell); color: var(--gruen); }
.status.gelb { background: var(--gelb-hell); color: var(--gelb); }
.status.rot { background: var(--rot-hell); color: var(--rot); }
.suche { position: relative; margin: 14px 0; }
.suche .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--tinte-2); }
.suche input { width: 100%; padding: 12px 14px 12px 42px; border-radius: 14px; border: 1px solid var(--linie); background: var(--flaeche); font: inherit; color: var(--tinte); box-shadow: var(--schatten); }
.suche input:focus { outline: 2px solid color-mix(in srgb, var(--akzent) 45%, transparent); outline-offset: 1px; }

.kennzahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kz { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 13px 14px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); color: var(--tinte); text-decoration: none; box-shadow: var(--schatten); transition: transform .12s; }
.kz:active { transform: scale(.98); }
.kz small { color: var(--tinte-2); font-size: .78rem; margin-top: 8px; }
.kz b { font-family: var(--schrift-titel); font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kz-unter { font-size: .78rem; color: var(--tinte-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kz-ico, .a-ico, .m-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; }
.kz-ico .ico, .a-ico .ico, .m-ico .ico { width: 19px; height: 19px; }
.blau.kz-ico, .blau.a-ico, .blau.m-ico { background: var(--blau-hell); color: var(--akzent); }
.gruen.kz-ico, .gruen.a-ico, .gruen.m-ico { background: var(--gruen-hell); color: var(--gruen); }
.rot.kz-ico, .rot.a-ico, .rot.m-ico { background: var(--rot-hell); color: var(--rot); }
.gelb.kz-ico, .gelb.a-ico, .gelb.m-ico { background: var(--gelb-hell); color: var(--gelb); }
.grau.a-ico, .grau.m-ico { background: var(--grau-hell); color: var(--tinte-2); }
.orange.m-ico { background: var(--orange-hell); color: var(--orange); }
.lila.m-ico { background: var(--lila-hell); color: var(--lila); }
.mini-balken { display: flex; gap: 2px; height: 6px; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.mini-balken i { background: var(--reiter); min-width: 3px; }
.fortschritt { display: block; height: 6px; border-radius: 99px; background: var(--grau-hell); overflow: hidden; margin-top: 8px; }
.fortschritt i { display: block; height: 100%; border-radius: 99px; background: var(--gruen); transition: width .4s; }
.kz .fortschritt i { background: linear-gradient(90deg, var(--rot), var(--gelb) 60%, var(--gruen)); background-size: 300px 100%; }

.aufgaben h2 { margin-bottom: .3rem; }
.aufgabe { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linie); color: var(--tinte); text-decoration: none; font-size: .93rem; }
.aufgabe:first-of-type { border-top: 0; }
.aufgabe.zu { display: none; }
.aufgabe .a-text { flex: 1; min-width: 0; }
.pfeil { width: 18px; height: 18px; color: var(--tinte-2); opacity: .7; }
#aufmehr { margin-top: 6px; }

.zeitleiste { list-style: none; margin: 0; padding: 0; }
.zeitleiste li + li { border-top: 1px solid var(--linie); }
.zeitleiste a { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--tinte); text-decoration: none; }
.z-datum { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 50px; border-radius: 12px; background: var(--grau-hell); flex: none; line-height: 1.05; }
.z-datum b { font-family: var(--schrift-titel); font-size: 1.25rem; }
.z-datum small { font-size: .62rem; font-weight: 700; letter-spacing: .06em; color: var(--tinte-2); }
.z-datum.bald { background: var(--rot-hell); color: var(--rot); }
.z-datum.bald small { color: var(--rot); }
.z-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.z-text b { font-weight: 600; font-size: .93rem; }
.z-text small { color: var(--tinte-2); font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.z-ico { color: var(--tinte-2); opacity: .6; }

.kreis-reihe { display: flex; align-items: center; gap: 16px; }
.kreis { width: 132px; height: 132px; flex: none; transform: rotate(-90deg); }
.kreis circle { fill: none; stroke-width: 5.2; }
.kreis circle[class^="reiter"] { stroke: var(--reiter); }
.kreis-grund { stroke: var(--grau-hell); }
.kreis text { transform: rotate(90deg); transform-origin: 21px 21px; text-anchor: middle; fill: var(--tinte); }
.kreis-zahl { font: 700 5.6px var(--schrift-titel); }
.kreis-text { font: 3.2px system-ui, sans-serif; fill: var(--tinte-2) !important; }
.legende { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.legende a { display: flex; align-items: center; gap: 9px; padding: 6px 0; color: var(--tinte); text-decoration: none; }
.legende span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .92rem; }
.legende small { color: var(--tinte-2); font-size: .75rem; }
.legende b { font-variant-numeric: tabular-nums; font-size: .92rem; }
.punkt { flex: none; }

.konten-reihe { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.konten-reihe::-webkit-scrollbar { display: none; }
.konto-karte { scroll-snap-align: start; flex: 0 0 auto; min-width: 150px; display: flex; flex-direction: column; padding: 11px 13px; border-radius: 13px; background: var(--grund); color: var(--tinte); text-decoration: none; border: 1px solid var(--linie); }
.konto-karte small { color: var(--tinte-2); font-size: .78rem; white-space: nowrap; }
.konto-karte b { font-family: var(--schrift-titel); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.konto-karte span { font-size: .74rem; color: var(--tinte-2); }
.konto-karte.knapp { border-color: var(--rot); }
.konto-karte.knapp > span:first-of-type { color: var(--rot); font-weight: 700; }

.schnell { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.willkommen .schnell { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.schnell a { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 13px; background: var(--grund); border: 1px solid var(--linie); color: var(--tinte); text-decoration: none; transition: transform .12s; }
.schnell a:active { transform: scale(.97); }
.schnell a .ico { color: var(--akzent); width: 22px; height: 22px; }
.schnell b { font-size: .9rem; font-weight: 600; }
.schnell small { font-size: .75rem; color: var(--tinte-2); margin-top: -4px; }
.willkommen p { margin: 0 0 12px; }

.einrichten .b-kopf { display: flex; justify-content: space-between; align-items: baseline; }
.einrichten ul { list-style: none; margin: 10px 0 0; padding: 0; }
.einrichten li a { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--tinte); text-decoration: none; font-size: .92rem; }
.einrichten li.ok a { color: var(--tinte-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--tinte-2) 50%, transparent); }
.e-haken { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--linie); flex: none; }
.einrichten li.ok .e-haken { border: 0; color: var(--gruen); }
.einrichten li.ok .e-haken .ico { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .kennzahlen { grid-template-columns: repeat(4, 1fr); }
  .dash { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .hallo h2 { font-size: 2rem; }
}
@media (max-width: 370px) { .kreis-reihe { flex-direction: column; align-items: stretch; } .kreis { align-self: center; } }

/* Mehr */
.ich-karte { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 6px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); color: var(--tinte); text-decoration: none; box-shadow: var(--schatten); }
.ich-karte > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ich-karte small { color: var(--tinte-2); font-size: .8rem; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--akzent); color: var(--akzent-text); font: 700 1.2rem var(--schrift-titel); flex: none; }
.m-gruppe { font: 700 .72rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .07em; color: var(--tinte-2); margin: 18px 4px 6px; }
.menue2 { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.menue2 a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--tinte); text-decoration: none; }
.menue2 a + a { background-image: linear-gradient(var(--linie), var(--linie)); background-size: calc(100% - 58px) 1px; background-position: right top; background-repeat: no-repeat; }
.menue2 a:active { background-color: var(--grau-hell); }
.m-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-text b { font-weight: 600; font-size: .95rem; }
.m-text small { color: var(--tinte-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zaehler { background: var(--rot); color: #fff; font-size: .72rem; font-weight: 700; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; }
.abmelden { width: 100%; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Feinschliff */
.haupt, .zweit { transition: transform .1s, filter .15s; }
.haupt:active, .zweit:active { transform: scale(.98); }
.karte { transition: transform .12s; }
.karte:active { transform: scale(.99); }
.meldung { box-shadow: 0 8px 24px rgba(0,0,0,.18); }

@media (min-width: 700px) { .leiste { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 12px; border: 1px solid var(--linie); border-radius: 22px; box-shadow: 0 8px 28px rgba(0,0,0,.12); padding-bottom: 6px; } body { padding-bottom: 100px; } }

/* ---------- 2.3: Adressfelder ---------- */
[data-nur-typ][hidden] { display: none !important; }
.adresse-felder, .adressblock { display: flex; flex-direction: column; gap: 0; }
.adr-reihe { display: grid; grid-template-columns: minmax(0, 3fr) minmax(64px, 1fr); gap: 10px; }
.adr-reihe:has(.adr-plz) { grid-template-columns: minmax(78px, 1fr) minmax(0, 2.2fr); }
.adr-reihe:has(.adr-land) { grid-template-columns: minmax(78px, 1fr) minmax(0, 2fr) minmax(0, 1.4fr); }
.adressblock { padding: 2px 0; }
fieldset .adressblock label:first-child { margin-top: 0; }
.ort-wohnung-felder { margin: 8px 0; }
.ort-wohnung { margin-top: -4px; }
@media (max-width: 420px) { .adr-reihe:has(.adr-land) { grid-template-columns: minmax(70px, 1fr) minmax(0, 2fr); } .adr-reihe .adr-land { grid-column: span 2; } }

/* ---------- 2.5: KI-Kosten ---------- */
.tagbalken { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin: 4px 0 12px; padding-bottom: 16px; position: relative; }
.tagbalken div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.tagbalken i { display: block; width: 100%; max-width: 22px; background: var(--akzent); border-radius: 4px 4px 0 0; opacity: .85; }
.tagbalken small { position: absolute; bottom: -16px; font-size: .62rem; color: var(--tinte-2); }
table.auswertung td small { white-space: normal; }
.ki-liste td:first-child { white-space: nowrap; }
tr.fehlzeile td { color: var(--rot); }
table.ki-tab td:nth-child(2) { white-space: nowrap; }
table.ki-tab td small { display: block; }
.ki-einzeln { list-style: none; margin: 0; padding: 0; }
.ki-einzeln li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--linie); font-size: .9rem; }
.ki-einzeln li:first-child { border-top: 0; }
.ki-einzeln span { display: flex; flex-direction: column; min-width: 0; }
.ki-einzeln span.r { align-items: flex-end; white-space: nowrap; }
.ki-einzeln small { color: var(--tinte-2); font-size: .76rem; overflow-wrap: anywhere; }
.ki-einzeln li.fehlzeile b, .ki-einzeln li.fehlzeile small { color: var(--rot); }

/* ---------- 2.6: Drive-Auswahl ---------- */
.ordnerliste { display: flex; flex-direction: column; margin: 8px 0; border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.ordner-zeile { display: flex; align-items: center; gap: 8px; padding: 0 0 0 12px; border-top: 1px solid var(--linie); background: var(--flaeche); min-height: 46px; }
.ordner-zeile:first-child { border-top: 0; }
.ordner-zeile label, label.ordner-zeile { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 0; margin: 0; cursor: pointer; min-width: 0; }
.ordner-zeile span { overflow: hidden; text-overflow: ellipsis; }
.ordner-zeile input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--akzent); }
.ordner-auf { align-self: stretch; width: 48px; border: 0; border-left: 1px solid var(--linie); background: var(--grund); color: var(--tinte-2); font-size: 1.4rem; cursor: pointer; }
.dateien-hier { background: var(--grund); font-size: .92rem; }
.chips-liste { list-style: none; margin: 6px 0 10px; padding: 0; }
.chips-liste li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--linie); font-size: .92rem; }
.chips-liste li:first-child { border-top: 0; }
.chips-liste span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.chips-liste small { color: var(--tinte-2); font-size: .76rem; }
.drive-auswahl h3 { margin-top: 14px; }
