/* Köster Bau · Baustellen-App
   Systemschriften (keine externen Fonts, DSGVO), große Bedienflächen für Handschuhe/Tablet. */
:root {
  --grund: #F4F2EE;
  --flaeche: #FFFFFF;
  --tinte: #1C1F23;
  --leise: #5F6368;
  --linie: #E2DED6;
  --linie-hell: #EFECE6;
  --eingabe: #CFCAC0;
  --akzent: #166A1F;
  --akzent-dunkel: #0E4A15;
  --akzent-hell: #E8F1E9;
  --blau: #1F5F8B;
  --blau-hell: #EAF2F8;
  --gruen: #1E6B3A;
  --gruen-hell: #EEF5EC;
  --rot: #9B1C1C;
  --rot-hell: #FBEAEA;
  --gelb-hell: #FFF4E5;
  --gelb-rand: #F0B46B;
  --kopf: #1C1F23;
  --radius: 10px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 16px/1.45 var(--schrift); }
h1 { font-size: 26px; margin: 0; line-height: 1.2; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--blau); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.rechts { text-align: right; }
.versteckt { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.laden { padding: 24px; color: var(--leise); }
.leer { color: var(--leise); margin: 4px 0; }
.meta { font-size: 13px; color: var(--leise); }
.meta.ok, .ok-text { color: var(--gruen); font-weight: 600; }
.warn-text { color: var(--akzent-dunkel); font-weight: 600; }
.ueberzeile { font-size: 13px; color: var(--leise); font-weight: 500; }
.vorformatiert { white-space: pre-wrap; }

/* ---------- Rahmen ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--kopf); color: #fff;
}
.marke { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 16px; }
.marke-unter { color: #C9CCD1; }
.logo { width: 30px; height: 30px; border-radius: 6px; background: var(--akzent); display: inline-flex; align-items: center; justify-content: center; }
.kopf-rechts { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #3A3F45; color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.offline-badge { font-size: 12px; font-weight: 600; background: #D97706; color: #1C1F23; padding: 4px 8px; border-radius: 12px; }

.rumpf { display: flex; align-items: flex-start; }
.seitennav { display: none; }
.inhalt { flex: 1; min-width: 0; padding: 16px 16px 96px; max-width: 1200px; margin: 0 auto; outline: none; }
.untennav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--flaeche); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.untennav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; font-size: 11px; color: var(--leise); text-decoration: none; text-align: center; line-height: 1.1; padding: 4px 2px; }
.untennav a[aria-current="page"] { color: var(--akzent-dunkel); font-weight: 700; }

@media (min-width: 900px) {
  .untennav { display: none; }
  .seitennav {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 56px;
    width: 220px; min-height: calc(100vh - 56px); padding: 16px 10px;
    background: var(--flaeche); border-right: 1px solid var(--linie);
  }
  .seitennav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; color: #3A3F45; text-decoration: none; font-size: 15px; }
  .seitennav a:hover { background: var(--grund); }
  .seitennav a[aria-current="page"] { background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 600; }
  .inhalt { padding: 24px 28px 48px; }
}

/* ---------- Bausteine ---------- */
.stapel { display: flex; flex-direction: column; gap: 16px; }
.stapel.klein { gap: 10px; }
.card { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.card.ohne-polster { padding: 0; overflow: hidden; }
details.card > summary, details > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.card[open] > summary { margin-bottom: 12px; }
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kopfzeile.umbruch { flex-wrap: wrap; align-items: flex-end; }
.reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.raster-2, .raster-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.zwei-spalten { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .zwei-spalten { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--eingabe);
  background: var(--flaeche); color: var(--tinte); text-decoration: none; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
.btn.primaer:hover { background: var(--akzent-dunkel); }
.btn.sekundaer:hover { background: var(--grund); }
.btn.leise { border-color: transparent; background: transparent; color: var(--blau); }
.btn.gross { min-height: 52px; font-size: 16px; padding: 0 20px; }
.btn.rund { width: 44px; padding: 0; }

.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.feld > label, .feld > .label { font-size: 14px; font-weight: 600; }
.feld .hilfe { font-size: 12px; color: var(--leise); }
input:not([type="checkbox"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--eingabe); border-radius: 8px; background: var(--flaeche);
}
textarea { resize: vertical; }
input:disabled, textarea:disabled { background: var(--grund); color: var(--leise); }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--akzent); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: var(--grund); color: #3A3F45; white-space: nowrap; }
.badges { display: inline-flex; gap: 6px; }
.badge.warn { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.badge.info { background: var(--blau-hell); color: #174766; }
.status-entwurf, .status-neu { background: var(--grund); }
.status-eingereicht { background: var(--blau-hell); color: #174766; }
.status-freigegeben, .abw-genehmigt, .zusatz-nachtrag { background: var(--gruen-hell); color: var(--gruen); }
.abw-beantragt { background: var(--gelb-hell); color: var(--akzent-dunkel); }
.abw-abgelehnt { background: var(--rot-hell); color: var(--rot); }
.abw-gemeldet { background: var(--rot-hell); color: var(--rot); }
.zaehler { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--akzent); color: #fff; }

.hinweis { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; background: var(--gelb-hell); border: 1px solid var(--gelb-rand); border-radius: 8px; font-size: 14px; }
.hinweis svg { color: var(--akzent-dunkel); flex: none; }
.zurueck { font-weight: 600; text-decoration: none; }

.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th, .tabelle td { padding: 10px 8px; border-bottom: 1px solid var(--linie-hell); text-align: left; }
.tabelle th { font-size: 13px; color: var(--leise); }
.tabelle tr.inaktiv td { color: var(--leise); }
.tabellen-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.listenzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--linie-hell); color: inherit; text-decoration: none; }
.listenzeile:last-child { border-bottom: 0; }
a.listenzeile:hover b { text-decoration: underline; }
.link-zeile { display: block; margin-top: 10px; font-weight: 600; }

/* ---------- Mein Tag ---------- */
.einsatz h2 { font-size: 22px; margin: 4px 0; }
.einsatz.dunkel { background: var(--kopf); color: #fff; border-color: var(--kopf); }
.einsatz.dunkel .meta, .einsatz.dunkel .ueberzeile { color: #C9CCD1; }
.einsatz .btn { margin-top: 10px; width: 100%; }
.gross-text { font-size: 18px; font-weight: 600; margin-top: 6px; }
.info { padding: 12px; border-radius: 8px; background: var(--blau-hell); margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.info.dringend, .info.krank { background: var(--akzent-hell); }
.zahlen { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.zahl-kachel { display: flex; flex-direction: column; padding: 12px 14px; border: 1px solid var(--linie); border-radius: 8px; color: inherit; text-decoration: none; }
.zahl-kachel span { font-size: 13px; color: var(--leise); }
.zahl-kachel b { font-size: 28px; font-family: var(--mono); }
.kachelgitter { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .kachelgitter { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kachel { display: flex; flex-direction: column; gap: 6px; padding: 14px; min-height: 96px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); color: var(--tinte); text-decoration: none; }
.kachel svg { color: var(--akzent); }
.kachel span { font-size: 12px; color: var(--leise); }

/* ---------- Tagesbericht ---------- */
.auswahl-leiste { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .auswahl-leiste { grid-template-columns: 2fr 1fr; } }
.auswahl-leiste .feld { margin: 0; }
.zeile { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--linie-hell); }
.zeile-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.stepper { display: flex; align-items: center; gap: 6px; }
.zahl-eingabe { width: 64px !important; text-align: center; font-family: var(--mono); font-size: 17px; padding: 8px 4px !important; }
select.hinzu { margin-top: 10px; color: var(--blau); font-weight: 600; }
.zusatz-karte { border-color: #E8A07A; }
.zusatz { padding: 12px; background: var(--akzent-hell); border-radius: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.zusatz.bearbeiten { align-items: stretch; }
.zusatz.bearbeiten .feld { margin-bottom: 4px; }
.fotos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin-top: 8px; }
.fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; background: var(--linie); }
.aktionsleiste { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.aktionsleiste .btn { flex: 1 1 200px; }
@media (min-width: 900px) { .aktionsleiste .btn { flex: 0 0 auto; } }

/* ---------- Pinnwand ---------- */
.eintrag { padding: 12px 0; border-bottom: 1px solid var(--linie-hell); display: flex; flex-direction: column; gap: 6px; }
.eintrag:last-child { border-bottom: 0; }
.eintrag.dringend { border-left: 0; }
.eintrag.dringend > .kopfzeile b::before { content: "● "; color: var(--akzent); }
.eintrag.erledigt b { color: var(--leise); }
.eintrag .reihe input { flex: 1 1 200px; width: auto; }
.neu-karte.hervor { border: 2px solid var(--akzent); }
details .neu-karte { border: 0; padding: 0; }

/* ---------- Planung ---------- */
.plan { border-collapse: collapse; width: 100%; min-width: 820px; font-size: 13px; }
.plan th, .plan td { border-bottom: 1px solid var(--linie-hell); padding: 6px; text-align: left; vertical-align: top; }
.plan thead th { font-size: 13px; color: var(--leise); padding: 10px 6px; background: var(--flaeche); }
.plan thead th.heute { color: var(--akzent-dunkel); }
.plan tbody th { width: 180px; padding-left: 14px; }
.plan tbody th b { display: block; font-size: 14px; }
.plan tbody th span { font-size: 12px; color: var(--leise); font-weight: 400; }
.plan tr.trenner th { background: var(--grund); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); padding: 6px 14px; }
.plan tfoot th, .plan tfoot td { background: #F8F6F2; padding: 10px 6px; }
.plan tfoot th { padding-left: 14px; }
.zelle select { min-height: 38px; padding: 4px 6px; font-size: 13px; background: var(--bg, var(--flaeche)); border-color: transparent; font-weight: 500; }
.zelle:not([style]) select { border: 1.5px dashed var(--eingabe); color: var(--leise); }
.zelle .bs { display: block; padding: 8px; border-radius: 6px; background: var(--bg); font-weight: 500; }
.zelle .frei { display: block; padding: 8px; border: 1.5px dashed var(--eingabe); border-radius: 6px; color: var(--leise); }
.zelle.konflikt select, .zelle.konflikt .bs { outline: 2px solid #D97706; outline-offset: -2px; }
.konflikt-text { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--akzent-dunkel); font-weight: 600; margin-top: 2px; }
.abw { display: block; font-size: 11px; font-weight: 700; margin-bottom: 3px; border-radius: 4px; padding: 2px 6px; }
.abw-urlaub { background: #ECEAE5; color: #3A3F45; }
.abw-krank { background: var(--rot-hell); color: var(--rot); }
.legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* ---------- Baustellen & Verwaltung ---------- */
.kartengitter { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.baustelle-karte { color: inherit; text-decoration: none; border-left: 6px solid var(--bg); display: flex; flex-direction: column; gap: 4px; }
a.baustelle-karte:hover { border-color: var(--eingabe); border-left-color: var(--bg); }
.farben { display: flex; flex-wrap: wrap; gap: 8px; }
.farben button { width: 44px; height: 44px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.farben button[aria-checked="true"] { border-color: var(--tinte); box-shadow: inset 0 0 0 2px #fff; }
.geraet-zeile { display: grid; gap: 8px; grid-template-columns: 1fr; padding: 10px 0; border-bottom: 1px solid var(--linie-hell); align-items: center; }
@media (min-width: 640px) { .geraet-zeile { grid-template-columns: 2fr 1fr auto auto; } .geraet-zeile.neu { grid-template-columns: 2fr 1fr auto; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-form { width: 100%; max-width: 380px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; }
.login-logo { width: 52px; height: 52px; border-radius: 12px; background: var(--akzent); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.login-form .unter { color: var(--leise); margin: 0 0 20px; text-align: center; }
.login-firmenlogo { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto 14px; }
.login-claim { text-align: center; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 17px; color: var(--akzent); margin: 0 0 14px; }
.fehlertext { color: var(--rot); font-weight: 600; min-height: 1.4em; }

/* ---------- Meldungen ---------- */
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { max-width: 520px; padding: 12px 16px; border-radius: 8px; background: var(--kopf); color: #fff; font-weight: 500; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.toast-fehler { background: var(--rot); }
.toast-hinweis { background: #8A4B08; }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(28, 31, 35, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--flaeche); border-radius: 12px; padding: 20px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.dialog.breit { max-width: 900px; max-height: 85vh; }
.datei-vorschau { margin: 0; overflow: auto; font: 13px/1.5 var(--mono); background: var(--grund); padding: 12px; border-radius: 8px; }

/* ---------- nur Demo ---------- */
.demo-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--linie); display: flex; flex-direction: column; gap: 10px; }
.demo-titel { font-weight: 700; margin: 0; }
.demo-rollen { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo-rollen .btn { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; min-height: 52px; white-space: normal; text-align: left; }
.demo-rollen .btn span { font-size: 12px; color: var(--leise); font-weight: 400; }

/* ---------- Planung als Balkenplan (Gantt) ---------- */
.gantt-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gantt { --namen: 190px; --tagpx: 44px; min-width: calc(var(--namen) + var(--n) * var(--tagpx)); font-size: 13px; user-select: none; -webkit-user-select: none; }
@media (max-width: 700px) { .gantt { --namen: 128px; } }
.g-zeile { display: grid; grid-template-columns: var(--namen) repeat(var(--n), minmax(var(--tagpx), 1fr)); position: relative; min-height: 44px; border-bottom: 1px solid var(--linie-hell); }
.g-name { grid-column: 1; grid-row: 1; position: sticky; left: 0; z-index: 4; background: var(--flaeche); padding: 6px 10px 6px 14px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--linie); min-width: 0; }
.g-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name span { font-size: 12px; color: var(--leise); }
.g-kopf { min-height: 0; background: var(--flaeche); }
.g-kopf .g-name { font-weight: 600; color: var(--leise); }
.g-woche { grid-row: 1; padding: 8px 6px 2px; font-weight: 700; font-size: 12px; color: var(--leise); border-left: 1px solid var(--linie); }
.g-tag { grid-row: 1; display: flex; flex-direction: column; align-items: center; padding: 4px 0 6px; color: var(--leise); }
.g-tag b { font-size: 14px; color: var(--tinte); font-variant-numeric: tabular-nums; }
.g-tag.heute b { background: var(--akzent); color: #fff; border-radius: 12px; padding: 0 7px; }
.g-tag.heute span { color: var(--akzent-dunkel); font-weight: 700; }
.g-zelle { grid-row: 1; border-left: 1px solid var(--linie-hell); display: flex; align-items: center; justify-content: center; }
.wochenstart { border-left: 1px solid var(--eingabe) !important; }
.g-zelle.heute { background: rgba(194, 65, 12, .05); }
.g-abschnitt { padding: 6px 14px; background: var(--grund); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); position: sticky; left: 0; border-bottom: 1px solid var(--linie-hell); }
.g-bs { min-height: 36px; }
.g-bs .g-name { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
.punkt { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.anzahl { background: var(--bg); min-width: 26px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-person { min-height: 48px; }
.gantt.bearbeitbar .g-person .g-zelle { cursor: cell; }
.gantt.bearbeitbar .g-person .g-zelle:hover { background: var(--blau-hell); }
.g-zelle.markiert { background: rgba(31, 95, 139, .22) !important; }
.g-zelle.abw-urlaub { background: repeating-linear-gradient(135deg, #ECEAE5 0 6px, #F6F4F0 6px 12px); }
.g-zelle.abw-krank { background: repeating-linear-gradient(135deg, var(--rot-hell) 0 6px, #FDF4F4 6px 12px); }
.abw-text { font-size: 11px; font-weight: 700; color: #3A3F45; }
.abw-krank .abw-text { color: var(--rot); }
.g-balken {
  grid-row: 1; z-index: 2; align-self: center; position: relative; margin: 0 3px; height: 34px; min-width: 0;
  background: var(--bg); border: 1px solid rgba(0, 0, 0, .12); border-radius: 7px; padding: 0 10px;
  display: flex; align-items: center; font: inherit; font-size: 13px; font-weight: 600; color: var(--tinte); text-align: left; overflow: hidden;
}
.g-balken > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
button.g-balken { cursor: pointer; }
button.g-balken:hover { box-shadow: 0 0 0 2px var(--tinte) inset; }
.g-balken.zieht { box-shadow: 0 0 0 2px var(--blau) inset, 0 4px 12px rgba(0, 0, 0, .18); z-index: 5; }
.griff { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; touch-action: none; }
.griff.links { left: 0; }
.griff.rechts { right: 0; }
.griff::after { content: ""; position: absolute; top: 9px; bottom: 9px; left: 5px; width: 3px; border-radius: 2px; background: rgba(0, 0, 0, .28); opacity: 0; }
.g-balken:hover .griff::after, .g-balken.zieht .griff::after { opacity: 1; }
@media (pointer: coarse) { .griff { width: 22px; } .griff::after { opacity: 1; left: 9px; } }
.g-konflikt { grid-row: 1; z-index: 3; align-self: start; justify-self: end; margin: 2px 4px 0 0; width: 20px; height: 20px; border-radius: 50%; background: #D97706; color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.g-fuss { background: #F8F6F2; min-height: 36px; }
.g-fuss .g-name { background: #F8F6F2; }
.g-fuss .g-zelle { font-variant-numeric: tabular-nums; }
.segment { display: inline-flex; border: 1px solid var(--eingabe); border-radius: 8px; overflow: hidden; }
.segment a { min-height: 42px; padding: 0 12px; display: inline-flex; align-items: center; color: var(--tinte); text-decoration: none; background: var(--flaeche); }
.segment a + a { border-left: 1px solid var(--eingabe); }
.segment a[aria-current="true"] { background: var(--tinte); color: #fff; font-weight: 600; }
.planen-dialog { max-width: 640px; overflow: auto; }
.planen-dialog .label { font-size: 14px; font-weight: 600; }
.wer-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; max-height: 220px; overflow: auto; margin-top: 8px; }
.wer-liste .check { min-height: 36px; }
.wer-trenner { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--leise); margin-top: 6px; }
.bs-wahl { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.bs-knopf { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1px solid var(--eingabe); border-radius: 8px; background: var(--flaeche); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.bs-knopf i { width: 18px; height: 18px; border-radius: 4px; background: var(--bg); flex: none; border: 1px solid rgba(0, 0, 0, .1); }
.bs-knopf:hover { background: var(--grund); }
.bs-knopf.aktuell { border: 2px solid var(--tinte); }

/* Zoomstufen der Planung */
.monatsstart { border-left: 2px solid var(--tinte) !important; }
.g-monat { grid-row: 1; padding: 8px 6px 2px; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; }
.g-woche { white-space: nowrap; overflow: hidden; }
.bs-zeitraum { background: color-mix(in srgb, var(--bg) 28%, transparent); }
.fuellung { display: block; width: 100%; height: 22px; background: var(--bg); }
.gantt.mittel .g-tag b { font-size: 13px; }
.gantt.mittel .g-balken { margin: 0 2px; padding: 0 8px; }
.gantt.eng .g-zelle { border-left: 0; }
.gantt.eng .g-woche { padding: 2px 3px 6px; font-size: 11px; font-weight: 600; border-left: 1px solid var(--linie); }
.gantt.eng .g-balken { margin: 0 1px; padding: 0 5px; height: 28px; font-size: 12px; border-radius: 5px; }
.gantt.eng .griff { width: 8px; }
.gantt.eng .griff::after { left: 2px; width: 2px; top: 7px; bottom: 7px; }
.gantt.eng .g-konflikt { align-self: stretch; justify-self: stretch; width: auto; height: 5px; margin: 0; border-radius: 0; }
.gantt.eng .frei-markiert { background: rgba(217, 119, 6, .35); }
.gantt.eng .g-zelle.heute { background: rgba(194, 65, 12, .18); }
.gantt.jahr .g-woche { padding-left: 1px; font-size: 10px; }
.gantt.jahr .g-balken > span:first-child { font-size: 11px; }
.gantt.jahr .wochenstart { border-left-color: var(--linie-hell) !important; }
.gantt.jahr .monatsstart { border-left: 2px solid var(--tinte) !important; }

/* ---------- Baustellen-Auswertung ---------- */
.soll-ist { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.soll-ist-zeile { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.soll-ist.gross .soll-ist-zeile { font-size: 16px; }
.fortschritt { display: flex; height: 10px; background: var(--grund); border-radius: 5px; overflow: hidden; }
.soll-ist.gross .fortschritt { height: 16px; margin-top: 4px; }
.fortschritt .frei { background: var(--gruen); }
.fortschritt .frei.ueber { background: var(--akzent); }
.fortschritt .offen { background: repeating-linear-gradient(135deg, #8FB79C 0 4px, #B8D3C0 4px 8px); }
.zahl-kachel b { font-variant-numeric: tabular-nums; }
.wochen-diagramm { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 8px; overflow-x: auto; }
.woche-saeule { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.woche-saeule .wert { font-size: 11px; color: var(--leise); font-variant-numeric: tabular-nums; }
.saeule { flex: 1; width: 100%; max-width: 40px; display: flex; flex-direction: column; justify-content: flex-end; border-bottom: 1px solid var(--eingabe); }
.saeule .frei { background: var(--gruen); border-radius: 3px 3px 0 0; }
.saeule .offen { background: repeating-linear-gradient(135deg, #8FB79C 0 4px, #B8D3C0 4px 8px); border-radius: 3px 3px 0 0; }
.saeule .offen + .frei { border-radius: 0; }
.woche-saeule .achse { font-size: 11px; color: var(--leise); }
.legende .lg-frei { background: var(--gruen); }
.legende .lg-offen { background: repeating-linear-gradient(135deg, #8FB79C 0 3px, #B8D3C0 3px 6px); }
.tabelle .rechts { text-align: right; }

/* ---------- Chat ---------- */
.nav-zaehler { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--akzent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.untennav a { position: relative; }
.untennav .nav-zaehler { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
.chat-gruppe { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); padding: 14px 16px 6px; margin: 0; }
details > summary.chat-gruppe { padding-bottom: 14px; }
.chat-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--linie-hell); color: inherit; text-decoration: none; min-height: 64px; }
.chat-zeile:hover { background: var(--grund); }
.chat-zeile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-zeile-text .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-punkt { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid rgba(0, 0, 0, .1); }
.chat-leer { padding: 8px 16px 16px; }
.chat-seite { display: flex; flex-direction: column; height: calc(100dvh - 56px - 32px - 70px); min-height: 360px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 900px) { .chat-seite { height: calc(100dvh - 56px - 72px); } }
.chat-kopf { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--linie); }
.chat-kopf h1 { font-size: 18px; }
.chat-verlauf { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--grund); }
.chat-tag { text-align: center; margin: 8px 0; }
.chat-tag span { font-size: 12px; font-weight: 600; color: var(--leise); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 2px 10px; }
.blase { align-self: flex-start; max-width: min(78%, 560px); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px 12px 12px 4px; padding: 6px 10px 4px; display: flex; flex-direction: column; gap: 2px; }
.blase.eigen { align-self: flex-end; background: var(--akzent-hell); border-color: #F3C6AC; border-radius: 12px 12px 4px 12px; }
.blase.wartend { opacity: .65; }
.blase p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.blase-name { font-size: 12px; color: var(--blau); }
.blase-zeit { align-self: flex-end; font-size: 11px; color: var(--leise); font-variant-numeric: tabular-nums; }
.blase-fotos { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 4px 0; }
.blase-fotos img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; display: block; }
.chat-eingabe { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-top: 1px solid var(--linie); background: var(--flaeche); }
.chat-eingabe textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 14px; }
.chat-eingabe .btn.rund { flex: none; border-radius: 50%; }

/* ---------- Rollen & Rechte ---------- */
.tabelle .mitte { text-align: center; }
.rechte-tabelle { min-width: 640px; }
.rechte-tabelle tbody th { font-weight: 500; color: var(--tinte); font-size: 14px; }
.rechte-tabelle tr.rechte-bereich th { background: var(--grund); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); padding: 8px; }
.rechte-tabelle input[type="checkbox"]:disabled { opacity: .45; }

/* Firmenlogo in der Kopfzeile */
.firmenlogo { height: 28px; width: auto; display: block; background: #fff; padding: 4px 8px; border-radius: 6px; }
