/* Baustellen-System Maler (Thomas Jung): nur Ergänzungen zu demo/metall/app.css und metall.css, Grundlage demo/muellerbau/ */
.c-zitat { background: var(--bg-4); border-left: 3px solid var(--violet); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.55; color: var(--ink); }
.c-zahl { width: 64px; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 6px; font: inherit; }
.c-neu td { background: #F6F1FE; }
.c-fragen { display: grid; gap: 8px; }
.c-fragen .p-knopf { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; line-height: 1.35; }
.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Sprachnachricht */
.b-sprach { display: flex; align-items: center; gap: 10px; background: var(--bg-4); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.b-sprach svg { width: 18px; height: 18px; color: var(--violet); flex: none; }
.b-welle { flex: 1; min-width: 70px; height: 16px; background: repeating-linear-gradient(90deg, #B9AECE 0 2px, transparent 2px 5px); border-radius: 3px; opacity: .8; }

/* Mail-Vorschau */
.m-mail { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.m-mail-kopf { background: var(--bg-4); padding: 10px 14px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; border-bottom: 1px solid var(--line); }
.m-mail-kopf b { color: var(--ink); font-size: 14px; }
.m-mail-koerper { padding: 14px; font-size: 13.8px; line-height: 1.6; }
.m-mail-koerper p { margin: 0 0 10px; }
.m-mail-koerper p:last-child { margin-bottom: 0; }

/* Handy-Rahmen mit Chat (wie demo/bau) */
.ph { max-width: 340px; margin: 0 auto; border: 1px solid var(--line-2); border-radius: 26px; overflow: hidden; background: #EFEAE2; box-shadow: 0 10px 28px rgba(21, 16, 28, .08); }
.ph-kopf { display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.ph-kopf svg { width: 18px; height: 18px; color: #148A4E; }
.ph-kopf b { display: block; font-size: 13.5px; }
.ph-kopf small { display: block; color: var(--muted-2); font-size: 11.5px; }
.ph-chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 260px; }
.ph-blase { max-width: 88%; padding: 8px 10px; border-radius: 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.ph-blase.ph-neu { animation: t-rein .25s ease-out; }
.ph-ma { align-self: flex-end; background: #D9FDD3; border-bottom-right-radius: 4px; }
.ph-ki { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.ph-wer { display: block; font-size: 11px; color: var(--violet); margin-bottom: 2px; }
.ph-ma .ph-wer { color: #148A4E; }
.ph-trans { display: block; margin-top: 6px; color: var(--ink); font-size: 12.3px; }
.ph-trans svg { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; margin-right: 3px; }
@keyframes t-rein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Aufmaßzettel (Foto) */
.au-foto { display: grid; gap: 8px; }
.au-foto-kopf { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-2); }
.au-foto-kopf svg { width: 15px; height: 15px; }
.au-zettel {
  position: relative; background-color: #FFFEF6;
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, #DDE6F4 25px 26px);
  border: 1px solid #E6DFC8; border-radius: 6px; padding: 10px 14px 12px 40px; color: #1F3D8C;
  font-style: italic; font-size: 14px; line-height: 26px; transform: rotate(-.5deg);
  box-shadow: 0 8px 22px rgba(21, 16, 28, .09); overflow-wrap: anywhere;
}
.au-zettel::before { content: ""; position: absolute; left: 28px; top: 0; bottom: 0; width: 1px; background: #F1B9C7; }
.au-zettel b { font-weight: 700; color: #142E6B; }
.au-zettel .au-zeile { display: block; }
.au-zettel .au-rot { color: #B4232F; }
.au-zettel .au-unklar { background: rgba(250, 204, 21, .45); border-radius: 3px; padding: 0 2px; text-shadow: 0 0 1.2px rgba(31, 61, 140, .7); }
.au-zettel svg { width: 100%; max-width: 250px; height: auto; margin: 4px 0 2px; }

/* Rückfrage bei unsicherem Maß */
.au-frage { border: 1px solid #F3D58A; background: #FFF8E6; border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.au-frage b { color: var(--ink); }
.au-frage .p-knoepfe { margin: 0; }
.au-frage--ok { border-color: #BFE6CD; background: var(--gruen-bg); }

/* Aufmaßblatt und Rechenweg */
.au-weg { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.au-weg .ab { color: var(--rot-text); font-weight: 700; }
.au-weg .ue { color: var(--gruen-text); font-weight: 700; }
.au-weg .neu { background: var(--markiert); border-radius: 3px; padding: 0 2px; color: var(--ink); }
.au-plus { color: var(--gelb-text); font-weight: 700; }
.au-minus { color: var(--violett-text); font-weight: 700; }
.au-lv { display: block; font-size: 11.5px; color: var(--muted-2); font-weight: 400; }
.au-raster { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); align-items: start; }
.au-tab td { vertical-align: top; }
@media (max-width: 1180px) { .au-raster { grid-template-columns: minmax(0, 1fr); } }

/* Schlussrechnung als Blatt */
.sr-blatt { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 22px 24px 20px; color: #1f2430; font-size: 13px; line-height: 1.5; }
.sr-kopf { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 3px solid #2F4858; }
.sr-firma { display: flex; gap: 10px; align-items: center; }
.sr-zeichen { width: 40px; height: 40px; border-radius: 8px; background: #2F4858; color: #fff; display: grid; place-items: center; font-weight: 700; letter-spacing: .04em; flex: none; }
.sr-firma b { display: block; font-size: 15.5px; color: #2F4858; }
.sr-firma small { display: block; font-size: 11.5px; color: #6b7280; }
.sr-meta { display: grid; grid-template-columns: auto auto; gap: 1px 12px; margin: 0; font-size: 12px; }
.sr-meta dt { color: #6b7280; }
.sr-meta dd { margin: 0; font-weight: 700; text-align: right; }
.sr-an { margin: 12px 0 6px; font-size: 12.5px; color: #374151; }
.sr-blatt h3 { font-family: var(--font-display); font-size: 17px; color: #2F4858; margin: 6px 0 2px; }
.sr-tab { width: 100%; border-collapse: collapse; margin: 10px 0 8px; font-size: 12.3px; }
.sr-tab th { text-align: left; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: #6b7280; border-bottom: 1px solid #d6dbe1; padding: 5px 6px; }
.sr-tab td { border-bottom: 1px solid #edf0f3; padding: 6px; vertical-align: top; }
.sr-tab td small { display: block; color: #6b7280; font-size: 11px; }
.sr-tab th.r, .sr-tab td.r { text-align: right; }
.sr-summen { margin-left: auto; width: min(100%, 340px); border-collapse: collapse; font-size: 12.8px; }
.sr-summen td { padding: 3px 6px; }
.sr-summen td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-summen tr.sr-zahl td { border-top: 2px solid #2F4858; font-weight: 700; font-size: 14px; padding-top: 6px; }
.sr-hinweis { margin-top: 10px; padding: 8px 10px; background: #F4F6F8; border-radius: 6px; font-size: 11.8px; color: #374151; }
.sr-format { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 13px; color: var(--ink-2); background: var(--bg-3); }
.sr-format .p-icon { width: 16px; height: 16px; color: var(--violet); flex: none; margin-top: 2px; }
.sr-reiter { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sr-reiter > span { font-size: 12.5px; color: var(--muted-2); }

/* Dokument-Blatt (Rapport, Regiezettel, Schadenbericht) */
.dk { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 13.2px; line-height: 1.5; }
.dk-kopf { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid #2F4858; padding-bottom: 8px; margin-bottom: 8px; }
.dk-kopf b { font-family: var(--font-display); font-size: 15px; color: #2F4858; }
.dk-kopf small { color: var(--muted-2); font-size: 12px; }
.dk dl { margin: 0; display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 5px 12px; }
.dk dt { color: var(--muted); font-size: 12.5px; }
.dk dd { margin: 0; color: var(--ink); }
.dk-quelle { margin-top: 8px; font-size: 11.8px; color: var(--muted-2); display: flex; gap: 6px; align-items: center; }
.dk-quelle svg { width: 13px; height: 13px; }

/* Unterschrift per Link */
.us { border: 1px solid var(--line-2); border-radius: 16px; padding: 14px; background: #fff; max-width: 320px; margin: 10px auto 0; box-shadow: 0 10px 24px rgba(21, 16, 28, .08); }
.us-kopf { font-size: 11.5px; color: var(--muted-2); margin-bottom: 6px; }
.us b { display: block; font-size: 14px; }
.us p { margin: 6px 0 10px; font-size: 13px; color: var(--ink-2); }
.us-feld { height: 56px; border: 1px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; color: var(--muted-2); font-size: 12px; margin-bottom: 10px; }
.us-feld svg { width: 120px; height: 40px; color: #1F3D8C; }

/* Beleg-Prüfung */
.bl-ok { color: var(--gruen-text); font-weight: 700; }
.bl-ab { color: var(--rot-text); font-weight: 700; }
.bl-tab td small { display: block; color: var(--muted-2); font-size: 11.5px; }
.xml { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.3px; background: #1E1B26; color: #E6E1F0; border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre; line-height: 1.55; margin: 0; }
.xml i { font-style: normal; color: #F5A3CF; }
.xml u { text-decoration: none; color: #9FE3B4; }
.bl-lesbar { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 13px; }
.bl-lesbar b { display: block; }

/* Fotos (Versicherungsfall) */
.fo-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fo { aspect-ratio: 4 / 3; border-radius: 8px; background: linear-gradient(135deg, #CFC6DB, #EEEAF4); display: flex; align-items: flex-end; padding: 4px 6px; font-size: 10.5px; line-height: 1.2; color: var(--ink-2); overflow: hidden; }
.fo--nass { background: linear-gradient(135deg, #9DB8D9, #DCE7F4); }
.fo--neu { background: linear-gradient(135deg, #CFE8D7, #F0F8F2); }

/* Baustellen-Stand */
.st-tab td { vertical-align: middle; }
.st-tab td b { display: block; }
.st-tab td small { color: var(--muted-2); font-size: 11.8px; }

/* Wo war ich */
.ww { display: grid; gap: 10px; }
.ww-zeit { font-size: 12px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.ww-zeit svg { width: 14px; height: 14px; }
.ww-text { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.ww-text b { color: var(--ink); }

@media (max-width: 640px) {
  .sr-blatt { padding: 16px 14px; }
  .sr-tab { font-size: 11.6px; }
  .fo-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .au-zettel { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .ph-blase { animation: none; } }

/* Kette auf der Übersicht */
.kt { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
.kt-glied { position: relative; display: grid; gap: 3px; justify-items: start; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; color: var(--ink); text-decoration: none; }
.kt-glied:hover { border-color: var(--violet); }
.kt-glied .p-icon { width: 20px; height: 20px; color: var(--violet); }
.kt-glied b { font-size: 14.5px; }
.kt-glied small { color: var(--muted); font-size: 12.3px; line-height: 1.35; }
.kt-glied:not(:last-child)::after { content: "→"; position: absolute; right: -19px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 16px; }
@media (max-width: 900px) { .kt { grid-template-columns: 1fr; gap: 10px; } .kt-glied:not(:last-child)::after { content: none; } }

/* Soll-Ist-Balken */
.sb { display: block; min-width: 90px; height: 8px; border-radius: 99px; background: var(--bg-4); overflow: hidden; }
.sb i { display: block; height: 100%; border-radius: 99px; background: #2FA86A; }
.sb--gelb i { background: #E2A72E; }
.sb--rot i { background: #D8434F; }
.au-rotz { color: var(--rot-text); font-weight: 700; }
.au-gruenz { color: var(--gruen-text); font-weight: 700; }

/* Handy: Zeit buchen */
.ph-kopf--wa { background: #0F5C4A; border-bottom: 0; color: #fff; }
.ph-kopf--wa svg, .ph-kopf--wa small { color: #D6F2E4; }
.wa-chat { height: 400px; overflow-y: auto; overscroll-behavior: contain; }
.wa-z { display: block; margin: 6px 0; padding-left: 9px; border-left: 3px solid #148A4E; }
.wa-z b, .wa-z small { display: block; }
.wa-z small { color: var(--muted); font-size: 12px; }
.wa-kn { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.wa-kn--liste { display: grid; grid-template-columns: 1fr 1fr; }
.wa-kn button { border: 1px solid #C9D8D2; border-radius: 12px; background: #fff; color: #0F6B3D; font: inherit; font-size: 13px; font-weight: 700; padding: 10px 13px; min-height: 40px; cursor: pointer; }
.wa-kn button:hover { background: #E5F7EC; }
.wa-tippt { color: var(--muted); font-style: italic; }
.wa-ein { display: flex; gap: 8px; padding: 10px; background: #F4F1EC; }
.wa-ein input { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 99px; padding: 10px 14px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.wa-ein button { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #148A4E; color: #fff; display: grid; place-items: center; cursor: pointer; }
.wa-ein svg { width: 18px; height: 18px; }
.wa-bsp { max-width: 340px; margin: 12px auto 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wa-bsp span { flex: 1 1 100%; }
.wa-bsp button { border: 1px solid var(--line-2); border-radius: 99px; background: #fff; font: inherit; font-size: 12.5px; padding: 8px 12px; color: var(--ink); cursor: pointer; }
.wa-kn button:focus-visible, .wa-ein button:focus-visible, .wa-ein input:focus-visible, .wa-bsp button:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Buchungen im Büro */
.bu { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bu li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.bu .p-icon { width: 16px; height: 16px; color: #148A4E; }
.bu b { display: block; font-size: 13.8px; }
.bu small { color: var(--muted); font-size: 12px; }
.bu em { font-style: normal; font-weight: 700; white-space: nowrap; }
.wz-fehlt { color: var(--rot-text); font-weight: 700; }
.wz td small { display: block; color: var(--muted-2); font-size: 11.5px; }

/* Eigener Raum */
.eig { display: flex; flex-wrap: wrap; gap: 12px; }
.eig label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.eig .c-zahl { width: 84px; padding: 8px; font-size: 15px; color: var(--ink); }
.eig-erg { margin: 10px 0 0; font-size: 14px; }

/* v3: Baustelle Lang (01.12.2026) */
.la-schritt { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.la-schritt .p-icon { width: 17px; height: 17px; color: var(--violet); }
.la-scroll { max-height: 420px; overflow-y: auto; }
.la-status { align-items: center; margin-bottom: 12px; }
.la-hin { display: grid; gap: 10px; }
.la-hinweis { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start; border: 1px solid #F3D58A; background: #FFFBF0; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.la-hinweis > .p-icon { width: 18px; height: 18px; color: #B7791F; margin-top: 1px; }
.la-hinweis b { display: block; color: var(--ink); font-size: 14px; }
.la-hinweis.la-ok { border-color: #BFE6CD; background: var(--gruen-bg); }
.la-hinweis.la-ok > .p-icon { color: #148A4E; }
.la-kn { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nk { font-size: 12.8px; }
.nk th, .nk td { padding-left: 7px; padding-right: 7px; }
.nk td:first-child { min-width: 230px; line-height: 1.35; }
.nk tr.nk-z td { background: #FFF6B8; }
.nk td.nk-neu, .nk tr.nk-z td.nk-neu { background: #CFF3DB; font-weight: 700; }
.nk-sum td { border-top: 2px solid var(--line-2); background: var(--bg-4); }
.wa-z--zusatz { border-left-color: #E2A72E; }
.wa-hin { display: block; margin: 6px 0; font-size: 12.3px; color: #8A5A00; }
.bu li.bu-z { border-color: #F3D58A; background: #FFFBF0; }
.bu li.bu-z .p-icon { color: #B7791F; }
@media (max-width: 640px) { .la-hinweis { grid-template-columns: 20px minmax(0, 1fr); } .la-kn { grid-column: 2; justify-content: flex-start; } }
.p-tabelle th.r, .p-tabelle td.r { text-align: right; }
.st-tab td, .nk td { vertical-align: middle; }
