:root {
  --ink: #2b2230; --leise: #6b6470; --linie: #e6e0e3; --grund: #fbf7f2; --karte: #ffffff;
  --mint: #bce3d6; --mint-hell: #eaf6f1; --pfirsich: #f4a07b; --pfirsich-hell: #fde9df; --lavendel: #ddd3f0;
  --rot: #b3261e; --rot-hell: #fbe4e2; --gruen: #1e6b4f; --gelb-hell: #fff4d6;
  --radius: 14px; --schatten: 0 1px 2px rgba(43, 34, 48, .06), 0 4px 16px rgba(43, 34, 48, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.mitte { text-align: center; }
.rechts { text-align: right; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }

.kopf { position: sticky; top: 0; z-index: 5; background: rgba(251, 247, 242, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: 1rem; padding: calc(.5rem + env(safe-area-inset-top)) 16px .5rem; flex-wrap: wrap; }
.marke { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; }
.marke img { height: 34px; }
.marke span { background: var(--mint); padding: .1rem .5rem; border-radius: 8px; font-size: .85rem; }
nav { display: flex; gap: .2rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
nav a { text-decoration: none; padding: .45rem .7rem; border-radius: 10px; white-space: nowrap; color: var(--leise); font-weight: 500; }
nav a.an { background: var(--karte); color: var(--ink); box-shadow: var(--schatten); }
main { max-width: 980px; margin: 0 auto; padding: 1rem 16px 5rem; }

.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1rem; margin-bottom: 1rem; }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.zahlen .karte { margin: 0; }
.zahlen b { display: block; font-size: 1.35rem; margin-top: .2rem; }

button, .knopf { font: inherit; border: 0; border-radius: 12px; padding: .65rem 1rem; cursor: pointer; background: var(--karte); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--linie); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; justify-content: center; min-height: 44px; }
button:disabled { opacity: .5; cursor: default; }
.haupt { background: var(--pfirsich); color: var(--ink); box-shadow: none; font-weight: 600; }
.mint { background: var(--mint); color: var(--ink); box-shadow: none; font-weight: 600; }
.gefahr { color: var(--rot); }
.gefahr.voll { background: var(--rot); color: #fff; box-shadow: none; }
.flach { box-shadow: none; background: transparent; padding: .4rem .6rem; min-height: 36px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.knoepfe.ende { justify-content: flex-end; }

label { display: block; font-size: .85rem; color: var(--leise); margin-bottom: .7rem; }
input, select, textarea { font: inherit; color: var(--ink); width: 100%; margin-top: .25rem; padding: .6rem .7rem; border: 1px solid var(--linie); border-radius: 10px; background: #fff; min-height: 44px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: #8fcab6; }
input[type=checkbox] { width: auto; min-height: 0; margin: 0 .4rem 0 0; }
.haken { display: flex; align-items: center; color: var(--ink); font-size: 1rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 .8rem; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.chip { padding: .35rem .75rem; border-radius: 999px; background: var(--karte); box-shadow: inset 0 0 0 1px var(--linie); min-height: 34px; font-size: .9rem; }
.chip.an { background: var(--ink); color: #fff; box-shadow: none; }

.liste { list-style: none; margin: 0; padding: 0; }
.zeile { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--linie); text-decoration: none; align-items: center; }
.zeile:last-child { border-bottom: 0; }
.zeile:hover { background: #fdfbf9; }
.liste.karte { padding: 0; overflow: hidden; }
.zeile .titel { font-weight: 600; }
.zeile .unter { font-size: .85rem; color: var(--leise); }

.marke-status { display: inline-block; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: var(--linie); color: var(--ink); vertical-align: middle; }
.s-entwurf { background: var(--lavendel); }
.s-offen { background: var(--pfirsich-hell); }
.s-ueberfaellig { background: var(--rot-hell); color: var(--rot); }
.s-bezahlt, .s-erstattet { background: var(--mint); }
.s-storniert { background: #ece8ea; color: var(--leise); text-decoration: line-through; }
.s-ausgestellt { background: var(--mint-hell); }

.hinweis { border-radius: 12px; padding: .7rem .9rem; background: var(--gelb-hell); margin-bottom: 1rem; font-size: .95rem; }
.hinweis.rot { background: var(--rot-hell); color: var(--rot); }
.hinweis.mint { background: var(--mint-hell); }

.pos { border: 1px solid var(--linie); border-radius: 12px; padding: .7rem; margin-bottom: .6rem; background: #fff; }
.pos-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; font-size: .85rem; color: var(--leise); }
.pos-felder { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 0 .6rem; }
.pos-felder label { margin-bottom: .3rem; }
.pos-betrag { text-align: right; font-weight: 600; }
@media (max-width: 560px) { .pos-felder { grid-template-columns: 1fr 1fr; } }

.summen { margin-left: auto; max-width: 340px; }
.summen div { display: flex; justify-content: space-between; padding: .2rem 0; }
.summen .gesamt { border-top: 2px solid var(--pfirsich); margin-top: .3rem; padding-top: .5rem; font-weight: 700; font-size: 1.15rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; background: var(--mint); padding: .45rem .5rem; font-weight: 600; }
td { padding: .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle { overflow-x: auto; }

.meldung { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 12px; z-index: 20; max-width: calc(100% - 32px); box-shadow: var(--schatten); }
.meldung.fehler { background: var(--rot); }

dialog { border: 0; border-radius: 18px; padding: 1.2rem; width: min(560px, calc(100% - 24px)); max-height: 88vh; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--ink); }
dialog::backdrop { background: rgba(43, 34, 48, .35); }
dialog h2 { margin-top: 0; }

.anmelden { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.anmelden img { width: 180px; margin-bottom: 1rem; }
.anmelden input { text-align: center; font-size: 1.6rem; letter-spacing: .3em; }
.code { font-size: 2.2rem; letter-spacing: .25em; font-weight: 700; text-align: center; background: var(--mint-hell); border-radius: 12px; padding: .6rem; margin: .6rem 0; }
.sha { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; word-break: break-all; color: var(--leise); }
.trenner { height: 1px; background: var(--linie); margin: 1rem 0; }
.oben { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
