/* DachProfi iPhone – Design 3.2 „Handwerk neutral · Abendrot“ (wie Android) */
@font-face { font-family: "Source Sans 3"; src: url(../fonts/source_sans3_400.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(../fonts/source_sans3_600.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(../fonts/source_sans3_700.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(../fonts/source_sans3_900.ttf) format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(../fonts/zilla_slab_600.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(../fonts/zilla_slab_700.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #111417; --panel: #171B1F; --panel2: #1D2227; --panel3: #323A41;
  --acc: #5FB3A1; --acc-soft: #BFE3DA; --on-acc: #0C1513;
  --muted: #AEB7BF; --text: #EEF1F3; --danger: #E5484D;
  --open-t: #E2C87E; --open-bg: #372F1C; --open-bar: #C9A94F; --done-t: #A9AFB5; --done-bg: #2A2E33;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { touch-action: manipulation; }
label.btn[aria-disabled="true"] { opacity: .45; }
/* Tastatur offen: untere Leisten ausblenden, damit sie nicht über dem Feld schweben */
body:has(input:focus, textarea:focus) .bottombar, body:has(input:focus, textarea:focus) .tabbar-wrap { display: none; }
.warnbar { background: #3a2020; color: #f2c4c4; }
body { font-family: "Source Sans 3", -apple-system, system-ui, sans-serif; font-size: 16px; line-height: 1.35;
  -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; padding-left: var(--sal); padding-right: var(--sar); }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
button:disabled { opacity: .45; cursor: default; }
input, textarea, select { font: inherit; }
.ic { fill: currentColor; flex: none; display: block; }
.slab { font-family: "Zilla Slab", Georgia, serif; }
.muted { color: var(--muted); } .small { font-size: 12px; } .xs { font-size: 11px; } .bold { font-weight: 700; } .black { font-weight: 900; }
.acc { color: var(--acc); } .mut { color: var(--muted); } .warn { color: var(--open-t); } .danger-t { color: var(--danger); }
.grow { flex: 1 1 auto; } .min0 { min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; } .row.top { align-items: flex-start; } .row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; } .col.tight { gap: 6px; }
.pad { padding: 0 16px; } .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.divider { height: 1px; background: var(--panel2); margin: 2px 0; }
p { margin: 0; }

.page { min-height: 100dvh; padding-top: var(--sat); padding-bottom: calc(40px + var(--sab)); }
.page.withbar { padding-bottom: calc(110px + var(--sab)); }
.stack { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }

/* Kopfzeile */
.hdr { display: flex; align-items: center; gap: 6px; padding: 10px 14px; min-height: 64px; }
.hdr-t { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; font-size: 24px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; flex: none; }
.icbtn:active { background: var(--panel2); }

/* Knöpfe */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; padding: 10px 16px; border-radius: 16px;
  font-weight: 900; font-size: 15px; text-align: center; letter-spacing: .2px; }
.btn span { overflow: hidden; text-overflow: ellipsis; }
.btn.primary { background: var(--acc); color: var(--on-acc); }
.btn.primary:active { filter: brightness(.9); }
.btn.outline { border: 1px solid var(--panel3); color: var(--acc); min-height: 48px; border-radius: 14px; font-weight: 700; }
.btn.outline:active { background: var(--panel2); }
.btn.text { min-height: 44px; color: var(--muted); font-weight: 700; width: auto; padding: 8px 12px; }
.btn.text.full { width: 100%; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.dark { background: var(--panel3); color: var(--text); }
.btn.sm { min-height: 44px; width: auto; padding: 8px 16px; border-radius: 12px; font-size: 14px; }
.btnrow { display: flex; gap: 10px; } .btnrow > * { flex: 1 1 0; min-width: 0; }

/* Karten */
.card { background: var(--panel); border-radius: 16px; }
.card.pad16 { padding: 16px; } .card.pad14 { padding: 14px; }
.tap:active { filter: brightness(1.15); }
.sec-h, .step-h { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; }
.sec-t { color: var(--acc); font-weight: 900; font-size: 15px; }
.sec-s, .step-s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-s.open { color: var(--open-t); }
.step-t { font-weight: 700; }
.sec-b, .step-b { border-top: 1px solid var(--panel2); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ring { width: 26px; height: 26px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ring.ok { background: rgba(95,179,161,.18); color: var(--acc); }
.ring.miss { border: 1.5px solid var(--open-bar); }
.ring.neutral { background: var(--panel2); color: var(--muted); }

/* Felder */
.field { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.field-l { color: var(--muted); font-size: 13px; padding-left: 2px; }
.field input, .field textarea { width: 100%; background: transparent; color: var(--text); border: 1px solid var(--panel3); border-radius: 14px;
  padding: 13px 14px; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none; }
.field textarea { resize: none; line-height: 1.4; overflow: hidden; min-height: 110px; }
.field input:focus, .field textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.select { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--panel3); border-radius: 14px; padding: 0 12px; min-height: 48px; }
.select select { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; }
.select-v { flex: 1; font-weight: 700; }

/* Schildchen, Chips, Schalter */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; font-weight: 700; font-size: 11px; white-space: nowrap; }
.pill.open { background: var(--open-bg); color: var(--open-t); } .pill.done { background: var(--done-bg); color: var(--done-t); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--panel3); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chips { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.toggle { width: 52px; height: 32px; border-radius: 16px; background: var(--panel3); position: relative; flex: none; transition: background .15s; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: #fff; transition: transform .15s; }
.toggle.on { background: var(--acc); } .toggle.on span { transform: translateX(20px); }
.checkrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 0; min-height: 44px; }
.cb { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cb.on { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }

/* Listenzeilen */
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.li-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--panel2); display: flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.openbar { box-shadow: inset 3px 0 0 var(--open-bar); }
.matrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--panel2); }

/* Fenster */
.ovl { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); }
.dlg { background: var(--panel); border-radius: 22px; width: 100%; max-width: 520px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.dlg-t { font-weight: 900; font-size: 19px; padding: 20px 20px 8px; }
.dlg-b { padding: 4px 20px 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; }
.dlg-a { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 8px 14px 14px; flex-wrap: wrap; }
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; padding-top: var(--sat); }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(14px + var(--sab)); background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(96px + var(--sab)); z-index: 90; background: #2b3238; color: var(--text); border-radius: 14px;
  padding: 14px 16px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.5); text-align: center; }

/* Untere Leisten */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); padding: 10px 16px calc(12px + var(--sab)); display: flex; gap: 10px; }
.bottombar > * { flex: 1 1 0; }
.tabbar-wrap { position: fixed; left: 16px; right: 16px; bottom: calc(14px + var(--sab)); height: 96px; z-index: 20; pointer-events: none; }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 66px; border-radius: 22px; background: rgba(29,34,39,.96); border: 1px solid var(--panel3);
  display: flex; align-items: stretch; pointer-events: auto; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.tab.on { color: var(--acc); }
.fab { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 32px; background: var(--bg); padding: 4px; pointer-events: auto; }
.fab button { width: 56px; height: 56px; border-radius: 28px; background: var(--acc); color: var(--on-acc); display: flex; align-items: center; justify-content: center; }

/* Startseite */
.hero { position: relative; height: calc(300px + var(--sat)); margin-top: calc(-1 * var(--sat)); background: var(--panel2) center/cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(17,20,23,.45) 0%, rgba(17,20,23,0) 28%, rgba(17,20,23,.15) 55%, var(--bg) 100%); }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; padding: calc(16px + var(--sat)) 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 99px; background: rgba(17,20,23,.55); border: 1px solid rgba(238,241,243,.18); }
.brand b { font-family: "Zilla Slab", serif; font-size: 16px; }
.counter { margin-left: auto; padding: 7px 11px; border-radius: 99px; background: rgba(17,20,23,.55); border: 1px solid rgba(238,241,243,.18); font-size: 12px; font-weight: 600; }
.hero-b { position: absolute; left: 20px; right: 20px; bottom: 14px; }
.hero-k { font-size: 12px; letter-spacing: 2px; font-weight: 600; color: #C9D6E2; }
.hero-g { font-family: "Zilla Slab", serif; font-weight: 600; font-size: 30px; margin-top: 4px; }
.hero-d { font-size: 15px; color: #D3D9DE; }
.cont { background: var(--panel2); border: 1px solid var(--panel3); border-radius: 20px; padding: 14px; display: flex; gap: 14px; align-items: center; width: 100%; }
.thumb { width: 72px; height: 72px; border-radius: 14px; background: var(--panel) center/cover no-repeat; border: 1px solid var(--panel3); position: relative; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center; }
.thumb-n { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 5px 3px; background: linear-gradient(transparent, rgba(17,20,23,.85)); font-size: 11px; font-weight: 700; display: flex; gap: 3px; align-items: center; }
.kick { color: var(--acc); font-size: 12px; letter-spacing: 1px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 4px; background: var(--acc); }
.h2 { font-family: "Zilla Slab", serif; font-weight: 600; font-size: 18px; }
.h3 { font-family: "Zilla Slab", serif; font-weight: 600; font-size: 20px; }
.tiles { display: flex; gap: 10px; }
.tile { flex: 1 1 0; height: 96px; background: var(--panel); border: 1px solid var(--panel2); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.tile-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--panel2); display: flex; align-items: center; justify-content: center; color: var(--acc); }
.tile-t { font-size: 14px; font-weight: 600; line-height: 17px; }
.tile:disabled .tile-ic { color: rgba(174,183,191,.5); }
.banner { background: var(--open-bg); color: var(--open-t); border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; width: 100%; }

/* Reparatur-Kopf */
.rhero { position: relative; height: calc(200px + var(--sat)); margin-top: calc(-1 * var(--sat)); background: var(--panel2) center/cover no-repeat; overflow: hidden; }
.rhero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(17,20,23,.55) 0%, rgba(17,20,23,0) 35%, var(--bg) 100%); }
.rhero > * { position: relative; z-index: 1; }
.rhero .zf { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-40%); opacity: .5; z-index: 0; }
.rhero-top { display: flex; align-items: center; padding: calc(6px + var(--sat)) 6px 0; }
.rhero-n { margin-left: auto; margin-right: 8px; background: rgba(17,20,23,.7); border-radius: 99px; padding: 4px 10px; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.rhero-b { position: absolute; left: 16px; right: 16px; bottom: 12px; }
.rhero-k { color: var(--muted); font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rhero-t { font-family: "Zilla Slab", serif; font-weight: 700; font-size: 24px; line-height: 1.15; }
.bars { display: flex; gap: 4px; } .bars span { flex: 1; height: 5px; border-radius: 3px; background: var(--panel3); } .bars span.on { background: var(--acc); }

/* Fotos */
.photos { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
.photos::-webkit-scrollbar { display: none; }
.ph { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; width: 112px; height: 112px; border-radius: 14px; background: var(--panel2) center/cover no-repeat; position: relative; flex: none; }
.ph-del { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 17px; background: rgba(17,20,23,.72); color: #fff; display: flex; align-items: center; justify-content: center; }
.ph-sel { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border-radius: 14px; background: var(--acc); color: #fff; display: flex; align-items: center; justify-content: center; }
.ph.sel { outline: 3px solid var(--acc); outline-offset: -3px; }
.daythumb { width: 64px; height: 64px; border-radius: 10px; background: var(--panel2) center/cover no-repeat; flex: none; display: flex; align-items: center; justify-content: center; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; font-size: 200px; }

/* Foto-Vollbild mit Wischen */
.pager { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; padding-top: var(--sat); }
.pager-top { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.pager-view { flex: 1; overflow: hidden; position: relative; touch-action: none; }
.pager-track { position: absolute; top: 0; bottom: 0; left: 0; display: flex; will-change: transform; }
.pager-slide { height: 100%; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pager-slide img { max-width: 100%; max-height: 100%; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; transform-origin: 0 0; }
.pager-hint { text-align: center; color: var(--muted); font-size: 12px; padding: 8px; }

/* Unterschrift */
.sig-wrap { flex: 1; margin: 0 12px; border-radius: 18px; background: var(--panel2); position: relative; touch-action: none; overflow: hidden; }
.sig-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

/* Vorschau */
.pv-card { background: var(--panel); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.pv-t { color: var(--acc); font-weight: 900; }
.kv { display: flex; gap: 8px; } .kv > :first-child { flex: 1; }

.busy { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.spin { width: 20px; height: 20px; border-radius: 10px; border: 2.5px solid var(--panel3); border-top-color: var(--acc); animation: sp 0.9s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
.progress { height: 4px; border-radius: 2px; background: var(--panel3); overflow: hidden; } .progress span { display: block; height: 100%; background: var(--acc); transition: width .2s; }
.foot { text-align: right; color: rgba(174,183,191,.62); font-size: 9px; font-weight: 600; padding: 4px 20px; }
.empty { color: var(--muted); padding: 8px 2px; }
.hint { background: var(--panel2); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.hint .ic { color: var(--acc); margin-top: 1px; }
.pick-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--panel2); }
.pick-row.ind { padding-left: 16px; }
.grp { background: var(--panel); border-radius: 14px; padding: 13px 14px; display: flex; align-items: center; gap: 8px; width: 100%; }
