@font-face { font-family: 'WW Type'; src: url('fonts/WWType-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'WW Type'; src: url('fonts/WWType-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root {
  --orange: #f84914;
  --orange-dark: #d63a0a;
  --orange-soft: #fff0ea;
  --text: #141414;
  --muted: #6b6b6b;
  --line: #dcdcdc;
  --bg: #f4f3f1;
  --card: #ffffff;
  --ok: #1f8a4c;
  --ok-soft: #e7f5ec;
  --warn: #b25d00;
  --warn-soft: #fff4e0;
  --bad: #c62828;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'WW Type', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 17px; line-height: 1.4; }
body.noscroll { overflow: hidden; }
a { color: var(--orange-dark); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.12rem; } h4 { font-size: 1rem; }
.orange { color: var(--orange); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mt { margin-top: 14px; }
em { color: var(--muted); }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); min-height: 60px; }
.tb-logo { height: 26px; display: block; }
.tb-back { font-size: 2.2rem; line-height: 1; text-decoration: none; color: var(--orange); padding: 0 10px 4px 0; display: block; }
.tb-title { display: flex; flex-direction: column; min-width: 0; }
.tb-title strong { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title span { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-menu { border: 0; background: none; font-size: 1.6rem; padding: 4px 8px; cursor: pointer; color: var(--text); }
.syncbadge { font-size: .75rem; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.syncbadge.ok { background: var(--ok-soft); color: var(--ok); }
.syncbadge.busy { background: var(--warn-soft); color: var(--warn); }
.syncbadge.off { background: #eee; color: #444; }

.page { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }

/* Karten & Formulare */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.span2 { grid-column: span 2; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span { font-size: .82rem; color: var(--muted); }
.card > .fld, .card > .grid2 + .fld, .card > .fld + .fld { margin-top: 12px; }
input, select, textarea { font: inherit; font-size: 17px; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 48px; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
input:disabled, select:disabled, textarea:disabled { background: #f6f6f6; color: #444; -webkit-text-fill-color: #444; opacity: 1; }
input[type=checkbox], input[type=radio] { width: 24px; height: 24px; min-height: 0; accent-color: var(--orange); flex: none; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.fld-group { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 1rem; border: 1.5px solid var(--line);
  background: #fff; color: var(--text); padding: 11px 18px; border-radius: 11px; min-height: 48px; cursor: pointer; text-decoration: none; text-align: center; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:active { background: var(--orange-dark); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost.danger { background: #fff; color: var(--bad); border-color: #f1c4c4; }
.btn.big { padding: 14px 26px; font-size: 1.08rem; min-height: 56px; }
.btn.small { min-height: 40px; padding: 7px 12px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: default; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btnrow.spread { justify-content: space-between; }
.linkbtn { background: none; border: 0; color: var(--orange-dark); font: inherit; padding: 6px 0; cursor: pointer; text-decoration: underline; }
.linkbtn.danger { color: var(--bad); }
.iconbtn { border: 0; background: rgba(0,0,0,.06); width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; cursor: pointer; flex: none; color: var(--text); }
.seg { display: inline-flex; background: #ecebe8; border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); min-height: 42px; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.big button { padding: 12px 26px; font-size: 1.05rem; min-height: 50px; }
.seg.zustand button.on.ok { background: var(--ok); color: #fff; }
.seg.zustand button.on.bad { background: var(--bad); color: #fff; }

.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #eee; color: #444; white-space: nowrap; }
.st-draft { background: #eceae6; color: #555; } .st-sign { background: var(--warn-soft); color: var(--warn); }
.st-done { background: var(--ok-soft); color: var(--ok); } .st-local { background: #fde8e8; color: var(--bad); margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: .95rem; padding: 9px 14px; border-radius: 99px; cursor: pointer; min-height: 44px; }
.chipbtn.on { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-dark); font-weight: 700; }
.chipbtn.add { border-style: dashed; }

.notice { background: var(--warn-soft); color: #6a3a00; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.notice.ok { background: var(--ok-soft); color: #145c33; }
.notice.warn { background: var(--warn-soft); }
.graybox { background: #eeeeee; box-shadow: none; }

/* Anmeldung */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); }
.login-logo { height: 38px; align-self: flex-start; }
.checks { list-style: none; padding: 0; margin: 0; font-size: .9rem; } .checks .ok { color: var(--ok); } .checks .bad { color: var(--bad); }

/* Liste */
.list-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.list-head input[type=search] { flex: 1; min-width: 200px; }
.plist { display: flex; flex-direction: column; gap: 10px; }
.pcard { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: inherit; }
.pc-date { text-align: center; background: var(--orange-soft); border-radius: 10px; padding: 8px 4px; color: var(--orange-dark); }
.pc-date strong { display: block; font-size: 1.05rem; } .pc-date span { font-size: .75rem; }
.pc-main { display: flex; flex-direction: column; min-width: 0; } .pc-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-st { text-align: right; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* Übersicht */
.hub-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.hub-head h2 { margin: 8px 0 4px; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: inherit; min-height: 128px; display: flex; flex-direction: column; gap: 4px; border: 2px solid transparent; }
.tile:active { border-color: var(--orange); }
.tile-nr { color: var(--orange); font-weight: 700; font-size: 1.1rem; }
.tile-ic { position: absolute; right: 14px; top: 12px; font-size: 1.4rem; opacity: .75; }
.tile strong { font-size: 1rem; margin-top: auto; }
.tile-info { font-size: .85rem; color: var(--muted); }
.tile-badge { position: absolute; right: 12px; bottom: 12px; min-width: 26px; height: 26px; border-radius: 99px; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; padding: 0 8px; }
.tile.open .tile-badge { background: var(--warn-soft); color: var(--warn); }
.tile.done .tile-badge { background: var(--ok-soft); color: var(--ok); }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li a { display: flex; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: inherit; }
.todo .tnr { width: 26px; height: 26px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex: none; }
.todo.compact li a { padding: 5px 0; border: 0; color: #6a3a00; text-decoration: underline; }
.hub-foot { text-align: center; margin-top: 30px; }
.secnav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 20px; }
.secnav > :first-child { justify-self: start; } .secnav > :last-child { justify-self: end; }

/* Personen, Zähler, Schlüssel */
.person { display: flex; gap: 10px; align-items: flex-end; padding: 10px 0; border-bottom: 1px dashed #eee; }
.person > .grid3 { flex: 1; }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.meters .card { margin-bottom: 0; display: flex; flex-direction: column; gap: 12px; }
.meter-head { display: flex; gap: 10px; align-items: flex-end; } .meter-head .fld { flex: 1; }
.meter-head input { font-weight: 700; }
.vpick { justify-content: flex-start; text-align: left; font-weight: 400; width: 100%; }
.pslot { position: relative; border: 2px dashed #cfcfcf; border-radius: 12px; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; color: var(--muted); cursor: pointer; min-height: 96px; width: 100%; overflow: hidden; }
.pslot.big { min-height: 170px; }
.pslot .cam { font-size: 1.8rem; }
.pslot.has { border: 0; background: #000; }
.pslot.has img { width: 100%; height: 100%; max-height: 260px; object-fit: contain; display: block; }
.pslot-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.pslot-actions .iconbtn { background: rgba(255,255,255,.9); }
.keys { display: flex; flex-direction: column; gap: 8px; }
.keyrow { display: grid; grid-template-columns: 1.3fr auto 1.5fr auto; gap: 10px; align-items: end; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; height: 48px; }
.stepper button { border: 0; background: #f3f3f3; width: 46px; height: 100%; font-size: 1.4rem; cursor: pointer; }
.stepper input { border: 0; width: 52px; text-align: center; min-height: 0; height: 100%; border-radius: 0; padding: 0; }
.pthumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.pthumb { position: relative; width: 132px; height: 104px; border-radius: 10px; overflow: hidden; background: #eee; flex: none; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb .iconbtn { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; background: rgba(255,255,255,.9); }
.pthumb.mangel { outline: 3px solid var(--bad); }
.pthumb.add { border: 2px dashed #cfcfcf; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.pthumb.add span { font-size: .85rem; }
.pthumb.add.mangel { outline: 0; border-color: #e9a0a0; color: var(--bad); }
.pcap { display: flex; flex-direction: column; gap: 6px; width: 132px; }
.pcap input { min-height: 38px; padding: 6px 8px; font-size: .85rem; }
.invrow { display: grid; grid-template-columns: 1fr 1fr 132px auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.invrow .pslot { min-height: 48px; height: 80px; }

/* Räume */
.rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.room { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; border-left: 6px solid #ccc; }
.room.ok { border-left-color: var(--ok); } .room.bad { border-left-color: var(--bad); } .room.open { border-left-color: #d9d9d9; }
.rstate { font-size: .85rem; font-weight: 700; } .room.ok .rstate { color: var(--ok); } .room.bad .rstate { color: var(--bad); } .room.open .rstate { color: var(--muted); }
.roomnav-top { text-align: right; margin: -6px 0 6px; }
.mlist { list-style: none; padding: 0; margin: 0; } .mlist a { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: inherit; }

/* Unterschriften */
.signers { display: flex; flex-direction: column; gap: 10px; }
.signer { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.signer.done { border-color: #bfe3cc; background: #fbfefc; }
.sg-info { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.sg-img { height: 56px; max-width: 200px; object-fit: contain; background: #fff; }
.sentlist { list-style: none; padding: 0; } .sentlist .ok { color: var(--ok); } .sentlist .bad { color: var(--bad); }
.vgroup { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.vgroup > div:first-child { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.vgroup.warn { color: var(--warn); }

.sig-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 14px; }
.sig-box { background: #fff; border-radius: 16px; width: min(980px, 100%); height: min(560px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.sig-head { padding: 14px 18px; border-bottom: 1px solid var(--line); } .sig-head div { display: flex; flex-direction: column; } .sig-head span { color: var(--muted); font-size: .85rem; }
.sig-area { position: relative; flex: 1; background: #fff; }
.sig-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 2; }
.sig-line { position: absolute; left: 6%; right: 6%; bottom: 28%; border-bottom: 2px solid #c9c9c9; z-index: 1; }
.sig-hint { position: absolute; left: 0; right: 0; bottom: calc(28% - 30px); text-align: center; color: #b5b5b5; z-index: 1; pointer-events: none; }
.sig-confirm { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .95rem; cursor: pointer; }
.sig-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }

/* Dialoge */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: min(520px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { width: min(820px, 100%); }
.modal form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-actions.stack { flex-direction: column; } .modal-actions.stack .btn { width: 100%; }
.modal.zoom { width: min(1100px, 100%); background: #111; }
.zoomimg { max-width: 100%; max-height: 80vh; object-fit: contain; display: block; margin: 0 auto; }
.menu { display: flex; flex-direction: column; } .menu a, .menu .linkbtn { padding: 14px 4px; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: var(--text); font-size: 1.05rem; text-align: left; }
.menu-user { display: flex; flex-direction: column; padding-bottom: 10px; border-bottom: 2px solid var(--orange); } .menu-user span { color: var(--muted); font-size: .85rem; }
.vlist { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.vitem { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 14px; font: inherit; cursor: pointer; }
.vitem.on { border-color: var(--orange); background: var(--orange-soft); }
.plist-sel .psel { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.plist-sel .psel > div:first-child { display: flex; flex-direction: column; }
.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: .8rem; color: var(--muted); padding: 6px; }
.tbl td { padding: 10px 6px; border-top: 1px solid #f0f0f0; vertical-align: top; } .tbl tr[data-user], .tbl tr[data-office] { cursor: pointer; }
.tbl tr.inactive { opacity: .5; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 200; opacity: 0; transition: .25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.error { background: var(--bad); }

/* Protokoll-Vorschau (auch Unterschriftsseite) */
.pv section { padding: 14px 0; border-bottom: 1px solid #eee; }
.pv h3 b { color: var(--orange); margin-right: 6px; }
.pv h4 { color: var(--orange); margin: 14px 0 6px; font-size: .95rem; }
.pv-row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f3f3f3; }
.pv-row span { color: var(--muted); font-size: .9rem; } .pv-row strong { font-weight: 400; }
.pv-table { width: 100%; border-collapse: collapse; font-size: .95rem; } .pv-table th { text-align: left; font-size: .78rem; color: var(--muted); padding: 6px 4px; }
.pv-table td { padding: 7px 4px; border-top: 1px solid #f0f0f0; vertical-align: top; }
.pv-warn { color: var(--bad); font-weight: 700; }
.pv-box { background: #eee; padding: 12px 14px; border-radius: 8px; }
.pv-sigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pv-sig { display: flex; flex-direction: column; border-top: 1px solid #ccc; padding-top: 6px; } .pv-sig img { height: 60px; object-fit: contain; align-self: flex-start; order: -1; }
.pv-sig span { font-size: .78rem; color: var(--muted); } .pv-sig-empty { order: -1; height: 60px; display: flex; align-items: center; color: var(--muted); font-size: .85rem; }
.pv-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pv-photo { margin: 0; } .pv-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #eee; display: block; cursor: zoom-in; }
.pv-photo figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; } .pv-photo.missing img { visibility: hidden; }

body.is-offline .topbar { border-bottom: 3px solid #999; }

/* Hochformat iPad / Smartphone */
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .meters, .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .keyrow { grid-template-columns: 1fr auto auto; } .keyrow .k-bem { grid-column: 1 / -1; order: 5; }
  .invrow { grid-template-columns: 1fr auto; } .invrow > :nth-child(3) { grid-column: 1 / -1; }
  .signer { grid-template-columns: 1fr; }
  .pv-row { grid-template-columns: 1fr; gap: 2px; }
  .pv-sigs, .pv-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard { grid-template-columns: 56px 1fr; } .pc-st { grid-column: 2; text-align: left; }
  .tb-logo { height: 20px; } .syncbadge { display: none; }
  .secnav { grid-template-columns: 1fr 1fr; } .secnav > :nth-child(2) { display: none; }
  .hub-actions .btn { flex: 1; }
}
@media (max-width: 480px) { .grid4, .tiles, .rooms { grid-template-columns: 1fr 1fr; } body { font-size: 16px; } }
@media print { .topbar, .secnav, .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }

/* Vertretung */
.vertreter { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; position: relative; }
.vertreter .iconbtn.del { position: absolute; right: 10px; top: 10px; }
.vertritt { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.signer .hint { font-size: .82rem; color: var(--muted); }
.signer.optional { border-style: dashed; }
.ownphone { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .ownphone > span { font-size: .8rem; color: var(--muted); }
.fp { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; background: #f3f3f3; padding: 2px 6px; border-radius: 6px; }
details.audit summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
details.audit table { font-size: .85rem; }

.st-ready { background: #e3effc; color: #1a5aa6; }
.notice.prep { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #e3effc; color: #123c6e; }
/* iPad: Datums-/Zeitfelder nicht überlaufen lassen */
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; width: 100%; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
.grid2 > *, .grid3 > *, .grid4 > * { min-width: 0; }
.prep-person { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; position: relative; }
.prep-person .iconbtn.del { position: absolute; right: 10px; top: 10px; }
.prep-person .row-head { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; padding-right: 44px; }
.signs { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; padding-bottom: 12px; cursor: pointer; }
.unit { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.unit-head { display: flex; gap: 10px; align-items: end; margin-bottom: 10px; } .unit-head .fld { flex: 1; }
.unit.allg { background: #fafaf8; }
.prep-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.meter-prep { display: grid; grid-template-columns: 1.1fr 1.2fr 1.3fr 1fr 1fr auto; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px dashed #eee; }
.vpick.empty { color: var(--muted); }
@media (max-width: 900px) { .meter-prep { grid-template-columns: 1fr 1fr; } .prep-person .row-head { grid-template-columns: 1fr; padding-right: 44px; } }

.unit-title { margin: 18px 0 10px; display: flex; gap: 10px; align-items: baseline; }
details.card summary { cursor: pointer; padding: 4px 0; }
details.card[open] summary { margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.tabs .tab { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 700; }
.tabs .tab.on { color: var(--text); border-bottom-color: var(--orange); }
.list-head select { width: auto; min-width: 140px; }
/* Versorger-Knopf in der Zählerzeile: feste Höhe (Safari dehnte ihn sonst auf) */
.meter-prep .fld { align-self: end; }
.vpick, .meter-prep .vpick { height: 48px; min-height: 48px; flex: none; display: block; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 11px 12px; }
.meter-prep.no-unit { grid-template-columns: 1.1fr 1.2fr 1.4fr 1fr auto; }
@media (max-width: 900px) { .meter-prep.no-unit { grid-template-columns: 1fr 1fr; } }
.pv-note { font-size: .85rem; color: var(--muted); margin: 8px 0; }
.hkv { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.hkv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.checks .indent { margin-left: 30px; }
.card.meter.funk .notice { margin: 8px 0; }
.ntrow { display: grid; grid-template-columns: 96px 1fr 1.2fr 1.1fr 1.3fr; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px dashed #eee; }
.ntfoto img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.ntinfo { display: flex; flex-direction: column; align-self: center; }
@media (max-width: 900px) { .ntrow { grid-template-columns: 80px 1fr; } .ntfoto img { width: 80px; height: 60px; } }
.card.nb h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mtprev { white-space: pre-wrap; font: inherit; font-size: .9rem; background: #fafaf8; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.modal.pdfmodal { width: 96vw; max-width: none; height: 92vh; display: flex; flex-direction: column; padding: 0; }
.pdfview { display: flex; flex-direction: column; height: 100%; }
.pdfbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pdfview iframe { flex: 1; width: 100%; border: 0; background: #f4f3f1; }
/* PDF-Ansicht: immer mit festem „Zurück zur App“ oben (iPad-Web-App hat keinen Zurück-Knopf) */
.pdfoverlay { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; flex-direction: column; }
.pdfoverlay .pdfbar { position: sticky; top: 0; z-index: 2; background: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.pdfoverlay .pdfbar strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfoverlay .pdfscroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: #f4f3f1; }
.pdfoverlay iframe { width: 100%; height: 100%; min-height: 100%; border: 0; display: block; }
body.noscroll { overflow: hidden; }
.notice.prep { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.segs { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.segs .seg { background: #fff; border: 0; padding: 12px 22px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-right: 1.5px solid var(--line); min-height: 48px; }
.segs .seg:last-child { border-right: 0; }
.segs .seg.on { background: var(--orange); color: #fff; }
.segs + .segs { display: flex; width: fit-content; }
.pv-title { font-size: 1.3rem; color: var(--orange); margin: 0 0 10px; }
.chip.st-miete{background:#eef4fb;color:#1f4e79}
.hvref-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px 16px; align-items: end; margin-top: 8px; }
.hvref-row .fld > span:empty { display: none; }
.hvref .btn.small { margin-top: 10px; }
.radios { display: flex; flex-direction: column; gap: 10px; }
.radios .indent { margin: 2px 0 6px 30px; }
/* Datum (deutsches Format) mit Kalender */
.dp { position: relative; display: flex; }
.dp .dp-txt { padding-right: 52px; }
.dp .dp-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.dp .dp-btn:hover:not(:disabled) { color: var(--orange); background: var(--orange-soft); }
.dp .dp-btn:disabled { opacity: .4; }
input.err { border-color: #c62828; box-shadow: 0 0 0 3px #fdecea; }
.dp-pop { position: absolute; z-index: 10050; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 12px; width: 312px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head strong { font-size: 1rem; }
.dp-head button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #f4f3f1; font-size: 22px; cursor: pointer; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-wd span { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.dp-grid button { height: 38px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 15px; cursor: pointer; }
.dp-grid button:hover { background: var(--orange-soft); }
.dp-grid button.heute { box-shadow: inset 0 0 0 1.5px var(--orange); }
.dp-grid button.on { background: var(--orange); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.dp-foot button { border: 0; background: transparent; color: var(--orange-dark); font: inherit; font-size: .9rem; padding: 8px 6px; cursor: pointer; }
.login-card .center { text-align: center; margin: 4px 0 -4px; }
.login-card #falogin { margin-bottom: 4px; }
.card.info { background: var(--orange-soft); }
.card.info p { margin: 0; }
.dstext h3 { font-size: 1rem; margin: 16px 0 4px; color: var(--orange-dark); }
.dstext > h3:first-child { font-size: 1.2rem; color: var(--text); margin-top: 0; }

/* Frühere Fassungen: Fotos ohne Zuordnung (Version 18) */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #eeeeee; cursor: zoom-in; }
.modal-body h4 { margin: 18px 0 6px; }

/* Schließanlage (Version 18) */
.sa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.sa-neu { display: flex; align-items: flex-end; gap: 10px; }
.sa-neu .fld { flex: 1; margin: 0; }
.sa-neu .btn { margin-bottom: 2px; }
.card .graybox { padding: 14px 16px; border-radius: 14px; }
.card .graybox .seg { background: #fff; }

.signer .sg-wait { grid-column: 1 / -1; margin: 0; }

.umzug-bar { position: sticky; top: 0; z-index: 2000; background: #f84914; color: #fff; padding: 10px 16px; font-size: 15px; line-height: 1.4; }
.umzug-bar a { color: #fff; text-decoration: underline; font-weight: 700; }
