/* Werkstatt-Tablet: dunkel wie die Marke (Schwarz trägt, Rot handelt, Gold zeichnet aus), große Flächen für Finger und Handschuhe. */
@font-face { font-family: 'Bebas Neue'; src: url('/bebas.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #0D0B0C; --flaeche: #171315; --flaeche2: #201B1D; --linie: #3A3234; --text: #F4F0EF; --leise: #A69D9C;
  --rot: #E01435; --gold: #D4A747; --gruen: #3FA66B;
  --kopf: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --text-schrift: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--text-schrift); font-size: 17px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2 { font-family: var(--kopf); font-weight: 400; letter-spacing: .03em; line-height: 1; margin: 0; }
h1 { font-size: 40px; }
h2 { font-size: 26px; margin-top: 8px; }
p { margin: 0; }
.leise { color: var(--leise); }

.app { min-height: 100%; display: flex; flex-direction: column; }
.kopf { display: flex; align-items: center; padding: 10px 16px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.logo { height: 40px; width: auto; }
.betrieb { font-family: var(--kopf); font-size: 26px; letter-spacing: .04em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kz-schild { font-weight: 700; font-size: 18px; letter-spacing: .08em; color: #111; background: #F2F2EE; border-radius: 5px; padding: 3px 10px 3px 24px; position: relative; white-space: nowrap; }
.kz-schild:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: #1F4FA3; border-radius: 5px 0 0 5px; }

.leiste { display: flex; padding: 8px 16px 0; padding: 8px max(16px, env(safe-area-inset-left)) 0; background: var(--bg); overflow-x: auto; }
.leiste button { flex: 1; min-width: 92px; background: none; border: 0; border-top: 4px solid var(--linie); padding: 8px 4px 4px; color: var(--leise); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.leiste button.fertig { border-color: var(--gold); color: var(--text); }
.leiste button.jetzt { border-color: var(--rot); color: var(--text); }

.inhalt { flex: 1; padding: 20px 16px 120px; padding: 20px max(16px, env(safe-area-inset-right)) 120px max(16px, env(safe-area-inset-left)); width: 100%; max-width: 980px; margin: 0 auto; }
.seite { display: flex; flex-direction: column; }
.seite > * + *, .schaden-seite > * + *, .karte > * + *, .fertig-text > * + * { margin-top: 14px; }
.kopf > * + *, .edit-kopf > * + *, .liste li > * + *, .schaden-liste li > * + *, .positionen li > * + * { margin-left: 12px; }
.leiste button + button { margin-left: 4px; }

.knopf { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; padding: 12px 22px; border-radius: 10px; border: 0; font-weight: 600; font-size: 18px; text-align: center; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.knopf small { font-weight: 400; font-size: 14px; opacity: .85; }
.knopf.haupt { background: var(--rot); color: #FFF; }
.knopf.zweit { background: var(--flaeche2); color: var(--text); border: 1px solid var(--linie); }
.knopf.text { background: none; color: var(--gold); min-height: 48px; padding: 8px 4px; align-self: flex-start; }
.knopf.riesig { min-height: 84px; font-size: 24px; }
.knopf.klein { min-height: 48px; padding: 8px 16px; font-size: 16px; }
.knopf:active { transform: scale(.98); }
.knopf[disabled] { opacity: .5; }
.foto { position: relative; overflow: hidden; }
.foto input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.feldname { display: block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--leise); margin-bottom: 4px; }
.feld { width: 100%; min-height: 54px; padding: 12px 14px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; font-size: 18px; }
.feld:focus { border-color: var(--gold); outline: none; }
.feld.gross { font-size: 26px; font-weight: 600; letter-spacing: .05em; }
.feld.kz { font-size: 24px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.feld.ki { border-color: var(--gold); }
textarea.feld { resize: vertical; }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.raster .breit { grid-column: 1 / -1; }
.status { min-height: 1.4em; color: var(--gold); font-size: 15px; }
.status.fehler, .fehler { color: #FF6B7F; }

.chips { display: flex; flex-wrap: wrap; margin: 0 -8px -8px 0; }
.chips button { margin: 0 8px 8px 0; }
.chips button { min-height: 52px; min-width: 64px; padding: 8px 16px; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--linie); color: var(--leise); font-size: 17px; cursor: pointer; }
.chips button.an { border-color: var(--rot); background: #3A0F18; color: var(--text); font-weight: 600; }
.haken { display: flex; align-items: center; min-height: 52px; font-size: 17px; cursor: pointer; }
.haken input { width: 28px; height: 28px; margin: 0 12px 0 0; accent-color: var(--rot); flex: none; }
.haken-reihe { display: flex; flex-wrap: wrap; }
.haken-reihe .haken { margin-right: 28px; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li + li, .schaden-liste li + li, .positionen li + li { margin-top: 8px; }
.liste li { display: flex; align-items: center; padding: 12px 14px; background: var(--flaeche); border-radius: 10px; }
.liste .kz-schild { font-size: 15px; }
.liste .wer { flex: 1; min-width: 0; color: var(--leise); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .wer strong { color: var(--text); font-weight: 600; }
.liste a { color: var(--gold); font-weight: 600; text-decoration: none; padding: 10px 6px; }

.akte { background: var(--flaeche2); border: 1px solid var(--gold); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; }
.akte .knopf { margin: 8px 0 0 auto; }
.akte p { flex: 1; min-width: 220px; }

.vorschau { display: flex; flex-wrap: wrap; }
.vorschau img { margin: 0 10px 10px 0; }
.vorschau img { height: 90px; border-radius: 6px; }

.kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kachel { position: relative; aspect-ratio: 4 / 3; min-height: 130px; border-radius: 12px; background: var(--flaeche) center / cover no-repeat; border: 2px dashed var(--linie); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.kachel svg { width: 58px; height: 80px; margin-bottom: 6px; }
.kachel .name { font-weight: 600; font-size: 16px; }
.kachel.ok { border: 2px solid var(--gold); }
.kachel.ok svg { display: none; }
.kachel.ok .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; background: rgba(0,0,0,.7); font-size: 14px; }
.kachel.ok:after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #111; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.kachel input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mini-auto { fill: #2B2426; stroke: #5A5052; stroke-width: 1.5; }
.mini-punkt { fill: var(--rot); }

.schaden-raster { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; align-items: start; }
.skizze { background: var(--flaeche); border-radius: 12px; padding: 10px; }
.skizze svg { display: block; width: 100%; max-height: 62vh; touch-action: manipulation; cursor: crosshair; }
.sk-text { font: 600 11px var(--text-schrift); fill: var(--leise); letter-spacing: 2px; }
.sk-rad { fill: #3A3335; }
.sk-koerper { fill: #262022; stroke: #4A4143; stroke-width: 2; }
.sk-glas { fill: #2B3A44; }
.sk-dach { fill: #2E2729; }
.sk-punkt circle { fill: var(--rot); }
.sk-punkt.aktiv circle { stroke: var(--gold); stroke-width: 4; }
.sk-punkt text { fill: #FFF; font: 700 13px var(--text-schrift); }
.schaden-seite { display: flex; flex-direction: column; min-width: 0; }
.karte { background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
.edit-kopf { display: flex; align-items: center; }
.nr { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--rot); color: #FFF; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.edit-fuss { display: flex; flex-wrap: wrap; align-items: center; }
.edit-fuss > * { margin: 0 12px 8px 0; }
.edit-foto { height: 64px; border-radius: 6px; }
.schaden-liste { margin: 0; padding: 0; list-style: none; }
.schaden-liste li { display: flex; align-items: center; padding: 10px 12px; background: var(--flaeche); border-radius: 8px; cursor: pointer; }
.schaden-liste .leise { font-size: 15px; }

.positionen { margin: 0; padding: 0; list-style: none; counter-reset: p; }
.positionen li { display: flex; align-items: center; }
.positionen li:before { counter-increment: p; content: counter(p) "."; width: 26px; color: var(--gold); font-weight: 700; flex: none; }
.positionen .weg { flex: none; width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--leise); font-size: 22px; cursor: pointer; }

.zusammenfassung { background: var(--flaeche); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; font-size: 16px; }
.zusammenfassung dt { color: var(--leise); }
.zusammenfassung dd { margin: 0; }
.erklaerung { font-size: 16px; color: var(--leise); }
.unterschrift-feld { position: relative; background: #FFF; border-radius: 12px; height: 220px; }
.unterschrift-feld canvas { display: block; width: 100%; height: 100%; border-radius: 12px; touch-action: none; }
.unterschrift-hinweis { position: absolute; left: 20px; right: 20px; bottom: 40px; border-top: 2px solid #C9C2C0; padding-top: 4px; color: #8A8284; font-size: 14px; pointer-events: none; }
.fortschritt { height: 10px; background: var(--flaeche2); border-radius: 5px; overflow: hidden; }
.fortschritt div { height: 100%; width: 0; background: var(--gold); transition: width .2s; }

.fertig { display: flex; flex-wrap: wrap; align-items: flex-start; }
.fertig .qr { margin: 0 24px 24px 0; }
.qr { background: #FFF; border-radius: 12px; padding: 12px; width: 280px; max-width: 100%; }
.qr svg { display: block; width: 100%; height: auto; }
.fertig-text { flex: 1; min-width: 260px; display: flex; flex-direction: column; }

.fuss { position: fixed; left: 0; right: 0; bottom: 0; display: flex; padding: 12px 16px; padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: var(--flaeche); border-top: 1px solid var(--linie); z-index: 5; }
.fuss .knopf { flex: 1; }
.fuss .knopf + .knopf { margin-left: 12px; }
.fuss #weiter { flex: 2; }
.meldung { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 10px; font-weight: 600; z-index: 10; max-width: 90%; }

@media (max-width: 700px) {
  .schaden-raster { grid-template-columns: minmax(0, 1fr); }
  .skizze svg { max-height: 50vh; }
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
