:root {
  --grund: #ffffff;
  --seite: #f7f7f5;
  --flaeche: #ffffff;
  --flaeche-2: #f1f1ef;
  --feld: #fbfbfa;
  --text: #37352f;
  --leise: #787774;
  --linie: #e9e9e7;
  --akzent: #4b6fe0;
  --akzent-text: #ffffff;
  --akzent-hell: #e7ecfb;
  --plus: #2f8a48;
  --plus-hell: #dff4e4;
  --warnung: #93650c;
  --warnung-hell: #fbf3d3;
  --fehler: #c93a34;
  --fehler-hell: #fde4e2;
  --radius: 6px;
  --radius-gross: 8px;
  --p0: #e4eafb; --p0t: #3553b8;
  --p1: #dff4e4; --p1t: #2f8a48;
  --p2: #fbe9d9; --p2t: #b0591b;
  --p3: #f1e4f8; --p3t: #8034a8;
  --p4: #dcf5f8; --p4t: #13808f;
  --p5: #fbf3d3; --p5t: #8a6d0b;
}

:root { color-scheme: light; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --grund: #14121f;
  --seite: #1c1930;
  --flaeche: #1c1930;
  --flaeche-2: #241f35;
  --feld: #19162a;
  --text: #f2efe6;
  --leise: #9a93b5;
  --linie: #2c2640;
  --akzent: #7d95ee;
  --akzent-text: #14121f;
  --akzent-hell: rgba(75, 111, 224, .2);
  --plus: #6fd98b;
  --plus-hell: rgba(76, 196, 106, .16);
  --warnung: #efd26a;
  --warnung-hell: rgba(232, 198, 58, .15);
  --fehler: #f07a74;
  --fehler-hell: rgba(224, 69, 63, .17);
  --p0: rgba(75, 111, 224, .22); --p0t: #a3b5f3;
  --p1: rgba(76, 196, 106, .2); --p1t: #8fe0a4;
  --p2: rgba(232, 135, 58, .2); --p2t: #f2b27f;
  --p3: rgba(162, 75, 209, .22); --p3t: #d3a3ec;
  --p4: rgba(41, 198, 217, .2); --p4t: #86dfe9;
  --p5: rgba(232, 198, 58, .18); --p5t: #efd67a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --grund: #14121f;
    --seite: #1c1930;
    --flaeche: #1c1930;
    --flaeche-2: #241f35;
    --feld: #19162a;
    --text: #f2efe6;
    --leise: #9a93b5;
    --linie: #2c2640;
    --akzent: #7d95ee;
    --akzent-text: #14121f;
    --akzent-hell: rgba(75, 111, 224, .2);
    --plus: #6fd98b;
    --plus-hell: rgba(76, 196, 106, .16);
    --warnung: #efd26a;
    --warnung-hell: rgba(232, 198, 58, .15);
    --fehler: #f07a74;
    --fehler-hell: rgba(224, 69, 63, .17);
    --p0: rgba(75, 111, 224, .22); --p0t: #a3b5f3;
    --p1: rgba(76, 196, 106, .2); --p1t: #8fe0a4;
    --p2: rgba(232, 135, 58, .2); --p2t: #f2b27f;
    --p3: rgba(162, 75, 209, .22); --p3t: #d3a3ec;
    --p4: rgba(41, 198, 217, .2); --p4t: #86dfe9;
    --p5: rgba(232, 198, 58, .18); --p5t: #efd67a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 650; }
h1 { font-size: 1.9rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: .5rem; }
p { margin: 0 0 .75rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.fehler { color: var(--fehler); margin: .6rem 0 0; font-size: .9rem; }
.zahl { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  border-radius: var(--radius);
  padding: .4rem .8rem;
  font-weight: 500;
  font-size: .92rem;
  line-height: 1.35;
  transition: background .12s ease, border-color .12s ease;
}
button:hover { background: var(--flaeche-2); }
button:disabled { opacity: .45; cursor: default; }
button.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
button.haupt:hover { filter: brightness(.94); background: var(--akzent); }
button.gefahr { color: var(--fehler); }
button.gefahr:hover { background: var(--fehler-hell); border-color: transparent; }
button.schlicht { border-color: transparent; background: transparent; color: var(--leise); }
button.schlicht:hover { background: var(--flaeche-2); color: var(--text); }
button.breit { width: 100%; padding: .6rem 1rem; }
button.klein { font-size: .82rem; padding: .25rem .55rem; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--linie);
  background: var(--feld);
  border-radius: var(--radius);
  padding: .45rem .6rem;
  min-height: 2.35rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
select {
  appearance: none;
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--leise) 50%), linear-gradient(135deg, var(--leise) 50%, transparent 50%);
  background-position: calc(100% - .95rem) 55%, calc(100% - .68rem) 55%;
  background-size: .27rem .27rem;
  background-repeat: no-repeat;
}
textarea { min-height: 4.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); background-color: var(--flaeche); }
button:focus-visible, .zeile:focus-visible, .chip:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
input:disabled, select:disabled, textarea:disabled { background-color: var(--seite); color: var(--text); opacity: 1; }
label { display: block; font-size: .78rem; font-weight: 500; color: var(--leise); margin-bottom: .7rem; }
label > input, label > select, label > textarea { margin-top: .25rem; color: var(--text); font-size: .95rem; }
label.haken { display: flex; gap: .55rem; align-items: center; color: var(--text); font-size: .92rem; }
label.haken input { width: 1rem; height: 1rem; min-height: 0; margin: 0; accent-color: var(--akzent); }

.marke { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.marke-zeichen {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
  background: url(icon.svg?v=2) center / contain no-repeat;
}

.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--seite); }
.anmelde-karte {
  width: 100%;
  max-width: 400px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  padding: 2rem 1.8rem 1.6rem;
}
.anmelde-karte .marke { margin-bottom: 1.4rem; }
.anmelde-karte h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.anmelde-karte p.leise { margin-bottom: 1.3rem; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 1.1rem 1.2rem; }
.schmal { width: 100%; max-width: 400px; }

.rahmen { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.seite {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  background: var(--seite);
  border-right: 1px solid var(--linie);
  padding: .9rem .6rem;
}
.seite-kopf { display: flex; flex-direction: column; gap: .5rem; padding: .2rem .5rem .6rem; }
.firma { font-size: .85rem; color: var(--leise); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firma select { font-size: .85rem; min-height: 2rem; padding: .2rem 1.7rem .2rem .5rem; background-color: transparent; }
.luecke { flex: 1; }

.reiter { display: flex; flex-direction: column; gap: 1px; }
.reiter button {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--leise);
  padding: .38rem .55rem;
  font-weight: 500;
  text-align: left;
  border-radius: var(--radius);
}
.reiter button:hover { background: var(--flaeche-2); color: var(--text); }
.reiter button.aktiv { background: var(--flaeche-2); color: var(--text); font-weight: 600; }
.reiter svg { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.seite-fuss { margin-top: auto; display: flex; align-items: center; gap: .4rem; padding: .5rem .3rem 0; border-top: 1px solid var(--linie); }
.wer { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; }
.wer .kreis { width: 1.6rem; height: 1.6rem; font-size: .66rem; border-radius: 4px; }
.wer-name { font-size: .85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bereich { min-width: 0; padding: 2.4rem clamp(16px, 5vw, 64px) 3rem; }
.seitentitel { max-width: 960px; margin: 0 auto 1.2rem; display: flex; align-items: center; gap: .6rem; }
.seitentitel svg { width: 1.75rem; height: 1.75rem; flex: none; fill: none; stroke: var(--leise); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.inhalt { max-width: 960px; margin: 0 auto; }

@media (max-width: 760px) {
  .rahmen { display: block; }
  .seite {
    position: sticky;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: .6rem;
    padding: .55rem 16px;
    padding-top: max(.55rem, env(safe-area-inset-top));
    border-right: 0;
    border-bottom: 1px solid var(--linie);
    z-index: 10;
  }
  .seite-kopf { flex-direction: row; align-items: center; gap: .6rem; padding: 0; min-width: 0; flex: 1; }
  .seite-fuss { margin: 0; padding: 0; border: 0; flex: none; }
  .wer-name, #abmelden { display: none; }
  .reiter {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: .3rem 4px max(.4rem, env(safe-area-inset-bottom));
    background: var(--seite);
    border-top: 1px solid var(--linie);
  }
  .reiter button { flex: 1; flex-direction: column; align-items: center; gap: .1rem; padding: .3rem .1rem; font-size: .64rem; text-align: center; }
  .reiter button.aktiv { background: transparent; color: var(--akzent); }
  .reiter svg { width: 1.35rem; height: 1.35rem; }
  .bereich { padding: 1.2rem 16px 6.5rem; }
  h1, .seitentitel { font-size: 1.5rem; }
}

.held {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .6rem 2rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  background: var(--seite);
  padding: 1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.held-kopf { width: 100%; display: flex; align-items: center; gap: .5rem; }
.held-name { flex: 1; font-size: .8rem; font-weight: 500; color: var(--leise); }
.held-kopf select { width: auto; min-height: 1.9rem; padding: .15rem 1.7rem .15rem .55rem; font-size: .85rem; background-color: var(--flaeche); }
.held-wert { font-size: clamp(1.9rem, 5vw, 2.5rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.held-teile { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; padding-bottom: .25rem; }
.held-teil { display: flex; flex-direction: column; padding-left: .8rem; border-left: 2px solid var(--linie); }
.held-teil:nth-child(1) { border-left-color: var(--p1t); }
.held-teil:nth-child(2) { border-left-color: var(--p2t); }
.held-teil:nth-child(3) { border-left-color: var(--p0t); }
.held-teil span { font-size: .75rem; color: var(--leise); }
.held-teil strong { font-size: .98rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.leiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.leiste select { width: auto; }
.leiste .luecke { flex: 1; }
.chips { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.chip { border-color: transparent; background: transparent; color: var(--leise); padding: .3rem .65rem; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.chip:hover { background: var(--flaeche-2); color: var(--text); }
.chip.aktiv { background: var(--flaeche-2); color: var(--text); font-weight: 600; }
.zaehler { background: var(--p5); color: var(--p5t); border-radius: 4px; font-size: .7rem; font-weight: 600; min-width: 1.15rem; padding: 0 .3rem; text-align: center; }

.liste { border-top: 1px solid var(--linie); }
.zeile {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .55rem .5rem;
  border-bottom: 1px solid var(--linie);
  cursor: pointer;
  transition: background .1s ease;
}
.zeile:hover { background: var(--seite); }
.zeile.ohne-klick { cursor: default; }
.zeile.oben { align-items: start; }
.zeile .titel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.zeile .unter { font-size: .8rem; font-weight: 400; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .rechts { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.zeile .betrag { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.zeile .betrag.plus { color: var(--plus); }
.zeile .marken { display: flex; gap: .25rem; justify-content: flex-end; flex-wrap: wrap; }
.zeile .marken:empty { display: none; }
.zeile .aktionen { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.dkopf .marken { display: flex; gap: .25rem; flex-wrap: wrap; }
.mitglieder { margin-top: .4rem; display: flex; flex-direction: column; gap: .15rem; white-space: normal; }
.mitglied { display: flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 400; }
.mitglied span:first-child { overflow: hidden; text-overflow: ellipsis; }
.leer { padding: 2.5rem 1rem; text-align: center; color: var(--leise); border-bottom: 1px solid var(--linie); }

.kreis {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  font-size: .72rem;
  flex: none;
}
.kreis.f0 { background: var(--p0); color: var(--p0t); }
.kreis.f1 { background: var(--p1); color: var(--p1t); }
.kreis.f2 { background: var(--p2); color: var(--p2t); }
.kreis.f3 { background: var(--p3); color: var(--p3t); }
.kreis.f4 { background: var(--p4); color: var(--p4t); }
.kreis.f5 { background: var(--p5); color: var(--p5t); }

.marke-klein {
  display: inline-block;
  font-size: .72rem;
  font-weight: 500;
  padding: .05rem .4rem;
  border-radius: 4px;
  background: var(--flaeche-2);
  color: var(--leise);
  white-space: nowrap;
}
.marke-klein.gut { background: var(--p1); color: var(--p1t); }
.marke-klein.warn { background: var(--p5); color: var(--p5t); }
.marke-klein.schlecht { background: var(--fehler-hell); color: var(--fehler); }

.dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  padding: 0;
  background: var(--flaeche);
  color: var(--text);
  box-shadow: 0 14px 44px rgba(15, 15, 15, .16), 0 0 0 1px rgba(15, 15, 15, .03);
}
.dialog::backdrop { background: rgba(15, 15, 15, .38); }
.dialog[open] { animation: auf .16s ease-out; }
@keyframes auf { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
.dialog .dkopf { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.3rem .5rem; }
.dialog .dkopf h2 { flex: 1; margin: 0; font-size: 1.25rem; }
.dialog .drumpf { padding: .4rem 1.3rem 1.1rem; overflow-y: auto; }
.dialog .dfuss {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  padding: .75rem 1.3rem;
  padding-bottom: max(.75rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--linie);
  background: var(--seite);
}
.dialog .dfuss .luecke { flex: 1; }
.dialog .dfuss input { width: auto; min-height: 2.1rem; }
@media (max-width: 760px) {
  .dialog { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 12px 12px 0 0; border-bottom: 0; }
  .dialog form { max-height: 94vh; }
  .dialog .dkopf h2 { font-size: 1.1rem; }
  .dialog .dfuss button.haupt { flex: 1; }
}

.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
.raster .breit { grid-column: 1 / -1; }
@media (max-width: 560px) { .raster { grid-template-columns: minmax(0, 1fr); } }

.posten { border: 1px solid var(--linie); border-radius: var(--radius-gross); margin: .4rem 0 .9rem; overflow: hidden; }
.posten-kopf, .posten-zeile { display: grid; gap: .4rem; align-items: center; padding: .35rem .5rem; }
.posten-zeile { border-top: 1px solid var(--linie); }
.posten-kopf { font-size: .72rem; font-weight: 500; color: var(--leise); background: var(--seite); }
.posten.beleg .posten-kopf, .posten.beleg .posten-zeile { grid-template-columns: minmax(0, 1.3fr) 5.5rem minmax(0, 1fr) 2rem; }
.posten.rechnung .posten-kopf, .posten.rechnung .posten-zeile { grid-template-columns: minmax(0, 2.4fr) 4.2rem 4rem 6rem 6.5rem 2rem; }
.posten input, .posten select { min-height: 2.1rem; padding: .25rem .45rem; border-color: transparent; background-color: transparent; }
.posten input:hover, .posten select:hover { background-color: var(--flaeche-2); }
.posten input:focus, .posten select:focus { border-color: var(--akzent); background-color: var(--flaeche); }
.posten select { padding-right: 1.5rem; }
.posten .weg { padding: .15rem .45rem; }
.posten-fuss { display: flex; justify-content: space-between; align-items: center; padding: .45rem .5rem; border-top: 1px solid var(--linie); background: var(--seite); }
.posten-fuss strong { font-size: 1rem; }
@media (max-width: 640px) {
  .posten-kopf { display: none; }
  .posten.beleg .posten-zeile, .posten.rechnung .posten-zeile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posten .text-feld { grid-column: 1 / -1; }
  .posten input, .posten select { border-color: var(--linie); background-color: var(--feld); }
}

.hinweis { border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: .9rem; font-size: .9rem; }
.hinweis.warn { background: var(--p5); color: var(--p5t); }
.hinweis.info { background: var(--p0); color: var(--p0t); }
.hinweis.schlecht { background: var(--fehler-hell); color: var(--fehler); }
.hinweis ul { margin: .25rem 0 0; padding-left: 1.1rem; }

.ablage {
  display: grid;
  place-items: center;
  gap: .3rem;
  border: 1px dashed var(--leise);
  border-radius: var(--radius-gross);
  padding: 1.2rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--leise);
  cursor: pointer;
  background: var(--seite);
  transition: background .12s ease, border-color .12s ease;
}
.ablage:hover { border-color: var(--akzent); background: var(--akzent-hell); }
.ablage input { display: none; }
.ablage .knopf .marke-klein { background: var(--akzent); color: var(--akzent-text); font-size: .85rem; padding: .3rem .8rem; border-radius: var(--radius); }
.vorschau { max-width: 100%; max-height: 240px; border-radius: var(--radius); margin-top: .5rem; border: 1px solid var(--linie); }

.abschnitt { margin-bottom: 1.4rem; }
.abschnitt > h2 { margin-bottom: .6rem; }
.abschnitt + .abschnitt { margin-top: 2rem; }
.wahl { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--seite); }
.wahl button { border: 0; background: transparent; color: var(--leise); padding: .3rem .8rem; }
.wahl button:hover { color: var(--text); background: var(--flaeche-2); }
.wahl button.aktiv { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 15, 15, .08); }
.adresse {
  display: flex;
  gap: .6rem;
  align-items: center;
  font: 500 .95rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--seite);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: .5rem .5rem .5rem .75rem;
  overflow-wrap: anywhere;
}
.adresse span { flex: 1; }
.adresse button { font-family: inherit; font-size: .85rem; }
pre.zugang { font: .9rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--seite); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem; margin: 0; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tabelle th, .tabelle td { text-align: left; padding: .5rem .4rem; border-top: 1px solid var(--linie); }
.tabelle th { font-weight: 500; color: var(--leise); font-size: .75rem; border-top: 0; }
.eintrag { display: flex; gap: .6rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--linie); }
.eintrag:first-child { border-top: 0; }
.eintrag span { flex: 1; overflow-wrap: anywhere; }

details summary { cursor: pointer; margin: .4rem 0; color: var(--leise); }

.meldung {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--text);
  color: var(--grund);
  font-size: .9rem;
  font-weight: 500;
  padding: .55rem .95rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 15, 15, .2);
  z-index: 50;
  animation: auf .15s ease-out;
}
.meldung.schlecht { background: var(--fehler); color: #fff; }

@media (max-width: 760px) {
  button.neu {
    position: fixed;
    right: 16px;
    bottom: calc(5rem + env(safe-area-inset-bottom));
    z-index: 15;
    width: 3.1rem;
    height: 3.1rem;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(15, 15, 15, .22);
  }
  button.neu .wort { display: none; }
  button.neu .plus { font-size: 1.5rem; font-weight: 400; line-height: 1; }
  .meldung { bottom: calc(9rem + env(safe-area-inset-bottom)); }
  .zeile .aktionen button { font-size: .75rem; }
}

.scannen {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 .5rem;
  padding: .45rem .6rem;
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--akzent-text);
  font-weight: 600;
}
.scannen:hover { background: var(--akzent); filter: brightness(.94); }
button.mit-symbol { display: inline-flex; align-items: center; gap: .45rem; }
button .symbol { width: 1.05rem; height: 1.05rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.karten-bild .vorschau { max-height: 180px; margin: 0 0 .9rem; }
.karten-bild .karten-foto { border: 0; border-radius: 0; filter: drop-shadow(0 3px 8px rgba(15, 15, 15, .18)); }

.kartenraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.4rem 1.1rem; }
.kundenkarte {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 400;
}
.kundenkarte:hover { background: transparent; }
.kk-bild, .kk-ersatz { width: 100%; aspect-ratio: 85.6 / 54; margin-bottom: .45rem; transition: transform .15s ease, filter .15s ease; }
.kk-bild { object-fit: contain; filter: drop-shadow(0 3px 8px rgba(15, 15, 15, .16)); }
.kundenkarte:hover .kk-bild, .kundenkarte:hover .kk-ersatz { transform: translateY(-2px); }
.kundenkarte:hover .kk-bild { filter: drop-shadow(0 8px 16px rgba(15, 15, 15, .2)); }
.kk-ersatz {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .85rem .95rem;
  border-radius: 8px;
  overflow: hidden;
  font-size: .78rem;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgba(15, 15, 15, .08), 0 3px 8px rgba(15, 15, 15, .08);
}
.kk-ersatz strong { font-size: .95rem; line-height: 1.2; }
.kk-ersatz span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-ersatz .kk-luecke { flex: 1; }
.kk-ersatz .kk-klein { font-size: .7rem; opacity: .85; }
.kk-ersatz.f0 { background: var(--p0); color: var(--p0t); }
.kk-ersatz.f1 { background: var(--p1); color: var(--p1t); }
.kk-ersatz.f2 { background: var(--p2); color: var(--p2t); }
.kk-ersatz.f3 { background: var(--p3); color: var(--p3t); }
.kk-ersatz.f4 { background: var(--p4); color: var(--p4t); }
.kk-ersatz.f5 { background: var(--p5); color: var(--p5t); }
.kk-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-unter { font-size: .8rem; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.1em; }
@media (max-width: 560px) { .kartenraster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem .8rem; } .kk-ersatz { padding: .6rem .65rem; font-size: .66rem; } .kk-ersatz strong { font-size: .8rem; } }
.scannen svg, .kamera-knopf svg { width: 1.2rem; height: 1.2rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) {
  .scannen { order: 2; margin: 0; width: 2.3rem; height: 2.3rem; padding: 0; justify-content: center; flex: none; }
  .scannen span { display: none; }
  .scannen svg { width: 1.3rem; height: 1.3rem; }
  .seite-fuss { order: 3; }
}

body.kamera-offen { overflow: hidden; }
.kamera {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #0b0918;
  color: #f2efe6;
}
.kamera-kopf {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 16px;
  padding-top: max(.6rem, env(safe-area-inset-top));
  background: #14121f;
  border-bottom: 1px solid #241f35;
}
.kamera-kopf .firma { color: #9a93b5; }
.kamera-knopf {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid #2c2640;
  border-radius: 8px;
  background: #1c1930;
  color: #f2efe6;
  cursor: pointer;
}
.kamera-knopf:hover { background: #241f35; }
.kamera-knopf input { display: none; }
.kamera-flaeche { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.kamera-flaeche video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kamera-rahmen { position: absolute; inset: 9% 8%; pointer-events: none; }
.kamera-rahmen span { position: absolute; width: 2.2rem; height: 2.2rem; border: 3px solid rgba(242, 239, 230, .9); }
.kamera-rahmen span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.kamera-rahmen span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.kamera-rahmen span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.kamera-rahmen span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.kamera.visitenkarte .kamera-rahmen { inset: auto 7%; top: 50%; aspect-ratio: 85.6 / 54; transform: translateY(-50%); }
.kamera-titel { font-size: .85rem; font-weight: 600; color: #f2efe6; white-space: nowrap; }
@media (max-width: 420px) { .kamera-kopf .firma { display: none; } }
.kamera-hinweis { position: relative; max-width: 22rem; margin: 0 16px; padding: .9rem 1rem; text-align: center; background: #1c1930; border: 1px solid #2c2640; border-radius: 8px; color: #f2efe6; }
.kamera-fuss {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 24px;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  background: #14121f;
  border-top: 1px solid #241f35;
}
.kamera-fuss .kamera-knopf { justify-self: start; }
.ausloeser {
  width: 4.4rem;
  height: 4.4rem;
  padding: 0;
  border-radius: 50%;
  border: 4px solid #f2efe6;
  background: #f2efe6;
  box-shadow: inset 0 0 0 3px #14121f;
}
.ausloeser:hover { background: #fff; }
.ausloeser:active { transform: scale(.94); }
.ausloeser:disabled { opacity: .3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
