:root {
  --blue: #1d4e89;
  --blue-dark: #163c6a;
  --green: #5fb135;
  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #d5d8de;
  --danger: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: var(--blue); color: #fff;
  min-height: 52px;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 2; }
.topbar #btn-back { grid-column: 1; justify-self: start; color: #fff; }
.save-state { grid-column: 3; justify-self: end; font-size: 12px; opacity: .8; }

.view { padding: 12px; max-width: 640px; margin: 0 auto; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); margin: 0 0 10px; }
.view > h2 { margin: 20px 4px 8px; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* Formularelemente */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label.sr { margin-bottom: 4px; }
label.sr > span, .lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=url], input[type=email], input[type=tel], input[type=time], input[type=date], textarea, select {
  display: block; width: 100%; margin-top: 4px;
  font: inherit; font-size: 16px; color: var(--text);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; -webkit-appearance: none; appearance: none;
  min-height: 44px;
}
textarea { resize: vertical; line-height: 1.35; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,137,.15); }
input:invalid.touched { border-color: var(--danger); }
.req { color: var(--danger); }
.row { display: flex; gap: 10px; }
.row > label { flex: 1; min-width: 0; }
.row > label.w-plz { flex: 0 0 132px; } /* 5 Ziffern plus Strich-Knopf (Simulation 28.09.2026: „45884“ stand als „4588“ da) */
.field { margin-bottom: 12px; }

/* Segment-Auswahl */
.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 8px; font-size: 15px; color: var(--text);
  background: #fff; text-align: center; border-right: 1px solid var(--border);
  -webkit-user-select: none; user-select: none;
}
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--blue); color: #fff; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 16px; font-weight: 600;
  padding: 12px 16px; border-radius: 10px; border: 0; cursor: pointer;
  text-decoration: none; min-height: 48px; width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-dark); }
.btn.secondary { background: #e8edf5; color: var(--blue); }
.btn.secondary:active { background: #d7e0ee; }
.btn.big { font-size: 17px; min-height: 52px; }
.btn[disabled] { opacity: .5; }
.link-btn {
  font: inherit; font-size: 15px; background: none; border: 0; padding: 8px 4px;
  color: var(--blue); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.link-btn.strong { font-weight: 600; }
.link-btn.danger { color: var(--danger); }
.file-btn { margin: 0; }

/* Liste */
.cards { list-style: none; margin: 0; padding: 0; }
.cards li {
  background: var(--card); border-radius: var(--radius); margin-bottom: 10px;
  display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.cards .open { flex: 1; text-align: left; padding: 14px; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; }
.cards .open strong { display: block; font-size: 17px; }
.cards .open span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.cards .badge { font-size: 11px; color: var(--green); font-weight: 600; margin-left: 6px; }
.cards .badge.horn { color: #b0364f; }
.cards .del { padding: 14px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint {
  background: #fff8e1; border: 1px solid #f5d77a; border-radius: var(--radius);
  padding: 12px; font-size: 14px; margin-bottom: 12px;
}

/* Material / Artikelsuche */
.search-wrap { margin-bottom: 10px; }
input[type=search] {
  display: block; width: 100%; font: inherit; font-size: 16px; color: var(--text);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  -webkit-appearance: none; appearance: none; min-height: 44px;
}
input[type=search]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,137,.15); }
.results {
  list-style: none; margin: 6px 0 0; padding: 0; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; max-height: 320px; overflow-y: auto;
}
.results li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px;
  padding: 10px 12px; border-bottom: 1px solid #eef0f3; cursor: pointer; font-size: 15px;
}
.results li:last-child { border-bottom: 0; }
.results li:active { background: #e8edf5; }
.results .nr { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.results .src { font-size: 11px; color: var(--green); font-weight: 600; text-transform: uppercase; }
.results .txt { grid-column: 1 / -1; line-height: 1.3; }
.results .none { display: block; color: var(--muted); font-size: 14px; cursor: default; }
.mat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mat-row {
  display: grid; grid-template-columns: 60px 54px 1fr 30px; gap: 6px; align-items: start;
  background: #f7f8fa; border-radius: 8px; padding: 6px;
}
.mat-row input { margin-top: 0; min-height: 40px; padding: 8px; font-size: 15px; }
.mat-row .menge { text-align: right; }
.mat-row .desc { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 2px; }
.mat-row .desc .txt { font-size: 15px; line-height: 1.25; word-break: break-word; }
.mat-row .desc .nr { font-size: 12px; color: var(--muted); }
.mat-row .rm { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 40px; padding: 0; cursor: pointer; }
#mat-manual { margin-bottom: 8px; }

/* Checkliste */
.checkliste .card.cl-head { border-left: 4px solid var(--green); }
.check-list { display: flex; flex-direction: column; }
.check-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #eef0f3; min-height: 48px; }
.check-row:last-child { border-bottom: 0; }
.check-row > label { flex: 1; display: flex; align-items: center; gap: 12px; margin: 0; padding: 8px 0; font-size: 15px; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.check-row input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.check-row .box { flex: 0 0 26px; width: 26px; height: 26px; border: 2px solid #b9bec8; border-radius: 6px; background: #fff; position: relative; }
.check-row input:checked + .box { background: var(--blue); border-color: var(--blue); }
.check-row input:checked + .box::after { content: ''; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.check-row .lbl { flex: 1; font-size: 15px; color: var(--text); margin: 0; line-height: 1.3; }
.check-row input.typ { flex: 0 0 128px; width: 128px; margin: 0; min-height: 38px; padding: 6px 8px; font-size: 14px; }
.check-row.static { padding: 8px 0; }
.check-row.static .lbl { flex: 1; }
.check-row input.bar { flex: 0 0 64px; width: 64px; margin: 0; min-height: 38px; padding: 6px 8px; font-size: 15px; text-align: right; }
.check-row.static .unit { color: var(--muted); font-size: 14px; }
.checkliste textarea { margin-top: 4px; }
.checkliste label.block { margin-top: 12px; }

/* Fotos */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 10px; }
.photo { position: relative; background: #f5f5f5; border-radius: 8px; overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo input { border-radius: 0; border: 0; border-top: 1px solid var(--border); font-size: 14px; min-height: 36px; padding: 6px 8px; margin: 0; }
.photo .rm {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: 0; font-size: 18px; line-height: 30px; cursor: pointer;
}

/* Unterschrift */
.sig-block { margin-bottom: 16px; }
.sig-box {
  position: relative; height: 90px; border: 1px dashed var(--border); border-radius: 8px;
  background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sig-box img { max-height: 100%; max-width: 100%; }
.sig-placeholder { color: #b0b5bf; font-size: 14px; }
.sig-box.has-sig .sig-placeholder { display: none; }
.sig-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.sig-actions .btn { width: auto; flex: 1; }

/* Aktionsleiste unten */
.spacer { height: 120px; }
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: rgba(242,243,245,.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
.actionbar .btn { max-width: 616px; width: 100%; margin: 0 auto; display: flex; }
.actionbar .link-btn { padding: 4px; }

/* Modal Unterschrift */
.modal {
  position: fixed; inset: 0; z-index: 50; background: #fff;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--border); font-weight: 600; }
.sig-canvas-wrap { flex: 1; position: relative; background: #fafafa; touch-action: none; overscroll-behavior: contain; }
#sig-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sig-line { position: absolute; left: 8%; right: 8%; bottom: 25%; border-bottom: 1px solid #c9ccd3; pointer-events: none; }
.modal-foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); }
.modal-foot .btn { width: auto; }

/* Anhänge, mehrere je Typ */
.inst-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.inst-head h2 { margin-bottom: 10px; }
.inst-head .link-btn { padding: 0 0 6px; font-size: 14px; white-space: nowrap; }
.inst + .inst { margin-top: 6px; }

/* Inbetriebnahmeprotokoll */
.checkliste .card.ibn-head { border-left: 4px solid #e08a1e; }
#btn-add-ibn, #btn-add-p15, #btn-add-p16, #btn-add-hibn { margin-top: 8px; }
.checkliste .card.p15-head { border-left: 4px solid #7b4fb0; }
.checkliste .card.p16-head { border-left: 4px solid #b0364f; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
/* Kontrollzeile unter der Beschriftung eines Werkswert-Feldes, z. B.
   '= 1,8 bar' unter 'Pumpe/Kompressor 1 EIN'. Leer heisst: kein Werkswert,
   dann soll auch keine Zeilenhoehe entstehen. */
.val-row .auto { display: block; font-style: normal; font-size: .8em; color: #6b7280; }
.val-row .auto:empty { display: none; }
.val-row { display: flex; align-items: center; gap: 8px; min-height: 46px; border-bottom: 1px solid #eef0f3; }
.val-row:last-child { border-bottom: 0; }
.val-row .lbl { flex: 1; margin: 0; font-size: 15px; color: var(--text); }
.val-row input { flex: 0 0 84px; width: 84px; margin: 0; min-height: 38px; padding: 6px 8px; text-align: right; font-size: 15px; }
.val-row .unit { flex: 0 0 30px; color: var(--muted); font-size: 14px; }
.seg.many { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.seg.many span { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 14px; }

/* pds-Import */
.pds-card { border-left: 4px solid #0b7a75; margin-top: 14px; }
.erp-card { border-left: 4px solid var(--blue); margin-top: 14px; }
.erp-card details { margin-top: 8px; }
.erp-card summary { list-style: none; cursor: pointer; padding: 6px 0; }
.erp-card summary::-webkit-details-marker { display: none; }
.erp-card #btn-erp-laden { margin: 6px 0; }
.erp-card #btn-erp-koppeln { margin-top: 4px; }
.pds-card .file-btn { margin: 6px 0; }
#btn-new-pds { margin-top: 8px; }
.pds-filters { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pds-filter { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 14px; color: var(--text); }
.pds-list li.all { background: #e8f3f2; }
.pds-list li.all .nr { color: #0b7a75; }
.pds-filter input { width: 20px; height: 20px; }
.pds-list { margin-top: 10px; max-height: none; }
.pds-list li[data-i] { display: block; line-height: 1.35; }
.pds-list li .nr { font-weight: 600; color: var(--text); font-size: 15px; }
.pds-list li .badge { margin-left: 6px; }
.pds-list li .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.pds-list li.unit .sub { color: var(--text); }
#pds-info { margin: -4px 0 8px; }
/* ERP Punkt 23: Hinweise des Büros zum Auftrag (nur Anzeige, nicht im PDF) */
.auftrag-hinweis { border: 1px solid var(--border); border-left: 4px solid #0b7a75; border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; font-size: 14px; }
.auftrag-hinweis strong { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.auftrag-hinweis p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.auftrag-hinweis.korr { background: #fff8e1; border-color: #f5d77a; border-left-color: #c0392b; }
.auftrag-hinweis.korr strong { color: #c0392b; }
#auftrag-navi { margin: 0 0 4px; }
#auftrag-navi[hidden] { display: none; }
#auftrag-navi-ziel { margin: 0 0 10px; overflow-wrap: anywhere; }
#auftrag-rueckmeldung { margin: 4px 0 12px; }
#auftrag-rueckmeldung[hidden], #rm-stand[hidden], #rm-verwerfen[hidden] { display: none; }
.rm-knoepfe { display: flex; gap: 8px; margin-bottom: 8px; }
.rm-knoepfe .btn { flex: 1; min-width: 0; }
#rm-stand { margin: 0 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
.rm-frage { white-space: pre-line; margin: 0 0 12px; }
.rm-knoepfe { flex-wrap: wrap; }
.rm-knoepfe .btn { flex: 1 1 calc(50% - 4px); }
.rm-art-wahl span { font-size: 14px; }
.rm-hinweis { margin: -4px 0 8px; font-size: 13px; color: var(--muted); }
.rm-hinweis.fehler { color: var(--danger); font-weight: 600; }
#rm-text.fehler { border-color: var(--danger); }
#rm-senden:disabled { opacity: .45; }
.pds-list li .rm-liste { display: inline-block; margin-top: 6px; padding: 6px 0; font-size: 14px; }
.pds-list li .rm-schild { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--green); }
.pds-list li .rm-schild.warn { color: #b0364f; }
.pds-list li .sub.korr { color: #c0392b; font-weight: 600; white-space: pre-line; }
.pds-list li .sub.besch { color: var(--text); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Textbausteine */
.modal-body { flex: 1; overflow-y: auto; padding: 12px; background: var(--bg); }
.tb-list { margin-top: 10px; max-height: none; }
.tb-list .grp { display: block; padding: 8px 12px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); background: #f4f6f9; cursor: default; }
.tb-list li[data-i] { display: flex; align-items: flex-start; gap: 10px; line-height: 1.35; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.tb-list li.sel { background: #e8edf5; }
.tb-list .ord { flex: 0 0 22px; height: 22px; border-radius: 11px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 22px; margin-top: 1px; }
.tb-hint { margin: 8px 2px 0; }
#tb-ok[disabled] { opacity: .4; }
.tb-open { padding: 6px 0; font-size: 14px; }

/* Warten */
.busy {
  position: fixed; inset: 0; z-index: 60; background: rgba(255,255,255,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.spinner { width: 36px; height: 36px; border: 4px solid #d5d8de; border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.update-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 80px); z-index: 40;
  background: #111; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.update-banner .link-btn { color: #9cd3ff; }

/* ---------- Pflichtfelder ----------
   Jedes Feld ist entweder ausgefuellt oder gestrichen. Der Strich-Knopf sitzt
   am rechten Rand des Feldkastens; ein gestrichenes Feld wird grau und
   bekommt eine Linie quer darueber - so, wie man es auf Papier macht. */
.pf { position: relative; padding-right: 34px; }
.strike {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; line-height: 1;
  border: 1px solid #d7dbe0; border-radius: 8px; background: #fff;
  color: #8a9099; font-size: 17px; font-weight: 700; cursor: pointer;
}
.pf.weg .strike { background: #eef0f3; color: var(--text); border-color: #c3c8ce; }
/* Schreibfelder bekommen den Strich mitten durchs Feld - so, wie man auf
   Papier eine Zeile streicht. Haekchen und Auswahlen haben keine Flaeche
   dafuer, dort geht der Strich quer ueber die ganze Zeile. */
.pf-text.weg input, .pf-text.weg textarea {
  background-image: linear-gradient(to bottom, transparent calc(50% - 1px),
    #8a9099 calc(50% - 1px), #8a9099 calc(50% + 1px), transparent calc(50% + 1px));
}
.pf-wahl.weg::after {
  content: ""; position: absolute; left: 0; right: 34px; top: 50%;
  height: 2px; background: #9aa0a6; pointer-events: none;
}
.pf.weg { opacity: .55; }
/* background als Kurzform wuerde den Strich-Verlauf wieder ausknipsen. */
.pf.weg input, .pf.weg textarea { background-color: #f4f5f7; color: #8a9099; }
/* Nach der Pruefung: das erste offene Feld kurz hervorheben. */
.pf.fehlt { outline: 2px solid var(--horn, #c8102e); outline-offset: 3px; border-radius: 8px; }
.strike-all { display: block; margin-top: 10px; }

[hidden] { display: none !important; }

/* D-14: Einwilligungs-Kästchen über der Kundenunterschrift — langer Satz, Kästchen oben. */
.consent-row > label { align-items: flex-start; }
/* Die echte Checkbox bleibt ausgeblendet (siehe .check-row oben) - gezeichnet wird
   das .box-Kaestchen daneben. Hier stand bis zum 21.09.2026 eine Regel, die nur
   width/height setzte und opacity:0 stehen liess: Das Kaestchen war 22x22 gross
   und trotzdem unsichtbar. Der Monteur sah nur Text und suchte vergeblich. */
.consent-row .box { margin-top: 2px; }
.consent-row .small { font-size: 13px; line-height: 1.35; }

/* Artikelkatalog: ganze Seite, nur Nachschlagen */
#btn-katalog { margin-top: 8px; width: 100%; }
.katalog-suche { margin-top: 12px; }
.results.katalog-results { max-height: none; overflow: visible; }
.results.katalog-results li { cursor: default; }
.results.katalog-results li:active { background: transparent; }

/* Meine Termine (ERP Punkt 23) */
#btn-termine { margin-top: 8px; width: 100%; }
.erp-card #btn-erp-trennen { display: block; margin-top: 4px; }
.erp-card #btn-erp-trennen[hidden] { display: none; }
.termine-nav { display: flex; align-items: center; gap: 8px; }
.termine-nav .btn { width: auto; flex: 0 0 auto; padding: 8px 12px; min-height: 44px; font-size: 15px; }
.termine-nav strong { flex: 1; text-align: center; font-size: 15px; }
.termine-kopf #termine-status { margin: 8px 0 0; }
.termine-links { display: flex; justify-content: space-between; }
.termine-leer { margin: 4px 4px 16px; }
.termin-tag h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); margin: 16px 4px 6px; }
.termin-tag.heute h3 { color: var(--green); }
.termin {
  background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); border-left: 4px solid var(--blue); overflow-wrap: anywhere;
}
.termin-zeit { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.termin-zeit .badge { font-style: normal; font-size: 12px; color: var(--green); margin-left: 4px; }
.termin-objekt strong { display: block; font-size: 16px; }
.termin-objekt span { display: block; font-size: 14px; color: var(--muted); }
.termin-nr { font-size: 14px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.termin-text { font-size: 14px; margin-top: 2px; white-space: pre-line; }
.termin-status { margin-top: 2px; }
.termin .auftrag-hinweis { margin: 8px 0 0; }
.termin-navi { margin-top: 8px; }
.termin-ziel { margin: 4px 0 0; }
.termin.abgesagt { border-left-color: var(--danger); background: #fdf2f2; }
.termin.abgesagt .termin-zeit, .termin.abgesagt .termin-objekt, .termin.abgesagt .termin-nr, .termin.abgesagt .termin-text { text-decoration: line-through; color: #8a6d6d; }
.termin-abgesagt { font-weight: 700; color: var(--danger); font-size: 13px; letter-spacing: .03em; margin-bottom: 4px; }
.termin.abwesenheit { border-left-color: #b58900; background: #fffaf0; }
.termin.abwesenheit strong { display: block; }
.termin.abwesenheit span { font-size: 14px; color: var(--muted); }
#export-card { margin-top: 16px; }
#btn-export-teilen { margin-top: 8px; }
#export-link { display: inline-block; margin-top: 4px; }
#export-link[hidden] { display: none; }
#export-status { margin-top: 8px; }
/* Abmelden */
.ab-knoepfe { flex-direction: column; align-items: stretch; }
.ab-knoepfe .btn { width: 100%; }
.btn.danger-btn { background: var(--danger); color: #fff; }
#export-monat { -webkit-appearance: menulist; appearance: auto; }

/* Horn-KDB: Zeitnachweis je Monteur und Tag */
.zeit-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.zeit-row { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 4px; }
.zeit-row .row > label.w-datum { flex: 0 0 150px; }

/* Urlaubskonten (ERP g2-personal-8b): je Jahr ein Kästchen */
.urlaub-konto { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.urlaub-konto-titel { font-weight: 600; margin-bottom: 4px; }
.urlaub-konto dl { margin: 0; }
.urlaub-konto dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 15px; }
.urlaub-konto dt { color: var(--muted); }
.urlaub-konto dd { margin: 0; font-variant-numeric: tabular-nums; }
.urlaub-konto dl > div.rest { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.urlaub-konto dl > div.rest dt { color: var(--text); }
.urlaub-offline { color: #92400e; }

/* Simulation 28.09.2026: nach der Abgabe geändert - der Hinweis bleibt oben stehen, solange er gilt. */
.nachtrag-hinweis { position: sticky; top: calc(env(safe-area-inset-top) + 60px); z-index: 5; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.nachtrag-hinweis strong { font-size: 14px; }

/* Auftragsliste: Filter alle / Reflex / Horn (Simulation 28.09.2026) */
.seg.pds-typ { margin-top: 10px; }

/* Einheiten neben den Wertfeldern der Checklisten (Simulation 28.09.2026); das Feld bleibt Text. */
.wert-mit-einheit { display: flex; align-items: center; gap: 8px; }
.wert-mit-einheit input { flex: 1; min-width: 0; }
.wert-mit-einheit .unit, .check-row.static .unit { flex: 0 0 auto; min-width: 26px; color: var(--muted); font-size: 14px; }
.check-row.static .unit { margin-right: 4px; }

/* Berichtsliste: Schilder in eigener Zeile, jedes am Stück (Simulation 28.09.2026) */
.cards .open .badges { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.cards .open .badges .badge { margin-left: 0; white-space: nowrap; font-style: normal; background: #eef6ea; border-radius: 6px; padding: 1px 6px; }
.cards .open .badges .badge.horn { background: #fbecef; }
#abgegeben-list li { opacity: .85; }

/* Urlaub: Anträge wie die Kontokästchen, nicht als Karte in der Karte (Simulation 28.09.2026) */
.urlaub-liste { list-style: none; margin: 8px 0 0; padding: 0; }
.urlaub-antrag { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; }
.urlaub-antrag .link-btn { padding-left: 0; }
/* Rückmeldung: der Melden-Knopf füllt die Fußleiste, „Abbrechen“ steht nur oben */
#rm-modal .modal-foot .btn { flex: 1; }
/* Unterschrift im Hochformat: eine Fläche von gut einem Drittel des Schirms statt des ganzen */
@media (orientation: portrait) {
  #sig-modal { justify-content: flex-start; }
  #sig-modal .sig-canvas-wrap { flex: 0 0 38vh; }
  #sig-modal .modal-foot { border-bottom: 1px solid var(--border); }
  #sig-modal .modal-foot .muted { font-size: 15px; color: var(--text); }
}

/* ---------- Reiter unten für gekoppelte Geräte (Owner 28.09.2026) ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -1px 4px rgba(0,0,0,.05); }
.tabbar button { flex: 1; min-width: 0; min-height: 58px; padding: 7px 2px 6px; background: none; border: 0; font: inherit; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.aktiv { color: var(--blue); font-weight: 600; }
body.mit-tabbar .view { padding-bottom: calc(env(safe-area-inset-bottom) + 84px); }
body.mit-tabbar .update-banner { bottom: calc(env(safe-area-inset-bottom) + 70px); }
/* Meine Aufträge */
#meine-auftraege { border-left: 4px solid var(--blue); }
.auftraege-kurz li { box-shadow: none; border: 1px solid var(--border); }
.auftraege-kurz .open { padding: 10px 12px; }
#btn-auftraege-laden { padding-left: 0; }
/* Kalender: Monat und Woche */
.kal-modus { margin-bottom: 10px; }
.termine-nav .btn { min-width: 48px; font-size: 20px; }
.kal-raster { margin: 10px 0 4px; }
.kal-kopfzeile, .kal-zeilen { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.kal-kopfzeile span { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 4px; }
.kal-tag { position: relative; min-height: 48px; padding: 4px 0; border: 0; border-radius: 8px; background: #f6f7f9; font: inherit; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.kal-tag .nr { font-size: 15px; line-height: 26px; min-width: 26px; text-align: center; border-radius: 13px; }
.kal-tag.fremd { background: none; color: #b0b5bf; }
.kal-tag.heute .nr { background: var(--green); color: #fff; font-weight: 700; }
.kal-tag.gewaehlt { box-shadow: inset 0 0 0 2px var(--blue); background: #e8edf5; }
.kal-tag.abwesend { background: #fff6e0; }
.kal-punkte { display: flex; gap: 3px; min-height: 6px; }
.kal-punkt { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.kal-punkt.abgesagt { background: var(--danger); opacity: .6; }
.kal-punkt.abw { background: #b58900; }
.kal-woche .kal-tag { min-height: 118px; justify-content: flex-start; }
.kal-tag .kal-wt { font-size: 11px; color: var(--muted); }
.kal-zeit { font-size: 11px; font-weight: 600; color: #fff; background: var(--blue); border-radius: 4px; padding: 1px 3px; font-variant-numeric: tabular-nums; }
.kal-zeit.abgesagt { background: var(--danger); text-decoration: line-through; opacity: .7; }
.kal-mehr { font-size: 11px; color: var(--muted); }
.kal-abw { font-size: 10px; color: #92400e; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.termin-auftrag { margin-top: 8px; }
#meine-auftraege { margin-top: 12px; }
/* Der Strich-Knopf braucht rechts seinen Platz auch in den Wertzeilen der Checkliste: „.check-row.static“
   setzte das Padding auf 0, und der Knopf lag über der Einheit (Simulation 28.09.2026: „bar“ fehlte). */
.check-row.static.pf { padding-right: 38px; }
