/* Prüfer-App. Design nach Fachspezifikation Abschnitt 20: nüchtern, Anthrazit als einzige Akzentfarbe,
   Stufenfarben fest, Tippflächen mindestens 48 px, Systemschrift (keine nachgeladenen Schriften). */
:root {
  --ink: #22262a; --ac: #2b2f33; --bg: #f2f3f4; --card: #fff; --ln: #d4d7da; --mu: #5d646b;
  --r: #c62828; --o: #ef6c00; --y: #f9a825; --g: #2e7d32; --h: #1565c0;
  box-sizing: border-box; color-scheme: light;
}
*, *::before, *::after { box-sizing: inherit; }
/* Inhalt von <details> erbt die Box-Regel in Chromium nicht (Zeilen ragten 14 px über den Rand). */
details > * { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-text-size-adjust: 100%;
}
button { color: var(--ink); }
header {
  background: var(--ac); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  padding: 8px 12px; position: sticky; top: 0; z-index: 5;
}
header .logo { height: 32px; width: 32px; flex: none; }
header h1 { font-size: 16px; margin: 0; flex: 1 1 100px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header button { flex: none; white-space: nowrap; background: transparent; color: #fff; border: 1px solid #8a9096; border-radius: 6px; min-height: 48px; min-width: 48px; padding: 0 12px; font: inherit; }
header #netz[aria-pressed=false] { background: var(--o); border-color: var(--o); color: #000; }
.netzanzeige { font-size: 13px; padding: 2px 8px; border-radius: 10px; background: #4b5157; }
.netzanzeige.aus { background: var(--o); color: #000; font-weight: 600; }
@media (max-width: 480px) { header h1 { display: none; } .netzanzeige { margin-left: auto; } }
main { max-width: 900px; margin: 0 auto; padding: 12px 12px calc(120px + env(safe-area-inset-bottom, 0px)); }
h2 { font-size: 20px; margin: 8px 0 12px; } h3 { font-size: 16px; margin: 18px 0 8px; }
.btn { background: var(--ac); color: #fff; border: 0; border-radius: 8px; min-height: 48px; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.sec { background: #fff; color: var(--ac); border: 2px solid var(--ac); }
.btn.warn { background: var(--r); }
.btn.sm { font-size: 14px; padding: 0 12px; }
.btn:disabled, .tile:disabled { opacity: .5; cursor: not-allowed; }
.lnk { background: none; border: 0; color: var(--ac); text-decoration: underline; font: inherit; min-height: 48px; cursor: pointer; padding: 0 4px; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.tile { background: var(--card); border: 1px solid var(--ln); border-radius: 10px; min-height: 120px; padding: 14px; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 6px; cursor: pointer; width: 100%; }
.tile b { font-size: 18px; } .tile:disabled { background: #e4e6e8; }
small, .muted { color: var(--mu); }
.w { display: block; border-left: 6px solid; padding-left: 8px; font-size: 14px; }
.w.r { border-color: var(--r); } .w.o { border-color: var(--o); } .w.y { border-color: var(--y); } .w.g { border-color: var(--g); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spalte { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.item { background: var(--card); border: 1px solid var(--ln); border-radius: 8px; padding: 12px; margin-bottom: 8px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; width: 100%; text-align: left; font: inherit; color: inherit; }
button.item { cursor: pointer; min-height: 56px; }
.item .t { flex: 1; min-width: 150px; }
.item.block { display: block; }
.item.alt { flex-direction: column; align-items: stretch; }
.item.alt.erledigt { opacity: .78; }
.chip { display: inline-block; border: 1px solid var(--ac); border-radius: 12px; padding: 0 8px; font-size: 13px; margin-left: 4px; white-space: nowrap; }
.chip.ha { background: var(--ac); color: #fff; }
.chip.bad { border-color: var(--r); color: var(--r); font-weight: 600; }
.chip.ok { border-color: var(--g); color: var(--g); }
.chip.warn { border-color: var(--o); color: #8a3d00; }
.status { display: inline-block; border-radius: 6px; padding: 1px 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status.entwurf { background: var(--ac); color: #fff; }
.status.abgeschlossen { background: var(--r); color: #fff; }
.status.synchronisiert { background: var(--o); color: #000; }
.status.versendet { background: var(--g); color: #fff; }
.status.verworfen, .status.ersetzt { background: #ddd; color: #333; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs button { flex: 1; min-height: 48px; border: 1px solid var(--ln); background: #fff; font: inherit; border-bottom: 4px solid transparent; }
.tabs button.on { border-bottom-color: var(--ac); font-weight: 700; }
input, select, textarea { color: var(--ink); width: 100%; min-height: 48px; font: inherit; padding: 8px; border: 1px solid #9aa0a6; border-radius: 6px; background: #fff; margin: 4px 0 12px; }
input[type=checkbox] { width: 28px; min-height: 28px; height: 28px; margin: 0; flex: none; }
label { display: block; font-size: 14px; font-weight: 600; }
label.item { font-weight: 400; font-size: 16px; cursor: pointer; }
.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--ac); color: #fff; font-size: 34px; box-shadow: 0 2px 8px #0005; cursor: pointer; z-index: 4; }
.fab.ueber { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.ov { position: fixed; inset: 0; background: #0007; display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
@media (min-width: 700px) { .ov { align-items: center; } .grid { grid-template-columns: repeat(3, 1fr); } }
.sheet { background: #fff; width: 100%; max-width: 520px; max-height: 92%; overflow: auto; border-radius: 14px 14px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.sheet .row .btn { flex: 1; }
.err { color: var(--r); font-weight: 600; min-height: 1em; margin: 0 0 8px; }
.banner { background: #fff3e0; border: 2px solid var(--o); padding: 10px; border-radius: 8px; margin-bottom: 12px; }
.banner.bad { background: #fdecea; border-color: var(--r); }
.banner.info { background: #eef0f2; border-color: var(--ac); }
.banner.ok { background: #e8f5e9; border-color: var(--g); }
.update { background: #fff3e0; border-bottom: 2px solid var(--o); padding: 8px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); background: var(--ac); color: #fff; padding: 12px; border-radius: 8px; z-index: 30; max-width: 600px; margin: 0 auto; }
dl { margin: 0 0 12px; } dt { font-size: 13px; color: var(--mu); } dd { margin: 0 0 8px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #ddd; flex: none; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot.sofort { background: var(--r); } .dot.schnell { background: var(--o); } .dot.bald { background: var(--y); } .dot.hinweis { background: var(--h); }
/* Stufen-Tasten: dürfen auf 360 px nicht über den Rand ragen (Fehlerliste Nr. 8) */
.stufen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sb { min-height: 64px; min-width: 0; padding: 4px; overflow-wrap: anywhere; hyphens: auto; border: 3px solid var(--ac); background: #fff; color: var(--ink); font: inherit; font-size: 14px; border-radius: 8px; cursor: pointer; }
.sb.on { background: #eceff1; box-shadow: inset 0 0 0 3px var(--ink); font-weight: 700; }
.sb.sofort { border-color: var(--r); } .sb.schnell { border-color: var(--o); } .sb.bald { border-color: var(--y); }
.drei { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.drei .sb { min-height: 48px; }
.uebernommen { background: #e0e0e0; color: #444; }
.ort { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ort > label { min-width: 0; }
.zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pimg { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #ddd; border-radius: 8px; }
.ph { height: 120px; display: flex; align-items: center; justify-content: center; background: #e4e6e8; border-radius: 8px; color: var(--mu); }
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--ln); padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; align-items: center; z-index: 6; flex-wrap: wrap; }
.bar .btn { flex: 1 1 120px; min-width: 0; }
.bar .t { flex: 1 1 100%; font-size: 14px; }
.bad { color: var(--r); font-weight: 700; }
canvas.sig { display: block; width: 100%; height: 160px; max-width: 760px; border: 2px solid var(--ac); border-radius: 6px; background: #fff; touch-action: none; margin: 6px 0; }
progress { width: 100%; height: 20px; }
.gesperrt { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 12px; }
.gesperrt .btn { min-width: 240px; }
body.busy { cursor: progress; }
.klein { font-size: 13px; }
.gruppe { margin-top: 12px; }
summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }

/* Bereich "Betrieb" (Auftrag 8) */
.reiter { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
/* Vorschau des PDF-Deckblatts: weiß wie das Papier, Flamme oben, eigenes Logo neben den Betriebsdaten */
.deckblatt { background: #fff; color: #1d1f21; border: 1px solid #c9ccd0; border-radius: 8px; padding: 16px; margin: 6px 0 10px; max-width: 520px; }
.deckblatt .flamme { width: 40px; height: 40px; display: block; margin-bottom: 14px; }
.deckblatt .dt { font-size: 17px; font-weight: 700; color: #2b2f33; }
.deckblatt .dn { font-weight: 700; margin-bottom: 14px; }
.deckblatt .betrieb { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; font-size: 14px; overflow-wrap: anywhere; }
.deckblatt .betrieb img { max-width: 150px; max-height: 60px; object-fit: contain; }
.deckblatt .betrieb > div { flex: 1 1 160px; min-width: 0; }
.deckblatt .betrieb small { color: #5f6368; }
.deckblatt .pre { white-space: pre-line; }
.deckblatt .dobj { margin-top: 14px; font-size: 14px; color: #5f6368; }
.platzhalter { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
dl.klein { font-size: 13px; display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 10px; }
dl.klein dt { font-family: monospace; }
dl.klein dd { margin: 0; }
pre.mailvorschau { white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 1px solid #c9ccd0; border-radius: 8px; padding: 10px; font: 14px/1.4 system-ui, sans-serif; }
#mailtext { font-family: monospace; }

/* Filter der alten Mängel: am Handy wie bisher untereinander. */
.filterleiste { margin-bottom: 16px; }

/* Tablet hochkant (Auftrag 9, gemessen am Galaxy Tab S6 Lite: 800 × 1262 px, mit Tastatur 800 × 850 px).
   Gleiche Bedienung wie am Handy, aber die Breite wird genutzt. Tasten bleiben mindestens 48 px hoch. */
@media (min-width: 700px) {
  canvas.sig { height: 240px; }
  .karten2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; align-items: start; }
  .karten2 > .item { margin-bottom: 10px; }
  .filterleiste { position: sticky; top: 64px; z-index: 3; background: var(--bg); padding: 6px 0; display: flex; gap: 8px; align-items: center; }
  .filterleiste input { margin: 0; flex: 1; }
  .pimg { max-height: 420px; }
}
