/* Design „Stapel hell“ (Entwurf D): weiße Grundfläche, Farbverlauf Violett→Türkis als Akzent, Plus Jakarta Sans für alles (Entscheidung Marc 07.11.2026). */

:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f4f5fb; --surface-3: #f8f9fe;
  --line: #e6e8f2; --line-strong: #d7daea;
  --ink: #0f1222; --ink-2: #5b6080; --ink-3: #8a90b0;
  --primary: #6d5cff; --primary-hover: #5a49f2; --primary-soft: #ecebff; --primary-ink: #4b3bd6; --on-primary: #ffffff;
  --accent: #14b8a6; --accent-soft: #dcf7f2; --accent-ink: #0f766e;
  --grad: linear-gradient(135deg, #6d5cff, #14b8a6);
  --side: #ffffff; --side-ink: #0f1222; --side-muted: #8a90b0; --side-active: #f4f5fb; --side-line: #e6e8f2;
  --ok: #16a34a; --ok-bg: #e7f8ee; --ok-ink: #15803d; --warn: #f59e0b; --warn-bg: #fff4dc; --warn-ink: #b45309; --bad: #ef4444; --bad-bg: #fee2e2; --bad-ink: #b91c1c; --off-bg: #f4f5fb; --off-ink: #5b6080;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-titel: "Plus Jakarta Sans", system-ui, sans-serif;
  --r: 18px; --r-sm: 12px; --shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 10px 30px rgba(15, 18, 34, .06);
  --seite-b: 264px;
  color-scheme: light;
}
/* Dunkelmodus bewusst aus: Design D ist weiß (Entscheidung Marc 07.11.2026). Eine dunkle Variante kommt später als eigener Entwurf. */

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background: radial-gradient(1100px 560px at 88% -8%, rgba(109, 92, 255, .11), transparent 62%), radial-gradient(900px 520px at -6% 104%, rgba(20, 184, 166, .11), transparent 62%), var(--bg);
  background-attachment: fixed; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-family: var(--font-titel); font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; }
h2 { font-family: var(--font-titel); font-size: 18px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; display: block; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.lade { padding: 48px 24px; text-align: center; color: var(--ink-3); font-weight: 600; }

/* Formulare */
label.field, div.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 12px; background: var(--surface); color: var(--ink); outline: none; font-weight: 500; min-width: 0; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"] { width: auto; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; font-size: 14px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1 1 130px; }
.row.ende { justify-content: flex-end; }
.hint { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.err { color: var(--bad-ink); background: var(--bad-bg); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; }
.okbox { color: var(--ok-ink); background: var(--ok-bg); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 9px 14px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primaer { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(109, 92, 255, .22); }
.btn.primaer:hover { filter: brightness(1.05); color: #fff; }
.btn.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.btn.klein { padding: 6px 10px; font-size: 13px; }
.btn.klein .ic { width: 15px; height: 15px; }
.btn.breit { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 20px; font-weight: 700; }
.iconbtn:hover { background: var(--off-bg); color: var(--ink); }
.link { color: var(--primary); font-weight: 700; font-size: 13px; }
.link:hover { text-decoration: underline; }
.link.gefahr { color: var(--bad-ink); }

/* Grundgerüst */
.shell { min-height: 100dvh; }
.seite { position: fixed; inset: 0 auto 0 0; width: var(--seite-b); background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--side-ink); border-right: 1px solid var(--side-line); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; z-index: 30; }
.haupt { margin-left: var(--seite-b); padding: 28px 40px 80px; }
.mobilkopf { display: none; }
.marke { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.marke .logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--grad); color: #fff; }

.marke b { display: block; font-family: var(--font-titel); font-size: 16px; letter-spacing: -.01em; line-height: 1.1; }
.marke span { font-size: 13px; color: var(--side-muted); font-weight: 600; }
.marke.dunkel span { color: var(--ink-3); }

.demo-marke { margin-left: auto; font-size: 11px !important; font-weight: 800 !important; letter-spacing: .06em; text-transform: uppercase; background: var(--warn-bg); color: var(--warn-ink) !important; padding: 3px 8px; border-radius: 99px; }
.seitentitel { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); padding: 16px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); color: var(--side-ink); font-weight: 600; font-size: 14px; text-align: left; }
.nav span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .ic { color: var(--side-muted); }
.nav:hover { background: var(--side-active); }
.nav.aktiv { background: var(--grad); color: #fff; }
.nav.aktiv .ic { color: #fff; }
.nav em { font-style: normal; font-size: 12px; font-weight: 700; background: var(--off-bg); color: var(--ink); padding: 1px 8px; border-radius: 99px; }
.nav.aktiv em { background: rgba(255,255,255,.25); color: #fff; }
.nav em.warn { background: var(--warn); color: #1a1200; }
.seitenfuss { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--side-muted); }
.seitenfuss span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seitenfuss .link { color: var(--primary); text-align: left; }

/* Kopf, Leisten */
.kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.kopf p { margin-top: 4px; }
.kopf-aktionen { display: flex; gap: 10px; flex-wrap: wrap; }
.leiste { display: flex; justify-content: space-between; align-items: center; gap: 8px 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 16px; }
.adresse { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-ink); background: var(--primary-soft); padding: 3px 10px; border-radius: 99px; font-weight: 800; margin-left: 4px; }
.adresse .ic { width: 14px; height: 14px; }
.st { display: inline-flex; align-items: center; gap: 6px; }
.st .ic { width: 15px; height: 15px; }
.st.warn { color: var(--warn-ink); }
.st.bad { color: var(--bad-ink); }
.werkzeug { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.werkzeug #suche { flex: 1 1 240px; }
.werkzeug #kat { flex: 0 1 240px; }
.jahrwahl { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.jahrwahl select { border: 0; width: auto; font-weight: 800; font-size: 16px; padding: 8px 4px; text-align: center; background: transparent; box-shadow: none; }
.monate { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin-bottom: 24px; }
.monat { position: relative; overflow: hidden; background: var(--surface-2); border: 0; border-radius: 14px; min-height: 66px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink-2); transition: transform .18s, box-shadow .18s; animation: auftauchen .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
.monat::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--f, 0) * 1%); background: linear-gradient(180deg, #6d5cff, #14b8a6); transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.monat:not(.leer):hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(109, 92, 255, .22); }
.monat span, .monat b { position: relative; }
.monat.voll { color: #fff; }
.monat.voll b { color: #fff; }
.monat b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.monat.jetzt { box-shadow: 0 0 0 2px var(--ink); }
.monat.leer { opacity: .55; cursor: default; }
.monat.leer b { color: var(--ink-3); font-weight: 600; }

/* Listen */
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); animation: auftauchen .4s cubic-bezier(.2, .8, .2, 1) both; }
.gruppe { margin-bottom: 22px; scroll-margin-top: 16px; }
.gruppe h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 8px; }
.gruppe h2 span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.zeile { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(0, 210px) 112px 178px; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.zeile:has(.z-aktion) { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 190px) 112px 178px 118px; }
.zeile:last-child { border-bottom: 0; }
.zeile:hover { background: var(--surface-3); }
.zeile.gewaehlt { background: var(--surface-2); }
.z-datum { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.z-datum small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.z-haupt { min-width: 0; display: flex; flex-direction: column; }
.z-haupt b { font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-haupt > span { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-haupt i { font-style: normal; flex: none; }
.z-haupt i.neu { font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary-ink); padding: 1px 8px; border-radius: 99px; }
.z-haupt i.pruefen { color: var(--warn); }
.z-haupt i.ablauf { color: var(--warn-ink); font-weight: 700; }
.z-haupt i.pruefen .ic { width: 16px; height: 16px; }
.chip { justify-self: start; max-width: 100%; font-size: 12px; font-weight: 700; color: var(--off-ink); background: var(--off-bg); padding: 3px 10px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-betrag { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.z-zahlung, .z-aktion { display: flex; justify-content: flex-end; }
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.leer { padding: 0; }
.leer-box { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 40px 24px; text-align: center; color: var(--ink-2); }
.leer-box p { max-width: 520px; margin: 8px auto 0; font-size: 14px; }
.tabelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
td .pill { white-space: normal; }

/* Einstellungen */
.einst-kopf { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 8px; }
.einst-adresse, .einst-stand > div { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.einst-adresse { background: linear-gradient(135deg, rgba(109, 92, 255, .10), rgba(20, 184, 166, .10)); }
.einst-kopf small { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.einst-stand { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.einst-stand b { font-family: var(--font-titel); font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.einst-stand b .muted { font-size: 16px; font-weight: 600; }
.adresse.gross { font-size: 18px; padding: 8px 16px; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ablagen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 0 0 26px; }
.ablage-karte { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; animation: auftauchen .4s cubic-bezier(.2, .8, .2, 1) both; }
.ak-kopf { display: flex; align-items: center; gap: 12px; }
.ak-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--grad); color: #fff; flex: none; }
.ak-icon .ic { width: 20px; height: 20px; }
.ak-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ak-text b { font-family: var(--font-titel); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-text span { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-fuss { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ak-fuss .adresse { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ak-zahl { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.ak-immo { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ak-immo .ic { width: 15px; height: 15px; color: var(--accent-ink); }
.ablage-neu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 140px; border: 2px dashed var(--line-strong); border-radius: 20px; color: var(--ink-2); transition: .15s; }
.ablage-neu span { font-size: 28px; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ablage-neu b { color: var(--ink); }
.ablage-neu small { font-size: 12px; }
.ablage-neu:hover { border-color: var(--primary); background: var(--primary-soft); }
.ablage-offen { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ablage-offen .karte { width: 100%; padding: 18px; }
.einst-unten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: stretch; }
.einst-unten > div { display: flex; flex-direction: column; }
.einst-karte { flex: 1; padding: 18px; }
.einst-karte.info p + p { margin-top: 10px; }
@media (max-width: 900px) { .einst-unten { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .einst-kopf, .einst-stand { grid-template-columns: 1fr; } }
.spalten { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: start; }
.abschnitt { margin: 6px 4px 10px; }
.spalten .karte { padding: 18px; margin-bottom: 18px; }
.info p + p { margin-top: 8px; }
.info { font-size: 14px; color: var(--ink-2); }
.info b { color: var(--ink); }

/* Detail */
.abdunkeln { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; }
#detail.offen .abdunkeln, .abdunkeln.sichtbar { display: block; }
.detail { position: fixed; inset: 0 0 0 auto; width: min(1120px, 96vw); background: var(--surface); z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) 420px; box-shadow: -12px 0 40px rgba(15, 23, 42, .18); }
.vorschau { background: #334155; min-height: 0; display: flex; }
.vorschau iframe { border: 0; width: 100%; height: 100%; background: #fff; }
.vorschau .lade { color: #cbd5e1; margin: auto; }
.bildrahmen { overflow: auto; width: 100%; padding: 16px; display: flex; justify-content: center; align-items: flex-start; }
.bildrahmen img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 4px 24px rgba(0, 0, 0, .35); background: #fff; }
.d-form { overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 16px; background: var(--surface-3); }
.d-kopf, .d-aktionen, .hinweis { background: transparent; }
.d-gruppen { gap: 12px; }
.d-block { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.d-block h3 { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 -2px; }
.d-block .row { gap: 10px; }
.d-block .hint { margin-top: -4px; }
.meta { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.d-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.d-kopf h2 { font-size: 19px; overflow-wrap: anywhere; }
.d-kopf p { overflow-wrap: anywhere; margin-top: 2px; }
.d-aktionen { display: flex; gap: 10px; flex-wrap: wrap; }
.hinweis { display: flex; gap: 10px; background: var(--warn-bg); color: var(--warn-ink); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; }
.segment { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--off-bg); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.segment button { padding: 7px 6px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.segment button.aktiv { background: var(--grad); color: #fff; }
.meta { margin: 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; }
.meta dt { color: var(--ink-3); font-weight: 600; }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.d-fuss { display: flex; justify-content: space-between; gap: 12px; }

/* Dialog, Anmeldung */
.dialog { position: fixed; z-index: 60; left: 50%; top: 12vh; transform: translateX(-50%); width: min(520px, 94vw); background: var(--surface); border-radius: var(--r); padding: 22px; box-shadow: 0 24px 64px rgba(15, 23, 42, .3); }
.mitte { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login { width: min(400px, 100%); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.login .marke, .einrichtung .marke { padding: 0; }
.marke.dunkel span { color: var(--ink-3); }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.einrichtung { width: min(620px, 100%); display: flex; flex-direction: column; gap: 14px; }
.einrichtung .karte { padding: 20px; }

/* Meldungen */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: #0f172a; color: #fff; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.ok { background: #166534; }
.toast.fehler { background: #991b1b; }
body.ziehen::after { content: "Dateien hier ablegen"; position: fixed; inset: 12px; z-index: 90; border: 3px dashed var(--primary); border-radius: 20px; background: rgba(37, 99, 235, .1); display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--primary); pointer-events: none; }

/* Schmale Bildschirme */
@media (max-width: 1180px) {
  .zeile, .zeile:has(.z-aktion) { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "datum haupt betrag" "datum chip zahlung"; gap: 4px 12px; }
  .z-datum { grid-area: datum; align-self: start; }
  .z-haupt { grid-area: haupt; }
  .chip { grid-area: chip; }
  .z-betrag { grid-area: betrag; }
  .z-zahlung { grid-area: zahlung; }
  .zeile:has(.z-aktion) { grid-template-areas: "datum haupt betrag" "datum chip zahlung" "datum aktion aktion"; }
  .z-aktion { grid-area: aktion; justify-content: flex-start; margin-top: 4px; }
  .detail { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 900px) {
  .seite { transform: translateX(-100%); transition: transform .2s; }
  .menue-offen .seite { transform: none; }
  .menue-offen > .abdunkeln { display: block; z-index: 25; }
  .haupt { margin-left: 0; padding: 0 16px 80px; }
  .mobilkopf { display: flex; align-items: center; gap: 8px; margin: 0 -16px 16px; padding: 8px 12px; background: var(--side); color: var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .mobilkopf .iconbtn { color: var(--ink); }
  .mobilkopf b { font-family: var(--font-titel); }
  h1 { font-size: 22px; }
  .monate { grid-template-columns: repeat(6, 1fr); }
  .spalten { grid-template-columns: 1fr; gap: 0; }
  .detail { width: 100vw; grid-template-columns: 1fr; grid-template-rows: 42vh minmax(0, 1fr); }
  .kopf-aktionen { width: 100%; }
  .kopf-aktionen .btn { flex: 1; }
}

/* Adressen, Verwaltung, Konto */
.adressliste { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 500; }
.adr { display: inline-flex; align-items: center; gap: 2px; }
.adr .adresse { margin-left: 0; }
.adresse.ruhig { background: var(--off-bg); color: var(--off-ink); }
.iconbtn.mini { width: 26px; height: 26px; }
.iconbtn.mini .ic { width: 14px; height: 14px; }
.row.eng { align-items: center; gap: 8px; flex-wrap: nowrap; }
.row.eng input { flex: 1; }
.field > .btn { align-self: flex-start; }
.abschnitt.oben { margin-top: 28px; }
.abstand { margin: 0 4px 10px; }
.seitenfuss b { color: var(--side-ink); font-family: var(--font-titel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seitenfuss select { background: var(--side-active); border-color: var(--side-line); color: var(--side-ink); padding: 6px 8px; font-weight: 700; }
.z-haupt i.neu.warn { background: var(--warn-bg); color: var(--warn-ink); }
.row.eng .mono { white-space: nowrap; color: var(--ink-2); font-size: 13px; }

/* Prüfen als Kartenstapel (wie Entwurf D) */
.pruef-kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.ring { width: 60px; height: 60px; border-radius: 50%; background: conic-gradient(var(--primary) 0 calc(var(--p, 0) * 1%), var(--surface-2) 0); display: grid; place-items: center; position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.ring b, .ring small { position: relative; line-height: 1; }
.ring b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring small { font-size: 9px; color: var(--ink-2); }
.buehne { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 36px; align-items: start; }
.buehne-mitte { position: relative; padding: 36px 32px 14px; border-radius: 28px; background: linear-gradient(160deg, rgba(109, 92, 255, .09), rgba(20, 184, 166, .09)); border: 1px solid var(--line); }
.buehne-seite { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow); animation: auftauchen .45s cubic-bezier(.2, .8, .2, 1) both; }
.buehne-stand { color: var(--ink-2); font-size: 14px; }
.buehne-stand b { color: var(--ink); }
.ring.gross { width: 108px; height: 108px; }
.ring.gross::before { inset: 8px; }
.ring.gross b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.ring.gross small { font-size: 11px; }
.tasten { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.tasten span { display: inline-flex; align-items: center; gap: 6px; }
kbd { font: inherit; font-weight: 800; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 7px; padding: 1px 7px; color: var(--ink); }
.naechste { width: 100%; text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
.naechste small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.naechste ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.naechste li { display: flex; flex-direction: column; font-size: 13px; }
.naechste li b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.naechste li span { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stapel { position: relative; height: 460px; max-width: 680px; margin: 0 auto; }
.sk { position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 22px 24px; box-shadow: 0 18px 40px rgba(15, 18, 34, .10); transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s; touch-action: none; user-select: none; cursor: grab; overflow: hidden; }
.sk[data-index="0"] { z-index: 4; }
.sk[data-index="1"] { z-index: 3; transform: translateY(14px) scale(.96); }
.sk[data-index="2"] { z-index: 2; transform: translateY(28px) scale(.92); }
.sk[data-index="3"], .sk[data-index="4"] { z-index: 1; transform: translateY(40px) scale(.88); opacity: 0; }
.sk.zieht { transition: none; }
.sk.weg-ja { transform: translate(140%, -20px) rotate(16deg) !important; opacity: 0; z-index: 5; }
.sk.weg-nein { transform: translate(-140%, -20px) rotate(-16deg) !important; opacity: 0; z-index: 5; }
.sk { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.sk-text { min-width: 0; display: flex; flex-direction: column; }
.sk-text .chips { margin-top: 2px; }
.sk-text .sk-grund { margin-top: auto; }
.doc { width: 200px; min-height: 260px; height: 100%; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px 12px; }
.doc canvas { display: none; }
.doc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: top center; background: #fff; }
.doc img + b { z-index: 1; }
.doc b { position: absolute; right: 6px; bottom: 6px; font-size: 9px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 5px; border-radius: 5px; }
.doc i { display: block; width: 70%; height: 6px; border-radius: 3px; background: var(--line-strong); margin: 0; }
.sk-rechts { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.ki { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; background: var(--grad); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.ki.schwach { background: linear-gradient(135deg, #f59e0b, #f97316); }
.ki.ohne { background: var(--off-bg); color: var(--off-ink); }
.sk-betrag { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sk-titel { display: block; font-family: var(--font-titel); font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-u { color: var(--ink-2); font-size: 13px; margin: 3px 0 10px; }
.sk-grund { margin-top: 14px; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.stempel { position: absolute; top: 18px; font-weight: 800; letter-spacing: .1em; font-size: 14px; padding: 6px 10px; border: 3px solid; border-radius: 10px; opacity: 0; transform: rotate(-12deg); pointer-events: none; }
.stempel.ja { left: 18px; color: var(--ok); border-color: var(--ok); }
.stempel.nein { right: 18px; color: var(--bad); border-color: var(--bad); transform: rotate(12deg); }
.sk-aktionen { display: flex; justify-content: center; gap: 22px; margin: 18px auto 6px; max-width: 680px; }
.rund { width: 60px; height: 60px; border-radius: 50%; border: 0; font-size: 24px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 24px rgba(15, 18, 34, .12); transition: transform .15s; display: grid; place-items: center; }
.rund:hover { transform: translateY(-2px) scale(1.04); }
.rund:active { transform: scale(.92); }
.rund.nein { background: var(--surface); color: var(--bad); border: 1px solid var(--line); }
.rund.ja { background: var(--grad); color: #fff; }
.sk-hinweis { color: var(--ink-3); font-size: 12px; max-width: 680px; margin: 0 auto 6px; text-align: center; }
.stapel-leer { max-width: 680px; margin: 0 auto 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; border-radius: 24px; padding: 40px 20px; background: linear-gradient(135deg, rgba(109, 92, 255, .08), rgba(20, 184, 166, .08)); border: 1px dashed var(--line-strong); }
.stapel-leer em { font-style: normal; width: 56px; height: 56px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 26px; margin-bottom: 6px; }
.stapel-leer b { font-family: var(--font-titel); font-size: 18px; }
.stapel-leer span { color: var(--ink-2); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.akz { background: var(--primary); color: #fff; }
.chip.gruen { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.rund .ic { width: 24px; height: 24px; }
.stapel-leer em .ic { width: 26px; height: 26px; }
@media (max-width: 1100px) { .buehne { grid-template-columns: 1fr; } .buehne-seite { flex-direction: row; flex-wrap: wrap; justify-content: center; text-align: left; } .buehne-seite .naechste { display: none; } }
@media (max-width: 900px) { .stapel { height: 420px; } .sk { grid-template-columns: 1fr; grid-template-rows: 150px minmax(0, 1fr); gap: 12px; padding: 14px; } .doc { width: 100%; height: 150px; min-height: 0; padding: 10px 8px; } .doc img { object-fit: cover; object-position: top; } .sk-aktionen { gap: 28px; } .buehne-mitte { padding: 16px 12px 6px; border-radius: 22px; } .tasten { display: none; } }
@media (min-width: 1800px) { .haupt { padding: 36px 56px 80px; } .hero b { font-size: 40px; } .hero-k { padding: 16px 18px; } .monat { min-height: 78px; font-size: 13px; } .monat b { font-size: 18px; } .zeile { padding: 13px 20px; } }
@keyframes auftauchen { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .karte, .hero, .monat, .buehne-seite { animation: none; } .monat::before, .meter i { transition: none; } }
/* Jahr: Kennzahlen und Lücken-Hinweis */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; border-radius: 24px; padding: 20px; margin-bottom: 14px; background: var(--grad); color: #fff; box-shadow: 0 16px 40px rgba(109, 92, 255, .25); animation: auftauchen .45s cubic-bezier(.2, .8, .2, 1) both; }
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -200px; border-radius: 50%; background: rgba(255, 255, 255, .14); pointer-events: none; }
.hero-k { position: relative; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.hero small { display: block; color: rgba(255, 255, 255, .82); font-size: 12px; font-weight: 600; }
.hero small.rot { color: #ffe4e4; margin-top: 2px; }
.hero b { display: block; margin-top: 2px; font-family: var(--font-titel); font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .warm { color: #fff3c4; }
.hero-r { text-align: right; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr 1fr; padding: 14px; } .hero b { font-size: 26px; } }
.luecke { display: flex; gap: 10px; align-items: flex-start; margin: -10px 0 16px; background: var(--warn-bg); border: 1px solid #fde7b8; border-radius: 14px; padding: 10px 12px; font-size: 13px; color: var(--warn-ink); }
.luecke .ic { color: var(--warn); flex: none; }
/* Offene Zahlungen: Zeile wischen = bezahlt */
.zeile.wischbar { position: relative; overflow: hidden; touch-action: pan-y; user-select: none; transition: transform .3s, opacity .3s; }
.zeile.wischbar.zieht { transition: none; }
.zeile.wischbar.weg { transform: translateX(120%); opacity: 0; }
.wisch-ok { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-style: normal; font-weight: 700; color: #fff; background: linear-gradient(90deg, var(--ok), var(--accent)); opacity: 0; pointer-events: none; z-index: 2; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: calc(var(--f, 0) * 1%); background: var(--grad); border-radius: 99px; transition: width .5s; }

/* Admin-Seite (/admin) */
.admin-body { background: var(--surface-3); }
.admin-kopf { display: flex; align-items: center; gap: 24px; padding: 12px 32px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.admin-kopf .marke { padding: 0; }
.admin-kopf .marke .logo { background: var(--ink); font-weight: 800; }
.admin-tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { background: var(--surface-2); }
.tab.aktiv { background: var(--ink); color: #fff; }
.tab em { font-style: normal; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .08); padding: 1px 7px; border-radius: 99px; }
.tab.aktiv em { background: rgba(255, 255, 255, .22); }
.admin-rechts { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.admin-haupt { padding: 24px 32px 80px; max-width: 1500px; }
.admin-hero { background: var(--ink); box-shadow: 0 16px 40px rgba(15, 18, 34, .18); }
.admin-hero b { white-space: normal; overflow: visible; }
.admin-hero::after { display: none; }
.admin-haupt > .karte.form, .admin-haupt > .karte.info { padding: 18px; }
.admin-haupt table.klein { white-space: nowrap; }
.admin-haupt .karte.info { overflow-x: auto; }
.admin-haupt .spalten { grid-template-columns: 1fr 1fr; align-items: stretch; }
.admin-haupt .spalten .karte { margin-bottom: 0; }
.admin-haupt .karte.tabelle table { min-width: 900px; }
.admin-haupt td, .admin-haupt th { vertical-align: middle; white-space: nowrap; }
.admin-haupt td:first-child { white-space: normal; min-width: 220px; }
.admin-haupt table.klein { min-width: 0; }
.admin-haupt table.klein td { white-space: normal; }
.admin-haupt .adressliste { gap: 6px; }
.admin-leiste { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.admin-leiste input { max-width: 420px; }
.admin-h3 { font-family: var(--font-titel); font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.karte.form .admin-h3, .karte.info .admin-h3 { margin-bottom: 2px; }
table.klein { font-size: 13px; margin-top: 8px; }
table.klein th, table.klein td { padding: 7px 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tarif-wahl { width: auto; padding: 5px 8px; font-size: 13px; }
@media (max-width: 900px) { .admin-kopf { flex-wrap: wrap; padding: 10px 16px; } .admin-haupt { padding: 16px; } .admin-tabs { margin: 0; order: 3; width: 100%; overflow-x: auto; } }

/* Handy-Scan (Ansicht "scan") */
.scan { margin: -28px -40px -80px; min-height: 100dvh; }
.haupt:has(.scan) { padding-bottom: 0; }
.sc-kamera { position: relative; height: 100dvh; background: #101322; overflow: hidden; }
.sc-kamera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-rahmen { position: absolute; inset: 12% 8% 26%; border-radius: 12px; pointer-events: none; transition: box-shadow .3s; }
.sc-rahmen::before, .sc-rahmen::after, .sc-rahmen i::before, .sc-rahmen i::after { content: ""; position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 6px; transition: border-color .3s; }
.sc-rahmen::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
.sc-rahmen::after { right: -2px; top: -2px; border-left: 0; border-bottom: 0; }
.sc-rahmen i::before { left: -2px; bottom: -2px; border-right: 0; border-top: 0; }
.sc-rahmen i::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.sc-rahmen.gefunden::before, .sc-rahmen.gefunden::after, .sc-rahmen.gefunden i::before, .sc-rahmen.gefunden i::after { border-color: #2dd4bf; }
.sc-rahmen.gefunden { box-shadow: inset 0 0 0 2px rgba(45, 212, 191, .6); }
.sc-blitz { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sc-blitz.an { animation: sc-blitz .35s; }
@keyframes sc-blitz { from { opacity: .9; } to { opacity: 0; } }
.sc-oben { position: absolute; left: 0; right: 0; top: 0; padding: max(14px, env(safe-area-inset-top)) 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-pill { background: rgba(0, 0, 0, .4); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 7px 12px; border-radius: 99px; font-weight: 700; font-size: 13px; border: 0; display: inline-flex; align-items: center; gap: 6px; }
.sc-pill .ic { width: 18px; height: 18px; }
.sc-ablage { width: auto; max-width: 46%; box-shadow: none; appearance: none; -webkit-appearance: none; }
.sc-seiten { position: absolute; left: 14px; bottom: 150px; display: flex; gap: 6px; }
.sc-seiten i { width: 44px; height: 58px; border-radius: 6px; background: #fff center/cover; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); display: grid; place-items: end start; animation: pop .3s; }
.sc-seiten i b { font-size: 10px; font-weight: 800; color: #fff; background: var(--primary); padding: 1px 5px; border-radius: 4px; margin: 3px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.sc-unten { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px max(22px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(16, 19, 34, .92)); color: #fff; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.sc-hinweis { font-size: 14px; font-weight: 600; text-align: center; min-height: 20px; }
.sc-knoepfe { display: flex; align-items: center; justify-content: center; gap: 22px; width: 100%; }
.sc-rund { border-radius: 99px; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.sc-rund.klein { width: 74px; height: 42px; background: rgba(255, 255, 255, .16); }
.sc-rund.klein.an { background: var(--grad); }
.sc-rund.klein.fertig { background: #fff; color: var(--ink); }
.sc-rund.klein:disabled { opacity: .4; }
.sc-rund.gross { width: 76px; height: 76px; background: rgba(255, 255, 255, .25); border: 4px solid #fff; }
.sc-rund.gross span { width: 54px; height: 54px; border-radius: 50%; background: #fff; transition: transform .1s; }
.sc-rund.gross:active span { transform: scale(.85); }
.sc-mitte, .sc-inhalt { max-width: 560px; margin: 0 auto; padding: 40px 24px; display: flex; flex-direction: column; gap: 14px; }
.sc-mitte { align-items: center; text-align: center; padding-top: 80px; }
.sc-mitte .meter { width: 220px; }
.sc-doc { width: 120px; height: 160px; border-radius: 10px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(15, 18, 34, .12); overflow: hidden; position: relative; }
.sc-doc img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.sc-doc::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(transparent, rgba(109, 92, 255, .3), transparent); animation: sc-lesen 1.1s linear infinite; }
@keyframes sc-lesen { to { top: 100%; } }
.sc-karte { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: 0 18px 40px rgba(15, 18, 34, .10); display: flex; flex-direction: column; gap: 6px; }
.sc-karte .sk-grund { margin-top: 10px; }
.sc-zentriert { align-items: center; text-align: center; padding-top: 60px; }
.sc-zentriert h1 { font-size: 34px; }
.sc-emoji { font-size: 64px; line-height: 1; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.zwei { display: flex; gap: 10px; width: 100%; margin-top: 8px; }
.zwei .btn { flex: 1; padding: 13px; font-size: 15px; }
.btn.dunkel { background: var(--ink); color: #fff; border-color: transparent; }
.sc-haken { width: 88px; height: 88px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; animation: pop .4s; }
.sc-haken .ic { width: 40px; height: 40px; }
.sc-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.sc-stat div { background: var(--surface-2); border-radius: 16px; padding: 12px; text-align: left; }
.sc-stat small { display: block; color: var(--ink-2); font-size: 12px; }
.sc-stat b { font-size: 20px; letter-spacing: -.02em; display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-fuss { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 10px; }
.scan-knopf { display: none; }
.tabbar, .ablage-chips, .d-tabs, .nur-mobil { display: none; }
/* Scannen nur am Handy/Tablet: in der Seitenleiste am großen Bildschirm ausgeblendet */
@media (min-width: 901px) { .seite .nav[data-id="scan"] { display: none; } }
@media (max-width: 900px) {
  /* iOS zoomt bei Eingabefeldern unter 16px automatisch hinein und behält den Zoom; deshalb mindestens 16px */
  input, select, textarea { font-size: 16px; }
  .jahrwahl select { font-size: 16px; }
  /* Grundgerüst: kompakter Kopf, Ablage-Chips, Tab-Leiste unten */
  .haupt { padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  .mobilkopf { margin: 0 -14px 0; padding: max(8px, env(safe-area-inset-top)) 10px 6px; border-bottom: 0; background: transparent; position: static; }
  .mobilkopf b { font-size: 17px; }
  .ablage-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px 12px; padding: 2px 14px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ablage-chips::-webkit-scrollbar { display: none; }
  .chip-ablage { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--ink-2); }
  .chip-ablage .ic { width: 15px; height: 15px; }
  .chip-ablage.aktiv { background: var(--ink); color: #fff; border-color: transparent; }
  .tabbar { display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tab-knopf { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: var(--ink-3); position: relative; border-radius: 12px; }
  .tab-knopf .ic { width: 22px; height: 22px; }
  .tab-knopf.aktiv { color: var(--primary-ink); }
  .tab-knopf em { position: absolute; top: 0; right: calc(50% - 22px); font-style: normal; font-size: 10px; font-weight: 800; background: var(--warn); color: #1a1200; padding: 0 5px; border-radius: 99px; min-width: 16px; line-height: 16px; }
  .tab-scan { width: 60px; height: 60px; margin: 0 auto -14px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(109, 92, 255, .35); }
  .tab-scan .ic { width: 28px; height: 28px; }
  .haupt:has(.scan) ~ .tabbar, .haupt:has(.scan) .mobilkopf, .haupt:has(.scan) .ablage-chips { display: none; }
  .scan { margin: -8px -14px -92px; }
  .seite .nav.ablage, .seite .nur-desktop { display: none; }

  /* Belege-Ansicht */
  h1 { font-size: 24px; }
  .kopf { margin-bottom: 10px; align-items: center; flex-wrap: nowrap; }
  .kopf > div:first-child { min-width: 0; flex: 1; }
  .kopf p { font-size: 13px; }
  .kopf-aktionen { width: auto; gap: 8px; }
  .kopf-aktionen .btn { flex: none; padding: 8px 10px; font-size: 0; gap: 0; width: 40px; height: 40px; justify-content: center; }
  .kopf-aktionen .btn .ic { width: 20px; height: 20px; }
  .leiste, .hero, .werkzeug #kat { display: none; }
  .nur-mobil { display: inline; }
  .nur-mobil .warm { color: var(--warn-ink); }
  .werkzeug { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
  .werkzeug #suche { order: 2; }
  .monate { gap: 6px; margin-bottom: 16px; }
  .monat { min-height: 54px; padding: 6px 2px; font-size: 11px; border-radius: 12px; }
  .monat b { font-size: 15px; }
  .gruppe { margin-bottom: 16px; }
  .gruppe h2 { font-size: 16px; }
  .zeile, .zeile:has(.z-aktion) { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "datum haupt betrag" "datum haupt zahlung"; gap: 2px 10px; padding: 10px 12px; align-items: center; }
  .zeile:has(.z-aktion) { grid-template-areas: "datum haupt betrag" "datum aktion zahlung"; }
  .zeile .chip { display: none; }
  .z-datum { font-size: 13px; }
  .z-haupt b { font-size: 14px; }
  .z-haupt > span { font-size: 12px; }
  .z-betrag { font-size: 14px; }
  .pill { font-size: 11px; padding: 2px 8px; }
  .z-aktion { margin-top: 2px; }
  .z-aktion .btn.klein { padding: 4px 9px; font-size: 12px; }
  .leer-box { padding: 28px 16px; }

  /* Prüfen: Karte, Knöpfe und Zähler passen zusammen auf den Bildschirm */
  .pruef-kopf { margin-bottom: 8px; align-items: center; }
  .pruef-kopf p { display: none; }
  .buehne { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .buehne-mitte, .buehne-seite { width: 100%; }
  .buehne-mitte { order: 2; padding: 12px 10px 10px; border-radius: 22px; }
  .stapel { height: clamp(300px, calc(100dvh - 400px), 440px); }
  .sk { padding: 12px; gap: 10px; grid-template-rows: 120px minmax(0, 1fr); }
  .doc { height: 120px; }
  .sk-titel { font-size: 18px; }
  .sk-betrag { font-size: 20px; }
  .sk-grund { font-size: 12px; padding: 8px 10px; margin-top: 8px; }
  .sk-aktionen { margin: 12px auto 0; gap: 36px; }
  .rund { width: 58px; height: 58px; }
  .sk-hinweis { display: none; }
  .buehne-seite { order: 1; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 16px; box-shadow: none; animation: none; }
  .ring.gross { width: 46px; height: 46px; }
  .ring.gross::before { inset: 5px; }
  .ring.gross b { font-size: 15px; }
  .ring.gross small { display: none; }
  .buehne-stand { font-size: 13px; flex: 1; text-align: left; margin: 0; }
  .tasten, .naechste { display: none; }
  .stapel-leer { padding: 28px 16px; }

  /* Detail: Reiter Datei / Angaben, Datei füllt den Bildschirm */
  .detail { grid-template-rows: auto minmax(0, 1fr); grid-template-columns: 1fr; }
  .d-tabs { display: flex; align-items: center; gap: 6px; padding: max(8px, env(safe-area-inset-top)) 10px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .d-tabs button[data-akt="d-tab"] { padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; color: var(--ink-2); background: var(--surface-2); }
  .d-tabs button.aktiv { background: var(--ink); color: #fff; }
  .d-tabs-titel { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .detail .vorschau { display: flex; background: #2a3042; }
  .detail .d-form { display: none; }
  .detail.zeige-angaben .vorschau { display: none; }
  .detail.zeige-angaben .d-form { display: flex; }
  .detail .d-kopf { display: none; }
  .seitenrahmen { overflow: auto; width: 100%; padding: 10px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
  .seitenrahmen canvas { width: 100%; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 4px 20px rgba(0, 0, 0, .35); }
  .d-form { padding: 12px 14px 32px; gap: 12px; }
  .d-kopf h2 { font-size: 17px; }

  /* Einstellungen */
  .einst-kopf { gap: 10px; }
  .ablagen-raster { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ablage-karte { min-width: 0; padding: 14px; }
  .ak-fuss .adresse { flex: 1 1 100%; min-width: 0; justify-content: space-between; }
  .ak-kopf .btn.klein { padding: 6px 8px; }
  .ablage-neu { min-height: 90px; }
  .abschnitt { margin: 4px 2px 8px; }
}
