:root {
  --rot: #c8102e;
  --rot-dunkel: #a00d25;
  --text: #1d1d1f;
  --neben: #5b5f66;
  --linie: #d9dce1;
  --flaeche: #f4f5f7;
  --weiss: #fff;
  --gruen: #1b7a3d;
  --gruen-hell: #e3f4e9;
  --gelb-hell: #fff3cd;
  --blau-hell: #e4ecfb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--flaeche); color: var(--text);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.kopf {
  background: var(--weiss); border-bottom: 5px solid var(--rot);
  padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
}
.marke { font-weight: 800; font-size: 1.35rem; color: var(--rot); letter-spacing: .01em; }
.kopftext { color: var(--neben); }
main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }
main.schmal, .schmal { max-width: 520px; }
main.mitte { text-align: center; padding-top: 60px; }
h1 { font-size: 1.6rem; margin: 8px 0 16px; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 22px 0 6px; }
.karte h2:first-child { margin-top: 0; }
.neben { color: var(--neben); margin: 2px 0 10px; }
.klein { font-size: .85rem; color: var(--neben); }
.laden, .leer { color: var(--neben); padding: 30px 0; text-align: center; }

.karte {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px;
  padding: 18px; margin: 0 0 14px;
}
.besucher { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.besucher.fertig { border-left: 6px solid var(--gruen); }
.besucher h2 { margin: 0; font-size: 1.3rem; }
.wer { flex: 1 1 320px; min-width: 0; }
.tun { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.marken { display: flex; flex-wrap: wrap; gap: 6px; }
.marke-klein { font-size: .82rem; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.marke-klein.gruen { background: var(--gruen-hell); color: var(--gruen); }
.marke-klein.grau { background: #eceef1; color: var(--neben); }
.marke-klein.gelb { background: var(--gelb-hell); color: #6b5200; }
.marke-klein.blau { background: var(--blau-hell); color: #1c3f8f; }

.zahlen { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.zahlen div { background: var(--weiss); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 16px; flex: 1 1 140px; }
.zahlen strong { font-size: 1.5rem; margin-right: 6px; font-variant-numeric: tabular-nums; }

.knopf {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  min-height: 48px; padding: 11px 18px; border-radius: 10px; line-height: 1.3;
  background: var(--weiss); color: var(--text); border: 1.5px solid #b9bec6;
}
.knopf:hover { border-color: var(--text); }
.knopf.rot { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.rot:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); }
.knopf.gross { font-size: 1.15rem; padding: 14px 26px; }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid #1c5fd4; outline-offset: 2px; }
.leiste { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.leiste.ende { justify-content: flex-end; margin-bottom: 0; }

label { display: block; font-weight: 600; font-size: .95rem; }
input:not([type=checkbox]):not([type=radio]) {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400;
  padding: 11px 12px; min-height: 48px; border: 1.5px solid #b9bec6; border-radius: 10px; background: #fff; color: var(--text);
}
input:disabled { background: var(--flaeche); color: var(--text); opacity: 1; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }
form.karte > label { margin-bottom: 12px; }

.schalter { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border: 1.5px solid #b9bec6; border-radius: 10px; background: #fff; cursor: pointer; }
.schalter.gross { display: flex; margin-top: 10px; }
.schalter input, .wahl input { width: 26px; height: 26px; accent-color: var(--gruen); flex: none; }
.wahl { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.wahl label { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; min-width: 120px; padding: 6px 16px; border: 1.5px solid #b9bec6; border-radius: 10px; background: #fff; cursor: pointer; font-size: 1.05rem; }

.rechtstext { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 4px 14px; font-size: .88rem; max-height: 260px; overflow-y: auto; }
.unterschrift { display: block; width: 100%; height: 220px; background: #fff; border: 2px dashed #8a9099; border-radius: 10px; touch-action: none; cursor: crosshair; }
.sig-gross { display: block; max-width: 100%; width: 480px; border: 1px solid var(--linie); border-radius: 10px; background: #fff; }

.fehler { color: #a3001c; font-weight: 600; margin: 10px 0; }
.fehler:empty { display: none; }
.hinweis { padding: 10px 14px; border-radius: 10px; margin: 0 0 14px; }
.hinweis.ok { background: var(--gruen-hell); color: #0f5a2a; }
.hinweis.fehler { background: #fde3e7; }
.hinweis.gelb { background: var(--gelb-hell); color: #6b5200; }
.haken { width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%; background: var(--gruen); color: #fff; font-size: 56px; line-height: 96px; }

/* Druckansicht und Hilfe */
.druckseite { background: #fff; padding: 16px 20px 40px; font-size: 15px; }
.druckseite h1 { font-size: 1.4rem; margin-bottom: 2px; }
.druckseite h2 { font-size: 1.1rem; margin-top: 18px; }
.druckseite h3 { font-size: 1rem; margin: 18px 0 6px; }
.druckleiste { display: flex; gap: 10px; margin-bottom: 16px; }
.tabellenrahmen { overflow-x: auto; }
table.druck { border-collapse: collapse; width: 100%; margin-top: 10px; }
table.druck { table-layout: fixed; min-width: 900px; }
table.druck th, table.druck td { border: 1px solid #222; padding: 5px 6px; text-align: left; vertical-align: top; font-size: .85rem; overflow-wrap: break-word; }
table.liste th:nth-child(1) { width: 8%; } table.liste th:nth-child(2) { width: 13%; }
table.liste th:nth-child(3) { width: 11%; } table.liste th:nth-child(4) { width: 20%; }
table.liste th:nth-child(5) { width: 14%; } table.liste th:nth-child(6) { width: 11%; }
table.liste th:nth-child(7) { width: 5%; } table.liste th:nth-child(8) { width: 7%; }
table.liste td:nth-child(4) { overflow-wrap: anywhere; }
.hilfe table.druck { min-width: 0; table-layout: auto; }
table.druck th { font-weight: 600; background: #f1f1f1; }
table.druck td.mitte { text-align: center; }
table.druck .sig { display: block; height: 52px; max-width: 190px; }
.druckseite .rechtstext { max-height: none; background: #fff; border: 1px solid #222; border-radius: 0; font-size: .7rem; margin-top: 10px; }
.druckseite .rechtstext p { margin: 4px 0; }
.hilfe { max-width: 900px; }
.hilfe code { font-size: .85em; background: var(--flaeche); padding: 1px 4px; border-radius: 4px; }

@page { size: A4 landscape; margin: 10mm; }
@media print {
  .druckleiste { display: none; }
  .druckseite { padding: 0; font-size: 11px; }
  table.druck tr { break-inside: avoid; }
}
@media (max-width: 600px) {
  .tun { width: 100%; }
  .tun .knopf { flex: 1 1 100%; }
}

/* Hauptansicht im Aufbau des Papierformulars */
main.blatt { max-width: 1400px; background: #fff; padding: 18px 20px 40px; }
body:has(main.blatt) { background: #fff; }
.blattkopf h1 { font-size: 1.45rem; font-weight: 500; margin: 0; }
.blattkopf .team { font-size: 1.45rem; margin: 0 0 10px; }
.blatthinweis { font-size: .9rem; margin: 0 0 6px; text-align: center; }
table.haupt { margin-top: 0; }
table.haupt th { background: #fff; font-weight: 500; text-align: center; vertical-align: middle; }
table.haupt td { height: 58px; font-size: .95rem; }
table.haupt tbody tr { cursor: pointer; }
table.haupt tbody tr:hover, table.haupt tbody tr:focus-visible { background: #fdf1f3; }
table.haupt tbody tr:focus-visible { outline: 3px solid #1c5fd4; outline-offset: -3px; }
table.haupt tr.fertig { background: #f3faf5; }
table.haupt .tipp { color: #8a9099; font-size: .85rem; }
table.haupt .vermerk { color: var(--neben); font-size: .72rem; }
table.haupt .sig { height: 40px; max-width: 100%; }
table.haupt .bezahltzelle { cursor: default; padding: 0; }
.haekchen { display: flex; align-items: center; justify-content: center; min-height: 56px; cursor: pointer; }
.haekchen input { width: 30px; height: 30px; accent-color: var(--gruen); }
main.blatt .rechtstext { max-height: none; background: #fff; border: 1px solid #222; border-radius: 0; font-size: .7rem; margin-top: 6px; padding: 2px 6px; }
main.blatt .rechtstext p { margin: 3px 0; }
main.blatt .hinweis { margin: 6px 0; }
.blattkopf { display: flex; align-items: center; gap: 28px; margin-bottom: 8px; }
.blattkopf .logo { height: 55px; width: auto; flex: none; }
.blattkopf .team { margin: 0; }
main.blatt .klein a { color: var(--rot-dunkel); }
