@font-face { font-family: "Hanken Grotesk"; src: url("hanken-grotesk-latin.woff") format("woff"); font-weight: 100 900; }
:root {
  --bg: #f2f5f7; --karte: #fff; --ink: #14212b; --muted: #5a6872; --linie: #dde3e7; --linie-stark: #c3ccd2;
  --marke: #0e2330; --akzent: #0b6e8a; --akzent-hell: #e3f1f5;
  --ok: #1d6b3a; --ok-bg: #e5f4ea; --warn: #8a5a00; --warn-bg: #fdf3dc; --rot: #a3261f; --rot-bg: #fbe8e6; --grau-bg: #eef1f3;
  --radius: 10px; --leiste: 62px;
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 "Hanken Grotesk", -apple-system, "Segoe UI", Arial, sans-serif; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--akzent); }
h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 22px 0 8px; font-weight: 650; color: var(--muted); }
.leise { color: var(--muted); font-size: 14px; }
.versteckt { display: none !important; }

/* Rahmen */
.kopfzeile { position: sticky; top: 0; z-index: 10; background: var(--marke); color: #fff; padding: calc(var(--oben) + 10px) 16px 12px; display: flex; align-items: center; gap: 10px; min-height: calc(var(--oben) + 56px); }
.kopfzeile h1 { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopfzeile .zurueck { color: #fff; background: none; border: 0; font-size: 16px; padding: 8px 10px 8px 0; display: flex; align-items: center; gap: 4px; min-height: 44px; }
.kopfzeile .rechts { color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 600; min-height: 40px; }
.inhalt { padding: 14px 16px calc(var(--leiste) + var(--unten) + 24px); max-width: 640px; margin: 0 auto; }
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--linie); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--unten); }
.leiste a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--leiste); color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500; }
.leiste a svg { width: 24px; height: 24px; }
.leiste a.aktiv { color: var(--akzent); font-weight: 650; }

/* Abgleich-Banner */
.banner { border-radius: var(--radius); padding: 10px 12px; font-size: 14.5px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: #5c3c00; }
.banner.rot { background: var(--rot-bg); color: var(--rot); }
.banner .knopf { margin-left: auto; }
.punkt { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }

/* Karten, Listen */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zahl { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; }
.zahl small { display: block; color: var(--muted); font-size: 13px; }
.zahl b { font-size: 21px; font-weight: 700; }
.zahl.rot b { color: var(--rot); }
.zahl.breit { grid-column: 1 / -1; }
.liste { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste > a, .liste > button, .liste > div.eintrag { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--linie); background: none; width: 100%; text-align: left; color: inherit; text-decoration: none; min-height: 56px; }
.liste > :last-child { border-bottom: 0; }
.eintrag-text { flex: 1; min-width: 0; }
.eintrag-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag-text span { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag-rechts { text-align: right; flex: none; }
.eintrag-rechts b { display: block; font-weight: 600; }
.leer { padding: 22px; text-align: center; color: var(--muted); }

/* Status */
.status { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.s-entwurf { background: var(--grau-bg); color: var(--muted); }
.s-offen { background: var(--warn-bg); color: var(--warn); }
.s-ueberfaellig { background: var(--rot-bg); color: var(--rot); }
.s-bezahlt, .s-erledigt { background: var(--ok-bg); color: var(--ok); }
.s-storniert, .s-widerrufen { background: var(--grau-bg); color: var(--muted); text-decoration: line-through; }
.s-storno { background: var(--grau-bg); color: var(--ink); }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; min-height: 46px; border-radius: var(--radius); border: 1px solid var(--linie-stark); background: #fff; text-decoration: none; color: var(--ink); font-weight: 550; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 650; }
.knopf.gefahr { color: var(--rot); }
.knopf.klein { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.knopf.voll { width: 100%; }
.knopf:disabled { opacity: .5; }
.knopf:active { transform: translateY(1px); }
.knoepfe { display: grid; gap: 10px; margin-top: 14px; }
.knoepfe.zwei { grid-template-columns: 1fr 1fr; }

/* Formulare (16 px, sonst zoomt iOS beim Tippen) */
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--linie-stark); border-radius: 8px; background: #fff; font-size: 16px; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent-hell); border-color: var(--akzent); }
input[type="date"] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; min-height: 64px; }
.zeile { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.zeile.drei { grid-template-columns: 1fr 1fr 1fr; }
.haken { display: flex; gap: 12px; align-items: center; font-size: 16px; color: var(--ink); margin: 14px 0 0; min-height: 44px; }
.haken input { width: 24px; height: 24px; min-height: 0; margin: 0; flex: none; accent-color: var(--akzent); }
.suche { position: sticky; top: calc(var(--oben) + 56px); z-index: 5; background: var(--bg); padding: 2px 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-top: 8px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--linie-stark); background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 14.5px; min-height: 38px; }
.chips button.an { background: var(--marke); border-color: var(--marke); color: #fff; }
.pos { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 4px 12px 12px; margin-bottom: 10px; }
.pos-kopf { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; color: var(--muted); }
.pos-kopf button { border: 0; background: none; color: var(--rot); font-size: 14px; padding: 8px 0 8px 12px; }
.vorschlaege { display: flex; flex-direction: column; gap: 0; margin-top: 4px; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.vorschlaege button { border: 0; border-bottom: 1px solid var(--linie); background: #fff; text-align: left; padding: 10px 12px; font-size: 15px; min-height: 44px; }
.vorschlaege button:last-child { border-bottom: 0; }
.summenzeile { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; font-weight: 700; margin: 16px 2px 0; }
.kunden-treffer { margin-top: 6px; }

/* Rechnung ansehen */
.vorschau { background: #dfe5e9; border-radius: var(--radius); padding: 10px; overflow: hidden; }
.vorschau-innen { transform-origin: top left; }
.vorschau .r-seite { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.infos { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.infos dt { color: var(--muted); } .infos dd { margin: 0; text-align: right; }
.hinweis { border-radius: var(--radius); padding: 10px 14px; font-size: 15px; margin: 10px 0; background: var(--akzent-hell); }
.hinweis.warn { background: var(--warn-bg); color: #5c3c00; }
.hinweis.rot { background: var(--rot-bg); color: var(--rot); }
.hinweis ul { margin: 4px 0 0; padding-left: 20px; }

/* Entsperren, Einrichten */
.sperre { min-height: 100vh; min-height: 100dvh; background: var(--marke); color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(var(--oben) + 48px) 24px calc(var(--unten) + 24px); }
.sperre .marke { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 20px; line-height: 1.15; }
.sperre .marke img { width: 52px; height: 52px; border-radius: 12px; }
.sperre p { color: #c9d7df; text-align: center; margin: 10px 0 0; }
.pin-punkte { display: flex; gap: 14px; margin: 34px 0 10px; }
.pin-punkte span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9fb4c0; }
.pin-punkte span.voll { background: #fff; border-color: #fff; }
.pin-fehler { min-height: 24px; color: #ffb4a8; font-size: 15px; }
.tasten { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 26px; margin-top: 12px; }
.tasten button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 30px; font-weight: 500; }
.tasten button:active { background: rgba(255,255,255,.25); }
.tasten button.leer-taste { background: none; font-size: 16px; }
.faceid { margin-top: 26px; background: #fff; color: var(--marke); border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 650; display: flex; gap: 10px; align-items: center; min-height: 50px; }
.einrichten { min-height: 100vh; background: var(--bg); padding: calc(var(--oben) + 28px) 18px calc(var(--unten) + 28px); max-width: 560px; margin: 0 auto; }
.einrichten h1 { margin: 16px 0 6px; }
.schritte { color: var(--muted); font-size: 14px; }
video.kamera { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 1; object-fit: cover; margin-top: 12px; }

/* Dialog als Blatt von unten */
.dialog-hg { position: fixed; inset: 0; background: rgba(14,35,48,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.dialog { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px 18px calc(var(--unten) + 18px); }
.dialog h2 { margin: 0 0 6px; color: var(--ink); font-size: 19px; }
.dialog-fuss { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.dialog-fuss .knopf:only-child { grid-column: 1 / -1; }
.ganz { position: fixed; inset: 0; z-index: 55; background: #dfe5e9; overflow: auto; padding: calc(var(--oben) + 60px) 10px calc(var(--unten) + 20px); }
.ganz .zu { position: fixed; top: calc(var(--oben) + 10px); right: 12px; z-index: 56; }
#meldung { position: fixed; left: 16px; right: 16px; bottom: calc(var(--leiste) + var(--unten) + 12px); z-index: 60; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#meldung div { background: var(--marke); color: #fff; padding: 11px 18px; border-radius: 10px; margin-top: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 15px; max-width: 100%; }
#meldung div.fehler { background: var(--rot); }
