/* Belegschachtel – Oberfläche. Blau, hell, aufgeräumt. Kein Grün. */
:root {
  --blau: #1d4ed8;
  --blau-dunkel: #1e40af;
  --blau-hell: #dbeafe;
  --blau-zart: #eff6ff;
  --grund: #f5f8fd;
  --flaeche: #ffffff;
  --text: #0f1b33;
  --text-leise: #5b6b86;
  --linie: #d7e0ee;
  --rot: #b42318;
  --rot-zart: #fdecea;
  --gelb-zart: #fff7e0;
  --gelb: #8a5a00;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(15, 27, 51, .06), 0 4px 16px rgba(15, 27, 51, .06);
  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
  --navhoehe: 64px;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; max-width: 100%; -webkit-text-size-adjust: 100%; }
html { background: var(--grund); }
body {
  margin: 0; color: var(--text); background: var(--grund);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
input, select, textarea, [contenteditable] { font-size: max(16px, 1em); font-family: inherit; color: inherit; }
button { font: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.leise { color: var(--text-leise); }
.klein { font-size: .875rem; }
.laden { padding: calc(var(--oben) + 40px) 20px; text-align: center; color: var(--text-leise); }
.versteckt { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Kopfzeile ---- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--oben) + 10px) 16px 10px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
}
.kopf .marke { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.08rem; flex: 1; min-width: 0; }
.kopf .marke img { width: 32px; height: 32px; }
.kopf .marke span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rund {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--blau);
  display: inline-grid; place-items: center; cursor: pointer; font-weight: 700; font-size: 1.05rem;
}
.rund:active { background: var(--blau-zart); }
.rund svg { width: 20px; height: 20px; }
.testhinweis {
  background: var(--gelb-zart); color: var(--gelb); font-size: .85rem; text-align: center;
  padding: 6px 12px; border-bottom: 1px solid #f1dfa8;
}

/* ---- Rahmen mit Navigation ---- */
.rahmen { min-height: 100vh; min-height: 100dvh; }
.inhalt { padding: 16px 16px calc(var(--navhoehe) + var(--unten) + 24px); max-width: 1500px; margin: 0 auto; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--unten));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--linie);
}
.nav button {
  flex: 1; max-width: 120px; border: 0; background: none; color: var(--text-leise);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .75rem; padding: 4px 2px; cursor: pointer; border-radius: 10px;
}
.nav button svg { width: 24px; height: 24px; }
.nav button.aktiv { color: var(--blau); font-weight: 600; }
.nav button.haupt svg { width: 28px; height: 28px; color: #fff; background: var(--blau); border-radius: 50%; padding: 5px; box-sizing: content-box; margin-top: -6px; }
@media (min-width: 900px) {
  .rahmen { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto auto 1fr; }
  .rahmen > .kopf, .rahmen > .testhinweis { grid-column: 1 / -1; }
  .nav {
    position: sticky; top: 61px; bottom: auto; right: auto; height: calc(100vh - 61px);
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 16px 12px; border-top: 0; border-right: 1px solid var(--linie); background: #fbfcfe;
  }
  .nav button { flex: none; max-width: none; flex-direction: row; gap: 12px; font-size: .95rem; padding: 10px 12px; justify-content: flex-start; }
  .nav button.aktiv { background: var(--blau-zart); }
  .nav button.haupt svg { margin-top: 0; padding: 3px; width: 20px; height: 20px; }
  .inhalt { padding: 20px 24px 40px; width: 100%; }
}

/* ---- Knöpfe wie Taster ---- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  font-weight: 550; text-decoration: none; box-shadow: 0 1px 0 rgba(15, 27, 51, .04);
}
.knopf:hover { border-color: #b9c7dd; }
.knopf:active { transform: translateY(1px); }
.knopf.haupt { background: var(--blau); border-color: var(--blau); color: #fff; }
.knopf.haupt:hover { background: var(--blau-dunkel); }
.knopf.breit { width: 100%; }
.knopf.klein { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.knopf[disabled] { opacity: .55; cursor: default; }
.knopf svg { width: 20px; height: 20px; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Karten, Felder ---- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px; box-shadow: var(--schatten); }
.feld { display: block; margin-bottom: 14px; }
.feld > span { display: block; font-size: .875rem; color: var(--text-leise); margin-bottom: 4px; }
.eingabe {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--linie); background: #fff; outline: none;
}
.eingabe:focus { border-color: var(--blau); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.eingabe[disabled] { background: var(--grund); color: var(--text-leise); }
textarea.eingabe { min-height: 80px; resize: vertical; }
.code-eingabe { letter-spacing: .25em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.meldung { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: .95rem; }
.meldung.fehler { background: var(--rot-zart); color: var(--rot); }
.meldung.info { background: var(--blau-zart); color: var(--blau-dunkel); }
.haken { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.haken input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--blau); }

/* ---- Anmeldung ---- */
.anmeldung { min-height: 100vh; min-height: 100dvh; display: grid; place-items: start center; padding: calc(var(--oben) + 28px) 16px 40px; }
.anmeldung .karte { width: 100%; max-width: 420px; }
.anmeldung .marke { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-weight: 700; font-size: 1.3rem; }
.anmeldung .marke img { width: 44px; height: 44px; }
.qr { display: grid; place-items: center; margin: 12px 0; }
.qr svg { width: 200px; height: 200px; border: 1px solid var(--linie); border-radius: 12px; }
.geheimnis { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--blau-zart); padding: 8px 10px; border-radius: 8px; word-break: break-all; font-size: .95rem; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--blau-zart); padding: 12px; border-radius: 10px; margin: 10px 0; }
.schritte { padding-left: 1.2em; margin: 0 0 12px; }
.schritte li { margin-bottom: 6px; }

/* ---- Start ---- */
.start-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.start-kopf h1 { margin: 0; }
.jahrwahl { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--linie); background: #fff; }
.einwerfen { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.einwerfen .knopf { min-height: 64px; font-size: 1.05rem; }
.einwerfen .knopf svg { width: 26px; height: 26px; }
.kacheln { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.kachel { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 112px; font: inherit; color: inherit; }
.kachel:hover { border-color: #b9c7dd; }
.kachel .art { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blau); font-weight: 650; }
.kachel .name { font-weight: 650; font-size: 1.05rem; }
.kachel .zahl { margin-top: auto; color: var(--text-leise); }
.kachel.eingang { background: var(--gelb-zart); border-color: #f1dfa8; }
.kachel.eingang .art { color: var(--gelb); }
.kachel.neu { border-style: dashed; box-shadow: none; background: transparent; align-items: center; justify-content: center; color: var(--blau); font-weight: 600; }

/* ---- Blatt (unten aufgehende Auswahl) ---- */
.schleier { position: fixed; inset: 0; background: rgba(15, 27, 51, .35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.blatt {
  background: var(--flaeche); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--unten)); box-shadow: 0 -8px 40px rgba(15, 27, 51, .2);
}
@media (min-width: 700px) { .schleier { align-items: center; } .blatt { border-radius: 18px; padding-bottom: 18px; } }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.blatt-kopf h2 { margin: 0; }
.tipps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tipp {
  min-height: 92px; border-radius: 14px; border: 1px solid var(--linie); background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px;
  font-weight: 650; font-size: 1.02rem; color: var(--text);
}
.tipp svg { width: 28px; height: 28px; color: var(--blau); }
.tipp .unter { font-weight: 400; font-size: .8rem; color: var(--text-leise); text-align: center; }
.tipp.zuletzt { border-color: var(--blau); box-shadow: 0 0 0 2px rgba(29, 78, 216, .25); background: var(--blau-zart); }
.tipp.voll { grid-column: 1 / -1; min-height: 56px; flex-direction: row; }
.vorschau-liste { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; }
.vorschau-liste img, .vorschau-liste .pdf { width: 64px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); flex: none; }
.vorschau-liste .pdf { display: grid; place-items: center; font-size: .8rem; color: var(--text-leise); background: var(--grund); }
.ergebnis { list-style: none; padding: 0; margin: 0 0 14px; }
.ergebnis li { padding: 8px 0; border-bottom: 1px solid var(--linie); display: flex; gap: 10px; justify-content: space-between; }
.ergebnis .ok { color: var(--blau); font-weight: 600; }
.ergebnis .nein { color: var(--rot); }

/* ---- Belegliste mit Bild rechts ---- */
.belege-kopf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex: 1; min-width: 0; }
.chip {
  white-space: nowrap; min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linie);
  background: #fff; cursor: pointer; color: var(--text); font-size: .92rem;
}
.chip.aktiv { background: var(--blau); border-color: var(--blau); color: #fff; }
.chip .anz { opacity: .75; margin-left: 4px; }
.arbeitsflaeche { display: block; }
.liste { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.liste th { text-align: left; font-weight: 600; color: var(--text-leise); font-size: .8rem; padding: 10px; border-bottom: 1px solid var(--linie); background: #fbfcfe; position: sticky; top: 0; }
.liste td { padding: 10px; border-bottom: 1px solid #edf1f7; vertical-align: top; }
.liste tr.zeile { cursor: pointer; }
.liste tr.zeile:hover td { background: #f8fafe; }
.liste tr.zeile.aktiv td { background: var(--blau-zart); }
.liste tr.zeile.aktiv td:first-child { box-shadow: inset 3px 0 0 var(--blau); }
.liste .nr { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.liste .betrag { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.liste .leer { padding: 28px 16px; text-align: center; color: var(--text-leise); }
.liste .nur-breit { display: none; }
.liste-scroll { max-height: none; overflow: auto; }
.detail { display: none; }
@media (min-width: 900px) {
  .arbeitsflaeche { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.15fr); gap: 16px; align-items: start; }
  .liste-scroll { max-height: calc(100vh - 180px); }
  .liste .nur-breit { display: table-cell; }
  .detail { display: block; position: sticky; top: 77px; }
}
.detail-karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.betrachter-leiste { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.betrachter-leiste .titel { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.betrachter { height: 52vh; overflow: auto; background: #e9eef6; display: block; text-align: center; padding: 10px; }
.betrachter img { display: block; margin: 0 auto 10px; max-width: none; background: #fff; box-shadow: 0 1px 6px rgba(15, 27, 51, .15); transform-origin: center center; }
.betrachter .ohne { padding: 40px 12px; color: var(--text-leise); }
.felder { padding: 14px; display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.felder .feld.ganz { grid-column: 1 / -1; }
.felder .status { grid-column: 1 / -1; font-size: .85rem; color: var(--text-leise); min-height: 1.3em; }
.zuordnen { padding: 0 14px 14px; }
.zuordnen .knopfreihe .knopf { flex: 1 1 auto; }

/* Handy: Beleg groß als eigene Ansicht */
.vollbild { position: fixed; inset: 0; z-index: 40; background: var(--grund); overflow: auto; padding-top: var(--oben); padding-bottom: calc(var(--unten) + 12px); }
.vollbild .detail-karte { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
.vollbild .betrachter { height: 58vh; }

/* ---- Einstellungen ---- */
.gruppe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.gruppe h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-leise); padding: 12px 16px 4px; margin: 0; }
.gruppe .eintrag { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #edf1f7; }
.gruppe .eintrag:first-of-type { border-top: 0; }
.einstellungen { max-width: 640px; }
.version { text-align: center; color: var(--text-leise); font-size: .85rem; margin-top: 14px; }

/* ---- Hinweis unten ---- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--navhoehe) + var(--unten) + 14px); z-index: 60;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px);
  box-shadow: var(--schatten); font-size: .95rem;
}
.toast.fehler { background: var(--rot); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---- Anleitung ---- */
.anleitung h3 { margin-top: 16px; }
.anleitung ul { padding-left: 1.2em; }
.anleitung li { margin-bottom: 4px; }

/* Korrekturen nach Sichtprüfung 0.1.0 */
.kachel svg { width: 20px; height: 20px; flex: none; }
.kachel.neu { flex-direction: row; gap: 8px; }
.nur-pc { display: none !important; }
@media (min-width: 900px) { .nur-pc { display: inline-flex !important; } }
.vollbild .betrachter-leiste .titel { font-size: .95rem; }

/* ---- 0.2.0: Zugänge, Kanzlei ---- */
.trenner { display: flex; align-items: center; gap: 10px; color: var(--text-leise); font-size: .85rem; margin: 14px 0; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--linie); }
.kanzlei-logo { margin-bottom: 14px; }
.kanzlei-logo img { max-width: 100%; max-height: 64px; display: block; }
.hinweise { padding-left: 1.2em; margin: 0 0 12px; }
.hinweise li { margin-bottom: 6px; }
.kanzlei-zeile { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; padding: 8px 12px; border-radius: 12px; background: var(--blau-zart); color: var(--text); font-size: .9rem; }
.kanzlei-zeile img { max-height: 28px; max-width: 100px; flex: none; }
.kanzlei-zeile svg { width: 24px; height: 24px; color: var(--blau); flex: none; }
.logo-klein { max-height: 36px; max-width: 140px; }
.gruppe .eintrag .logo-klein + span { flex: 1; }
.linkfeld { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; }
.werkzeuge { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.werkzeuge .suche { flex: 1 1 220px; width: auto; }
.abzeichen { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; white-space: nowrap; border: 1px solid transparent; }
.abzeichen.aktiv { background: var(--blau-hell); color: var(--blau-dunkel); }
.abzeichen.eingeladen { background: var(--gelb-zart); color: var(--gelb); border-color: #f1dfa8; }
.abzeichen.ohne { background: var(--grund); color: var(--text-leise); border-color: var(--linie); }
.liste table.mandanten td { vertical-align: middle; }
.liste table.mandanten .aktion { text-align: right; width: 1%; white-space: nowrap; }
.liste table.mandanten th.nur-breit, .liste table.mandanten td.nur-breit { display: none; }
@media (min-width: 900px) { .liste table.mandanten th.nur-breit, .liste table.mandanten td.nur-breit { display: table-cell; } }
.verlauf { list-style: none; padding: 0; margin: 0; }
.verlauf li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.verlauf .wann { font-size: .8rem; color: var(--text-leise); }
.felder.stamm { padding: 0; }
.felder.stamm .knopf.ganz { grid-column: 1 / -1; }
.felder .haken.feld { align-self: end; margin-bottom: 18px; }
.knopf.warnung { border-color: var(--rot); color: var(--rot); }
.felder.stamm { grid-template-columns: 1fr; }
.felder.stamm .paar { display: grid; gap: 0 12px; }
.felder.stamm .strasse-nr { grid-template-columns: 1fr 96px; }
.felder.stamm .plz-ort { grid-template-columns: 110px 1fr; }
@media (min-width: 600px) { .felder.stamm { grid-template-columns: 1fr 1fr; } .felder.stamm .paar { grid-column: 1 / -1; } }

/* ---- 0.3.0: Liste vollständig ---- */
.abschnitt { margin: 24px 0 10px; font-size: 1.05rem; }
.liste table.auswertung td:first-child { white-space: nowrap; }
.liste table.auswertung tr.summe td { font-weight: 650; background: var(--blau-zart); }
.vorschlag { color: var(--blau); font-style: italic; }
.warnung-text { color: var(--rot); }
.liste tr.teil td { padding-top: 4px; padding-bottom: 4px; font-size: .85rem; color: var(--text-leise); background: #fbfcfe; }
.liste tr.teil td:first-child { box-shadow: inset 3px 0 0 var(--blau-hell); padding-left: 18px; }
.liste tr.gruppe-kopf td:first-child { box-shadow: inset 3px 0 0 var(--blau-hell); }
.liste tr.summe-falsch td.betrag { color: var(--rot); }
.steuerzeile { margin-top: -6px; }
.teilzeilen .teilliste { list-style: none; padding: 0; margin: 0 0 8px; }
.teilzeilen .teilliste li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0 4px 10px; border-left: 3px solid var(--blau-hell); font-size: .9rem; }
.teil-zeile { display: grid; grid-template-columns: 1fr 84px 110px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 560px) { .teil-zeile { grid-template-columns: 1fr 1fr 40px; } .teil-zeile [data-f=kategorie] { grid-column: 1 / -1; } }
@media (min-width: 900px) { .detail { max-height: calc(100vh - 90px); overflow: auto; border-radius: var(--radius); } }

/* ---- 0.4.0: Auslesen und Prüfen ---- */
.ampel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: #c3cddd; }
.ampel.gruen { background: var(--blau); }   /* „in Ordnung“ in Blau – kein Grün */
.ampel.gelb { background: #e0a800; }
.ampel.rot { background: var(--rot); }
.pruefung { margin: 0 14px 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--linie); font-size: .9rem; }
.pruefung.rot { background: var(--rot-zart); border-color: #f3c2bd; }
.pruefung.gelb { background: var(--gelb-zart); border-color: #f1dfa8; }
.pruefung.gruen { background: var(--blau-zart); }
.pruefung-kopf { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.pruefung ul { margin: 0; padding-left: 1.2em; }
.eingabe.unsicher { background: var(--gelb-zart); border-color: #e0c264; }
.hinweis-gelb { margin: 0 14px 6px; color: var(--gelb); }
.erechnung { text-align: left; background: #fff; padding: 14px; border-radius: 10px; max-width: 640px; margin: 0 auto; font-size: .9rem; }
.er-parteien { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.erechnung table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.erechnung th, .erechnung td { padding: 4px 6px; border-bottom: 1px solid #edf1f7; text-align: left; }
.erechnung .betrag { text-align: right; white-space: nowrap; }
.erechnung tr.summe td { font-weight: 650; }
.erechnung-daten { margin: 0 14px 10px; }
.erechnung-daten summary { cursor: pointer; color: var(--blau); padding: 6px 0; }
.klein-wahl { width: auto; min-height: 36px; padding: 4px 8px; }

/* ---- 0.5.0: Quartal ---- */
.quartal-karte { margin-bottom: 16px; border-left: 4px solid var(--blau); }
.quartal-karte.abgeholt { border-left-color: var(--blau-hell); }
.qk-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qk-kopf .art { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blau); font-weight: 650; }
.qk-zahl { font-size: 1.1rem; margin: 8px 0 4px; }
.liste table.kennzahlen td { vertical-align: top; }
.liste table.kennzahlen tr.summe td { font-weight: 650; background: var(--blau-zart); }
.korrekturen { border-top: 1px dashed var(--linie); padding-top: 8px; }

/* ---- 0.6.0: Alltag ---- */
.rund.mit-punkt { position: relative; }
.rund.mit-punkt::after { content: ""; position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--rot); border: 2px solid #fff; }
.gruppe button.eintrag.hinweis { width: 100%; background: none; border: 0; border-top: 1px solid #edf1f7; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.gruppe button.eintrag.hinweis:first-of-type { border-top: 0; }
.gruppe button.eintrag.hinweis.dringend span:first-child { font-weight: 600; }
.rueckfragen { border-top: 1px dashed var(--linie); padding-top: 8px; }
.rueckfrage { background: var(--grund); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.rueckfrage.offen { background: var(--gelb-zart); }
.rueckfrage.erledigt { opacity: .7; }
.rueckfrage textarea, .rueckfragen > textarea { min-height: 60px; margin: 4px 0 6px; }

/* ---- 0.7.0: Suche ---- */
.belege-kopf .suche { flex: 1 1 220px; width: auto; min-height: 38px; }
@media (min-width: 900px) { .belege-kopf .suche { flex: 0 1 280px; } }
/* ---- 0.8.0: Einrichtung ---- */
.pruefliste { list-style: none; padding: 0; margin: 0 0 14px; font-size: .9rem; }
.pruefliste li.nein { color: var(--gelb); }

/* ---- 0.9.0: Rechnungen ---- */
.re-kopf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.re-kopf .feld, .re-pos > * { min-width: 0; }
.re-kopf input[type=date] { width: 100%; min-width: 0; }
.re-kopf .feld:first-child { grid-column: 1 / -1; }
.re-summen { margin: 8px 0 14px; padding: 10px 12px; background: var(--grund); border-radius: 10px; }
.re-summen div { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
.re-summen .summe { font-weight: 650; border-top: 1px solid var(--linie); margin-top: 4px; padding-top: 6px; }
.re-bezahlt { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.re-bezahlt .feld { margin-bottom: 0; flex: 1 1 160px; }
.abzeichen.fehler { background: var(--rot-zart); color: var(--rot); }
@media (min-width: 700px) { .blatt:has(#fr) { max-width: 860px; } }

/* ---- 0.10.0: Rechnungen ausgebaut ---- */
.re-suche { max-width: 240px; flex: 0 1 240px; min-height: 38px; }
.re-pos-kopf, .re-pos { display: grid; grid-template-columns: minmax(0, 1fr) 64px 96px 100px 72px 76px 40px; gap: 6px; align-items: center; }
.re-pos-kopf { font-size: .8rem; color: #5b6573; margin-bottom: 4px; }
.re-pos { margin-bottom: 10px; }
.re-f { display: block; min-width: 0; margin: 0; }
.re-f .eingabe { width: 100%; }
.re-f-t { display: none; }
.re-pos .re-beschreibung { grid-column: 1 / -2; min-height: 0; font-size: 16px; resize: vertical; }
.re-leistung { max-width: 280px; min-height: 38px; }
.datei-knopf { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.re-mahnen .knopf:disabled { opacity: .45; }
@media (max-width: 700px) {
  .re-suche { max-width: none; flex: 1 1 100%; }
  .re-pos-kopf { display: none; }
  .re-pos { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-areas: "bez bez bez bez bez weg" "menge menge einheit einheit preis preis" "rabatt rabatt rabatt ust ust ust" "besch besch besch besch besch besch";
    padding: 10px 0 12px; border-bottom: 1px solid var(--linie); align-items: end; }
  .re-f-t { display: block; font-size: .78rem; color: #5b6573; margin-bottom: 2px; }
  .re-f-bezeichnung { grid-area: bez; } .re-f-menge { grid-area: menge; } .re-f-einheit { grid-area: einheit; } .re-f-preis { grid-area: preis; }
  .re-f-rabatt { grid-area: rabatt; } .re-f-ust { grid-area: ust; } .re-weg { grid-area: weg; justify-self: end; } .re-pos .re-beschreibung { grid-area: besch; }
}
.papier { background: #fff; color: #1d2733; border: 1px solid var(--linie); border-radius: 10px; padding: 28px 30px; margin-bottom: 14px; font-size: .92rem; box-shadow: 0 1px 4px rgba(20, 40, 80, .06); }
.papier.entwurf { background-image: repeating-linear-gradient(-45deg, transparent 0 40px, rgba(37, 99, 235, .035) 40px 80px); }
.papier-kopf { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.papier-absender { font-weight: 700; font-size: 1.15rem; }
.papier-klein { font-size: .78rem; color: #5b6573; }
.papier-empfaenger { margin-top: 18px; line-height: 1.45; }
.papier-daten { display: grid; grid-template-columns: auto auto; gap: 2px 10px; margin: 0; font-size: .85rem; align-self: start; }
.papier-daten dt { color: #5b6573; } .papier-daten dd { margin: 0; text-align: right; }
.papier-titel { font-size: 1.25rem; margin: 26px 0 8px; }
.papier-entwurf { color: var(--blau); font-weight: 600; font-size: .85rem; margin: 18px 0 0; }
.papier-tabelle { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .88rem; }
.papier-tabelle th { text-align: left; font-size: .75rem; color: #5b6573; border-bottom: 1px solid var(--linie); padding: 4px 6px; }
.papier-tabelle td { padding: 6px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.papier-tabelle .betrag { text-align: right; white-space: nowrap; }
.papier-summen { margin-left: auto; max-width: 320px; }
.papier-hinweis { margin: 4px 0; }
.papier-fuss { margin-top: 26px; padding-top: 10px; border-top: 1px solid var(--linie); font-size: .72rem; color: #5b6573; line-height: 1.5; }
@media (max-width: 700px) { .papier { padding: 16px 14px; } }
@media (min-width: 700px) { .blatt:has(.papier), .blatt:has(#fa) { max-width: 860px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .papier { background: #fff; color: #1d2733; } }

/* ---- 0.11.0: mehrere Firmen ---- */
.firmen-auswahl { max-width: 360px; }
.firmen-wahl { margin-bottom: 12px; flex-wrap: wrap; }

/* 0.12 Scannen: Seiten, Zuschnitt */
.scan-seiten { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.scan-seite { margin: 0; display: flex; flex-direction: column; gap: 6px; flex: none; width: 150px; }
.scan-bild { padding: 0; border: 1px solid var(--linie); border-radius: 10px; background: var(--grund); overflow: hidden; cursor: pointer; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.scan-bild img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scan-seite figcaption { font-size: .8rem; color: var(--text-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-knoepfe { display: flex; gap: 6px; }
.scan-knoepfe .knopf { flex: 1; padding-left: 6px; padding-right: 6px; gap: 4px; }
.scan-knoepfe .knopf[data-weg] { width: 36px; padding: 0; }
.scan-knoepfe .knopf[data-weg] { flex: none; }
.scan-seite.laedt { height: 200px; border: 1px dashed var(--linie); border-radius: 10px; display: grid; place-items: center; }
.scan-warte { font-size: .85rem; color: var(--text-leise); text-align: center; padding: 8px; }
#scanMehr { margin-bottom: 12px; }
.ecken-rahmen { display: flex; justify-content: center; margin-bottom: 8px; }
.ecken-feld { position: relative; display: inline-block; touch-action: none; user-select: none; -webkit-user-select: none; max-width: 100%; }
.ecken-feld img { display: block; max-width: 100%; max-height: 58vh; border-radius: 6px; pointer-events: none; }
.ecken-linie { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ecken-linie polygon { fill: rgba(29, 78, 216, .14); stroke: var(--blau); stroke-width: 3; vector-effect: non-scaling-stroke; }
.ecken-linie polygon.falsch { stroke: var(--rot); fill: rgba(180, 35, 24, .12); }
.ecke { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 3px solid var(--blau); background: rgba(255, 255, 255, .85); padding: 0; touch-action: none; cursor: grab; box-shadow: 0 1px 4px rgba(15, 27, 51, .3); }
.ecke.zieht { cursor: grabbing; background: var(--blau-hell); transform: scale(1.15); }
.ecke:focus-visible { outline: 3px solid var(--blau-dunkel); outline-offset: 2px; }

/* 0.13 KI-Auslesen, Betrieb */
.hinweis-blau { margin: 0 14px 6px; color: var(--blau-dunkel); }
.blatt-inhalt .hinweis-blau, .blatt-inhalt .hinweis-gelb { margin: 10px 0; }
.tabelle { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tabelle th, .tabelle td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--linie); }
.tabelle td:nth-child(n+2), .tabelle th:nth-child(n+2) { text-align: right; white-space: nowrap; }
details.eintrag { display: block; }
details.eintrag summary { cursor: pointer; }

/* 0.15 Logo, wiederkehrende Rechnungen */
.papier-logo { float: right; max-width: 170px; max-height: 60px; margin: 0 0 8px 12px; }
.re-serien { margin-bottom: 10px; }

/* 0.17 Tarife */
.tarif-wahl { border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; margin: 12px 0; }
.tarif-wahl legend { font-weight: 600; padding: 0 4px; }
.tarif-karte { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; cursor: pointer; }
.tarif-karte input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--blau); }
