/* Mängelliste: iPhone zuerst, H24-Türkis. Kein Inline-Stil in Vorlagen (CSP), Klassen hier. */
:root {
  --ink: #0f2f33; --muted: #5a6f74; --line: #d9e3e6; --bg: #f2f6f7; --card: #ffffff;
  --brand: #007f8c; --brand-d: #00606a; --accent: #00b4c5; --brand-bg: #e3f6f8;
  --p1: #c92a2a; --p2: #b86e00; --p3: #2b6a99; --p0: #6b7c80; --ok: #2f8f5b;
  --radius: 14px; --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
  font-family: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.38; }
body { min-height: 100vh; min-height: 100dvh; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.blatt h3 { margin: 22px 0 8px; }
.blatt .karte + .karte { margin-top: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }

/* ---------- Kopf und Rahmen */
.kopf { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: calc(10px + var(--sat)) 14px 10px;
  display: flex; align-items: center; gap: 10px; }
.kopf .logo { height: 26px; width: auto; }
.kopf .titel { flex: 1; font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf button.icon { background: transparent; border: 0; color: #fff; font-size: 1.35rem; min-width: 44px; min-height: 44px; border-radius: 10px; cursor: pointer; }
.kopf button.icon:active { background: rgba(255, 255, 255, .15); }
.kopf::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--brand)); }
main { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(110px + var(--sab)); }
.banner { background: #fff4d6; border: 1px solid #f0d58a; color: #6b4a00; padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; font-size: .95rem; }
.banner.fehler { background: #fde8e8; border-color: #f2b8b8; color: #7d1d1d; }
.banner.ok { background: #e3f6ec; border-color: #a9dcc0; color: #1d5a38; }
.leer { text-align: center; color: var(--muted); padding: 40px 12px; }
.klein { font-size: .88rem; color: var(--muted); }
.zeile { display: flex; align-items: center; gap: 8px; }
.zeile.umbruch { flex-wrap: wrap; }
.platz { flex: 1; }

/* ---------- Bedienelemente */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 1.5px solid var(--brand); background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:active { background: var(--brand-d); }
.btn.hell { background: #fff; color: var(--brand); }
.btn.grau { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.gefahr { background: #fff; color: var(--p1); border-color: #e7b5b5; }
.btn.voll { width: 100%; }
.btn.klein { min-height: 38px; padding: 6px 12px; font-size: .92rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips + .zeile { margin-bottom: 12px; }
label.feld { display: block; margin: 12px 0 0; font-size: .88rem; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; margin-top: 4px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 1rem; }
textarea { min-height: 86px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.karte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }

/* ---------- Projektliste */
.projekt { display: flex; gap: 12px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px; }
.projekt:active { background: #f7fbfc; }
.projekt .bild { width: 92px; flex: none; background: var(--brand-bg) center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--brand); }
.projekt .inhalt { padding: 12px 12px 12px 0; flex: 1; min-width: 0; }
.projekt h2 { font-size: 1.05rem; }
.projekt .adr { color: var(--muted); font-size: .9rem; margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zaehler { display: flex; flex-wrap: wrap; gap: 6px; }
.z { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 8px; font-size: .84rem; font-weight: 700; color: #fff; background: var(--p0); }
.z.sofort { background: var(--p1); } .z.w4 { background: var(--p2); } .z.w12 { background: var(--p3); } .z.erledigt { background: var(--ok); }
.z.ghost { background: #eef3f4; color: var(--muted); }
.rolle { font-size: .75rem; letter-spacing: .02em; text-transform: uppercase; color: var(--brand-d); background: var(--brand-bg); border-radius: 6px; padding: 1px 7px; margin-left: 6px; font-weight: 700; }

/* ---------- Mängelkarten */
.mangel { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--p0); border-radius: var(--radius);
  padding: 10px; margin-bottom: 10px; cursor: pointer; text-align: left; width: 100%; }
.mangel.p-sofort { border-left-color: var(--p1); } .mangel.p-4w { border-left-color: var(--p2); } .mangel.p-12w { border-left-color: var(--p3); }
.mangel.fertig { opacity: .62; border-left-color: var(--ok); }
.mangel .foto { width: 76px; height: 76px; flex: none; border-radius: 10px; background: #eaf0f1 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #9bb0b4; font-size: 1.5rem; }
.mangel .text { flex: 1; min-width: 0; }
.mangel .nr { font-weight: 800; }
.mangel .ort { color: var(--muted); font-size: .92rem; }
.mangel .was { margin: 2px 0 4px; font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mangel .wer { font-size: .9rem; color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 7px; color: #fff; font-size: .78rem; font-weight: 800; vertical-align: 1px; margin-left: 6px; background: var(--p0); }
.badge.sofort { background: var(--p1); } .badge.p4w { background: var(--p2); } .badge.p12w { background: var(--p3); } .badge.ueber { background: #7d1d1d; }
.haken { width: 44px; height: 44px; flex: none; align-self: center; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.3rem; color: transparent; cursor: pointer; }
.fertig .haken { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- Untere Leiste, Blätter */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 10px; justify-content: center; padding: 10px 14px calc(10px + var(--sab));
  background: linear-gradient(to top, var(--bg) 70%, rgba(242, 246, 247, 0)); }
.leiste .btn { box-shadow: 0 4px 14px rgba(0, 60, 70, .22); }
.leiste .gross { flex: 1; max-width: 420px; min-height: 56px; font-size: 1.1rem; }
.blatt { position: fixed; inset: 0; z-index: 50; background: rgba(15, 47, 51, .55); display: flex; align-items: flex-end; justify-content: center; }
.blatt > .inner { background: var(--bg); width: 100%; max-width: 760px; max-height: 94dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 16px 14px calc(20px + var(--sab)); }
.blatt .titelzeile { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; position: sticky; top: -16px; background: var(--bg); padding: 6px 0; z-index: 2; }
.blatt .zu { background: #fff; border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; }
.prios { display: flex; gap: 8px; margin-top: 6px; }
.prios button { flex: 1; min-height: 46px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; }
.prios button[aria-pressed="true"].sofort { background: var(--p1); border-color: var(--p1); color: #fff; }
.prios button[aria-pressed="true"].w4 { background: var(--p2); border-color: var(--p2); color: #fff; }
.prios button[aria-pressed="true"].w12 { background: var(--p3); border-color: var(--p3); color: #fff; }
.prios button[aria-pressed="true"].keine { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Aufnahme */
.fotofeld { position: relative; border: 2px dashed #9bc9cf; border-radius: var(--radius); background: #fff; min-height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fotofeld img { width: 100%; max-height: 300px; object-fit: contain; display: block; background: #000; }
.fotofeld .knoepfe { display: flex; gap: 10px; padding: 14px; flex-wrap: wrap; justify-content: center; }
.fotofeld .weg { position: absolute; top: 8px; right: 8px; }
.sprechen { margin-top: 12px; text-align: center; }
.sprechtaste { width: 100%; min-height: 84px; border-radius: 20px; border: 0; background: var(--brand); color: #fff; font-size: 1.15rem; font-weight: 800; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sprechtaste.an { background: var(--p1); animation: puls 1.1s ease-in-out infinite; }
.sprechtaste.arbeit { background: var(--ink); }
@keyframes puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 42, 42, .5); } 50% { box-shadow: 0 0 0 14px rgba(201, 42, 42, 0); } }
.pegel { height: 8px; background: #d3e3e6; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.pegel > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
.punkt { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 10px; }
.punkt .kopfzeile { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--muted); font-size: .85rem; }

/* ---------- Diverses */
.warte { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.drehen { width: 22px; height: 22px; border: 3px solid #cfe3e6; border-top-color: var(--brand); border-radius: 50%; animation: dreh .8s linear infinite; flex: none; }
@keyframes dreh { to { transform: rotate(360deg); } }
.qr { text-align: center; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.qr img { width: 220px; height: 220px; }
.linkbox { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle td, .tabelle th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--sab)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 80; max-width: 90vw; font-size: .95rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.viewer { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer button { position: absolute; top: calc(12px + var(--sat)); right: 12px; }
.hilfefilm { width: 100%; border-radius: var(--radius); background: #000; }
.anmeldung { max-width: 460px; margin: 0 auto; padding: 40px 18px; text-align: center; }
.anmeldung .logo { width: 150px; margin: 0 auto 18px; display: block; }
@media (min-width: 720px) { .blatt { align-items: center; } .blatt > .inner { border-radius: 22px; } }
@media (prefers-reduced-motion: reduce) { .sprechtaste.an, .drehen { animation-duration: 3s; } }
