/* ============================================================
   Taxbox – Oberfläche
   Marke: vibits-Kiesel als Grund, Petrol als einzige Akzentfarbe.
   Ein System für Schrift und Abstände (siehe Design-System „Taxbox“):
     Schrift  display 34 · title 26 · heading 20 · body 15 · small 13.5 · eyebrow 12
     Abstand  4 · 8 · 12 · 16 · 22 · 28 · 40
   Keine style-Attribute im Markup (CSP), alles über Klassen.
   ============================================================ */

/* Schrift wie in der shy-collective-App: Jost (variabel, 300–700) */
@font-face { font-family: 'Jost'; font-weight: 300 700; font-style: normal; font-display: swap;
  src: url('fonts/jost-latin-wght-normal.woff2') format('woff2-variations'), url('fonts/jost-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Jost'; font-weight: 300 700; font-style: normal; font-display: swap;
  src: url('fonts/jost-latin-ext-wght-normal.woff2') format('woff2-variations'), url('fonts/jost-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ground: #F3F1EC; --card: #FBFAF7; --sunk: #E6E2DA; --ink: #262420; --muted: #6B675F; --line: #DDD8CE;
  --akzent: #1E6B74; --akzent-soft: #D6EAEA;
  --ok-bg: #E3ECDD; --ok-ink: #34482F; --warn-bg: #FBE4DF; --warn-ink: #8C2219;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 28px; --s7: 40px;
  --r-pill: 999px; --r-card: 22px; --r-inner: 14px;
  --font: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --schatten: 0 10px 30px rgba(38, 36, 32, .14);
  color-scheme: light;
}
/* Dunkel: automatisch (System) oder fest gewählt – Schalter Auto · Hell · Dunkel */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=hell]) {
    --ground: #1C1B18; --card: #262420; --sunk: #33302B; --ink: #F3F1EC; --muted: #BDB7AC; --line: #3A3732;
    --akzent: #7CC7CE; --akzent-soft: #1E3A3D;
    --ok-bg: #2A3626; --ok-ink: #C2D8BC; --warn-bg: #45231F; --warn-ink: #F6C2BA;
    --schatten: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme=dunkel] {
  --ground: #1C1B18; --card: #262420; --sunk: #33302B; --ink: #F3F1EC; --muted: #BDB7AC; --line: #3A3732;
  --akzent: #7CC7CE; --akzent-soft: #1E3A3D;
  --ok-bg: #2A3626; --ok-ink: #C2D8BC; --warn-bg: #45231F; --warn-ink: #F6C2BA;
  --schatten: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 15px/23px var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.zahl, .betrag { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.klein { font-size: 13.5px; line-height: 20px; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.versteckt { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Grundgerüst ------------------------------------------ */

.seite { max-width: 1200px; margin: 0 auto; padding: 0 var(--s4) var(--s7); }
@media (min-width: 700px) { .seite { padding: 0 var(--s6) var(--s7); } }

.kopf {
  position: sticky; top: 0; z-index: 20; background: var(--ground);
  display: flex; align-items: center; gap: var(--s3);
  padding: calc(var(--s3) + env(safe-area-inset-top)) 0 var(--s3);
}
.marke { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.marke img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.kopf .suche { flex: 1; max-width: 360px; margin-left: auto; position: relative; }
.kopf .suche input {
  width: 100%; height: 38px; border: 0; border-radius: var(--r-pill); background: var(--sunk);
  padding: 0 var(--s4) 0 38px; font-size: 15px; outline: none;
}
.kopf .suche input:focus-visible { box-shadow: 0 0 0 2px var(--akzent); }
.kopf .suche svg { position: absolute; left: 12px; top: 10px; width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 560px) { .marke span { display: none; } }

.knopf-rund {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--sunk); color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; flex: none;
}
.knopf-rund svg { width: 19px; height: 19px; }
.knopf-rund { position: relative; }
.knopf-rund .zahl {
  position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--petrol-voll); color: var(--auf-petrol); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--ground);
}
@media (max-width: 420px) { .kopf { gap: var(--s2); } .kopf .knopf-rund { width: 36px; height: 36px; } }

/* ---------- Knöpfe ------------------------------------------------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 40px; padding: 0 var(--s4); border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.knopf svg { width: 17px; height: 17px; }
.knopf.primaer { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.knopf.gefahr { color: var(--warn-ink); border-color: transparent; background: var(--warn-bg); }
.knopf.leise { border-color: transparent; background: var(--sunk); }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf:focus-visible, .knopf-rund:focus-visible, .pille:focus-visible, .zeile:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.textknopf { border: 0; background: none; padding: 0; font-weight: 600; color: var(--akzent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Jahre ------------------------------------------------ */

.jahre { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s1) 0 var(--s2); scrollbar-width: none; }
.jahre::-webkit-scrollbar { display: none; }
.pille {
  flex: none; height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  font-variant-numeric: tabular-nums;
}
.pille svg { width: 16px; height: 16px; }
.pille.aktiv { background: var(--ink); color: var(--ground); border-color: var(--ink); }
/* Jahres-Reiter nach Stand, drei Abstufungen: offen (hell) · eingereicht (Petrol hell) · erledigt (Petrol satt).
   Aktiv und Hover nur als Umrandung, damit die Farbe den Stand behält. */
:root { --petrol-voll: #1E6B74; --auf-petrol: #FBF8F2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=hell]) { --petrol-voll: #2B8A93; --auf-petrol: #FBF8F2; } }
:root[data-theme=dunkel] { --petrol-voll: #2B8A93; --auf-petrol: #FBF8F2; }
.jahre { padding: 6px 5px 8px; margin: 0 -5px; }
.jahre .pille { position: relative; border: 1px solid transparent; }
.jahre .pille.jahr-offen  { background: var(--card); border-color: var(--line); color: var(--ink); }
.jahre .pille.jahr-amt    { background: var(--akzent-soft); color: var(--ink); }
.jahre .pille.jahr-fertig { background: var(--petrol-voll); color: var(--auf-petrol); }
.jahre .pille:hover { box-shadow: 0 0 0 1.5px var(--ink); }
.jahre .pille.aktiv { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--ink); }
.jahre .pille .punkt { display: none; }
.jahre > button.pille { border-color: var(--line); }
.pille.ziel { border-color: var(--akzent); background: var(--akzent-soft); color: var(--ink); }

/* ---------- Jahreskopf ---------------------------------------------- */

.jahr-kopf { padding: var(--s5) 0 var(--s4); display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s5); }
.jahr-kopf h1 { font-size: 34px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.jahr-kopf .summe { margin-left: auto; text-align: right; }
.jahr-kopf .summe b { display: block; font-size: 26px; line-height: 29px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.stand {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); width: 100%;
}
.stand .pille { height: 30px; font-size: 13.5px; padding: 0 var(--s3); }
.frist { display: inline-flex; align-items: center; height: 30px; padding: 0 var(--s3); border-radius: var(--r-pill);
  background: var(--akzent-soft); color: var(--ink); font-size: 13.5px; font-weight: 600; }
.frist.knapp { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Ablagefläche --------------------------------------------- */

.ablage {
  display: flex; align-items: center; gap: var(--s4); width: 100%;
  padding: var(--s5); border-radius: var(--r-card); border: 2px dashed var(--line); background: var(--card);
  cursor: pointer; text-align: left;
}
.ablage .symbol { width: 52px; height: 52px; border-radius: 14px; background: var(--petrol-voll); color: var(--auf-petrol); display: grid; place-items: center; flex: none; }
.ablage .symbol svg { width: 26px; height: 26px; }
.ablage b { display: block; font-size: 20px; line-height: 26px; letter-spacing: -0.01em; }
.ablage:hover, .ablage:focus-visible { border-color: var(--akzent); outline: none; }
body.ziehen .ablage, .ablage.ueber { border-color: var(--akzent); background: var(--akzent-soft); }

/* Beim Ziehen: ganze Seite ist Ablage */
.zieh-hinweis {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; display: none;
  border: 3px solid var(--akzent); border-radius: 0;
}
.zieh-hinweis div {
  position: absolute; left: 50%; bottom: calc(var(--s6) + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: var(--s3) var(--s5); border-radius: var(--r-pill); font-weight: 600;
  box-shadow: var(--schatten); white-space: nowrap;
}
body.ziehen .zieh-hinweis { display: block; }

/* ---------- Hinweiszeile ----------------------------------------------- */

.hinweis {
  display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4);
  padding: var(--s3) var(--s4); border-radius: var(--r-inner); background: var(--card); border: 1px solid var(--line);
}
.hinweis p { flex: 1; }
.hinweis .knopf { height: 34px; }

/* ---------- Gruppen und Zeilen --------------------------------------- */

.abschnitt { margin-top: var(--s6); }
.abschnitt > .eyebrow { margin-bottom: var(--s3); }
.gruppe { background: var(--card); border-radius: var(--r-card); border: 1px solid var(--line); overflow: hidden; }
.gruppe + .gruppe { margin-top: var(--s3); }
.gruppe.ueber { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent) inset; }
.gruppe-kopf { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s4) var(--s5) var(--s2); }
.gruppe-kopf h2 { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.gruppe-kopf .anlage { color: var(--muted); font-size: 13.5px; }
.gruppe-kopf .betrag { margin-left: auto; font-weight: 600; }

.zeile {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s3); align-items: center;
  padding: var(--s2) var(--s5); min-height: 60px; border-top: 1px solid var(--line);
  text-decoration: none; cursor: pointer; background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0;
}
.gruppe-kopf + .zeile { border-top-color: transparent; }
.zeile:hover { background: var(--ground); }
.zeile .bild {
  width: 44px; height: 44px; border-radius: 10px; background: var(--sunk); overflow: hidden;
  display: grid; place-items: center; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
}
.zeile .bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zeile .text { min-width: 0; }
.zeile .titel { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .unter { display: block; color: var(--muted); font-size: 13.5px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .rechts { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.zeile .betrag { font-weight: 600; }
.marke-klein {
  display: inline-block; font-size: 11.5px; line-height: 18px; font-weight: 600; padding: 0 8px; border-radius: var(--r-pill);
  background: var(--sunk); color: var(--muted); white-space: nowrap;
}
.marke-klein.ki { background: var(--akzent-soft); color: var(--ink); }
.marke-klein.fehler { background: var(--warn-bg); color: var(--warn-ink); }
.marke-klein.ok { background: var(--ok-bg); color: var(--ok-ink); }

.leer { padding: var(--s7) var(--s4); text-align: center; color: var(--muted); }

/* Fortschritt beim Hochladen */
.balken { height: 4px; border-radius: 2px; background: var(--sunk); overflow: hidden; margin-top: 6px; }
.balken i { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .2s; }

/* ---------- Unten: Checkliste und Weitergeben ---------------------------- */

.raster-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
@media (min-width: 700px) { .raster-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.karte { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.karte h2 { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.karte .unten { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--s2); }

.check { display: flex; align-items: center; gap: var(--s3); min-height: 32px; }
.check .haken { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.check.da .haken { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-ink); }
.check .haken svg { width: 14px; height: 14px; }
.check span.t { flex: 1; min-width: 0; }
.check.weg { color: var(--muted); }
.check.weg span.t { text-decoration: line-through; }
.check .x { white-space: nowrap; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px; }

/* ---------- Blatt (Beleg ansehen und ändern) ----------------------------- */

.blatt-hg { position: fixed; inset: 0; z-index: 40; background: rgba(28, 27, 24, .45); }
.blatt {
  position: fixed; z-index: 41; background: var(--ground); display: flex; flex-direction: column;
  inset: 0; overflow: hidden;
}
@media (min-width: 900px) {
  .blatt { inset: 0 0 0 auto; width: min(880px, 92vw); box-shadow: var(--schatten); }
}
.blatt-kopf { display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s4) var(--s3); border-bottom: 1px solid var(--line); }
.blatt-kopf h2 { flex: 1; font-size: 17px; line-height: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blatt-inhalt { flex: 1; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
@media (min-width: 900px) { .blatt-inhalt { grid-template-columns: minmax(0, 1fr) 340px; align-content: stretch; } }
.vorschau { background: var(--sunk); display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 900px) { .vorschau { min-height: 0; } .vorschau img { max-height: 78vh; } }
.vorschau .flaeche { flex: 1; display: grid; place-items: center; padding: var(--s3); min-height: 30vh; min-width: 0; }
.vorschau img { max-width: 100%; max-height: 42vh; border-radius: 8px; box-shadow: var(--schatten); background: #fff; }
.vorschau iframe { width: 100%; height: 100%; min-height: 70vh; border: 0; background: #fff; border-radius: 8px; }
.vorschau .dateien { flex: none; display: flex; gap: var(--s2); padding: var(--s2) var(--s3) var(--s3); overflow-x: auto; }
.vorschau .dateien .pille { height: 30px; font-size: 13px; font-weight: 600; }
.vorschau.ueber { box-shadow: 0 0 0 3px var(--akzent) inset; }
.pdf-mobil { text-align: center; display: flex; flex-direction: column; gap: var(--s3); align-items: center; }

.felder { padding: var(--s5) var(--s4) var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.felder .zwei, .zwei-dialog { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld label, .feld .label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--muted); }
.feld input, .feld select, .feld textarea {
  width: 100%; height: 42px; padding: 0 var(--s3); border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-size: 15px; outline: none; min-width: 0;
}
.feld textarea { height: 76px; padding: 10px var(--s3); resize: vertical; }
.feld input:focus-visible, .feld select:focus-visible, .feld textarea:focus-visible { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
.feld .hilfe { font-size: 12.5px; color: var(--muted); line-height: 17px; }
.feld input.betrag-feld { text-align: right; font-variant-numeric: tabular-nums; }
.segment { display: flex; background: var(--sunk); border-radius: var(--r-pill); padding: 3px; gap: 3px; }
.segment button { flex: 1; height: 34px; border: 0; border-radius: var(--r-pill); background: none; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.segment button.an { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ki-zeile { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3); border-radius: var(--r-inner); background: var(--akzent-soft); font-size: 13.5px; line-height: 20px; }
.ki-zeile.fehler { background: var(--warn-bg); color: var(--warn-ink); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: var(--s2); }
.knopfreihe .knopf.primaer { flex: 1; }
.trenner { height: 1px; background: var(--line); }

/* ---------- Dialog, Toast, Laden -------------------------------------- */

.dialog-hg { position: fixed; inset: 0; z-index: 70; background: rgba(28, 27, 24, .45); display: grid; place-items: end center; padding: var(--s4); }
@media (min-width: 600px) { .dialog-hg { place-items: center; } }
.dialog { width: 100%; max-width: 440px; background: var(--ground); border-radius: var(--r-card); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); box-shadow: var(--schatten); max-height: 90vh; overflow: auto; }
.dialog h2 { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.dialog .knopfreihe { justify-content: flex-end; }
.dialog .knopfreihe .knopf.primaer { flex: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  z-index: 80; background: var(--ink); color: var(--ground); padding: var(--s3) var(--s5); border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.zeigen { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; }

.laden { display: grid; place-items: center; min-height: 60vh; }
.kreisel { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--sunk); border-top-color: var(--akzent); animation: dreh .8s linear infinite; }
.kreisel.mini { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .kreisel { animation-duration: 2s; } .toast, .balken i { transition: none; } }

/* ---------- Konto ---------------------------------------------------- */

html { scrollbar-gutter: stable; }   /* gleiche Breite mit und ohne Scrollbalken */
.konto h1 { font-size: 26px; line-height: 29px; font-weight: 600; letter-spacing: -0.015em; padding: var(--s5) 0 var(--s2); }
.konto .karte + .karte { margin-top: var(--s3); }
.konto .abschnitt-titel { margin: var(--s6) 0 var(--s3); }
.eintrag { display: flex; align-items: center; gap: var(--s3); min-height: 44px; }
.eintrag .grow { flex: 1; min-width: 0; }
.schalter { display: flex; align-items: center; gap: var(--s3); cursor: pointer; }
.schalter span { flex: 1; }
.schalter input { width: 46px; height: 28px; appearance: none; -webkit-appearance: none; border-radius: 14px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.schalter input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.schalter input:checked { background: var(--petrol-voll); }
.schalter input:checked::after { left: 21px; }
.schritte { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: var(--s2); }
.schritte ul { margin: 6px 0 0; padding-left: 18px; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; background: var(--sunk); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.schluessel-neu { padding: var(--s3); border-radius: var(--r-inner); background: var(--akzent-soft); display: flex; flex-direction: column; gap: var(--s2); }
.qr { width: 200px; height: 200px; align-self: center; border-radius: 10px; }

/* ---------- Anmelden: links Marke, rechts Formular (wie Städtli WWS) ---- */

.auth-seite { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .auth-seite { grid-template-columns: minmax(380px, 36%) minmax(0, 1fr); } }
.auth-marke {
  position: relative; overflow: hidden; background: #16525A; color: #FBF6EF;
  display: flex; flex-direction: column; gap: var(--s5);
  padding: calc(var(--s6) + env(safe-area-inset-top)) var(--s6) var(--s6);
}
@media (min-width: 900px) { .auth-marke { padding: var(--s7) 56px var(--s6); } }
.auth-marke .wortmarke { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; font-size: 26px; letter-spacing: -0.02em; position: relative; }
.auth-marke .wortmarke img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1.5px rgba(251, 246, 239, .35); }
.auth-marke .bon {
  position: absolute; right: -50px; top: 90px; width: 230px; height: 306px; pointer-events: none; opacity: .1; transform: rotate(8deg);
}
.auth-marke .text { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: var(--s4); max-width: 440px; }
.auth-marke h2 { font-size: 40px; line-height: 42px; font-weight: 600; letter-spacing: -0.01em; }
.auth-marke h2 em { font-style: normal; color: #9FE0D8; }
.auth-marke p { color: rgba(251, 246, 239, .78); }
.auth-marke ul { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.auth-marke li { display: flex; align-items: center; gap: var(--s3); font-weight: 600; font-size: 14.5px; }
.auth-marke li span { width: 30px; height: 30px; border-radius: 8px; background: rgba(251, 246, 239, .14); display: grid; place-items: center; flex: none; }
.auth-marke li svg { width: 16px; height: 16px; }
.auth-marke .fuss { position: relative; font-size: 12.5px; color: rgba(251, 246, 239, .6); }
@media (max-width: 899px) {
  .auth-marke h2 { font-size: 30px; line-height: 33px; }
  .auth-marke ul, .auth-marke .fuss, .auth-marke .bon { display: none; }
}

.auth-form { display: flex; flex-direction: column; padding: var(--s5) var(--s4) var(--s4); min-width: 0; }
@media (min-width: 900px) { .auth-form { padding: var(--s6) var(--s7) var(--s5); } }
.auth-form .oben { display: flex; justify-content: flex-end; }
.auth-form .mitte { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--s6) 0; }
.auth { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--s5); }
.auth .kopftext { display: flex; flex-direction: column; gap: 6px; }
.auth .kopftext h1 { font-size: 34px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.auth .kopftext p { color: var(--muted); }
.auth form { display: flex; flex-direction: column; gap: var(--s4); }
.auth .feld-kopf { display: flex; justify-content: space-between; align-items: baseline; }
.auth .feld-kopf a { font-size: 13px; font-weight: 600; color: var(--akzent); text-decoration: none; }
.auth .mit-symbol { position: relative; }
.auth .mit-symbol > svg { position: absolute; left: 13px; top: 13px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.auth .mit-symbol input { padding-left: 40px; height: 46px; }
.auth .auge { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.auth .auge svg { width: 18px; height: 18px; }
.auth .bleiben { display: flex; align-items: center; gap: var(--s2); font-size: 14px; }
.auth .bleiben input { width: 18px; height: 18px; accent-color: var(--akzent); margin: 0; }
.auth .bleiben small { color: var(--muted); font-size: 13px; }
.auth .knopf.primaer { height: 46px; background: #16525A; border-color: #16525A; color: #FBF6EF; }
.oder { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: 12.5px; }
.oder::before, .oder::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth .unten { display: flex; flex-direction: column; gap: var(--s2); align-items: center; text-align: center; }
.auth .unten a, .auth .unten .textknopf { font-weight: 600; color: var(--akzent); }
.auth-form .fusszeile { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; font-size: 12.5px; color: var(--muted); }
.auth-form .fusszeile a { text-decoration: none; }
.auth-form .fusszeile .rechts { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.auth-form .fusszeile .rechts svg { width: 13px; height: 13px; }

/* Schalter Auto · Hell · Dunkel */
.thema { display: inline-flex; background: var(--sunk); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.thema button { height: 28px; min-width: 32px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; display: grid; place-items: center; }
.thema button svg { width: 15px; height: 15px; }
.thema button.an { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.check-zeile { display: flex; gap: var(--s2); align-items: flex-start; font-size: 13.5px; line-height: 20px; color: var(--muted); }
.check-zeile input { margin-top: 3px; accent-color: var(--akzent); }
.fehlertext { color: var(--warn-ink); font-size: 13.5px; line-height: 20px; }
.fehlertext:empty { display: none; }
.honig { position: absolute; left: -9999px; }
.code-input { letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; font-size: 20px !important; }

.powered { margin-top: var(--s7); text-align: center; color: var(--muted); font-size: 13px; }
.powered a { text-decoration: none; }
.powered b { font-weight: 600; }

/* ---------- Hinweisleisten (Update, Wartung) -------------------------- */

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s3);
  padding: var(--s3) var(--s4); border-radius: var(--r-inner); background: var(--akzent-soft); }
.banner p { flex: 1; min-width: 200px; font-size: 14px; }
.banner .knopf { height: 36px; }

/* ---------- KI-Knopf ---------------------------------------------------- */

.ki-knopf {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ki-knopf svg { width: 13px; height: 13px; color: var(--akzent); }
.ki-knopf:hover { border-color: var(--akzent); }
.gruppe-kopf .ki-knopf { margin-left: var(--s2); }
.zeile .rechts .ki-knopf { margin-top: 2px; }
.zeile { position: relative; }

/* ---------- Ordner ------------------------------------------------------ */

.gruppe-kopf .ordner-pfad { color: var(--muted); font-weight: 400; }
.ablage-zeile { display: flex; justify-content: flex-end; margin-top: var(--s2); }
.ablage-zeile .textknopf { font-size: 13.5px; }
.import-liste { max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-inner); }
.import-liste .z { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-top: 1px solid var(--line); font-size: 14px; }
.import-liste .z:first-child { border-top: 0; }
.import-liste .z b { flex: 1; min-width: 0; }
.import-liste .z select { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); padding: 0 6px; }
.import-leiste {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--s4) + env(safe-area-inset-bottom)); z-index: 50;
  width: min(560px, calc(100vw - 32px)); background: var(--ink); color: var(--ground); border-radius: var(--r-inner);
  padding: var(--s3) var(--s4); box-shadow: var(--schatten); display: flex; flex-direction: column; gap: var(--s2);
}
.import-leiste .zeile-oben { display: flex; align-items: center; gap: var(--s3); font-size: 14px; }
.import-leiste .zeile-oben span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-leiste button { border: 0; background: none; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.import-leiste .balken { background: rgba(255, 255, 255, .2); margin: 0; }

/* ---------- Verlauf und Papierkorb ------------------------------------- */

.verlauf h1 { font-size: 26px; line-height: 29px; font-weight: 600; letter-spacing: -0.015em; padding: var(--s5) 0 var(--s3); }
.verlauf .tabs { display: inline-flex; background: var(--sunk); border-radius: var(--r-pill); padding: 3px; gap: 3px; margin-bottom: var(--s4); }
.verlauf .tabs a { height: 34px; padding: 0 var(--s4); border-radius: var(--r-pill); display: inline-flex; align-items: center; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--muted); }
.verlauf .tabs a.an { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tag-kopf { padding: var(--s4) var(--s5) var(--s2); }
.ereignis { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: 10px var(--s5); border-top: 1px solid var(--line); }
.tag-kopf + .ereignis { border-top-color: transparent; }
.ereignis .uhr { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.ereignis .was { font-size: 14.5px; line-height: 21px; }
.ereignis .was small { display: block; color: var(--muted); font-size: 12.5px; }
.ereignis.zurueck .was { color: var(--muted); text-decoration: line-through; }
.ereignis .tun { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ereignis .tun button { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--akzent); white-space: nowrap; }
.ereignis .tun button.leise { color: var(--muted); font-weight: 400; }

/* ---------- Vorschaubilder, Seiten, große Ansicht mit Lupe ------------ */

.zeile button.bild { border: 0; padding: 0; cursor: zoom-in; position: relative; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.zeile .bild img { object-position: top center; background: #fff; }
.zeile .bild .lupe-mini {
  position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--card); color: var(--ink); display: grid; place-items: center; opacity: 0; transition: opacity .15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.zeile .bild .lupe-mini svg { width: 12px; height: 12px; }
.zeile button.bild:hover .lupe-mini, .zeile button.bild:focus-visible .lupe-mini { opacity: 1; }
@media (pointer: coarse) { .zeile .bild .lupe-mini { opacity: .9; } }
.zeile button.bild:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.vorschau .flaeche { position: relative; }
.pdf-inline { width: 100%; max-height: 72vh; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: 1px; }
@media (min-width: 900px) { .pdf-inline { max-height: calc(100vh - 210px); } }
.seite-blatt { position: relative; flex: none; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: var(--schatten); }
.seite-blatt canvas, .seite-blatt img { display: block; width: 100%; height: 100%; }
.lupe-knopf {
  position: absolute; right: var(--s4); bottom: var(--s4); display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 var(--s4); border: 0; border-radius: var(--r-pill); background: var(--ink); color: var(--ground);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--schatten);
}
.lupe-knopf svg { width: 17px; height: 17px; }
.bild-gross { border: 0; padding: 0; background: none; cursor: zoom-in; display: grid; place-items: center; max-width: 100%; }

html.ansicht-offen, html.ansicht-offen body { overflow: hidden; }
.ansicht-hg {
  position: fixed; inset: 0; z-index: 80; background: rgba(20, 19, 17, .55); display: grid; place-items: center;
  padding: max(var(--s5), env(safe-area-inset-top)) var(--s5) max(var(--s5), env(safe-area-inset-bottom));
  animation: einblenden .15s ease-out;
}
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }
.ansicht {
  width: min(1100px, 100%); height: 100%; max-height: 100%; background: var(--card); border-radius: var(--r-card); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); position: relative;
}
@media (max-width: 560px) { .ansicht-hg { padding: calc(var(--s2) + env(safe-area-inset-top)) var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); } }
.ansicht-kopf {
  flex: none; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--card);
}
.ansicht-titel { flex: 1; min-width: 120px; display: flex; flex-direction: column; line-height: 1.25; }
.ansicht-titel b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ansicht-titel span { color: var(--muted); }
.ansicht .zoom { display: flex; align-items: center; gap: var(--s1); }
.ansicht .zoom .pille { min-width: 74px; justify-content: center; }
.ansicht .pille { gap: 6px; }
.ansicht .pille.an { background: var(--akzent-soft); border-color: var(--akzent); }
.ansicht-dateien { flex: none; display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line); }
.ansicht-dateien .pille { height: 30px; font-size: 13px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 28px; }
.ansicht-flaeche { flex: 1; overflow: auto; outline: none; background: var(--sunk); -webkit-overflow-scrolling: touch; }
.ansicht-seiten {
  display: flex; flex-direction: column; align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); min-width: min-content;
}
.ansicht-flaeche.lupe-modus .seite-blatt { cursor: zoom-in; touch-action: none; }
.ansicht-flaeche.mit-lupe .seite-blatt { cursor: none; }
.lupe-glas {
  position: fixed; left: 0; top: 0; width: 200px; height: 200px; border-radius: 50%; overflow: hidden; pointer-events: none;
  border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .3); background: #fff;
  opacity: 0; transition: opacity .12s; z-index: 81;
}
.lupe-glas.an { opacity: 1; }
.lupe-glas canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 560px) {
  .ansicht-kopf { padding-left: var(--s3); padding-right: var(--s3); }
  .ansicht-titel { order: -1; flex-basis: calc(100% - 50px); }
  .ansicht .lupe-knopf span, .ansicht [data-a=lupe] span { display: none; }
}

/* ---------- Ordner (Anlagen) auf- und zuklappen, Unterordner nach Art ---------- */
.gruppe-kopf h2 .klapp {
  all: unset; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px;
}
.gruppe-kopf h2 .klapp:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
.gruppe-kopf .klapp svg { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; transform: rotate(90deg); flex: none; }
.gruppe.zu .gruppe-kopf .klapp svg { transform: rotate(0deg); }
.gruppe.zu .gruppe-kopf { padding-bottom: var(--s4); }
.gruppe-kopf .anzahl { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.gruppe-kopf .anlage + .anzahl::before { content: '·'; margin-right: var(--s3); }
.unterordner {
  display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s5) var(--s1); border-top: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--akzent);
}
.unterordner svg { width: 16px; height: 16px; flex: none; }
.unterordner .anzahl { color: var(--muted); font-weight: 400; }
.unterordner .betrag { margin-left: auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.unterordner + .zeile { border-top-color: transparent; }
.zeile + .unterordner { margin-top: var(--s1); }
.gruppe-kopf .anlage { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .gruppe-kopf .anlage { display: none; } .gruppe-kopf .anlage + .anzahl::before { content: none; } }

/* ---------- Ordner-Baum (kompakt) ---------------------------------------- */
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.abschnitt-kopf .eyebrow { margin: 0; }
.abschnitt-kopf .textknopf { font-size: 12.5px; text-decoration: none; }
.abschnitt-kopf .textknopf:hover { text-decoration: underline; }
.baum { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-inner); overflow: hidden; }
.ordner { border-top: 1px solid var(--line); }
.baum > .ordner:first-child { border-top: 0; }
.ordner .ordner { border-top-color: transparent; }
.ordner.ueber { box-shadow: 0 0 0 2px var(--akzent) inset; background: var(--akzent-soft); }
.ordner-kopf { display: flex; align-items: center; gap: var(--s2); min-height: 42px; padding-right: var(--s4); }
.ordner-knopf {
  all: unset; box-sizing: border-box; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 42px;
  padding-left: var(--s3); cursor: pointer; font-weight: 600; font-size: 15px;
}
.ordner-knopf.leer { cursor: default; }
.ordner-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; border-radius: 8px; }
.ordner-kopf:hover { background: var(--ground); }
.ordner-knopf .pfeil { width: 16px; height: 16px; flex: none; display: grid; place-items: center; color: var(--muted); }
.ordner-knopf .pfeil svg { width: 14px; height: 14px; transition: transform .15s; }
.ordner.auf > .ordner-kopf .pfeil svg { transform: rotate(90deg); }
.ordner-knopf > svg { width: 18px; height: 18px; flex: none; color: var(--akzent); }
.ordner-knopf.leer > svg { color: var(--muted); }
.ordner-knopf .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.ordner-knopf .zusatz { color: var(--muted); font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.ordner-knopf .anzahl {
  flex: none; font-size: 11.5px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--sunk); color: var(--muted); font-variant-numeric: tabular-nums;
}
.ordner-kopf .betrag { flex: none; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.ordner-kopf .ki-knopf { flex: none; }
.ordner.auf > .ordner-kopf { background: color-mix(in srgb, var(--sunk) 35%, transparent); }
/* Einrückung je Ebene */
.ordner-kopf.t1 .ordner-knopf { padding-left: 34px; }
.ordner-kopf.t2 .ordner-knopf { padding-left: 56px; }
.ordner-kopf.t3 .ordner-knopf { padding-left: 78px; }
.ordner-kopf.t4 .ordner-knopf, .ordner-kopf.t5 .ordner-knopf { padding-left: 100px; }

/* Beleg-Zeilen im Baum: eine Zeile hoch, kleines Vorschaubild */
.baum .zeile { grid-template-columns: 30px minmax(0, 1fr) auto; gap: var(--s3); min-height: 44px; padding: 5px var(--s4) 5px 36px; border-top-color: color-mix(in srgb, var(--line) 60%, transparent); }
.baum .zeile.t2 { padding-left: 58px; }
.baum .zeile.t3 { padding-left: 80px; }
.baum .zeile.t4 { padding-left: 102px; }
.baum .zeile.t5, .baum .zeile.t6 { padding-left: 124px; }
.baum .zeile .bild { width: 30px; height: 30px; border-radius: 6px; font-size: 8.5px; }
.baum .zeile .text { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.baum .zeile .titel { font-size: 14.5px; flex: 0 1 auto; min-width: 0; }
.baum .zeile .unter { font-size: 13px; flex: 1 1 0; min-width: 0; }
.baum .zeile .rechts { flex-direction: row; align-items: center; gap: var(--s2); }
.baum .zeile .rechts .ki-knopf { margin-top: 0; }
.baum .zeile .betrag { font-size: 14px; }
@media (max-width: 640px) {
  .baum .zeile { padding-left: 28px; }
  .baum .zeile.t2, .baum .zeile.t3, .baum .zeile.t4, .baum .zeile.t5, .baum .zeile.t6 { padding-left: 44px; }
  .ordner-kopf.t1 .ordner-knopf { padding-left: 24px; }
  .ordner-kopf.t2 .ordner-knopf, .ordner-kopf.t3 .ordner-knopf, .ordner-kopf.t4 .ordner-knopf, .ordner-kopf.t5 .ordner-knopf { padding-left: 38px; }
  .baum .zeile .text { display: block; }
  .ordner-knopf .zusatz { display: none; }
  .ordner-kopf .ki-knopf span { display: none; }
  .baum .zeile .rechts { flex-direction: column; align-items: flex-end; gap: 2px; }
}

/* ---------- Scanner ------------------------------------------------------- */
.ablage-reihe { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); }
.scan-start {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 112px;
  padding: var(--s4); border-radius: var(--r-card); border: 2px solid var(--line); background: var(--card); cursor: pointer;
  font: inherit; color: var(--ink);
}
.scan-start .symbol { width: 44px; height: 44px; border-radius: 12px; background: var(--akzent-soft); color: var(--akzent); display: grid; place-items: center; }
.scan-start .symbol svg { width: 24px; height: 24px; }
.scan-start b { font-size: 14.5px; }
.scan-start:hover, .scan-start:focus-visible { border-color: var(--akzent); outline: none; }
@media (max-width: 560px) { .scan-start { min-width: 88px; padding: var(--s3); } .ablage .muted.klein { display: none; } }

.scanner { position: fixed; inset: 0; z-index: 85; background: #141311; color: #F3F1EC; display: flex; flex-direction: column; }
.scanner .scan-inhalt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scan-kopf { flex: none; display: flex; align-items: center; gap: var(--s3); padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s4) var(--s2); }
.scan-kopf h2 { font-size: 17px; flex: 1; }
.scanner .knopf-rund { background: rgba(255, 255, 255, .12); color: #F3F1EC; }
.scanner .muted { color: #BDB7AC; }
.scan-hinweis { padding: 0 var(--s4) var(--s2); color: #BDB7AC; }
.scan-laden { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s5); }
.scan-buehne { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; overflow: hidden; padding: var(--s4); }
.scan-bild { position: relative; touch-action: none; }
.scan-bild .scan-foto { display: block; width: 100%; height: 100%; border-radius: 4px; }
.scan-rahmen { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.scan-rahmen polygon { fill: rgba(43, 138, 147, .18); stroke: #7CC7CE; stroke-width: 2; }
.scan-ecke {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; background: none;
  cursor: grab; touch-action: none;
}
.scan-ecke::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: #FBF8F2; border: 3px solid #2B8A93; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.scan-ecke.zieht { cursor: grabbing; }
.scan-ecke.zieht::after { inset: 15px; }
.scan-ecke:focus-visible { outline: none; }
.scan-ecke:focus-visible::after { box-shadow: 0 0 0 3px #7CC7CE; }
.scan-lupe {
  position: absolute; left: 0; top: 0; width: 128px; height: 128px; border-radius: 50%; overflow: hidden; pointer-events: none;
  border: 3px solid #FBF8F2; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); opacity: 0; transition: opacity .1s; z-index: 2;
}
.scan-lupe.an { opacity: 1; }
.scan-lupe canvas { width: 100%; height: 100%; display: block; }
.scan-fuss, .scan-werkzeug, .scan-frage { flex: none; padding: var(--s3) var(--s4); }
.scan-fuss { display: flex; gap: var(--s2); justify-content: space-between; padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
.scan-fuss .knopf.primaer { margin-left: auto; min-width: 120px; }
.scanner .knopf { background: rgba(255, 255, 255, .1); color: #F3F1EC; border-color: transparent; }
.scanner .knopf.leise { background: none; }
.scanner .knopf.primaer { background: #2B8A93; color: #FBF8F2; }
.scan-buehne.ergebnis .scan-seite { max-width: 100%; max-height: 100%; width: auto; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); object-fit: contain; }
.scan-werkzeug { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: center; }
.scanner .segment { background: rgba(255, 255, 255, .08); }
.scanner .segment button { color: #F3F1EC; }
.scanner .segment button.an { background: #F3F1EC; color: #141311; }
.scanner .pille { border-color: rgba(255, 255, 255, .2); color: #F3F1EC; gap: 6px; }
.scan-seiten { flex: none; display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s1) var(--s4); }
.scan-mini { position: relative; flex: none; width: 46px; height: 60px; border-radius: 4px; overflow: hidden; background: #fff; }
.scan-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-mini i { position: absolute; left: 3px; bottom: 2px; font-style: normal; font-size: 11px; font-weight: 600; color: #141311; background: rgba(255, 255, 255, .85); padding: 0 4px; border-radius: 4px; }
.scan-mini .weg { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; background: rgba(20, 19, 17, .75); color: #fff; display: grid; place-items: center; cursor: pointer; }
.scan-mini .weg svg { width: 12px; height: 12px; }
.scan-frage { border-top: 1px solid rgba(255, 255, 255, .1); padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); text-align: center; }
.scan-frage p { margin-bottom: var(--s2); }
.scan-frage .knopfreihe { justify-content: center; flex-wrap: wrap; }
.scan-frage .knopf { gap: 6px; }
.scan-frage .knopf svg, .scanner .pille svg { width: 17px; height: 17px; }

.scanner .segment button { flex: none; padding: 0 12px; overflow: visible; }
.scan-frage .knopfreihe .knopf { flex: none; }
@media (max-width: 560px) {
  .scan-werkzeug .segment { width: 100%; overflow-x: auto; }
  .scan-werkzeug .segment button { flex: 1 0 auto; }
  .scan-frage .knopfreihe .knopf { flex: 1 1 100%; }
  .scan-fuss .knopf { padding: 0 var(--s3); }
}

/* Stand im Jahreskopf: drei Stufen, aktive in der Farbe des Reiters */
.stand-schalter { display: inline-flex; padding: 3px; }
.stand-schalter button { flex: none; height: 30px; padding: 0 12px; font-size: 13px; overflow: visible; }
.stand-schalter button.an.offen { background: var(--card); color: var(--ink); }
.stand-schalter button.an.amt { background: var(--akzent-soft); color: var(--ink); box-shadow: 0 0 0 1px var(--akzent) inset; }
.stand-schalter button.an.fertig { background: var(--petrol-voll); color: var(--auf-petrol); }
.jahr-kopf .stand { flex-wrap: wrap; }

/* ---------- Einführung (Tour) ------------------------------------------- */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-sperre { position: absolute; inset: 0; }
.tour-loch {
  position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(20, 19, 17, .58), 0 0 0 2px var(--petrol-voll) inset;
  transition: transform .25s ease, width .25s ease, height .25s ease;
}
.tour-karte {
  position: absolute; left: 0; top: 0; width: min(380px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  border-radius: var(--r-card); padding: var(--s4) var(--s5) var(--s4); box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; gap: var(--s2); transition: transform .25s ease, opacity .15s;
}
.tour.wechsel .tour-karte { opacity: .55; }
.tour-karte h3 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.tour-karte p { line-height: 21px; }
.tour-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.tour-kopf .eyebrow { color: var(--akzent); }
.knopf-rund.klein { width: 30px; height: 30px; }
.knopf-rund.klein svg { width: 15px; height: 15px; }
.tour-fuss { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.tour-fuss .knopf { height: 36px; padding: 0 var(--s4); }
.tour-fuss .knopf.primaer { margin-left: 0; }
.tour-fuss .muted { margin-right: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tour-punkte { display: flex; gap: 4px; }
.tour-punkte i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.tour-punkte i.fertig { background: var(--akzent-soft); }
.tour-punkte i.jetzt { background: var(--petrol-voll); width: 22px; }
.tour-karte.unten {
  left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; transform: none !important;
}
.tour-karte.oben {
  left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); bottom: auto; width: auto; transform: none !important;
}
.tour-start { display: flex; flex-direction: column; gap: var(--s3); }
.tour-start h2 { font-size: 24px; line-height: 28px; letter-spacing: -0.015em; }
.tour-start .eyebrow { color: var(--akzent); }
.tour-kapitel { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-inner); overflow: hidden; }
.tour-kapitel li { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); padding: 9px var(--s3); border-top: 1px solid var(--line); font-size: 14.5px; }
.tour-kapitel li:first-child { border-top: 0; }
.tour-kapitel .nr { width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.tour-kapitel .symbol { color: var(--akzent); display: grid; place-items: center; }
.tour-kapitel .symbol svg { width: 18px; height: 18px; }
.tour-start .knopfreihe { justify-content: flex-end; }

/* ---------- Demo-Hinweis ------------------------------------------------- */
.demo-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  margin: var(--s3) 0 0; padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-inner);
  background: var(--akzent-soft); font-size: 14px;
}
.demo-banner .knopfreihe { gap: var(--s2); }
.demo-banner .knopf { height: 34px; padding: 0 var(--s4); font-size: 14px; }
.demo-banner .knopf.primaer { background: var(--petrol-voll); border-color: var(--petrol-voll); color: var(--auf-petrol); }

/* ---------- Mehrere auswählen ------------------------------------------- */
.abschnitt-knoepfe { display: inline-flex; gap: var(--s4); }
.wahl-box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--muted); background: var(--card); color: transparent;
  display: grid; place-items: center; padding: 0; flex: none; cursor: pointer;
}
.wahl-box svg { width: 13px; height: 13px; }
.wahl-box.an { background: var(--petrol-voll); border-color: var(--petrol-voll); color: var(--auf-petrol); }
.wahl-box.teil { background: var(--akzent-soft); border-color: var(--akzent); color: var(--akzent); }
.wahl-box.teil svg { display: none; }
.wahl-box.teil::after { content: ''; width: 9px; height: 2px; border-radius: 1px; background: var(--akzent); }
.ordner-kopf > .wahl-box { margin-left: var(--s3); margin-right: -4px; }
.waehlen .baum .zeile { grid-template-columns: 20px 30px minmax(0, 1fr) auto; cursor: default; }
.waehlen .baum .zeile.gewaehlt { background: color-mix(in srgb, var(--akzent-soft) 70%, transparent); }
.wahl-leiste {
  position: fixed; left: 50%; bottom: calc(var(--s4) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--schatten);
  width: max-content; max-width: calc(100vw - 24px);
}
.wahl-leiste .anzahl-text { white-space: nowrap; margin-right: var(--s2); font-size: 14px; }
.wahl-leiste .knopf { height: 38px; gap: 6px; }
.wahl-leiste .knopf svg { width: 17px; height: 17px; }
.wahl-leiste .knopf[disabled] { opacity: .45; pointer-events: none; }
body:has(.wahl-leiste) .seite { padding-bottom: 110px; }
@media (max-width: 560px) {
  .wahl-leiste { left: 8px; right: 8px; transform: none; width: auto; border-radius: var(--r-card); flex-wrap: wrap; justify-content: space-between; }
  .wahl-leiste .anzahl-text { width: 100%; padding: 2px 0 0 4px; }
  .wahl-leiste .knopf span { display: none; }
  .abschnitt-knoepfe { gap: var(--s3); }
}

/* ---------- ELSTER-Spickzettel ------------------------------------------- */
.spick-titel { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); padding: var(--s5) 0 var(--s4); }
.spick-titel h1 { font-size: 26px; line-height: 29px; font-weight: 600; letter-spacing: -0.015em; margin: var(--s2) 0 var(--s1); }
.spick-titel p { max-width: 720px; }
.spick-titel .textknopf { text-decoration: none; }
.spickzettel .hinweis { margin-bottom: var(--s4); }
.spickzettel .karte.spick + .karte.spick { margin-top: var(--s3); }
.spick-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.spick-kopf h2 { font-size: 18px; line-height: 24px; }
.spick-summe { display: flex; align-items: center; gap: 4px; }
.spick-summe .betrag { font-size: 20px; font-variant-numeric: tabular-nums; }
.kopier { border: 0; background: none; padding: 4px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle; }
.kopier svg { width: 15px; height: 15px; }
.kopier:hover, .kopier:focus-visible { color: var(--akzent); background: var(--akzent-soft); outline: none; }
.personen { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s2); font-size: 13.5px; color: var(--muted); }
.personen b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hinweis-zeile { margin-top: var(--s2); color: var(--muted); }
.spick-art { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s2); }
.spick-art-kopf { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14.5px; padding: var(--s1) 0; }
.spick-art-kopf .betrag { font-variant-numeric: tabular-nums; }
.spick-zeile { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: var(--s3); padding: 5px 0; font-size: 13.5px; text-decoration: none; color: inherit; border-radius: 6px; }
.spick-zeile:hover { background: var(--ground); }
.spick-zeile .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.spick-zeile .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spick-zeile .betrag { font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 560px) { .spick-zeile { grid-template-columns: 72px minmax(0, 1fr) auto; } .spick-titel { flex-direction: column; align-items: flex-start; } }
@media print {
  .kopf, .demo-banner, .powered, .spick-titel .knopf, .spick-titel .textknopf, .kopier, .hinweis .knopf, #toast { display: none !important; }
  body { background: #fff; }
  .seite { max-width: none; padding: 0; }
  .karte { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* ---------- Per Mail ----------------------------------------------------- */
.mail-eingang { display: flex; flex-direction: column; gap: var(--s2); }
.adresse-zeile { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.adresse-zeile code { font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: var(--r-pill); background: var(--akzent-soft); color: var(--ink); user-select: all; }
.adresse-zeile .knopf { height: 34px; gap: 6px; }
.adresse-zeile .knopf svg { width: 15px; height: 15px; }
.mail-eingang textarea { min-height: 64px; }
