/* Hell, grosse Bedienelemente (Handschuhe), gut lesbar im Sonnenlicht */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d9dde3;
  --brand: #1f5fa8;
  --ok: #1b7f3b;
  --warn: #b45309;
  --err: #b91c1c;
  --btn-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: 84px; -webkit-tap-highlight-color: transparent; }

.demo-banner { background: #fde68a; color: #78350f; text-align: center; font-weight: 700;
  padding: 6px 8px; font-size: 14px; position: sticky; top: 0; z-index: 5; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 8px 0 6px; }
h2 { font-size: 19px; margin: 22px 0 8px; }
h4 { margin: 14px 0 6px; font-size: 16px; }
.hint { color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.err { color: var(--err); }
.warn { color: var(--warn); }
.notice { background: #e0ecfa; border-left: 4px solid var(--brand); padding: 10px 12px; border-radius: 6px; }
.crumb { font-size: 15px; margin-bottom: 4px; }
a { color: var(--brand); }

/* Navigation unten */
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
nav a { flex: 1; text-align: center; padding: 16px 4px; text-decoration: none; color: var(--muted); font-weight: 600; }
nav a.active { color: var(--brand); border-top: 3px solid var(--brand); margin-top: -1px; }

/* Eingabe */
.search, input[type="text"], input[type="search"] {
  width: 100%; height: var(--btn-h); font-size: 18px; padding: 10px 14px;
  border: 1px solid #b7bec9; border-radius: 10px; background: #fff; margin: 8px 0; }
.field { display: block; margin: 12px 0; font-weight: 600; }
.field input { margin-top: 6px; }

/* Karten und Listen */
.list { display: grid; gap: 10px; margin-top: 10px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; text-decoration: none; color: inherit; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
.rn-body { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }

/* Status-Chips */
.chip { font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.chip-open { background: #e5e7eb; color: #374151; }
.chip-draft { background: #e0ecfa; color: var(--brand); }
.chip-wait { background: #fef3c7; color: #92400e; }
.chip-error { background: #fee2e2; color: var(--err); }
.chip-ok { background: #dcfce7; color: var(--ok); }

/* Zählmaske */
.pos { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 12px 0; }
.pos-head { margin-bottom: 6px; }
.pos-nr { display: inline-block; font-size: 13px; background: #eef2f7; border-radius: 6px; padding: 2px 6px; margin-right: 6px; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line); }
.row-label { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step { min-width: 56px; height: 52px; font-size: 24px; font-weight: 700; border-radius: 12px;
  border: 1px solid #b7bec9; background: #f8fafc; color: var(--ink); cursor: pointer; }
.step:active { background: #e2e8f0; }
.step-wide { min-width: 0; font-size: 15px; font-weight: 600; padding: 0 12px; }
output.val { min-width: 64px; text-align: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.reset-row { margin: 6px 0 14px; }

/* Summen */
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 16px; }
.sum-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.sum-row span:nth-child(2) { grid-column: 1; color: var(--muted); font-size: 14px; }
.sum-row strong { grid-row: 1; grid-column: 2; text-align: right; }
.sum-total { display: flex; justify-content: space-between; font-size: 19px; margin: 10px 0; }
.msgs { padding-left: 18px; margin: 8px 0; font-size: 15px; }

/* Buttons */
.btn, .btn-ghost, .btn-danger { display: inline-block; min-height: var(--btn-h); padding: 14px 18px; font-size: 18px;
  font-weight: 700; border-radius: 12px; border: 1px solid #b7bec9; background: #fff; color: var(--ink);
  text-decoration: none; cursor: pointer; text-align: center; width: 100%; margin: 6px 0; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); min-height: 44px; width: auto; font-size: 16px; }
.btn-danger { background: #fff; color: var(--err); border-color: #fca5a5; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.row-btns { display: flex; gap: 8px; }

/* Unterschrift */
#pad { width: 100%; height: 240px; background: #fff; border: 2px dashed #94a3b8; border-radius: 12px; touch-action: none; margin: 8px 0; }

/* Büro */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 14px; color: var(--muted); }
.kpi span { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.kpi.warnkpi span { color: var(--warn); }
table.bill { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bill th, table.bill td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
table.bill .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.bill tr.back td { color: #166534; }
table.bill tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
img.sig { max-width: 100%; height: 120px; object-fit: contain; border: 1px solid var(--line); background: #fff; border-radius: 8px; margin: 6px 0; }

/* Einstellungen */
.radio { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin: 8px 0; }
.radio input { margin-top: 6px; transform: scale(1.4); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff;
  padding: 12px 18px; border-radius: 10px; opacity: 0; transition: all .25s; z-index: 20; max-width: 90%; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
