:root {
  --blau: #1f2bb8;
  --blau-hell: #e9ebfb;
  --text: #1d2130;
  --grau: #646b80;
  --linie: #dde0e8;
  --hinter: #f3f4f8;
  --karte: #fff;
  --rot: #b42318;
  --gruen: #18794e;
  --gelb: #fff6d6;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--hinter); }
a { color: var(--blau); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 6px; }
.klein { font-size: 12px; color: var(--grau); }
.r { text-align: right; }
.laden { color: var(--grau); padding: 40px; text-align: center; }

/* Kopfleiste */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.marke img { height: 42px; width: auto; display: block; }
.kopf nav { display: flex; flex: 1; gap: 2px; align-items: center; margin-left: 24px; min-width: 0; }
.kopf nav a:not(.knopf) { padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--text); white-space: nowrap; }
.kopf nav a:not(.knopf):hover { background: #eef0f7; }
.kopf nav a.aktiv, .kopf nav a.aktiv:hover { background: var(--blau-hell); color: var(--blau); font-weight: 600; }
/* Menügruppen: am PC zum Aufklappen, schmal als Liste mit Überschriften */
.nav-gruppe { position: relative; }
.nav-knopf { display: inline-flex; align-items: center; gap: 5px; min-height: 0; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); white-space: nowrap; }
.nav-knopf::after { content: '▾'; color: var(--grau); font-size: 11px; }
.nav-knopf:hover, .nav-gruppe.offen > .nav-knopf { background: #eef0f7; }
.nav-gruppe.aktiv > .nav-knopf { background: var(--blau-hell); color: var(--blau); font-weight: 600; }
.nav-liste { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; flex-direction: column; gap: 1px; min-width: 220px; padding: 6px; background: #fff;
  border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
.nav-gruppe.offen > .nav-liste { display: flex; }
.kopf nav .nav-liste a { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav-gruppe.einzeln > .nav-knopf { display: none; }
.nav-gruppe.einzeln > .nav-liste { display: block; position: static; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.nav-ich { margin-left: auto; }
.nav-ich > .nav-liste { left: auto; right: 0; }
.nav-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blau); color: #fff; font-size: 11px; font-weight: 600; }
@media (min-width: 901px) and (max-width: 1100px) { #nav-name { display: none; } }
/* Leiste unten am Handy (siehe unten bei max-width: 700px) */
:root { --unten: 0px; }
.unten { display: none; }
/* Menü-Knopf (drei Striche) für Handy und Tablet */
.menue-knopf { display: none; flex-direction: column; justify-content: space-between; width: 44px; height: 44px; padding: 11px 10px; border-radius: 8px; flex-shrink: 0; }
.menue-knopf span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menue-offen .menue-knopf span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menue-offen .menue-knopf span:nth-child(2) { opacity: 0; }
.menue-offen .menue-knopf span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Startseite */
.start-kopf { display: flex; align-items: center; gap: 28px; padding: 12px 4px 22px; }
.start-logo { width: 240px; max-width: 42vw; height: auto; flex-shrink: 0; }
.start-logo-spalte { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
/* Zwei-Faktor einrichten am Handy: Schlüssel groß zum Kopieren (web/app.js) */
.zf-schluessel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 10px; background: #f6f7fb; border-radius: 8px; }
.zf-schluessel b { font: 15px/1.4 monospace; letter-spacing: 1px; overflow-wrap: anywhere; user-select: all; }
/* Face ID / Passkey (web/app.js, passkey.js) */
.passkey-knopf { width: 100%; min-height: 44px; font-size: 16px; }
.anmelde-oder { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; color: var(--grau); font-size: 13px; }
.anmelde-oder::before, .anmelde-oder::after { content: ''; flex: 1; border-top: 1px solid #dde1ea; }
.zf-face { margin: 6px 0 12px; padding: 10px 12px; background: #f6f7fb; border-radius: 8px; }
.zf-face p { margin: 0 0 8px; }
.zf-app > summary { cursor: pointer; margin: 6px 0; font-weight: 600; }
.zf-titel { margin: 12px 0 6px; }
.pk-liste { list-style: none; margin: 0 0 8px; padding: 0; }
.pk-liste li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eceff5; }
/* Pinnwand mit Klebezetteln (web/start.js, zettel.js): am PC rechts neben den Kacheln, auf dem Handy darüber */
.start-flaeche { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.pinnwand { background: #d8b98e; border-radius: 12px; padding: 12px 12px 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), inset 0 2px 8px rgba(0, 0, 0, 0.08); }
.pinnwand-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pinnwand-kopf h2 { margin: 0; font-size: 16px; color: #4a3520; }
.pinnwand-leer { color: #4a3520; padding: 8px 2px; }
.zettel { position: relative; margin: 14px 4px 16px; padding: 14px 14px 10px; border-radius: 2px; color: #2a2a2a; transform: rotate(var(--dreh, 0deg));
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15); }
.zettel.gelb, .zettel-farbe.gelb { background: #fff59d; }
.zettel.rosa, .zettel-farbe.rosa { background: #f8bbd0; }
.zettel.gruen, .zettel-farbe.gruen { background: #c5e1a5; }
.zettel.blau, .zettel-farbe.blau { background: #b3e5fc; }
.zettel.neu { outline: 3px solid var(--rot); outline-offset: 2px; }
.zettel-text { font: 16px/1.35 'Segoe Print', 'Bradley Hand', 'Chalkboard SE', 'Comic Sans MS', cursive; overflow-wrap: anywhere; }
.zettel-fuss { margin-top: 8px; font-size: 11px; color: rgba(0, 0, 0, 0.6); }
.zettel-pin { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-size: 20px; }
.zettel-weg { position: absolute; top: 2px; right: 2px; min-height: 0; padding: 2px 7px; border: none; background: transparent; color: #2a2a2a; opacity: 0.4; cursor: pointer; }
.zettel-weg:hover { opacity: 1; }
.zettel [data-gelesen] { margin-top: 8px; background: rgba(255, 255, 255, 0.7); }
.zettel-ok { margin-top: 6px; font-size: 12px; color: var(--gruen); }
.zettel-stand { display: block; margin-top: 4px; padding: 0; min-height: 0; border: none; background: none; font-size: 11px; color: rgba(0, 0, 0, 0.65); text-decoration: underline dotted; cursor: help; }
.zettel-farben { display: flex; gap: 8px; }
.zettel-farbe { width: 36px; height: 36px; min-height: 0; padding: 0; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
.zettel-farbe.gewaehlt { border-color: var(--text); }
.zettel-personen { max-height: 30vh; overflow: auto; margin: -4px 0 8px; }
@media (max-width: 1100px) {
  .start-flaeche { grid-template-columns: minmax(0, 1fr); }
  .pinnwand { order: -1; }
  .zettel-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 10px; }
}
/* Handy: Zettel nebeneinander zum Wischen – die Kacheln bleiben oben sichtbar */
@media (max-width: 700px) {
  .zettel-liste { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 2px; }
  .zettel { flex: 0 0 78%; scroll-snap-align: start; margin: 14px 0 12px; }
}
/* Schalter „KI (Claude)“ unter dem Logo (nur Administratoren) */
.start-ki { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px; background: #eef0f6; border: 1px solid var(--linie); font-size: 13px; max-width: 100%; }
.start-ki.an { background: #e6f6ee; border-color: #b9e3cc; }
.start-ki a { color: var(--text); text-decoration: none; display: flex; flex-direction: column; line-height: 1.25; }
.start-ki a span { color: var(--grau); font-size: 12px; }
.schalter { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.schalter input { position: absolute; opacity: 0; width: 0; height: 0; }
.schalter .schieber { position: absolute; inset: 0; background: #c6cad6; border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.schalter .schieber::before { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.schalter input:checked + .schieber { background: var(--gruen); }
.schalter input:checked + .schieber::before { transform: translateX(20px); }
.schalter input:focus-visible + .schieber { outline: 2px solid var(--blau); outline-offset: 2px; }
.start-gruss h1 { font-size: 28px; }
.start-gruss p { margin: 4px 0 0; color: var(--grau); font-size: 15px; }
.start-hinweise { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.start-hinweis { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; text-decoration: none; font-weight: 600; border: 1px solid; }
a.start-hinweis::after { content: '→'; }
.start-hinweis.rot { color: var(--rot); background: #fff1f1; border-color: #f0b4b4; }
.start-hinweis.orange { color: #8a4b00; background: #fff6e8; border-color: #f1c98c; }
.start-hinweis.gruen { color: #14632e; background: #eefaf1; border-color: #a6d9b5; font-weight: 500; }
.start-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.start-gruppe { grid-column: 1 / -1; margin: 8px 0 -4px; color: var(--grau); font-size: 13px; font-weight: 600; }
.start-kachel { display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 18px; background: #fff; border: 1px solid var(--linie); border-radius: 12px;
  text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s, border-color .15s; }
.start-kachel:hover { border-color: #0b03cf; box-shadow: 0 4px 16px rgba(11, 3, 207, .12); transform: translateY(-1px); }
.start-symbol { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; background: #0b03cf; color: #fff; }
.start-symbol svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.start-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.start-text b { font-size: 16px; }
.start-text span { font-size: 13px; color: var(--grau); }
.start-demnaechst ul { list-style: none; margin: 0; padding: 0; }
.start-demnaechst li a { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 4px; border-top: 1px solid #f0f1f5; text-decoration: none; color: var(--text); }
.start-demnaechst li:first-child a { border-top: none; }
.start-demnaechst li a:hover { background: var(--hinter); }
.start-zeit { color: var(--grau); font-size: 13px; }
.start-titel.frist { color: #8c1d1d; }
.start-projekt { font-size: 12px; color: var(--grau); }

.start-hinweis.blau { color: var(--blau); background: var(--blau-hell); border-color: #b9bff3; }

/* Chat */
main.chat-ansicht { padding-bottom: 12px; }
.chat-seite { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; height: calc(100vh - 100px); height: calc(100dvh - 100px); min-height: 420px; }
.chat-liste, .chat-verlauf { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); min-height: 0; display: flex; flex-direction: column; }
.chat-liste-kopf { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.ch-push { padding: 0 14px 8px; }
.ch-push p { margin: 0; }
.ch-push-an { width: 100%; background: var(--blau-hell); border-color: #b9bff3; color: var(--blau); font-weight: 600; }
.ch-klein { padding: 2px 8px; font-size: 12px; }
.ch-kanaele { overflow-y: auto; flex: 1; padding: 0 6px 8px; }
.ch-gruppe { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--grau); padding: 12px 8px 4px; }
.ch-kanal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); position: relative; }
.ch-kanal:hover { background: var(--hinter); }
.ch-kanal.aktiv { background: var(--blau-hell); }
.ch-kanal.neu .ch-titel { font-weight: 700; }
.ch-titel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-zeit { font-size: 11px; color: var(--grau); }
.ch-vorschau { grid-column: 1; font-size: 12px; color: var(--grau); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-kanal .zaehler { grid-column: 2; grid-row: 2; justify-self: end; }
.chat-leer { color: var(--grau); text-align: center; margin: auto; padding: 30px; }
.ch-kopf { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--linie); }
.ch-kopf b { font-size: 16px; }
.ch-zurueck { display: none; text-decoration: none; font-size: 26px; line-height: 1; padding: 0 6px; color: var(--blau); }
.ch-nachrichten { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--hinter); }
.ch-mehr { align-self: center; margin-bottom: 8px; font-size: 13px; }
.ch-tag { display: flex; justify-content: center; margin: 10px 0 6px; }
.ch-tag span { font-size: 12px; color: var(--grau); background: #fff; border: 1px solid var(--linie); border-radius: 10px; padding: 2px 10px; }
.cn { align-self: flex-start; max-width: min(78%, 620px); padding: 7px 11px 5px; background: #fff; border: 1px solid var(--linie); border-radius: 14px 14px 14px 4px; overflow-wrap: anywhere; }
.cn.eigen { align-self: flex-end; background: #e3e6fc; border-color: #c9cef6; border-radius: 14px 14px 4px 14px; }
.cn.folge { margin-top: -1px; }
.cn.geloescht { color: var(--grau); font-size: 13px; }
.cn-kopf { font-size: 12px; color: var(--grau); margin-bottom: 2px; }
.cn-kopf b { color: var(--blau); }
.cn.eigen .cn-kopf b { color: var(--text); }
.cn-text { line-height: 1.4; }
.cn-erwaehnt { color: var(--blau); font-weight: 600; }
.cn-erwaehnt.ich { background: #fff3c4; border-radius: 4px; padding: 0 2px; }
.cn-bilder { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cn-bilder img { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; object-fit: cover; }
.cn-datei { display: flex; gap: 6px; align-items: baseline; margin-top: 4px; padding: 6px 8px; background: rgba(0, 0, 0, .04); border-radius: 6px; text-decoration: none; }
.cn-datei span { font-size: 11px; color: var(--grau); }
.cn-fuss { display: flex; justify-content: flex-end; gap: 6px; align-items: center; font-size: 11px; color: var(--grau); min-height: 4px; }
.cn-fuss button { padding: 0 5px; font-size: 12px; min-height: 0; border-color: transparent; background: transparent; color: var(--grau); }
.cn-fuss button:hover { color: var(--rot); }
.ch-eingabe { position: relative; border-top: 1px solid var(--linie); padding: 8px 10px; }
.ch-zeile { display: flex; gap: 6px; align-items: flex-end; }
.ch-zeile textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; border-radius: 20px; padding: 9px 14px; }
.ch-plus { padding: 8px 10px; border-radius: 20px; font-size: 16px; line-height: 1; }
.ch-zeile .primaer { border-radius: 20px; }
.ch-anhaenge { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-anhaenge:not(:empty) { margin-bottom: 6px; }
.ch-anhang { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; background: var(--hinter); border-radius: 12px; padding: 3px 4px 3px 10px; }
.ch-anhang button { padding: 0 6px; border-color: transparent; background: transparent; min-height: 0; }
.ch-vorschlaege { position: absolute; bottom: 100%; left: 10px; display: flex; flex-direction: column; min-width: 220px; background: #fff; border: 1px solid var(--linie); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); overflow: hidden; }
.ch-vorschlaege button { border: none; border-radius: 0; text-align: left; padding: 9px 12px; }
.ch-vorschlaege button:hover { background: var(--blau-hell); }

/* Einladung */
dialog.einladung { width: min(440px, 94vw); }
.ei-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

main { max-width: 1280px; margin: 0 auto; padding: 20px 24px 120px; }

/* Knöpfe */
.knopf, button {
  font: inherit; cursor: pointer; border: 1px solid var(--linie); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 6px; text-decoration: none; display: inline-block; line-height: 1.3;
}
.knopf:hover, button:hover { border-color: #b8bdcc; }
.primaer { background: var(--blau); border-color: var(--blau); color: #fff; font-weight: 600; }
.primaer:hover { background: #1823a0; border-color: #1823a0; }
.gefahr { color: var(--rot); }
button:disabled { opacity: .5; cursor: default; }

/* Felder */
input, textarea, select {
  font: inherit; color: inherit; width: 100%; padding: 6px 8px;
  border: 1px solid var(--linie); border-radius: 5px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #b9bff3; border-color: var(--blau); }
textarea { resize: vertical; }
.feld { display: flex; flex-direction: column; gap: 3px; }
.feld > span { font-size: 12px; color: var(--grau); }
.breit { grid-column: 1 / -1; }
.raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; }
.raster .s2 { grid-column: span 2; }
.raster .s3 { grid-column: span 3; }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.zwei > .karte { margin-bottom: 0; }
.zwei + * { margin-top: 16px; }

/* Leisten */
.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.titelzeile .knoepfe { display: flex; gap: 8px; }
.id { color: var(--grau); font-weight: 400; font-size: 14px; margin-left: 6px; }
.filter { display: flex; gap: 8px; margin-bottom: 12px; }
.filter input { max-width: 420px; }
.filter select { width: auto; }

/* Archivliste */
table.liste { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--linie); background: #fafbfd; }
.liste td { padding: 9px 10px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
.liste tbody tr { cursor: pointer; }
.liste tbody tr:hover { background: #f7f8fe; }
.liste .unter { color: var(--grau); font-size: 12px; }
.liste .r { white-space: nowrap; }
.leer { text-align: center; color: var(--grau); padding: 40px !important; cursor: default; }
.summenzeile { display: flex; justify-content: flex-end; gap: 24px; padding: 10px 4px; color: var(--grau); }
.summenzeile b { color: var(--text); }

.chip { display: inline-block; font-size: 12px; padding: 2px 7px; margin: 1px 3px 1px 0; border-radius: 10px; text-decoration: none; border: 1px solid; white-space: nowrap; }
.chip.angebot { color: #6b4a00; border-color: #e9cf8a; background: #fff8e6; }
.chip.ab { color: #4b2a8a; border-color: #cbb9ef; background: #f5f0ff; }
.chip.lieferschein { color: #155e75; border-color: #a5d8e6; background: #eefaff; }
.chip.rechnung { color: var(--blau); border-color: #b9bff3; background: var(--blau-hell); }
.status { font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.status.offen { background: #fdecea; color: var(--rot); }
.status.bezahlt { background: #e6f6ee; color: var(--gruen); }
.status.arbeit { background: #f0f1f5; color: var(--grau); }

/* Hinweise */
.hinweis { background: var(--gelb); border: 1px solid #f1dc94; border-radius: var(--radius); padding: 9px 14px; margin-bottom: 16px; }
.warnung { background: var(--gelb); border: 1px solid #f1dc94; border-radius: 6px; padding: 8px 10px; margin: 10px 0 0; }
.steuerwahl { display: flex; gap: 16px; padding: 6px 0; flex-wrap: wrap; }
.steuerwahl label, .haken { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.steuerwahl input, .haken input { width: auto; }

/* Positionstabelle */
table.pos { width: 100%; border-collapse: collapse; }
.pos th { font-size: 12px; color: var(--grau); font-weight: 600; text-align: left; padding: 4px 4px 6px; border-bottom: 1px solid var(--linie); }
.pos td { padding: 5px 4px; vertical-align: top; border-bottom: 1px solid #f0f1f5; }
.pos .c-pos { width: 70px; }
.pos .c-menge { width: 90px; }
.pos .c-einh { width: 80px; }
.pos .c-ep { width: 110px; }
.pos .c-gp { width: 120px; }
.pos .c-ls { width: 62px; }
.pos .f-bem { margin-top: 4px; min-height: 31px; height: 31px; resize: none; overflow: hidden; font-size: 13px; font-style: italic; }
.pos .f-notiz { margin-top: 4px; min-height: 31px; height: 31px; resize: none; overflow: hidden; font-size: 13px; background: #fffbe6; border-color: #f1dc94; }
.pos .ls-info { color: var(--blau); margin-top: 2px; }
.summen .ls-summe { display: block; margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--linie); color: var(--blau); }
.summen .ls-summe .gesamt { font-size: 14px; border-top-color: var(--blau); }

/* GAEB-Fenster im Vorgang, Anmeldung, Nutzeranzeige */
dialog.gross { width: min(1280px, 96vw); height: 92vh; padding: 14px 18px; background: var(--hinter); }
dialog.gross .lv th { top: 0; }
.dlg-gaeb-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dlg-gaeb-kopf h3 { margin: 0; font-size: 16px; }
#nutzer { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--linie); }
#nutzer select { margin: 4px 6px; padding: 4px 8px; font-size: 13px; }
.passwortschalter { margin-top: 14px; font-weight: 600; }
#nutzer a { color: var(--text); }
.anmeldung { display: flex; flex-direction: column; gap: 12px; }
.anmelde-logo { width: 100%; max-width: 300px; height: auto; margin: 0 auto 6px; display: block; }
.sprachwahl { text-align: center; margin: 14px 0 0; font-size: 13px; color: var(--grau); }
.sprachwahl a { color: var(--grau); }
.sprachwahl a.aktiv { color: var(--text); font-weight: 600; text-decoration: none; }
.anmeldung .hinweis { margin: 0; }
.anmelde-vergessen { margin: -6px 0 0; text-align: right; }

/* GAEB-Import */
.ablage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px;
  border: 2px dashed #c3c8d6; border-radius: var(--radius); cursor: pointer; text-align: center; background: #fafbfd; }
.ablage:hover, .ablage.ziehen { border-color: var(--blau); background: var(--blau-hell); }
#lv-liste tr { cursor: pointer; }
#lv-liste tr:hover { background: #f7f8fe; }
/* GAEB: geöffnetes LV in der Liste markieren; beim Wechsel springt die Seite zum LV, das kurz aufleuchtet */
#lv-liste tr.lv-aktiv, #lv-liste tr.lv-aktiv:hover { background: #e8eefc; box-shadow: inset 4px 0 0 var(--blau); }
#lv-liste tr.lv-aktiv td:first-child b::after { content: '✓ geöffnet'; margin-left: 8px; padding: 1px 7px; border-radius: 10px; background: var(--blau); color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
#lv-liste tr.lv-laedt { opacity: .5; }
.lv-wechsel { margin: 8px 0 0; max-width: 440px; }
#lv-ansicht, #lv-liste { scroll-margin-top: 72px; }
#dlg-gaeb #lv-ansicht, #dlg-gaeb #lv-liste { scroll-margin-top: 8px; }
#lv-ansicht.lv-neu { animation: lv-neu 1.6s ease-out; }
@keyframes lv-neu { 0%, 30% { box-shadow: 0 0 0 3px var(--blau); background: #f2f5fe; } 100% { box-shadow: 0 0 0 3px transparent; } }
.lv-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.lv-kopf h2 { margin-bottom: 2px; }
.lv-kopf .knoepfe { display: flex; gap: 8px; }
.lv-werkzeuge { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lv-werkzeuge input[type=search] { max-width: 360px; }
table.lv { width: 100%; border-collapse: collapse; }
.lv th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--linie); position: sticky; top: 52px; background: #fff; }
.lv td { padding: 6px; border-bottom: 1px solid #f0f1f5; vertical-align: top; }
.lv .c-wahl { width: 34px; }
.lv .c-oz { width: 110px; }
.lv .c-menge { width: 90px; }
.lv .c-einh { width: 60px; }
.lv .c-ep { width: 100px; }
.lv td.oz { font-family: Consolas, monospace; font-size: 12px; white-space: nowrap; }
.lv td.r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv input[type=checkbox] { width: auto; }
.lv tbody tr { cursor: pointer; }
.lv tbody tr:hover td { background: #f7f8fe; }
.lv tr.lv-titel td { background: #f3f4f8; }
.lv tr.gewaehlt td { background: var(--blau-hell); }
.lv .lv-kurz { font-weight: 600; }
.lv .lv-lang { white-space: pre-wrap; color: #4a5064; font-size: 12.5px; margin-top: 3px; }
.lv .lv-mehr { padding: 0; border: none; background: none; color: var(--blau); font-size: 12px; margin-top: 2px; }
.lv tr.lv-hinweis .lv-lang { font-style: italic; }
.lv .lv-stift { padding: 0 6px; margin-left: 4px; border: 1px solid transparent; background: none; color: var(--blau); font-size: 14px; font-weight: 400; line-height: 1.4; border-radius: 6px; vertical-align: baseline; }
.lv .lv-stift:hover { border-color: var(--blau); background: #eef0ff; }
.lv .chip.lv-geaendert { background: #fff4e0; color: #8a4b00; border-color: #f0c98a; font-weight: 500; }
.lv-text-dialog textarea { width: 100%; font: inherit; line-height: 1.45; resize: vertical; }
.lv-text-dialog .lv-original { margin: 8px 0; padding: 8px 10px; background: #f6f7fb; border-radius: 8px; font-size: 13px; }
.lv-text-dialog .lv-original .lv-lang { white-space: pre-wrap; color: #4a5064; margin-top: 4px; max-height: 220px; overflow: auto; }
.lv-fuss { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: flex-end; gap: 12px; padding: 12px 0 4px; background: #fff; border-top: 1px solid var(--linie); margin-top: 8px; }
.lv-fuss #lv-zaehler { margin-right: auto; align-self: center; color: var(--grau); }
.lv-fuss select { min-width: 320px; }
.pos .c-akt { width: 150px; }
.pos td.gp { padding-top: 11px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos input.r { text-align: right; font-variant-numeric: tabular-nums; }
.pos .f-kurz { font-weight: 600; }
.pos .f-lang { margin-top: 4px; min-height: 31px; height: 31px; resize: none; overflow: hidden; font-size: 13px; color: #3a4053; }
.pos tr.titel td { background: #f6f7fb; }
.pos tr.titel .f-kurz { font-size: 15px; }
.pos .akt { display: flex; gap: 2px; justify-content: flex-end; padding-top: 2px; }
.pos .akt button { padding: 4px 7px; font-size: 13px; border-color: transparent; background: transparent; color: var(--grau); }
.pos .akt button:hover { background: var(--hinter); color: var(--text); }
.pos .akt button[data-a="weg"]:hover { color: var(--rot); }
.pos tr:focus-within td { background: #fafbff; }
.pos .bilder { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 6px; }
.pos .bilder figure { margin: 0; padding: 4px; border: 1px solid var(--linie); border-radius: 5px; background: #fff; }
.pos .bilder img { display: block; height: 80px; max-width: 220px; object-fit: contain; }
.pos .bilder figcaption { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--grau); }
.pos .bilder figcaption input { width: 52px; padding: 2px 5px; text-align: right; }
.pos .bilder figcaption button { padding: 1px 6px; border-color: transparent; color: var(--grau); }
.pos .bilder figcaption button:hover { color: var(--rot); }
.pos .bild-plus { padding: 3px 9px; font-size: 12px; color: var(--grau); border-style: dashed; }
.pos tr.ziehen td { background: var(--blau-hell); }
.dlg-nr { margin-top: 10px; }
.unter-tabelle { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.unter-tabelle .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.summen { min-width: 300px; }
.summen div { display: flex; justify-content: space-between; gap: 24px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.summen .gesamt { border-top: 1px solid var(--text); margin-top: 4px; padding-top: 6px; font-weight: 700; font-size: 16px; }
/* Rechnung: Art und Abzüge */
.rechnungsart { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 6px; font-size: 15px; }
.rechnungsart label { display: flex; gap: 6px; align-items: center; }
.rechnungsart input { width: auto; margin: 0; }
.re-raster { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.re-raster h3, #rechnungen-bisher h3 { font-size: 14px; margin: 12px 0 6px; color: var(--blau); }
.re-liste { margin-bottom: 4px; }
table.abzuege { width: 100%; border-collapse: collapse; font-size: 14px; }
table.abzuege th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 2px 4px; }
table.abzuege td { padding: 3px 4px; vertical-align: middle; }
table.abzuege td:nth-child(3) input, table.abzuege td:nth-child(4) input { width: 90px; text-align: right; }
table.abzuege td:nth-child(3) input { width: 64px; }
table.abzuege td:nth-child(5) input { width: 140px; }
table.abzuege select { min-width: 160px; max-width: 230px; }
table.abzuege input:disabled { visibility: hidden; }
table.abzuege tr.verrechnet :is(input, select) { opacity: 0.55; }
table.abzuege small { display: block; font-size: 12px; color: var(--grau); }
.rechnungssumme { min-width: 0; }
.rechnungssumme > div > span:last-child { white-space: nowrap; padding-left: 12px; align-self: end; }
.rechnungssumme .oben { border-top: 1px solid var(--linie); margin-top: 3px; padding-top: 5px; }
.rechnungssumme small { display: block; font-size: 12px; color: var(--grau); font-weight: 400; }
.rechnungssumme .klein { font-size: 12px; color: var(--grau); }
.rechnungssumme .warnung { color: #9a1b1b; }
@media (max-width: 900px) {
  .re-raster { grid-template-columns: 1fr; }
  table.abzuege thead { display: none; }
  table.abzuege tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--linie); }
  table.abzuege td:nth-child(1), table.abzuege td:nth-child(2) { grid-column: 1 / -1; }
  table.abzuege td input, table.abzuege td select { width: 100% !important; max-width: none; }
}
.dlg-rechnung { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; }
.dlg-rechnung label { display: flex; gap: 8px; align-items: center; }
.dlg-rechnung input { width: auto; margin: 0; }

/* Belegkarten */
.belege { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.beleg { border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.beleg.erstellt { border-color: #b9bff3; background: #fbfbff; }
.beleg .info { font-size: 13px; color: var(--grau); min-height: 36px; }
.belegnr { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--grau); }
.belegnr input { font-weight: 600; }
.nr-warnung { color: var(--rot); margin-top: -4px; }
.zahlung-vorschau { align-self: end; margin: 0 0 6px; }
table.zahlungen { width: 100%; border-collapse: collapse; }
.zahlungen th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 4px 6px; }
.zahlungen td { padding: 4px 6px; vertical-align: top; border-top: 1px solid #f0f1f5; }
.zahlungen textarea { min-width: 320px; }
.zw-beispiel { margin-top: 3px; }
.beleg .info a { font-weight: 600; }
.beleg .knoepfe { display: flex; gap: 6px; margin-top: auto; }
.beleg .knoepfe button { flex: 1; padding: 6px 8px; }

/* Einstellungen */
table.nummern { width: 100%; border-collapse: collapse; }
.nummern th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 4px 6px; }
.nummern td { padding: 4px 6px; }
.nummern .beispiel { color: var(--grau); font-family: Consolas, monospace; white-space: nowrap; }
.textgruppe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-bottom: 14px; }
.textgruppe h3 { grid-column: 1 / -1; margin: 6px 0 0; }

details.karte > summary { cursor: pointer; font-weight: 600; }
details.karte[open] > summary { margin-bottom: 12px; }

/* Speicherleiste */
.speicherleiste {
  position: fixed; left: 0; right: 0; bottom: var(--unten); z-index: 9;
  display: flex; justify-content: center; gap: 12px; align-items: center;
  padding: 10px; background: #fff; border-top: 1px solid var(--linie);
  transform: translateY(100%); transition: transform .15s;
}
body.ungespeichert .speicherleiste { transform: none; }

/* Dialog & Meldungen */
dialog { border: none; border-radius: 10px; padding: 20px 22px; width: 380px; max-width: 96vw; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 24, 40, .35); }
.dlg-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#meldungen { position: fixed; right: 20px; bottom: calc(70px + var(--unten)); display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.meldung { background: #1d2130; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 420px; }
.meldung.fehler { background: var(--rot); }
.meldung a { color: #c9cdff; }

/* Bauvorhaben */
.pnr { display: inline-block; font-family: Consolas, monospace; font-weight: 700; color: var(--blau); background: var(--blau-hell);
  border-radius: 4px; padding: 0 5px; margin-right: 6px; font-size: .92em; }
h1 .pnr { font-size: .85em; padding: 1px 8px; vertical-align: 2px; }
.projektleiste { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 10px; font-size: 13px; }
.projektleiste a { color: var(--text); text-decoration: none; }
.projektleiste a:hover { color: var(--blau); }
.projektleiste label { display: flex; align-items: center; gap: 8px; color: var(--grau); }
.projektleiste select { width: auto; min-width: 280px; max-width: 420px; padding: 4px 8px; }
.projektinfo { margin: -8px 0 14px; color: var(--grau); }
.kennzahlen { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kennzahlen > div { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.kennzahlen span { font-size: 12px; color: var(--grau); }
.kennzahlen b { font-size: 18px; font-variant-numeric: tabular-nums; }
.karten-kopf { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.karten-kopf h2 { margin: 0; }
.karten-kopf .knoepfe { display: flex; gap: 8px; margin-left: auto; }
.karte table.liste { border: none; }
table.projekte td.pnr-zelle { font-family: Consolas, monospace; font-weight: 700; color: var(--blau); white-space: nowrap; width: 90px; }
table.projekte tr.gruppe td { background: #f3f4f8; color: var(--grau); font-size: 12px; font-weight: 600; padding: 6px 10px; cursor: default; }
table.projekte tr.abgeschlossen td { color: var(--grau); }
.unterkopf { margin: 0 0 8px; font-size: 14px; }
.stamm-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Leiste: Zähler offener Prüfungen, Reiter */
.zaehler { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--rot); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; margin-left: 3px; }
.reiter { display: inline-flex; border: 1px solid var(--linie); border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.reiter button, .reiter a { border: none; border-radius: 0; padding: 6px 12px; background: #fff; white-space: nowrap; color: var(--text); }
.reiter button + button, .reiter a + a { border-left: 1px solid var(--linie); }
.reiter button.aktiv, .reiter a.aktiv { background: var(--blau-hell); color: var(--blau); font-weight: 600; }

/* Eingangsrechnungen */
.estatus { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; border: 1px solid; vertical-align: middle; }
.estatus.neu { color: #6b4a00; border-color: #e9cf8a; background: #fff8e6; }
.estatus.pruefung { color: var(--blau); border-color: #b9bff3; background: var(--blau-hell); }
.estatus.beanstandet { color: var(--rot); border-color: #f0b4b4; background: #fff1f1; }
.estatus.freigegeben { color: #14632e; border-color: #a6d9b5; background: #eefaf1; }
.estatus.bezahlt { color: var(--grau); border-color: var(--linie); background: #f3f4f8; }
h1 .estatus { font-size: 13px; font-weight: 600; margin-left: 8px; }
.ueberfaellig { color: var(--rot); font-weight: 600; }
.bald { color: #b35c00; font-weight: 600; }
.klein-ablage { padding: 14px 16px; margin-bottom: 12px; flex-direction: row; font-size: 13px; color: var(--grau); }
.eingang-seite { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); gap: 16px; align-items: start; }
.eingang-dokument { position: sticky; top: 64px; }
.pdf-rahmen { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 150px); min-height: 480px; }
.pdf-rahmen iframe { width: 100%; height: 100%; border: none; }
.erechnung h2 { font-size: 14px; }
table.liste.kompakt td, table.liste.kompakt th { padding: 5px 6px; font-size: 13px; cursor: default; }
.rechenhilfe { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.rechenhilfe button { padding: 3px 9px; font-size: 12px; color: var(--grau); }
.freigabe-info { background: #eefaf1; border: 1px solid #a6d9b5; border-radius: 6px; padding: 8px 10px; color: #14632e; margin-bottom: 10px; }
.beanstandung-info { background: #fff1f1; border: 1px solid #f0b4b4; border-radius: 6px; padding: 8px 10px; color: #8c1d1d; margin-bottom: 10px; }
.kommentar-text { margin-top: 4px; font-style: italic; white-space: pre-wrap; }
.kommentar-feld textarea { resize: vertical; }
.eingang-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
button.gruen { background: #16803c; border-color: #16803c; color: #fff; font-weight: 600; }
button.gruen:hover { background: #12692f; }
ul.verlauf { list-style: none; margin: 0; padding: 0; font-size: 13px; }
ul.verlauf li { padding: 6px 0 6px 12px; border-left: 3px solid var(--linie); margin-bottom: 4px; }
ul.verlauf li.freigeben { border-left-color: #16803c; }
ul.verlauf li.beanstanden, ul.verlauf li.zurueck { border-left-color: var(--rot); }
ul.verlauf li.bezahlt { border-left-color: var(--grau); }

/* Eingangsrechnungen: Zuordnen */
.mail-stand { margin: -6px 0 10px; }
.z-leiste { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.z-leiste select { width: auto; max-width: 280px; }
.z-seite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.z-liste { display: flex; flex-direction: column; gap: 8px; }
.z-karte { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.z-karte:hover { border-color: #b9bff3; }
.z-karte.aktiv { border-color: var(--blau); box-shadow: 0 0 0 2px var(--blau-hell); }
.z-oben { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--grau); }
.z-oben input { width: auto; }
.z-oben a { margin-left: auto; font-size: 12px; }
.z-betreff { margin: 4px 0 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Zeile 1: Lieferant | Brutto – Zeile 2: Bauvorhaben | Zuständig | Knöpfe */
.z-felder { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.z-felder [data-z="lieferant"] { grid-column: 1 / 3; }
.z-felder input, .z-felder select { padding: 6px 7px; font-size: 13px; }
.z-knoepfe { display: flex; gap: 4px; }
.z-felder button { padding: 6px 10px; white-space: nowrap; }
.z-felder select.vorschlag { background: #fff8e6; border-color: #e9cf8a; }
.z-hinweis { margin-top: 6px; font-size: 12px; color: #8a6400; }
.z-vorschau { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
.z-vorschau .pdf-rahmen { height: calc(100vh - 260px); min-height: 420px; }
.z-mail { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.z-mailtext { white-space: pre-wrap; font-size: 13px; color: #3a4053; max-height: 160px; overflow: auto; margin-top: 6px; border-top: 1px solid #f0f1f5; padding-top: 6px; }
.mail-test { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Kalender */
.k-leiste { align-items: center; flex-wrap: wrap; }
.k-leiste select { width: auto; }
.k-monat { min-width: 150px; text-align: center; font-size: 16px; }
.k-monatsblatt { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; background: var(--linie); gap: 1px; }
.k-kopf { background: #fafbfd; font-size: 12px; color: var(--grau); font-weight: 600; text-align: center; padding: 6px 0; }
.k-kw { background: #fafbfd; font-size: 11px; color: var(--grau); text-align: center; padding-top: 6px; }
.k-tag { background: #fff; min-height: 108px; padding: 4px 4px 6px; cursor: pointer; overflow: hidden; }
.k-tag:hover { background: #fafbff; }
.k-tag.wochenende { background: #fbfbfc; }
.k-tag.fremd { background: #f6f7f9; }
.k-tag.fremd .k-nr { color: #b5b9c6; }
.k-tag.heute .k-nr { background: var(--blau); color: #fff; border-radius: 10px; display: inline-block; padding: 0 7px; }
.k-nr { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.k-eintrag { font-size: 12px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; background: var(--blau-hell); color: #1d2a8a;
  border-left: 3px solid var(--blau); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.k-eintrag .pnr { font-size: 10.5px; padding: 0 3px; margin-right: 4px; }
.k-eintrag.art-montage { background: #eefaf1; color: #14632e; border-left-color: #16803c; }
.k-eintrag.art-aufmaß { background: #f5f0ff; color: #4b2a8a; border-left-color: #7c4dcc; }
.k-eintrag.art-lieferung { background: #eefaff; color: #155e75; border-left-color: #1b8db0; }
.k-eintrag.art-abnahme { background: #fff8e6; color: #6b4a00; border-left-color: #d49a00; }
.k-eintrag.art-abwesenheit { background: #f3f4f8; color: var(--grau); border-left-color: #9aa0b2; }
.k-eintrag.frist { background: #fff1f1; color: #8c1d1d; border-left-color: var(--rot); font-style: italic; }
.k-eintrag.frist.art-skonto { background: #fff6ec; color: #8a4500; border-left-color: #e08a1e; }
.k-listentag { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 8px 12px; background: #fff; border: 1px solid var(--linie); border-radius: 8px; margin-bottom: 6px; }
.k-listentag.heute { border-color: var(--blau); }
.k-listentag .k-eintrag, .p-termin .k-eintrag { white-space: normal; display: block; }
.k-datum { font-weight: 600; font-size: 13px; }
.p-termine { display: flex; flex-direction: column; gap: 4px; }
.p-termin { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: start; }
/* Bauvorhaben als Liste oder Kacheln (web/module.js) */
.ansicht-wahl { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.ansicht-wahl button { min-height: 0; padding: 6px 12px; border: none; border-radius: 0; background: var(--karte); color: var(--grau); cursor: pointer; }
.ansicht-wahl button.aktiv { background: var(--blau-hell); color: var(--blau); font-weight: 600; }
.p-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.p-kachel { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px 14px; background: var(--karte); border: 1px solid var(--linie); border-top: 4px solid var(--blau);
  border-radius: var(--radius); color: var(--text); text-decoration: none; }
.p-kachel:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.p-kachel.weitere { border-top-color: #9aa1b5; }
.p-kachel.abgeschlossen { opacity: 0.6; border-top-color: var(--grau); }
.p-kachel-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 22px; }
.p-kachel-zahlen { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.p-kachel-gruppe { grid-column: 1 / -1; margin: 10px 0 0; font-size: 14px; color: var(--grau); }
/* Übersicht eines Bauvorhabens als Kacheln (web/module.js): Antippen öffnet den Bereich groß im Dialog */
.p-bereiche-leiste { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 10px; }
.p-bereiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.p-bereich { display: flex; flex-direction: column; gap: 6px; min-height: 100px; padding: 12px 16px 14px; text-align: left; background: var(--karte);
  border: 1px solid var(--linie); border-top: 4px solid var(--blau); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.p-bereich:hover { border-color: #b8bdcc; border-top-color: var(--blau); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.p-bereich.reiter, .p-bereich.reiter:hover { border-top-color: #9aa1b5; }
.p-bereich.wichtig, .p-bereich.wichtig:hover { border-top-color: var(--rot); }
.p-bereich-kopf { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.p-bereich-symbol { font-size: 18px; line-height: 1; }
.p-bereich-zahl { margin-left: auto; min-width: 26px; padding: 1px 8px; border-radius: 10px; background: var(--blau-hell); color: var(--blau); font-size: 12px; font-weight: 600; text-align: center; }
.p-bereich.wichtig .p-bereich-zahl { background: #fdecea; color: var(--rot); }
.p-bereich-text { font-size: 13px; color: var(--grau); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
dialog.p-bereich-dlg { width: min(1180px, 96vw); max-height: 92dvh; padding: 12px 16px 16px; background: var(--hinter); }
dialog.p-bereich-dlg .karte { margin-bottom: 0; }
.p-bereich-dlg-kopf { position: sticky; top: -12px; z-index: 2; display: flex; justify-content: flex-end; margin: -12px -16px 8px; padding: 10px 16px 8px; background: var(--hinter); }
/* Bauzeitenplan (web/bauzeitenplan.js): Tabelle mit Balkenplan nach Kalenderwochen */
.bz-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.bz-stand { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-left: auto; }
.bz-stand input { width: auto; }
.bz-start .bz-vorlage { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bz-start .bz-vorlage input { width: auto; }
.bz-rahmen { overflow-x: auto; background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); }
table.bz { border-collapse: collapse; width: 100%; font-size: 13px; }
table.bz th { position: sticky; top: 0; background: #f6f7fb; text-align: left; font-weight: 600; font-size: 12px; color: var(--grau); padding: 6px 4px; white-space: nowrap; }
table.bz td { padding: 2px 3px; border-top: 1px solid var(--linie); white-space: nowrap; }
table.bz input { padding: 4px 5px; font-size: 13px; min-height: 0; }
table.bz td:nth-child(2) input { width: 110px; }
table.bz td:nth-child(3) input { width: 220px; }
table.bz td:nth-child(4) input, table.bz td:nth-child(6) input { width: 128px; }
table.bz td:nth-child(5) input, table.bz td:nth-child(8) input { width: 52px; }
table.bz td:nth-child(7) input { width: 64px; }
.bz-nr { color: var(--grau); text-align: right; padding-right: 6px !important; }
.bz-ms-zeile td:nth-child(3) input { font-weight: 600; }
.bz-aktionen button { min-height: 0; padding: 2px 6px; border: none; background: none; color: var(--grau); cursor: pointer; }
.bz-aktionen button:hover { color: var(--text); }
/* Balkenplan: Hintergrund mit Wochenlinien und grauen Wochenenden, eine Woche = 1/--wochen der Breite */
.bz-gantt { position: relative; min-width: 420px; width: 100%; height: 30px;
  background-image: linear-gradient(90deg, #d9dce5 1px, transparent 1px), linear-gradient(90deg, transparent 71.43%, #f1f2f6 71.43%);
  background-size: calc(100% / var(--wochen)) 100%; }
.bz-gantt-kopf { height: 34px; background-image: linear-gradient(90deg, #d9dce5 1px, transparent 1px); }
.bz-kw { position: absolute; top: 2px; padding-left: 3px; font-size: 11px; line-height: 1.15; color: var(--grau); }
.bz-kw small { display: block; font-size: 10px; font-weight: 400; }
.bz-balken { position: absolute; top: 8px; height: 14px; border: 1px solid var(--blau); background: #b9c1f3; border-radius: 3px; overflow: hidden; }
.bz-fertig { display: block; height: 100%; background: var(--blau); }
.bz-ms { position: absolute; top: 9px; width: 12px; height: 12px; margin-left: -6px; background: #1d2130; transform: rotate(45deg); }
.bz-heute { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--rot); opacity: 0.6; }
/* Wetter am Bauvorhaben (web/module.js, wetter.js) */
.p-wetter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 2px 0 14px; font-size: 14px; }
.p-wetter-tag { white-space: nowrap; }
.p-wetter-ort { margin-left: auto; color: var(--grau); }
.w-liste { max-height: 50vh; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
/* Ereignisse (Anrufe, Änderungen …) oben auf der Übersicht des Bauvorhabens */
.p-ereignisse { display: flex; flex-direction: column; gap: 8px; }
.p-ereignis { border-left: 3px solid var(--linie); padding: 2px 0 2px 10px; overflow-wrap: anywhere; }
.p-ereignis.wichtig { border-left-color: var(--rot); background: #fdf3f2; }
.p-ereignis .k-datum { font-size: 12px; color: var(--grau); }
.md-ereignis { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 4px; }
.md-eintrag.md-wichtig { border-left: 3px solid var(--rot); }
dialog.termin-dialog { width: min(560px, 94vw); }
.k-feiertag { font-size: 11px; color: var(--rot); font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-eintrag.abwesend { background: #f3f4f8; color: #4a5064; border-left-color: #9aa0b2; }
.seitenreiter a.knopf { border: none; border-radius: 0; padding: 6px 12px; text-decoration: none; }
.seitenreiter a.knopf.aktiv { background: var(--blau-hell); color: var(--blau); font-weight: 600; }

/* Urlaubsplaner */
.u-rahmen { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 16px; }
table.u-plan { border-collapse: collapse; width: 100%; font-size: 12px; }
.u-plan th, .u-plan td { border: 1px solid #eceef3; text-align: center; padding: 0; min-width: 24px; height: 30px; }
.u-plan th { font-weight: 600; color: var(--grau); padding: 3px 0; line-height: 1.2; }
.u-plan .u-name { text-align: left; padding: 3px 8px; min-width: 150px; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; font-size: 13px; }
.u-plan .u-name .unter { font-size: 11px; color: var(--grau); }
.u-plan td[data-ma] { cursor: pointer; }
.u-plan td[data-ma]:hover { background: var(--blau-hell); }
.u-plan .we { background: #f3f4f8; }
.u-plan .fei { background: #fde8e8; }
.u-plan th.heute { background: var(--blau); color: #fff; }
.u-plan td[data-eintrag] { cursor: pointer; font-weight: 700; }
.u-plan .u-urlaub { background: #b9e6c7; color: #14632e; }
.u-plan .u-sonderurlaub { background: #ddd0f5; color: #4b2a8a; }
.u-plan .u-freizeitausgleich { background: #fde1bf; color: #8a4500; }
.u-plan .u-berufsschule { background: #cde8f3; color: #155e75; }
.u-plan .u-krank { background: #f6c9c9; color: #8c1d1d; }
.u-plan .u-sonstiges { background: #e3e5ec; color: #4a5064; }
.u-plan td.beantragt { opacity: .55; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.6) 4px 7px); }
.u-plan tr.u-summe td { color: var(--grau); font-weight: 600; background: #fafbfd; }
.u-konto input.u-uebertrag { width: 70px; padding: 3px 6px; }
.u-info { margin: 0; color: var(--blau); font-size: 13px; }
ul.abo-links { list-style: none; padding: 0; margin: 10px 0; }
ul.abo-links input { font-family: Consolas, monospace; font-size: 12px; margin-bottom: 4px; }

/* Nachträge & Schreiben: Textfeld mit Formatierung und Vorschau */
.tf-leiste { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.tf-leiste button { padding: 4px 9px; font-size: 13px; }
.tf-leiste select { width: auto; padding: 4px 6px; font-size: 13px; }
.tf-leiste .klein { margin-left: 8px; }
.tf-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-felder.ohne-vorschau { grid-template-columns: 1fr; }
.tf-eingabe { min-height: 120px; resize: vertical; line-height: 1.45; }
.tf-vorschau { border: 1px dashed var(--linie); border-radius: 6px; padding: 8px 12px; background: #fff; font-family: 'Times New Roman', Times, serif; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.tf-leer { height: .7em; }
.tf-li { display: flex; gap: 8px; }
.tf-li > span { min-width: 14px; }
.tf-titel { font-weight: 700; margin-top: 4px; }

.m-bilder, .bilder.m-bilder { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 10px; }
.m-bilder figure { margin: 0; padding: 4px; border: 1px solid var(--linie); border-radius: 5px; background: #fff; }
.m-bilder img { display: block; height: 80px; max-width: 220px; object-fit: contain; }
.m-bilder figcaption { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--grau); }
.m-bilder figcaption input { width: 52px; padding: 2px 5px; text-align: right; }
.m-bilder figcaption button { padding: 1px 6px; border-color: transparent; color: var(--grau); }
.m-bilder .bild-plus { padding: 3px 9px; font-size: 12px; color: var(--grau); border-style: dashed; cursor: pointer; }

/* Kalkulationstabellen */
.m-tabelle { overflow-x: auto; }
table.m-kalk, table.m-bt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.m-kalk th, .m-bt th { font-size: 12px; color: var(--grau); font-weight: 600; text-align: left; padding: 4px 3px 6px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.m-kalk td, .m-bt td { padding: 3px; border-bottom: 1px solid #f0f1f5; vertical-align: middle; }
.m-kalk th.r, .m-kalk td.r, .m-bt th.r, .m-bt td.r { text-align: right; }
.m-kalk input, .m-kalk select, .m-bt input { padding: 5px 6px; font-size: 13px; }
.m-kalk input.r, .m-bt input.r { text-align: right; }
.m-kalk input.r { width: 62px; padding-left: 4px; padding-right: 4px; }
.m-kalk [data-z="einheit"] { width: 58px; }
.m-kalk select { width: 100px; }
.m-kalk input.bez { min-width: 150px; }
.m-kalk td.nr { color: var(--grau); font-size: 12px; text-align: right; }
.m-kalk td.c { text-align: center; }
.m-kalk td.c input { width: auto; }
.m-kalk .z-ep, .m-kalk .z-gp, .m-kalk .z-loehne, .m-bt .bt-calc { white-space: nowrap; padding-right: 6px; }
.m-kalk .z-gp { font-weight: 600; }
.m-kalk tr.minder td { background: #fff5f5; }
.m-kalk tr.minder .z-ep, .m-kalk tr.minder .z-gp { color: var(--rot); }
.m-kalk input:disabled { background: #f6f7fb; color: var(--grau); }
.m-bt td:first-child { width: 50%; }
.m-bt input.r { width: 96px; }
.m-bt .bt-calc { min-width: 70px; }
.m-bt .bt-calc { color: #3a4053; }
.m-bt-plus { margin-top: 8px; }
.m-kalk .akt, .m-bt .akt { display: flex; gap: 2px; justify-content: flex-end; }
.m-kalk .akt button, .m-bt .akt button { padding: 3px 4px; font-size: 13px; border-color: transparent; background: transparent; color: var(--grau); }
.m-kalk .akt button:hover, .m-bt .akt button:hover { background: var(--hinter); color: var(--text); }
.m-saetze { margin-bottom: 6px; }

/* Schreiben: Eingabe links, Briefvorschau rechts */
.brief { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.brief-rechts { position: sticky; top: 64px; }
.brief-rechts .karte { max-height: calc(100vh - 90px); overflow: auto; }
.brief-blatt { background: #fff; border: 1px solid var(--linie); box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 36px 40px 40px 48px;
  font-family: 'Times New Roman', Times, serif; font-size: 15px; line-height: 1.4; min-height: 600px; overflow-wrap: anywhere; }
.bv-anschrift { min-height: 90px; margin-bottom: 18px; }
.bv-datum { text-align: right; margin-bottom: 18px; }
.bv-betreff { font-weight: 700; font-size: 16.5px; margin-bottom: 6px; }
.bv-zeile { margin-bottom: 4px; }
.bv-text { margin-top: 14px; }
.m-vorlage { display: flex; gap: 8px; flex-wrap: wrap; }
.m-vorlage select { flex: 1; min-width: 220px; }

/* Einstellungen: Schreib-Vorlagen */
table.vorlagen { width: 100%; border-collapse: collapse; margin-top: 12px; }
.vorlagen th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 4px 6px; }
.vorlagen td { padding: 4px 6px; vertical-align: top; border-top: 1px solid #f0f1f5; }
.vorlagen textarea { min-width: 360px; font-size: 13px; }

/* Zugriffsrechte: nur lesen (Stufe 1) – Speichern, Neu und Löschen ausgeblendet, Eingaben gesperrt */
main.nur-lesen .primaer, main.nur-lesen .gefahr, main.nur-lesen .speicherleiste, main.nur-lesen [data-speichern] { display: none !important; }
.nur-lesen-hinweis { margin-bottom: 12px; }
.nur-lesen-block input:disabled, .nur-lesen-block select:disabled, .nur-lesen-block textarea:disabled { color: var(--text); background: #f6f7f9; }

/* Personen & Rechte */
.pe-liste td { vertical-align: top; }
.gr-matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.gr-matrix th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.gr-matrix td { padding: 4px 6px; border-top: 1px solid #f0f1f5; }
.gr-matrix select { width: auto; min-width: 104px; padding: 3px 6px; font-size: 13px; }
/* Spalte „Bereich“ bleibt beim waagrechten Schieben stehen, nur die Gruppen schieben sich durch */
.gr-matrix th:first-child, .gr-matrix td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--linie); }
.gr-matrix th:first-child { z-index: 2; }
@media (max-width: 700px) { .gr-matrix td:first-child { min-width: 120px; max-width: 150px; white-space: normal; overflow-wrap: anywhere; overflow: hidden; font-size: 12px; } }
.gr-bereich { white-space: nowrap; font-weight: 500; }
select.stufe-0 { color: var(--grau); background: #f6f7f9; }
select.stufe-1 { background: #fff8e6; color: #6b4a00; }
select.stufe-2 { background: #eefaf1; color: #14632e; }
select.stufe-3 { background: #e7f4ff; color: #155e75; }
dialog.p-dialog { width: min(860px, 96vw); max-height: 94vh; }
.pe-haken { display: flex; flex-direction: column; gap: 4px; grid-column: span 3; justify-content: center; }
.pe-zugang { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0 4px; padding: 8px 10px; background: var(--hinter); border-radius: 6px; font-size: 13px; }
.pe-zugang button { padding: 3px 10px; font-size: 13px; }
/* Code-Feld je Person (web/personen.js, codes.js) */
.pe-code { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0; padding: 8px 10px; background: var(--hinter); border-radius: 6px; }
.pe-code .feld { flex: 1 1 260px; margin: 0; }
.pe-code #pe-code-feld { font: 16px monospace; }
.pe-code .haken, .pe-code #pe-code-hinweis { flex-basis: 100%; margin: 0; }
.pe-projekte { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: flex-start; }
.pe-projektliste { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 12px; max-height: 200px; overflow: auto;
  padding: 8px 10px; border: 1px solid var(--linie); border-radius: 6px; font-size: 13px; }
.pe-projektliste[hidden] { display: none; }
.pe-rechte { width: 100%; border-collapse: collapse; font-size: 13px; }
.pe-rechte th { text-align: left; font-size: 12px; color: var(--grau); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--linie); }
.pe-rechte td { padding: 3px 6px; border-top: 1px solid #f0f1f5; }
.pe-rechte select { width: auto; min-width: 150px; padding: 3px 6px; font-size: 13px; }

.warnband { display: flex; gap: 12px; align-items: center; justify-content: space-between; max-width: 1280px; margin: 12px auto 0; padding: 10px 14px;
  background: #fff6e8; border: 1px solid #f1c98c; border-radius: var(--radius); color: #8a4b00; font-size: 14px; }
.warnband button { border-color: transparent; background: transparent; color: #8a4b00; }

/* Baustelle: Übersicht, Unterlagen, Mängel */
.b-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.b-kachel { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; }
.b-kachel:hover { border-color: var(--blau); box-shadow: 0 0 0 2px var(--blau-hell); }
.b-kachel.weitere { background: #fafbfd; }
.b-kachel-kopf { display: flex; align-items: baseline; gap: 6px; }
.b-zahlen { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.mstatus { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; white-space: nowrap; border: 1px solid; vertical-align: middle; }
.mstatus.rot { color: var(--rot); border-color: #f0b4b4; background: #fff1f1; }
.mstatus.rot.voll { color: #fff; background: var(--rot); border-color: var(--rot); font-weight: 600; }
.mstatus.orange { color: #8a4b00; border-color: #f1c98c; background: #fff6e8; }
.mstatus.blau { color: var(--blau); border-color: #b9bff3; background: var(--blau-hell); }
.mstatus.gruen { color: #14632e; border-color: #a6d9b5; background: #eefaf1; }
.b-reiter { margin-bottom: 14px; }
.b-reiter button, .b-reiter a { padding: 8px 16px; }
.b-werkzeuge { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.b-werkzeuge select { width: auto; max-width: 220px; }
.b-werkzeuge input[type=search] { width: 200px; }
.b-werkzeuge .knopf.primaer, .b-werkzeuge #m-neu { margin-left: auto; }
.b-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.b-chips button { padding: 4px 10px; border-radius: 14px; font-size: 13px; }
.b-chips button.aktiv { background: var(--blau-hell); border-color: #b9bff3; color: var(--blau); font-weight: 600; }
.b-typ { display: inline-block; min-width: 34px; text-align: center; font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: #eef0f6; color: var(--grau); }
.b-unterlagen tr.ueberholt td { color: var(--grau); }
.b-unterlagen tr.ueberholt b { font-weight: 500; text-decoration: line-through; }
.b-aktionen { white-space: nowrap; }
.b-aktionen .knopf, .b-aktionen button { padding: 3px 8px; margin-left: 4px; text-decoration: none; }
.zwei-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-baustelle { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.m-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.m-karte { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.m-karte:hover { border-color: var(--blau); }
.m-karte.aufgabe { border-left: 4px solid var(--blau); }
/* Art (Mangel / Aufgabe) beim Anlegen */
.m-art { display: inline-flex; margin: 0 0 10px; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.m-art button { border: 0; border-radius: 0; padding: 7px 18px; background: #fff; }
.m-art button.aktiv { background: var(--blau); color: #fff; }
/* Zuständige: Personen und Gruppen */
.m-zust { border: 1px solid var(--linie); border-radius: 8px; padding: 6px 10px; }
.m-zust summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.m-zust summary span { color: var(--grau); font-size: 13px; }
.m-zust summary b { font-weight: 600; }
.m-zust-gruppen, .m-zust-personen { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.m-zust-gruppen { padding-bottom: 8px; border-bottom: 1px dashed var(--linie); align-items: center; }
.m-zust-personen label, .m-zust-gruppen label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--text); }
.m-zust input[type=checkbox] { width: auto; flex: none; margin: 0; }
.m-zust .sieht-nicht { color: var(--grau); }
.m-warn { color: #8a4b00; }
.m-markiert { background: #fff4e0; color: #8a4b00; border-radius: 6px; padding: 0 5px; margin-right: 4px; }
/* Foto markieren */
dialog.m-markieren { width: min(1200px, 99vw); height: 98dvh; display: none; flex-direction: column; }
dialog.m-markieren[open] { display: flex; }
.m-mark-flaeche { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #222; border-radius: 8px; overflow: hidden; }
.m-mark-flaeche canvas { touch-action: none; cursor: crosshair; display: block; }
.m-werkzeug { min-width: 40px; font-size: 18px; line-height: 1; }
.m-mark-tipp { margin-right: auto; }
/* Für mich: eigene offene Mängel und Aufgaben */
.b-meine h2 { margin-top: 0; }
.b-meine-liste { display: flex; flex-direction: column; }
.b-mein { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--linie); color: var(--text); text-decoration: none; }
.b-mein:hover { background: var(--blau-hell); }
.b-mein-nr { font-weight: 700; min-width: 54px; }
.b-mein-nr.aufgabe { color: var(--blau); }
.b-mein-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.b-mein-rest { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.bv-reiter a { text-decoration: none; }
.bv-reiter { max-width: 100%; overflow-x: auto; }
.start-version { text-align: center; margin: 18px 0 6px; color: var(--grau); }
.version-zeile { text-align: center; color: var(--grau); margin: 4px 0 0; }
.m-kopf { display: flex; gap: 6px; align-items: baseline; }
.m-kopf .m-titel { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.m-fotos { display: flex; gap: 6px; overflow: hidden; margin-top: 4px; }
.m-fotos img { height: 64px; width: auto; max-width: 110px; object-fit: cover; border-radius: 4px; border: 1px solid var(--linie); }
.ueberfaellig { color: var(--rot); font-weight: 600; }
dialog.m-dialog { width: min(640px, 96vw); max-height: 94vh; }
.m-fotos-edit { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.m-fotos-edit figure { margin: 0; padding: 3px; border: 1px solid var(--linie); border-radius: 5px; background: #fff; }
.m-fotos-edit img { display: block; height: 90px; width: auto; max-width: 160px; object-fit: cover; }
.m-fotos-edit figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--grau); min-height: 20px; }
.m-fotos-edit figcaption button { padding: 0 6px; border-color: transparent; color: var(--grau); }
.m-fotos-edit figcaption button:hover { color: var(--rot); }
.foto-knopf { display: inline-flex; align-items: center; gap: 6px; }
.foto-knopf.arbeitet { opacity: .6; pointer-events: none; }
.foto-knopf.arbeitet::after { content: '– wird übertragen …'; color: var(--grau); }
.m-dialog details { margin-top: 10px; }
.m-dialog summary { cursor: pointer; color: var(--grau); font-size: 13px; }

/* Arbeitszeit */
.mstatus.grau { color: var(--grau); border-color: var(--linie); background: #f6f7fa; }
.zt-reiter { margin-bottom: 14px; }
.zt-ort { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; color: var(--grau); }
.zt-ort a { text-decoration: none; }
.zt-gps-hinweis { margin: 10px 0 0; color: var(--grau); }
.zt-gps-orte { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.zt-gps-ort { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(160px, 2fr) auto auto; gap: 6px; }
.zt-gps-ort input { min-width: 0; }
.zt-uhr .raster { margin-bottom: 12px; }
.zt-haken { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.zt-haken input, .zt-personen input, #zp-offen input, #zp-alle { width: auto; flex: none; margin: 0; }
.zt-kolonne { grid-column: 1 / -1; }
.zt-kolonne summary { cursor: pointer; color: var(--blau); font-size: 14px; }
.zt-personen { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 2px; }
.zt-personen label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.zt-uhr-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zt-gross { font-size: 16px; padding: 10px 22px; }
.zt-leise { border-color: transparent; background: transparent; color: var(--grau); font-size: 13px; }
.zt-uhr.laeuft { border-color: #a6d9b5; background: #f4fbf6; }
.zt-uhr.pausiert { border-color: #f1c98c; background: #fffaf0; }
.zt-uhr-zeile { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; margin-bottom: 12px; }
.zt-uhr-anzeige { display: flex; gap: 12px; align-items: center; }
.zt-punkt { width: 14px; height: 14px; border-radius: 50%; background: var(--gruen); box-shadow: 0 0 0 4px #d5f0de; animation: zt-puls 2s infinite; }
.zt-uhr.pausiert .zt-punkt { background: #e07b00; box-shadow: 0 0 0 4px #fde6c4; animation: none; }
@keyframes zt-puls { 50% { box-shadow: 0 0 0 8px rgba(213, 240, 222, 0); } }
.zt-laufzeit { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.zt-uhr-info { flex: 1; min-width: 200px; }
.zt-wochenkopf { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.zt-wochenkopf input[type=month] { width: auto; }
.zt-blaettern { display: flex; gap: 6px; align-items: center; }
.zt-blaettern > button { min-width: 36px; padding: 5px 10px; }
.zt-personwahl { width: auto; max-width: 100%; }
.zt-summe { margin-left: auto; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.zt-tage { display: flex; flex-direction: column; gap: 8px; }
.zt-tag { border: 1px solid var(--linie); border-radius: var(--radius); padding: 8px 12px; background: #fff; }
.zt-tag.frei { background: #fafafc; }
.zt-tag.heute { border-color: #b9bff3; box-shadow: inset 3px 0 0 var(--blau); }
.zt-tagkopf { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 30px; }
.zt-tagsumme { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.zt-plus { min-width: 34px; padding: 2px 8px; font-size: 18px; line-height: 1; color: var(--blau); }
.zt-eintrag { display: grid; grid-template-columns: 110px 1fr auto; gap: 2px 12px; padding: 6px 4px; border-top: 1px dashed var(--linie); align-items: start; border-radius: 4px; }
.zt-eintrag.aenderbar { cursor: pointer; }
.zt-eintrag.aenderbar:hover { background: var(--blau-hell); }
.zt-zeit, .zt-dauer { font-variant-numeric: tabular-nums; }
.zt-zeit small { display: block; color: var(--grau); }
.zt-was .klein { display: block; }
.zt-dauer { font-weight: 600; }
.zt-hinweis { margin-top: 4px; color: #8a4b00; font-size: 13px; }
/* Arbeitstag (Version 1.2): Anwesenheit oben, darunter die Verteilung auf Bauvorhaben und der Rest */
.zt-anwesend { padding: 2px 4px; border-top: 1px dashed var(--linie); border-radius: 4px; background: #f6f8fd; }
.zt-anwesend-zeile { display: grid; grid-template-columns: 110px 1fr auto; gap: 2px 12px; padding: 4px 0; align-items: start; }
.zt-anwesend.aenderbar { cursor: pointer; }
.zt-anwesend.aenderbar:hover { background: var(--blau-hell); }
.zt-anwesend ~ .zt-eintrag .zt-was > b::before { content: '↳ '; color: var(--grau); font-weight: 400; }
.zt-verteilt { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 6px 4px 2px; border-top: 1px dashed var(--linie); color: var(--grau); }
.zt-verteilt:empty { display: none; }
.zt-verteilt.offen { color: #8a4b00; }
.zt-verteilen { padding: 3px 12px; font-size: 13px; }
.zt-wochen-offen { margin: -4px 0 10px; color: #8a4b00; }
.zt-uhr-tipp { margin: 8px 0 0; color: var(--grau); }
.zt-wahl { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.zt-wahl .knopf { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 14px; white-space: normal; }
.zt-wahl .knopf b { font-size: 15px; }
.zt-bloecke { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.zt-block { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px 8px; align-items: end; }
.zt-block-info { grid-column: 1 / -1; color: var(--grau); }
.zt-luecken { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.zt-luecken button { padding: 4px 10px; font-size: 13px; }
.zt-luecken button.aktiv { background: var(--blau); color: #fff; border-color: var(--blau); }
.zt-monat tr.zt-tagzeile td { background: #fafafc; }
.zt-monat tr.zt-m-anwesend td { border-top-color: transparent; }
.zt-offen-hinweis { display: block; margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #fdecea; color: #a31a12; font-weight: 600; text-decoration: none; }
.zt-offen-hinweis:hover { background: #fadbd7; }
.zt-term-offen td.r { white-space: nowrap; }
.zt-wochenfuss { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
.zt-verlauf { margin-top: 10px; font-size: 13px; color: var(--grau); }
.zt-verlauf summary { cursor: pointer; }
.zt-monat tr.zt-frei td { color: var(--grau); }
.zt-monat tr.zt-folge td { border-top-color: transparent; }
.zt-balken { display: flex; flex-direction: column; gap: 6px; }
.zt-balken-zeile { display: grid; grid-template-columns: minmax(120px, 40%) 1fr 60px; gap: 4px 10px; align-items: center; font-size: 14px; }
.zt-balken-zeile > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zt-balken-wert { background: #f0f1f5; border-radius: 4px; height: 10px; }
.zt-balken-wert i { display: block; height: 100%; border-radius: 4px; background: var(--blau); }
.zt-balken-zeile b { text-align: right; font-variant-numeric: tabular-nums; }
dialog.zt-dialog { width: min(560px, 96vw); max-height: 94vh; }
.zwei-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.zt-unterschrift { position: relative; border: 1px dashed #9aa0b4; border-radius: 8px; background: #fff; margin-top: 8px; }
.zt-unterschrift canvas { display: block; width: 100%; height: auto; aspect-ratio: 3; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.zt-unterschrift::after { content: 'Unterschrift'; position: absolute; left: 14px; right: 14px; bottom: 22%; border-top: 1px solid #c8ccd8; font-size: 11px; color: var(--grau); padding-top: 2px; pointer-events: none; }
.zt-unterschrift button { position: absolute; top: 4px; right: 4px; z-index: 2; }
tr.klickbar { cursor: pointer; }

/* Planansicht */
main.plan-ansicht { max-width: none; padding-bottom: 12px; }
.plan-leiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.plan-leiste > a { color: var(--text); text-decoration: none; }
.plan-titel { flex: 1; min-width: 180px; }
.plan-knoepfe { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.plan-knoepfe button, .plan-knoepfe .knopf { min-width: 40px; padding: 7px 11px; }
#pl-seiten { display: inline-flex; gap: 4px; align-items: center; margin-right: 6px; }
#pl-seiten[hidden] { display: none; }
#pl-setzen.aktiv { background: var(--rot); border-color: var(--rot); }
.plan-rahmen { position: relative; overflow: auto; overflow-y: scroll; height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 360px; background: #d9dce4; border: 1px solid var(--linie); border-radius: var(--radius);
  touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.plan-blatt { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.plan-blatt canvas { display: block; }
.plan-blatt.setzen { cursor: crosshair; }
.plan-detail { position: absolute; z-index: 1; pointer-events: none; }
.plan-detail[hidden] { display: none; }
.plan-punkte { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pin { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px;
  font-size: 12px; font-weight: 700; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); line-height: 24px; }
.pin.rot { background: #d11a1a; }
.pin.orange { background: #e07b00; }
.pin.blau { background: var(--blau); }
.pin.gruen { background: #16803c; opacity: .75; }
.pin.frueher { border-style: dashed; }
.pin.aufgabe { border-radius: 6px; min-width: 32px; font-size: 12px; }
.pin:hover { z-index: 3; filter: brightness(1.1); border-color: #fff; }
.plan-laden { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--grau); margin: 0; padding: 20px; text-align: center; }
.plan-laden[hidden] { display: none; }

/* Notizen & Sprachmemos, Lieferungen (web/medien.js) */
.md-leiste { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.md-knoepfe, .md-filterzeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.md-filter { display: flex; flex-direction: column; gap: 2px; }
.md-filterzeile input[type=search] { width: 220px; }
.md-arbeitet { opacity: .6; pointer-events: none; }
.md-arbeitet::after { content: ' …'; }
.md-ziel { margin: 0 0 8px; }
.md-tag { font-size: 14px; color: var(--grau); font-weight: 600; margin: 18px 0 6px; text-transform: none; }
.md-eintrag { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: start; background: var(--karte);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.md-zeit { display: flex; flex-direction: column; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.md-zeit span { font-size: 18px; line-height: 1; }
.md-inhalt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.md-audio { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.md-audio audio { width: min(420px, 100%); height: 40px; }
.md-bild img { display: block; max-width: min(100%, 520px); max-height: 320px; border-radius: 6px; border: 1px solid var(--linie); background: #fff; }
.md-text .md-notiz { font-size: 15px; }
.md-notiz { white-space: normal; overflow-wrap: anywhere; }
.md-abschrift summary { cursor: pointer; color: var(--blau); font-size: 13px; }
.md-abschrift p { margin: 4px 0 0; padding: 8px 10px; background: var(--hinter); border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }
.md-laeuft { color: var(--grau); font-style: italic; }
.md-klein { font-size: 12px; padding: 2px 8px; min-height: 0; }
.md-meta a { color: inherit; }
.md-aktionen { display: flex; gap: 4px; }
.md-aktionen button { padding: 4px 8px; }
.md-leer { padding: 12px 0; }
dialog.md-dialog { width: min(460px, 96vw); }
.md-rec { display: flex; align-items: center; gap: 18px; margin: 10px 0 14px; }
.md-rec-knopf { width: 76px; height: 76px; border-radius: 50%; border: 3px solid #e3e5ec; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.md-rec-knopf span { width: 34px; height: 34px; border-radius: 50%; background: var(--rot); transition: all .15s; }
.nimmt-auf .md-rec-knopf span { width: 26px; height: 26px; border-radius: 5px; }
.nimmt-auf .md-rec-knopf { border-color: #f3b7b2; animation: md-puls 1.4s infinite; }
@keyframes md-puls { 50% { box-shadow: 0 0 0 8px rgba(180, 35, 24, .12); } }
.md-rec-info { flex: 1; min-width: 0; }
.md-rec-zeit { font-size: 28px; font-variant-numeric: tabular-nums; font-weight: 600; }
.md-pegel { height: 6px; background: var(--hinter); border-radius: 3px; overflow: hidden; margin: 4px 0; }
.md-pegel span { display: block; height: 100%; width: 0; background: var(--gruen); transition: width .08s; }
.md-vorschau { width: 100%; margin-bottom: 10px; }
dialog.md-hand { width: min(1100px, 98vw); max-height: 98dvh; padding: 10px 12px; overscroll-behavior: contain; }
.md-hand-leiste { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.md-hand-leiste > b { margin-right: auto; }
.md-wahl { display: inline-flex; gap: 4px; }
.md-farbe { width: 30px; height: 30px; border-radius: 50%; padding: 0; background: var(--f); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--linie); }
.md-farbe.aktiv { box-shadow: 0 0 0 2px var(--blau); }
.md-staerke { width: 40px; display: inline-flex; align-items: center; justify-content: center; }
.md-staerke i { display: block; width: 20px; background: var(--text); border-radius: 3px; }
.md-hand-leiste button.aktiv:not(.md-farbe) { border-color: var(--blau); background: var(--blau-hell); }
.md-flaeche { display: block; width: 100%; height: min(68dvh, 900px); touch-action: none; cursor: crosshair; border: 1px solid var(--linie); border-radius: 8px;
  background: #fff repeating-linear-gradient(transparent 0 35px, #eef0f6 35px 36px); }
.md-hand-fuss { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.md-hand-fuss input { flex: 1; min-width: 0; }

/* Tablet hochkant und kleiner: Menü hinter dem Knopf, als Liste mit Überschriften zum Antippen */
@media (max-width: 900px) {
  .kopf { padding: 8px 16px; }
  .menue-knopf { display: flex; }
  .kopf nav { display: none; flex: none; position: absolute; top: 100%; right: 0; width: min(340px, 100vw); max-height: calc(100dvh - 64px); margin: 0; overflow-y: auto;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; padding: 10px; background: #fff;
    border: 1px solid var(--linie); border-top: none; border-radius: 0 0 0 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); }
  .kopf.menue-offen nav { display: flex; }
  .kopf nav a:not(.knopf) { padding: 11px 14px; font-size: 16px; }
  .nav-knopf, .nav-gruppe.aktiv > .nav-knopf { display: flex; width: 100%; padding: 12px 14px 4px; background: none; color: var(--grau); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; pointer-events: none; }
  .nav-knopf::after, .nav-zahl { display: none !important; }
  .nav-liste, .nav-gruppe.offen > .nav-liste { display: flex; position: static; min-width: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .nav-ich { margin: 8px 0 0; border-top: 1px solid var(--linie); }
  .nav-ich .nav-knopf { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
}

/* Touch-Geräte (iPad, Handy): größere Tipp-Flächen; 16 px verhindert das Hineinzoomen beim Tippen auf iOS */
@media (pointer: coarse) {
  button, .knopf { min-height: 40px; }
  input, select, textarea { font-size: 16px; }
  input:not([type=checkbox]):not([type=radio]), select { min-height: 40px; }
}

@media (max-width: 1000px) {
  .zwei, .belege { grid-template-columns: 1fr 1fr; }
  .raster { grid-template-columns: 1fr 1fr; }
  .brief, .tf-felder { grid-template-columns: 1fr; }
  .kennzahlen { grid-template-columns: repeat(3, 1fr); }
  .eingang-seite { grid-template-columns: 1fr; }
  .z-seite { grid-template-columns: 1fr; }
  .z-vorschau { position: static; max-height: none; }
  .z-felder { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .eingang-dokument { position: static; }
  .pdf-rahmen { height: 70vh; }
  .k-tag { min-height: 80px; }
  .k-eintrag .pnr { display: none; }
  .brief-rechts { position: static; }
}

/* Handy (nach dem Tablet-Block, damit diese Werte gelten): Listen als Karten, Formulare einspaltig */
@media (max-width: 700px) {
  .b-mein { flex-wrap: wrap; row-gap: 2px; }
  .b-mein-rest { width: 100%; padding-left: 64px; }
  .kopf { padding: 6px 12px; }
  .marke img { height: 34px; }
  /* Handy: Leiste unten mit dem Wichtigsten, „Mehr“ öffnet das Menü über die ganze Fläche */
  :root { --unten: 60px; }
  .menue-knopf { display: none; }
  .kopf nav { position: fixed; top: 46px; right: 0; bottom: var(--unten); left: 0; width: auto; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .unten { display: flex; position: fixed; right: 0; bottom: 0; left: 0; z-index: 15; height: var(--unten); background: #fff; border-top: 1px solid var(--linie); box-shadow: 0 -2px 10px rgba(0, 0, 0, .06); }
  .unten a, .unten button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 0; padding: 4px 2px; border: 0; border-radius: 0; background: none; color: var(--grau); font-size: 11px; text-decoration: none; }
  .unten .aktiv, .unten button[aria-expanded="true"] { color: var(--blau); font-weight: 600; }
  .unten-symbol { font-size: 20px; line-height: 1.15; }
  .unten .zaehler { position: absolute; top: 3px; left: calc(50% + 6px); }
  .unten-scan { color: var(--blau) !important; font-weight: 600; }
  .unten-scan .unten-symbol { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: var(--blau); box-shadow: 0 3px 10px rgba(31, 43, 184, .4); font-size: 23px; }
  body:has(input:focus, textarea:focus) .unten { display: none; }
  main { padding-left: 12px; padding-right: 12px; }
  table.pos, table.lv, table.zahlungen, table.vorlagen, table.nummern { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Listen: jede Zeile eine Karte, die Spaltenüberschrift steht vor dem Wert (data-label setzt app.js) */
  table.liste { display: block; border: none; background: transparent; overflow: visible; }
  table.liste thead { display: none; }
  table.liste tbody { display: flex; flex-direction: column; gap: 8px; }
  table.liste tr { display: block; background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: 8px 12px; }
  table.liste tr.gruppe { background: transparent; border: none; padding: 8px 2px 0; font-weight: 600; }
  table.liste td { display: block; padding: 3px 0 !important; border: none; text-align: right; overflow-wrap: anywhere; }
  table.liste td::after { content: ''; display: block; clear: both; }
  table.liste td[data-label]::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--grau); font-size: 12px; line-height: 20px; text-align: left; }
  table.liste td:first-child { text-align: left; font-size: 15px; }
  table.liste td:first-child::before { content: none; }
  table.liste td:empty { display: none; }
  table.liste td.leer { display: block; text-align: center; }
  .raster { grid-template-columns: 1fr; }
  .raster .s2, .raster .s3 { grid-column: auto; }
  .p-bereiche { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .p-bereich-kopf { font-size: 14px; gap: 6px; }
  .p-bereich-kopf b { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
  .p-bereich { min-height: 0; padding: 10px 12px 12px; }
  .p-bereich-text { -webkit-line-clamp: 2; }
  dialog.p-bereich-dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; padding: 8px 8px 12px; border-radius: 0; }
  .p-bereich-dlg-kopf { top: -8px; margin: -8px -8px 8px; padding: 8px; }
  .titelzeile .knoepfe { flex-wrap: wrap; }
  .start-kopf { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 4px; }
  .start-logo { width: 190px; max-width: 60vw; }
  .start-logo-spalte { align-items: flex-start; }
  .start-gruss h1 { font-size: 22px; }
  .start-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .start-kachel { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 128px; min-width: 0; padding: 14px; }
  .start-text { width: 100%; }
  .start-text b { font-size: 15px; overflow-wrap: anywhere; hyphens: auto; }
  .filter > *, .b-werkzeuge > *, .titelzeile > * { max-width: 100%; }
  .filter select, .b-werkzeuge select { max-width: 100%; }
  .reiter { max-width: 100%; overflow-x: auto; }
  .start-symbol { width: 44px; height: 44px; }
  .start-demnaechst li a { grid-template-columns: 1fr; gap: 2px; }
  /* Chat: entweder die Kanalliste oder der offene Kanal, jeweils über die ganze Breite */
  main.chat-ansicht { padding: 0; }
  .chat-seite { grid-template-columns: 1fr; gap: 0; height: calc(100dvh - 47px - var(--unten)); }
  .chat-liste, .chat-verlauf { border-radius: 0; border: none; }
  .chat-seite.mit-kanal .chat-liste, .chat-seite:not(.mit-kanal) .chat-verlauf { display: none; }
  .ch-zurueck { display: inline; }
  .cn { max-width: 86%; }
  .cn-bilder img { max-width: 200px; }
  .filter { flex-wrap: wrap; }
  .titelzeile h1 { font-size: 22px; }
  .zwei { grid-template-columns: 1fr; }
  .kennzahlen { grid-template-columns: 1fr 1fr; }
  .k-listentag, .p-termin { grid-template-columns: 1fr; gap: 2px; }
  .m-liste { grid-template-columns: 1fr; }
  .b-werkzeuge input[type=search] { width: 100%; }
  .plan-rahmen { height: calc(100dvh - 190px - var(--unten)); }
  .plan-knoepfe { width: 100%; }
  /* Arbeitszeit: Einträge zweizeilig, große Knöpfe für die Stempeluhr */
  .zt-eintrag, .zt-anwesend-zeile { grid-template-columns: 1fr auto; }
  .zt-eintrag .zt-was, .zt-anwesend-zeile .zt-was { grid-column: 1 / -1; grid-row: 2; }
  .zt-block { grid-template-columns: 1fr 1fr 70px auto; }
  .zt-zeit small { display: inline; margin-left: 6px; }
  .zt-uhr-knoepfe > button { flex: 1 1 auto; }
  .zt-laufzeit { font-size: 30px; }
  .zt-summe { margin-left: 0; }
  .zt-balken-zeile { grid-template-columns: 1fr 56px; }
  .zt-balken-wert { grid-column: 1 / -1; grid-row: 2; }
  /* Baustelle: Reiter in zwei Spalten statt seitlich zu scrollen */
  .b-reiter { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
  .b-reiter button, .b-reiter a { white-space: normal; border-top: 1px solid var(--linie); margin-top: -1px; padding: 8px 10px; }
  .b-reiter button:nth-child(odd), .b-reiter a:nth-child(odd) { border-left: none; }
  .b-reiter button:last-child:nth-child(odd), .b-reiter a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Notizen, Lieferungen: Knöpfe über die ganze Breite, Einträge kompakt */
  .md-knoepfe > * { flex: 1 1 auto; justify-content: center; text-align: center; }
  .md-filterzeile, .md-filter, .md-filterzeile input[type=search] { width: 100%; }
  .md-eintrag { grid-template-columns: 44px minmax(0, 1fr); padding: 8px 10px; }
  .md-aktionen { grid-column: 2; }
  .md-flaeche { height: calc(100dvh - 190px - var(--unten)); }
}

/* ---------- Formulare (web/formulare.js): Liste, Eingabemaske mit Mikrofon je Feld, Unterschrift ---------- */
.fo-neu { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fo-tab tbody tr { cursor: pointer; }
.fo-kurz { color: var(--grau); max-width: 380px; }
.fo-tab .unter { display: block; }
.klein-knopf { padding: 3px 10px; font-size: 13px; min-height: 0; }
.fo-kopf { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin: -6px 0 12px; }
.fo-kopf .fo-fehler { color: var(--rot); font-weight: 600; }
.fo-tipp { font-size: 13px; }
/* Schnelleingabe: alles auf einmal sagen (web/formulare.js, web/formular-text.js) */
.fo-schnell-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; }
dialog.fo-schnell { width: min(680px, 94vw); }
dialog.fo-schnell textarea { min-height: 110px; }
.fo-schnell-vorschau { margin-top: 10px; max-height: 42vh; overflow: auto; }
.fo-schnell-vorschau label.haken { align-items: flex-start; margin: 6px 0; }
.fo-schnell-vorschau label.haken input { margin-top: 3px; }
.fo-schnell-rest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.fo-schnell-rest select { width: auto; max-width: 100%; }
.fo-abschnitt .karten-kopf .knopf { margin-left: auto; }
.fo-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fo-feld .fo-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--grau); min-height: 32px; }
.fo-eingabe { display: flex; align-items: center; gap: 6px; }
.fo-eingabe input, .fo-eingabe textarea { flex: 1; min-width: 0; width: 100%; }
.fo-eingabe textarea { resize: vertical; overflow: hidden; }
.fo-einheit { color: var(--grau); font-size: 13px; }
.fo-mic { flex: none; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; font-size: 16px; line-height: 1; }
.fo-mic.hoert { background: #d92c2c; border-color: #d92c2c; animation: fo-puls 1s ease-in-out infinite; }
.fo-mic.arbeitet { opacity: .5; cursor: progress; }
@keyframes fo-puls { 50% { box-shadow: 0 0 0 7px rgba(217, 44, 44, .25); } }
.fo-haken { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.fo-haken input { width: 22px; height: 22px; flex: none; }
.fo-tabelle { display: flex; flex-direction: column; gap: 4px; }
.fo-tzeile { display: flex; gap: 6px; align-items: center; }
.fo-tkopf { font-size: 12px; color: var(--grau); font-weight: 600; }
.fo-tnr { width: 26px; flex: none; color: var(--grau); font-size: 12px; text-align: right; }
.fo-tz { flex: 1 1 90px; min-width: 0; display: block; }
.fo-tz.fo-tbreit { flex: 3 1 220px; }
.fo-tz.fo-tklein { flex: 0 1 80px; }
.fo-tz.fo-thaken { flex: 0 0 56px; text-align: center; }
.fo-tname { display: none; }
.fo-tfeld { display: flex; gap: 4px; align-items: center; }
.fo-tfeld input { width: 100%; min-width: 0; }
.fo-tfeld input[type=checkbox] { width: 22px; height: 22px; margin: auto; }
.fo-tfeld .fo-mic { width: 30px; height: 30px; font-size: 14px; }
.fo-tweg { flex: none; width: 30px; min-height: 0; padding: 4px 0; border-color: transparent; background: transparent; color: var(--grau); }
.fo-tkopf .fo-tweg { visibility: hidden; }
.fo-plus { margin-top: 8px; }
.fo-u-feld { display: flex; align-items: center; justify-content: center; min-height: 70px; max-width: 420px; margin: 4px 0; border: 1px dashed var(--linie); border-radius: 6px; background: #fafbfd; }
.fo-u-feld img { max-width: 100%; max-height: 110px; }
.fo-u-knoepfe { margin-top: 6px; }
dialog.fo-u-dialog { width: min(720px, 98vw); }
.fo-u-pad { position: relative; margin-top: 10px; border: 1px solid var(--linie); border-radius: 6px; background: #fff; }
.fo-u-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; }
.fo-u-pad button { position: absolute; top: 6px; right: 6px; }
dialog.fo-auswahl { display: none; flex-direction: column; }
dialog.fo-auswahl[open] { display: flex; }
.fo-auswahl-suche { margin-bottom: 8px; }
.fo-auswahl-liste { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.fo-auswahl-eintrag { display: block; width: 100%; text-align: left; }
.fo-auswahl-eintrag.gewaehlt { background: var(--blau-hell); border-color: #b9bff3; }
.fo-verlauf summary { cursor: pointer; font-weight: 600; }
.fo-verlauf ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.fo-warnung { margin: 0 0 12px; }
@media (max-width: 700px) {
  .fo-neu > * { flex: 1 1 auto; }
  .fo-raster { grid-template-columns: 1fr 1fr; }
  .fo-raster > .fo-feld { grid-column: 1 / -1; }
  .fo-raster > .fo-schmal { grid-column: span 1; }
  /* Tabellenzeilen als Karten mit Beschriftung je Feld */
  .fo-tkopf { display: none; }
  .fo-tzeile { position: relative; flex-wrap: wrap; padding: 24px 8px 8px; border: 1px solid var(--linie); border-radius: 8px; background: #fafbfd; }
  .fo-tnr { position: absolute; top: 5px; left: 8px; width: auto; text-align: left; font-weight: 700; }
  .fo-tz, .fo-tz.fo-tklein, .fo-tz.fo-thaken { flex: 1 1 40%; text-align: left; }
  .fo-tz.fo-tbreit { flex-basis: 100%; }
  .fo-tname { display: block; margin-bottom: 2px; font-size: 11px; color: var(--grau); }
  .fo-tfeld input[type=checkbox] { margin: 4px 0; }
  .fo-tzeile .fo-tweg { position: absolute; top: 0; right: 2px; }
}

/* Fenster im Angebot (web/fenster.js): links die Eingabe, rechts die Zeichnung mit Maßen und der Preis */
dialog.fe-dialog { width: min(1280px, 98vw); max-height: 96vh; padding: 16px 18px; }
dialog.fe-dialog[open] { display: flex; flex-direction: column; }
.fe-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fe-kopf h3 { margin: 0; }
.fe-raster { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.15fr); gap: 16px; min-height: 0; flex: 1; margin-top: 8px; }
.fe-eingabe { overflow: auto; padding-right: 6px; max-height: calc(96vh - 130px); }
.fe-eingabe section { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.fe-eingabe h4 { margin: 0 0 8px; font-size: 14px; color: var(--blau); }
.fe-ansicht { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 8px; max-height: calc(96vh - 130px); overflow: auto; }
.fe-zeichnung { border: 1px solid var(--linie); border-radius: 8px; background: #fff; padding: 6px; }
.fe-zeichnung svg { display: block; width: 100%; height: auto; max-height: 52vh; }
.fe-zeichnung .fe-feld { cursor: pointer; }
.fe-zeichnung .fe-feld:hover { fill: #bcdcf3; }
.fe-typen { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.fe-typen button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; font-size: 11px; line-height: 1.2; white-space: normal; background: #fff; }
.fe-typen button svg { width: 100%; height: 56px; }
.fe-typen button.aktiv { border-color: var(--blau); background: var(--blau-hell); box-shadow: inset 0 0 0 1px var(--blau); }
.fe-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 6px; }
.fe-spalten { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 6px 0; }
.fe-spalten .feld { width: 120px; }
.fe-zeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 4px 0 8px 24px; }
.fe-zeile .feld { width: 190px; }
.fe-oeffnung { display: grid; grid-template-columns: 90px 1fr 150px; gap: 6px; align-items: center; margin-bottom: 6px; }
.fe-oeffnung > span { font-size: 13px; color: var(--grau); }
.fe-material { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.fe-material label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.fe-material input { width: auto; margin: 0; }
.fe-system { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: start; margin-bottom: 8px; }
.fe-system-info { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; }
.fe-system-info img { width: 150px; border: 1px solid var(--linie); border-radius: 6px; background: #fff; }
.fe-posten { width: 100%; border-collapse: collapse; font-size: 13px; }
.fe-posten td { padding: 3px 4px; border-bottom: 1px solid #eef0f5; vertical-align: top; }
.fe-posten td.r { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.fe-posten tr.fe-ep td { border-top: 2px solid var(--text); border-bottom: 0; font-weight: 700; font-size: 15px; padding-top: 6px; }
.fe-vorgaben { width: min(1100px, 98vw); }
.fe-vorgaben section { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.fe-vtab input { width: 100%; min-width: 60px; }
.fe-vtab td { padding: 3px 4px; }
.fe-bearbeiten { color: var(--blau); font-weight: 600; }
.fe-felder .fe-breit { grid-column: span 2; }
.fe-farben { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fe-farbe { display: flex; gap: 8px; align-items: center; }
.fe-farbe select { flex: 1; min-width: 0; }
.fe-farbfeld { flex: 0 0 34px; height: 34px; border: 1px solid var(--linie); border-radius: 6px; background: repeating-linear-gradient(45deg, #e3e6ee 0 5px, #fff 5px 10px); }
.fe-zubehoer { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.fe-zubehoer td { padding: 5px 4px; border-bottom: 1px solid #eef0f5; vertical-align: top; }
.fe-zubehoer td.r { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; padding-top: 8px; }
.fe-zubehoer .warnung { color: #9a5b00; }
.fe-z-wahl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fe-z-wahl select { width: auto; max-width: 100%; font-size: 13px; padding: 3px 6px; }
.fe-z-menge { white-space: nowrap; }
.fe-z-menge input { width: 70px; text-align: right; }
.fe-frei { display: grid; grid-template-columns: 1fr 80px 80px 100px auto; gap: 6px; align-items: end; margin-bottom: 6px; }
.fe-posten tr.fe-zusatz td { color: var(--grau); font-size: 12px; border-bottom: 0; }
/* fefawin (Fenstermodul) */
.titelzeile h1 .fb-logo { height: 78px; width: auto; display: block; }
.titelzeile h1 .fb-logo.klein { height: 34px; display: inline-block; vertical-align: middle; margin-right: 10px; }
@media (max-width: 700px) {
  .titelzeile h1 .fb-logo { height: 56px; }
}
.fb-zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.fb-zahlen > div { background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.fb-zahlen b { font-size: 20px; color: var(--blau); }
.fb-zahlen span { font-size: 12px; color: var(--grau); }
.fb-tab tbody tr { cursor: pointer; }
.fb-aus { white-space: nowrap; }
.fb-aus button { margin: 0 4px 4px 0; }
.fk-gruppe h2 { font-size: 16px; margin: 0 0 8px; }
.fk-preise { font-size: 13px; line-height: 1.5; }
.fk-tab td { vertical-align: top; }
@media (max-width: 1000px) {
  .fe-raster { grid-template-columns: 1fr; }
  .fe-ansicht { position: static; order: -1; max-height: none; }
  .fe-eingabe { max-height: none; overflow: visible; }
  dialog.fe-dialog { overflow: auto; }
  .fe-zeichnung svg { max-height: 40vh; }
  .fe-frei { grid-template-columns: 1fr 1fr; }
  .fe-frei .feld:first-child { grid-column: 1 / -1; }
  .fe-felder .fe-breit { grid-column: 1 / -1; }
  .fe-farben { grid-template-columns: 1fr; }
}

/* ---------- KI: Claude-Connector und Kosten (web/ki.js) ---------- */
.ki-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 8px 0; }
.ki-kacheln > div { background: var(--blau-hell); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ki-kacheln b { font-size: 24px; }
.ki-balken { display: block; height: 8px; background: #fff; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.ki-balken > span { display: block; height: 100%; background: var(--blau); }
.ki-balken.warnung { border: none; padding: 0; margin: 4px 0 0; }
.ki-balken.warnung > span { background: var(--rot); }
.ki-haken { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2px 16px; margin: 6px 0; }
label.haken { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
label.haken input { width: auto; }

/* Firma oben links, fefasoft rechts; Wechsel zu anderen Firmen */
.marke img[hidden], .marke span[hidden] { display: none; }
.marke-name { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
.marke-programm { display: flex; align-items: center; margin-left: 12px; flex-shrink: 0; }
.marke-programm img { height: 30px; width: auto; display: block; }
.firma-wechsel { display: flex; gap: 6px; margin-left: 12px; flex-shrink: 0; }
.firma-wechsel[hidden] { display: none; }
.firma-wechsel a { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 15px; border: 1px solid var(--linie); border-radius: 50%; text-decoration: none; color: var(--text); }
.firma-wechsel a:hover { background: var(--linie); }
.anmelde-firmenlogo { display: block; max-width: 220px; max-height: 110px; margin: 0 auto 10px; }
.anmelde-firmenname { text-align: center; font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.anmelde-logo.anmelde-logo-klein { max-width: 130px; margin: 0 auto 12px; }
.firma-bilder { margin-top: 16px; border-top: 1px solid var(--linie); padding-top: 12px; }
.firma-bilder-zeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.firma-bilder img { max-height: 60px; max-width: 180px; background: #fff; border: 1px solid var(--linie); padding: 4px; }
.marke.umschalter:hover img, .marke.umschalter:hover span { opacity: .7; }
@media (max-width: 700px) {
  .marke-programm img { height: 24px; }
  .marke-name { font-size: 15px; max-width: 58vw; overflow: hidden; text-overflow: ellipsis; }
}


/* Firmenwechsel: Farbstreifen oben, damit man immer sieht, in welcher Firma man arbeitet */
html[data-firma] body { border-top: 5px solid #1c4ca0; }
html[data-firma="rauser"] body { border-top-color: #b3261e; }
