/* H&N App — Komponenten. Werte nur aus tokens.css. 4-px-Raster. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf-hoehe) + 12px); }
body {
  margin: 0; background: var(--grau-seite); color: var(--hn-text);
  font-family: var(--schrift-text); font-weight: 400; line-height: 1.45;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
@media (min-width: 1024px) { body.buero { font-size: 15px; } html:has(body.buero) { font-size: 15px; } }
a { color: var(--hn-logo-blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--hn-navy); }
b, strong { font-weight: 600; }
h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--hn-text); }
h1 { font-family: var(--schrift-titel); font-weight: var(--gewicht-titel); font-size: 1.5rem; letter-spacing: .005em; }
h2 { font-family: var(--schrift-display); font-weight: 800; font-size: 1.15rem; margin: 24px 0 12px; }
h3 { font-family: var(--schrift-display); font-weight: 800; font-size: .95rem; margin: 16px 0 8px; }
p { margin: 8px 0; }
small, .meta { font-size: .82rem; color: var(--hn-text-3); }
.nebentext { color: var(--hn-text-2); }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rechts { text-align: right; }
.zentriert { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[x-cloak] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: var(--radius); }
::selection { background: var(--hn-lightblue); }

/* ---------- Hinweisband (Staging/Local) ---------- */
.band { background: var(--hn-navy); color: #dbe7f3; font-size: .78rem; text-align: center; padding: 4px 16px; }
.band b { color: #fff; }

/* ---------- Kopf: blaue Logo-Flaeche oben links mit schraeger Kante ---------- */
.kopf { position: sticky; top: 0; z-index: 45; display: flex; align-items: stretch; min-height: var(--kopf-hoehe); background: var(--weiss); box-shadow: 0 1px 0 var(--grau-rand), 0 4px 16px rgba(23,44,70,.05); }
.kopf-marke { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 40px 0 16px; background: var(--hn-markenverlauf); color: #fff; text-decoration: none; clip-path: polygon(0 0, 100% 0, calc(100% - 27px) 100%, 0 100%); min-width: 150px; }
.kopf-marke:hover { color: #fff; }
.wortmarke { display: block; width: 128px; height: 30px; background: currentColor; -webkit-mask: url('../img/wortmarke.svg') no-repeat left center / contain; mask: url('../img/wortmarke.svg') no-repeat left center / contain; }
.kopf-marke small { display: block; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin-top: 2px; font-weight: 600; }
.kopf-titel { display: flex; align-items: center; padding: 0 12px; min-width: 0; }
.kopf-titel span { font-family: var(--schrift-display); font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.kopf-nutzer { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-size: .8rem; }
.kopf-nutzer b { font-size: .85rem; }
.kopf-nutzer span { color: var(--hn-text-3); }
.ansicht-wechsel { display: inline-flex; border: 1px solid var(--grau-rand-2); border-radius: var(--radius); overflow: hidden; }
.ansicht-wechsel a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; font-size: .78rem; font-weight: 600; color: var(--hn-text-2); text-decoration: none; }
.ansicht-wechsel a.aktiv { background: var(--hn-navy); color: #fff; }
.menue-knopf { display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch); min-height: 40px; border: 1px solid var(--grau-rand-2); border-radius: var(--radius); background: var(--weiss); font: inherit; font-weight: 600; font-size: .85rem; color: var(--hn-text); cursor: pointer; padding: 0 10px; gap: 6px; }
@media (max-width: 640px) {
  .kopf-marke { min-width: 0; padding-right: 32px; }
  .kopf-marke small { display: none; }
  .wortmarke { width: 104px; height: 26px; }
  .kopf-nutzer { display: none; }
  .kopf-titel { padding: 0 4px; }
}

/* ---------- Navigation Buero/GF (Desktop: Leiste, Handy: Menue) ---------- */
.nav-buero { background: var(--weiss); border-bottom: 1px solid var(--grau-rand); }
.nav-buero ul { list-style: none; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; max-width: 1440px; }
.nav-buero a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--hn-text-2); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav-buero a:hover { color: var(--hn-text); }
.nav-buero a.aktiv { color: var(--hn-logo-blue); border-bottom-color: var(--hn-logo-blue); }
.nav-buero .zaehler { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--hinweis-bg); color: var(--hn-text); font-size: .72rem; line-height: 18px; text-align: center; }
@media (max-width: 1023px) { .nav-buero { display: none; } }
@media (min-width: 1024px) { .nur-handy { display: none !important; } }
@media (max-width: 1023px) { .nur-desktop { display: none !important; } }
.menue-blatt { position: fixed; inset: 0; z-index: 60; background: rgba(23,44,70,.45); display: flex; justify-content: flex-end; }
.menue-blatt nav { width: min(320px, 86vw); height: 100%; background: var(--weiss); box-shadow: var(--schatten-hoch); padding: 12px 0; overflow-y: auto; }
.menue-blatt a, .menue-blatt button.link { display: flex; align-items: center; justify-content: space-between; min-height: var(--touch); padding: 0 20px; color: var(--hn-text); text-decoration: none; font-weight: 600; width: 100%; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; }
.menue-blatt a.aktiv { color: var(--hn-logo-blue); background: var(--grau-zeile); }
.menue-blatt hr { border: 0; border-top: 1px solid var(--grau-rand); margin: 8px 0; }
.menue-blatt svg { width: 20px; height: 20px; flex: none; }
.menue-blatt .klein { font-weight: 400; color: var(--hn-text-2); }

/* ---------- Navigation Monteur (unten) ---------- */
.nav-unten { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--weiss); border-top: 1px solid var(--grau-rand); box-shadow: 0 -4px 16px rgba(23,44,70,.06); padding-bottom: env(safe-area-inset-bottom); }
.nav-unten ul { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 680px; }
.nav-unten a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-unten); color: var(--hn-text-2); text-decoration: none; font-size: .78rem; font-weight: 600; }
.nav-unten a svg { width: 24px; height: 24px; }
.nav-unten a.aktiv { color: var(--hn-logo-blue); box-shadow: inset 0 3px 0 var(--hn-logo-blue); }

/* ---------- Seitenrahmen ---------- */
main { margin: 0 auto; padding: 16px 16px 32px; max-width: 680px; }
body.monteur main { padding-bottom: calc(var(--nav-unten) + 32px); }
body.buero main { max-width: 1440px; padding: 20px 24px 48px; }
body.buero.schmal main { max-width: 960px; }
@media (max-width: 640px) { body.buero main { padding: 16px 16px 40px; } }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin: 4px 0 16px; }
.seitenkopf .unterzeile { margin: 4px 0 0; color: var(--hn-text-2); font-size: .9rem; }
.seitenkopf .aktionen { margin: 0; }
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-size: .88rem; text-decoration: none; font-weight: 600; }

/* ---------- Karten, Listen ---------- */
.karte { background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; margin-bottom: 16px; }
.karte > :first-child { margin-top: 0; }
.karte > :last-child { margin-bottom: 0; }
.karte.dicht { padding: 12px; }
.karte.ohne-rand { padding: 0; overflow: hidden; }
.karte h2 { margin-top: 0; }
.karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.karte-kopf h2, .karte-kopf h3 { margin: 0; }
.raster { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .raster.zwei { grid-template-columns: 1fr 1fr; } .raster.drei { grid-template-columns: repeat(3, 1fr); } .raster.haupt-seite { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.raster > .karte { margin-bottom: 0; }

.liste { list-style: none; margin: 0; padding: 0; background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); box-shadow: var(--schatten); }
.liste > li + li { border-top: 1px solid var(--grau-rand); }
.liste > li > a, .liste > li > .zeile-inhalt { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: var(--touch); color: inherit; text-decoration: none; }
.liste > li > a:hover { background: var(--grau-zeile); }
.liste .haupt { flex: 1; min-width: 0; }
.liste .haupt b { display: block; overflow-wrap: anywhere; }
.liste .haupt small { display: block; }
.liste .pfeil { color: var(--hn-text-3); font-size: 1.3rem; line-height: 1; }
.liste.in-karte { border: 0; box-shadow: none; border-radius: 0; margin: 0 -16px; }
.liste.in-karte > li > a, .liste.in-karte > li > .zeile-inhalt { padding-left: 16px; padding-right: 16px; }

/* ---------- Knoepfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch); padding: 0 16px; border: 1px solid var(--grau-rand-2); border-radius: var(--radius); background: var(--weiss); color: var(--hn-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--hn-text-3); color: var(--hn-text); background: var(--grau-zeile); }
.btn.primaer { background: var(--hn-blue-dunkel); border-color: var(--hn-blue-dunkel); color: #fff; font-size: 1.1rem; min-height: var(--haupt); }   /* R3-A11y 1: 5,3:1 */
.btn.primaer:hover { background: var(--hn-logo-blue); border-color: var(--hn-logo-blue); }
.btn.primaer.mittel { font-size: 1rem; min-height: var(--touch); background: var(--hn-blue-dunkel); border-color: var(--hn-blue-dunkel); }
.btn.dunkel { background: var(--hn-navy); border-color: var(--hn-navy); color: #fff; }
.btn.dunkel:hover { background: var(--hn-navy-2); }
.btn.breit { width: 100%; }
.btn.klein { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn.leise { border-color: transparent; background: transparent; color: var(--hn-logo-blue); }
.btn.leise:hover { background: var(--grau-zeile); }
.btn.gefahr { color: var(--fehler); border-color: #e7b8b3; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.aktionen.rechts { justify-content: flex-end; }
.knopfleiste { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Formulare ---------- */
label, .label { display: block; font-weight: 600; font-size: .88rem; margin: 12px 0 4px; }
label .auto, .auto { font-weight: 400; color: var(--hn-text-3); font-size: .78rem; margin-left: 6px; }
.pflicht { color: var(--fehler); }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], input[type=email], input[type=tel], select, textarea {
  width: 100%; min-height: var(--touch); padding: 10px 12px; border: 1px solid var(--grau-rand-2); border-radius: var(--radius);
  background: var(--weiss); color: var(--hn-text); font: inherit; font-variant-numeric: tabular-nums;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hn-blue); box-shadow: 0 0 0 3px rgba(49,127,194,.25); }
input[disabled], select[disabled], textarea[disabled] { background: var(--grau-zeile); color: var(--hn-text-2); }
textarea { min-height: 88px; resize: vertical; }
.feldfehler { color: var(--fehler); font-size: .85rem; margin: 4px 0 0; }
input.fehlerhaft, select.fehlerhaft, textarea.fehlerhaft { border-color: var(--fehler); }
.zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zeile.drei { grid-template-columns: 1fr 1fr 1fr; }
.zeile > div > label { margin-top: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--touch); font-weight: 400; margin: 4px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--hn-logo-blue); }
fieldset { border: 0; padding: 0; margin: 0; }
.formular-fuss { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--grau-rand-2); border-radius: 20px; background: var(--weiss); color: var(--hn-text); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--hn-text-3); }
.chip.aktiv, .chip[aria-pressed="true"] { background: var(--hn-navy); border-color: var(--hn-navy); color: #fff; }
.chip.gross { min-height: var(--touch); min-width: 56px; padding: 0 10px; justify-content: center; font-weight: 600; }
.btn.primaer small, .btn.dunkel small { color: #fff; }

/* ---------- Status, Hinweise ---------- */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius); font-size: .76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--grau-zeile); color: var(--hn-text-2); border: 1px solid var(--grau-rand); }
.status.ok { background: var(--ok-bg); color: var(--ok); border-color: #c9dbec; }
.status.hinweis { background: var(--hinweis-bg); color: var(--hinweis-text); border-color: var(--hinweis-rand); }
.status.fehler { background: var(--fehler-bg); color: var(--fehler); border-color: #f0c4be; }
.status.dunkel { background: var(--hn-navy); color: #fff; border-color: var(--hn-navy); }
.kuerzel { display: inline-block; min-width: 34px; padding: 0 4px; border: 1px solid var(--grau-rand-2); border-radius: 3px; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-align: center; color: var(--hn-text-2); background: var(--weiss); line-height: 1.5; }
.hinweis { padding: 12px 16px; border-radius: var(--radius); background: var(--hinweis-bg); border: 1px solid var(--hinweis-rand); margin: 12px 0; }
.hinweis.info { background: var(--ok-bg); border-color: #c9dbec; }
.hinweis.fehler { background: var(--fehler-bg); border-color: #f0c4be; color: var(--fehler); }
.hinweis > :first-child { margin-top: 0; } .hinweis > :last-child { margin-bottom: 0; }
.leer { text-align: center; padding: 24px 16px; color: var(--hn-text-2); }
.leer p { margin: 0 0 12px; }

/* Meldung (Toast) */
.meldung { position: fixed; left: 50%; bottom: calc(var(--nav-unten) + 16px); transform: translateX(-50%); z-index: 80; max-width: min(520px, calc(100vw - 32px)); background: var(--hn-navy); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--schatten-hoch); font-weight: 600; animation: rein .2s ease-out; }
body.buero .meldung { bottom: 24px; }
.meldung.fehler { background: var(--fehler); }
@keyframes rein { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Kennzahlen-Leiste ---------- */
.kennzahlen { display: flex; flex-wrap: wrap; background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); box-shadow: var(--schatten); margin-bottom: 16px; }
.kennzahlen > div { flex: 1 1 160px; padding: 12px 16px; min-width: 0; }
.kennzahlen > div + div { border-left: 1px solid var(--grau-rand); }
.kennzahlen .wert { display: block; font-family: var(--schrift-titel); font-weight: var(--gewicht-titel); font-size: 1.6rem; line-height: 1.1; white-space: nowrap; }
.kennzahlen .wert small { font-family: var(--schrift-text); font-size: .85rem; font-weight: 600; color: var(--hn-text-2); }
.kennzahlen .text { display: block; font-size: .8rem; color: var(--hn-text-2); margin-top: 2px; }
.kennzahlen a { color: inherit; text-decoration: none; }
.kennzahlen a:hover .text { color: var(--hn-logo-blue); text-decoration: underline; }
@media (max-width: 640px) { .kennzahlen > div { flex-basis: 50%; } .kennzahlen > div:nth-child(odd) { border-left: 0; } .kennzahlen > div:nth-child(n+3) { border-top: 1px solid var(--grau-rand); } }
.grosszahl { font-family: var(--schrift-titel); font-weight: var(--gewicht-titel); font-size: 2.4rem; line-height: 1; }

/* ---------- Tabellen ---------- */
.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--grau-rand); border-radius: var(--radius); background: var(--weiss); box-shadow: var(--schatten); margin-bottom: 16px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--grau-rand); }
.tabelle th { font-size: .76rem; font-weight: 600; color: var(--hn-text-2); background: var(--grau-zeile); text-transform: none; white-space: nowrap; position: sticky; top: 0; }
.tabelle tbody tr:hover td { background: #fafbfc; }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tfoot td { font-weight: 600; background: var(--grau-zeile); border-top: 1px solid var(--grau-rand-2); }
.tabelle .gedimmt td { color: var(--hn-text-3); }
@media (max-width: 640px) {
  .tabelle.stapel thead { display: none; }
  .tabelle.stapel tr { display: block; border-bottom: 1px solid var(--grau-rand); padding: 8px 0; }
  .tabelle.stapel td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; text-align: right; }
  .tabelle.stapel td::before { content: attr(data-label); font-weight: 600; color: var(--hn-text-2); text-align: left; }
  .tabelle.stapel td.zahl { text-align: right; }
}

/* ---------- Reiter ---------- */
.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--grau-rand-2); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.reiter a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--hn-text-2); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.reiter a.aktiv { color: var(--hn-logo-blue); border-bottom-color: var(--hn-logo-blue); }
.reiter a .zaehler { margin-left: 6px; font-size: .72rem; padding: 0 6px; border-radius: 10px; background: var(--grau-zeile); color: var(--hn-text-2); }
.reiter a .zaehler.hinweis { background: var(--hinweis-bg); color: var(--hn-text); }
/* In der Testphase abgeschaltet: GF und Betreiber sehen den Punkt ausgegraut, ohne Link */
.nav-buero .nav-grau, .reiter .nav-grau { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--hn-text-2); opacity: .45; font-weight: 600; white-space: nowrap; cursor: not-allowed; border-bottom: 3px solid transparent; }
.menue-blatt .nav-grau { display: flex; flex-direction: column; justify-content: center; min-height: var(--touch); padding: 0 20px; color: var(--hn-text-2); opacity: .55; font-weight: 600; cursor: not-allowed; }
.menue-blatt .nav-grau small { font-weight: 400; font-size: .75rem; }

/* ---------- Balken: Ist und verplant gegen Soll ---------- */
.verbrauch { display: grid; gap: 4px; margin: 6px 0; }
.verbrauch .spur { position: relative; height: 12px; background: var(--grau-zeile); border-radius: 2px; overflow: visible; border: 1px solid var(--grau-rand); }
.verbrauch .ist { position: absolute; left: 0; top: 0; bottom: 0; background: var(--hn-logo-blue); border-radius: 2px 0 0 2px; }
.verbrauch .verplant { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--hn-lightblue) 0 6px, #c4ddf4 6px 12px); }
.verbrauch .ueber { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #f0c4be 0 4px, #f8dcd8 4px 8px); }
.verbrauch .soll-linie { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--hn-text); }
.verbrauch .toleranz-linie { position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 2px dotted var(--hn-text-3); }
.verbrauch .legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--hn-text-2); }
.verbrauch .legende b { color: var(--hn-text); }
.verbrauch .legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.verbrauch .legende i.ist { background: var(--hn-logo-blue); position: static; }
.verbrauch .legende i.verplant { background: var(--hn-lightblue); position: static; }
.ampel { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; }
.ampel::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.ampel.toleranz::before { background: #c69214; }
.ampel.rot { color: var(--fehler); }
.ampel.rot::before { background: var(--fehler); }
.ampel.eingeordnet::before { background: var(--hn-text-3); }

/* ---------- Doku: Strom und Galerie ---------- */
.strom { list-style: none; margin: 0; padding: 0; }
.strom > li { background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); box-shadow: var(--schatten); padding: 12px; margin-bottom: 12px; }
.strom .kopfzeile { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--hn-text-3); margin-bottom: 8px; }
.strom .kopfzeile b { color: var(--hn-text); }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.fotos a, .fotos button.foto { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: var(--grau-zeile); border: 0; padding: 0; cursor: zoom-in; }
.fotos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos .platzhalter-marke { position: absolute; left: 6px; top: 6px; background: var(--hinweis-bg); color: var(--hn-text); font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.datei-zeile { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.datei-zeile .symbol { width: 40px; height: 48px; border: 1px solid var(--grau-rand-2); border-radius: 3px; display: grid; place-items: center; font-size: .64rem; font-weight: 600; color: var(--fehler); background: var(--weiss); flex: none; }
.gepinnt { border-left: 0; }
.vollbild { position: fixed; inset: 0; z-index: 90; background: rgba(10,18,30,.97); display: flex; flex-direction: column; }
.vollbild .leiste { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: #fff; }
.vollbild .leiste .text { flex: 1; min-width: 0; font-size: .9rem; }
.vollbild .leiste a, .vollbild .leiste button { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.vollbild .bild { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pinch-zoom; }
.vollbild .bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vollbild .bild.zoom img { max-width: none; max-height: none; width: auto; }
.warteschlange { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--hinweis-bg); border: 1px solid var(--hinweis-rand); border-radius: var(--radius); font-size: .88rem; margin: 8px 0; }
.ablage { border: 2px dashed var(--grau-rand-2); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--hn-text-2); background: var(--weiss); }
.ablage.drueber { border-color: var(--hn-blue); background: var(--ok-bg); }

/* ---------- Dialog ---------- */
.dialog-hg { position: fixed; inset: 0; z-index: 70; background: rgba(23,44,70,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten-hoch); padding: 20px; }
.dialog h2 { margin: 0 0 12px; }
@media (max-width: 640px) { .dialog-hg { align-items: flex-end; padding: 0; } .dialog { width: 100%; border-radius: var(--radius) var(--radius) 0 0; max-height: 92vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); } }

/* ---------- Monteur: Heute, Stundennachweis ---------- */
.heute-kopf { margin: 4px 0 12px; }
.heute-kopf h1 { font-size: 1.5rem; }
.heute-kopf p { margin: 2px 0 0; color: var(--hn-text-2); }
.plan-karte { border-top: 4px solid var(--hn-logo-blue); }
.plan-karte .ort { font-family: var(--schrift-display); font-weight: 800; font-size: 1.2rem; line-height: 1.2; margin: 2px 0 4px; }
.plan-karte .zeilen { display: grid; gap: 6px; margin: 10px 0 0; }
.plan-karte .zeilen > div { display: flex; gap: 10px; align-items: flex-start; }
.plan-karte .zeilen svg { width: 20px; height: 20px; flex: none; color: var(--hn-text-3); margin-top: 1px; }
.plan-karte .notiz { background: var(--grau-zeile); border-radius: var(--radius); padding: 8px 12px; margin-top: 10px; font-size: .92rem; }
.eintragen-knopf { width: 100%; margin: 4px 0 16px; }
.eintragen-knopf small { display: block; font-size: .8rem; font-weight: 400; opacity: 1; }
.kacheln { display: grid; gap: 8px; }
.kachel { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; width: 100%; min-height: 60px; padding: 10px 14px; border: 1px solid var(--grau-rand-2); border-radius: var(--radius); background: var(--weiss); font: inherit; color: inherit; cursor: pointer; }
.kachel b { display: block; }
.kachel small { display: block; }
.kachel.gewaehlt { border: 2px solid var(--hn-logo-blue); background: var(--ok-bg); padding: 9px 13px; }
.kachel.intern { min-height: var(--touch); }
.eintrag-block { background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; margin-bottom: 12px; }
.eintrag-block .kopf-zeile { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.eintrag-block.aus-bericht { background: var(--grau-zeile); box-shadow: none; }
.summenzeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--grau-rand); }
.summenzeile .summe { font-family: var(--schrift-display); font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.summenzeile.gross .summe { font-family: var(--schrift-titel); font-size: 1.8rem; }
.vorbelegt { font-size: .82rem; color: var(--hn-text-2); background: var(--ok-bg); border-radius: var(--radius); padding: 6px 10px; display: inline-block; margin-bottom: 8px; }
.fertig-zeichen { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 16px auto 8px; }
.fertig-zeichen svg { width: 40px; height: 40px; }

/* Wochenliste (Monteur-Plan, Handy-Tagesliste) */
.tagesliste { list-style: none; margin: 0; padding: 0; }
.tagesliste > li { background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--schatten); }
.tagesliste .tag-kopf { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--grau-rand); font-weight: 600; font-size: .88rem; }
.tagesliste .tag-kopf.heute { background: var(--hn-navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.tagesliste .eintrag { padding: 10px 12px; }
.tagesliste .eintrag + .eintrag { border-top: 1px dashed var(--grau-rand); }

/* ---------- Plantafel ---------- */
.plan-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
@media (max-width: 1279px) { .plan-layout { grid-template-columns: minmax(0, 1fr) 220px; } }
.plantafel { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--weiss); font-size: .82rem; table-layout: fixed; }
.plantafel th, .plantafel td { border-right: 1px solid var(--grau-rand); border-bottom: 1px solid var(--grau-rand); padding: 0; vertical-align: top; }
.plantafel thead th { position: sticky; top: var(--kopf-hoehe); z-index: 5; background: var(--grau-zeile); font-weight: 600; font-size: .78rem; padding: 6px 8px; text-align: left; }
.plantafel thead th.heute { background: var(--hn-navy); color: #fff; }
.plantafel thead th.feiertag { background: #e9ebef; }
.plantafel .person { width: 168px; padding: 6px 8px; background: var(--weiss); position: sticky; left: 0; z-index: 2; }
.plantafel .person b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plantafel .person small { font-size: .72rem; }
.plantafel .gruppe th { background: var(--hn-navy); color: #fff; text-align: left; padding: 4px 8px; font-size: .74rem; letter-spacing: .04em; position: sticky; left: 0; }
.plantafel .auslastung { width: 64px; padding: 6px 6px; text-align: right; font-weight: 600; background: var(--grau-zeile); }
.plantafel .auslastung.ueber { background: var(--fehler-bg); color: var(--fehler); }
.plantafel .auslastung.frei { color: var(--hn-text-3); font-weight: 400; }
.plantafel .zelle { height: 58px; position: relative; cursor: pointer; }
.plantafel .zelle:hover { background: #f7f9fc; }
.plantafel .zelle.vergangen { background: #fafafa; }
.plantafel .zelle.gewaehlt { box-shadow: inset 0 0 0 2px var(--hn-blue); background: var(--ok-bg); }
.plantafel .zelle.ablage-ziel { box-shadow: inset 0 0 0 2px var(--hn-navy); background: #dfeaf6; }
.plantafel .zelle.nicht-arbeitstag { background: repeating-linear-gradient(135deg, #f4f5f7 0 6px, #eceef1 6px 12px); cursor: default; }
.plantafel .zelle.konflikt { box-shadow: inset 3px 0 0 #c69214; }
.plantafel .zelle.leer-frei::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--grau-rand-2); font-size: 1.2rem; opacity: 0; }
.plantafel .zelle.leer-frei:hover::after { opacity: 1; }
.pe { display: block; margin: 2px; padding: 3px 6px; border-radius: 3px; background: var(--ok-bg); border: 1px solid #c9dbec; line-height: 1.25; overflow: hidden; }
.pe b { display: block; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe small { display: block; font-size: .7rem; color: var(--hn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe.halb { min-height: 24px; }
.pe.termin { background: #fff; border-color: var(--grau-rand-2); }
.pe.termin .zeit { color: var(--hn-logo-blue); margin-right: 4px; }
.pe.ist-abweichung { border-style: dashed; border-color: #c69214; }
.pe.ist { background: #f2f3f5; border-color: var(--grau-rand); }
.abwesend { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 54px; font-size: .78rem; font-weight: 600; color: var(--hn-text-2); background: var(--grau-zeile); }
.abwesend.uw { background: repeating-linear-gradient(135deg, #fff 0 5px, #f4f5f7 5px 10px); border: 1px dashed var(--grau-rand-2); }
.abwesend.bs { background: #eef2f7; }
.plantafel tfoot td { background: var(--grau-zeile); padding: 6px 8px; font-size: .74rem; }
.plantafel tfoot .gewerk-fuss b { font-size: .78rem; }
.seitenleiste { position: sticky; top: calc(var(--kopf-hoehe) + 52px); max-height: calc(100vh - var(--kopf-hoehe) - 72px); overflow-y: auto; }
.offener-abschnitt { display: block; padding: 8px 10px; margin-bottom: 6px; background: var(--weiss); border: 1px solid var(--grau-rand-2); border-radius: var(--radius); cursor: grab; font-size: .82rem; line-height: 1.3; }
.offener-abschnitt:hover { border-color: var(--hn-blue); }
.offener-abschnitt b { display: block; }
.offener-abschnitt.sortable-chosen { box-shadow: var(--schatten-hoch); }
.offener-abschnitt.sortable-ghost { opacity: .4; }
.zieh-hinweis { font-size: .78rem; color: var(--hn-text-3); }

/* ---------- Zeitleiste der Abschnitte ---------- */
.zeitleiste { width: 100%; border-collapse: collapse; font-size: .82rem; }
.zeitleiste th { font-weight: 600; font-size: .72rem; color: var(--hn-text-2); padding: 4px 2px; text-align: center; border-bottom: 1px solid var(--grau-rand); }
.zeitleiste th.heute { color: var(--hn-logo-blue); }
.zeitleiste td { padding: 6px 0; border-bottom: 1px solid var(--grau-rand); }
.zeitleiste td.name { padding-right: 12px; white-space: nowrap; width: 1%; }
.zeitleiste .woche { position: relative; height: 22px; border-left: 1px solid #f0f1f3; }
.zeitleiste .fenster { position: absolute; top: 3px; bottom: 3px; left: 0; right: 0; background: var(--hn-lightblue); }
.zeitleiste .fenster.fertig { background: #cfd8e3; }
.zeitleiste .fenster.start { border-radius: 3px 0 0 3px; left: 2px; }
.zeitleiste .fenster.ende { border-radius: 0 3px 3px 0; right: 2px; }
.zeitleiste .heute-linie { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--hn-navy); }

/* ---------- Matrix (Auslastung, Monat) ---------- */
.matrix { border-collapse: collapse; font-size: .8rem; width: 100%; }
.matrix th, .matrix td { border: 1px solid var(--grau-rand); padding: 4px 6px; text-align: center; white-space: nowrap; }
.matrix th { background: var(--grau-zeile); font-weight: 600; font-size: .74rem; }
.matrix td.name, .matrix th.name { text-align: left; position: sticky; left: 0; background: var(--weiss); }
.matrix td.ueber { background: var(--fehler-bg); color: var(--fehler); font-weight: 600; }
.matrix td.voll { background: var(--ok-bg); }
.matrix td.wenig { color: var(--hn-text-3); }
.matrix td.wochenende { background: var(--grau-zeile); color: var(--hn-text-3); }
.matrix td.kz { font-weight: 600; color: var(--hn-text-2); }
.matrix td.geaendert { box-shadow: inset 0 0 0 2px #c69214; }

/* Gewerke-Uebersicht (Bedarf gegen Kapazitaet) */
.gewerk-karte .gk-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.wochenbalken { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 120px; margin: 12px 0 4px; }
.wochenbalken .w { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wochenbalken .bedarf { width: 60%; background: var(--hn-logo-blue); border-radius: 2px 2px 0 0; }
.wochenbalken .kap { position: absolute; left: 4%; right: 4%; border-top: 2px solid var(--hn-text); }
.wochenbalken-achse { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; font-size: .7rem; color: var(--hn-text-3); text-align: center; }

/* ---------- Login ---------- */
body.login { background: var(--hn-navy); min-height: 100vh; }
.login-flaeche { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .login-flaeche { grid-template-columns: minmax(420px, 46%) 1fr; } }
.login-links { position: relative; z-index: 2; background: var(--hn-navyverlauf); color: #fff; padding: 40px 32px; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 900px) { .login-links { clip-path: polygon(0 0, 100% 0, calc(100% - 49vh * 0.49 * 0.4) 100%, 0 100%); padding: 48px 96px 48px 56px; margin-right: -80px; } }
.login-links .wortmarke { width: 180px; height: 42px; color: #fff; margin-bottom: 8px; }
.login-links .zusatz { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--hn-lightblue); font-weight: 600; margin-bottom: 32px; }
.login-links h1 { color: #fff; font-size: 1.7rem; margin-bottom: 20px; }
.login-links label { color: #dbe7f3; }
.login-links input[type=text], .login-links input[type=password] { background: #fff; border-color: transparent; font-size: 1.05rem; }
.login-links .check { color: #fff; }
.login-links .feldfehler { color: #ffd4cf; }
.login-links .btn.primaer { width: 100%; margin-top: 16px; }
.login-links .fuss { margin-top: 32px; font-size: .78rem; color: #b9cbe0; }
.login-links .fuss a { color: #fff; }
.login-formular { max-width: 400px; width: 100%; }
.login-bild { display: none; position: relative; background-size: cover; background-position: center; }
@media (min-width: 900px) { .login-bild { display: block; } }
.login-bild .bildunterschrift { position: absolute; right: 16px; bottom: 16px; background: rgba(23,44,70,.75); color: #fff; font-size: .74rem; padding: 4px 8px; border-radius: 3px; }
@media (max-width: 899px) { .login-links { min-height: 100vh; padding: 32px 24px; justify-content: flex-start; padding-top: 56px; } }

/* ---------- Fehlerseiten ---------- */
.fehlerseite { max-width: 560px; margin: 10vh auto 0; padding: 0 16px; }
.fehlerseite .code { font-family: var(--schrift-titel); font-weight: var(--gewicht-titel); font-size: 3.4rem; color: var(--hn-logo-blue); line-height: 1; }

/* ---------- Diverses ---------- */
.trenn { border: 0; border-top: 1px solid var(--grau-rand); margin: 16px 0; }
.zwei-spalten { display: grid; gap: 16px; }
@media (min-width: 900px) { .zwei-spalten { grid-template-columns: 1fr 1fr; } }
.unterschrift-feld { width: 100%; height: 180px; border: 1px solid var(--grau-rand-2); border-radius: var(--radius); background: #fff; touch-action: none; }
.lade { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen .8s linear infinite; vertical-align: -3px; }
@keyframes drehen { to { transform: rotate(360deg); } }
.protokoll-zeile { font-size: .85rem; padding: 8px 0; border-bottom: 1px solid var(--grau-rand); }
.protokoll-zeile:last-child { border-bottom: 0; }
.alt { text-decoration: line-through; color: var(--hn-text-3); }
.neu { font-weight: 600; }
.demo-wert { font-size: .7rem; color: var(--hn-text-3); border: 1px dashed var(--grau-rand-2); border-radius: 3px; padding: 0 4px; white-space: nowrap; }
@media print { .kopf, .nav-buero, .nav-unten, .band, .aktionen { display: none !important; } body { background: #fff; } .karte { box-shadow: none; } }

/* ---------- Baustellen (B4) ---------- */
.text-fehler { color: var(--fehler); }
.inline { display: inline; margin: 0; }
a.klein { font-size: .8rem; }
.filterleiste { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 16px; }
.filterleiste > div { min-width: 140px; }
.filterleiste > div:first-child { flex: 1 1 220px; }
.filterleiste label { margin-top: 0; }
.filterleiste .filter-knoepfe { display: flex; gap: 8px; min-width: 0; }
@media (max-width: 640px) { .filterleiste > div { flex: 1 1 45%; } .filterleiste > div:first-child { flex-basis: 100%; } }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.erledigt td { color: var(--hn-text-2); }
.tabelle-rahmen.ohne-schatten { box-shadow: none; margin-bottom: 0; }
.karte > .tabelle-rahmen.ohne-schatten { margin-left: 0; margin-right: 0; }
.baustellen-tabelle td { vertical-align: middle; }
.verbrauch.kompakt { margin: 0; min-width: 120px; }
.verbrauch.kompakt .spur { height: 10px; }
.abschnitte-tabelle td { vertical-align: middle; }
.abschnitte-tabelle .verbrauch { margin: 2px 0; }
.abweichung-hinweis { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.abweichung-hinweis > div { flex: 1 1 320px; }
.zeitleiste-rahmen { overflow-x: auto; }
.zeitleiste { min-width: 640px; }
.zeitleiste td.name { font-size: .85rem; }
.zeitleiste .woche .std { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: 100%; font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--hn-navy); }
.zeitleiste .woche .std .plan, .zeitleiste .woche .std.plan { font-style: italic; font-weight: 400; color: var(--hn-text-2); margin-left: 2px; }
.zeitleiste .woche.heute { background: rgba(22, 85, 137, .06); }
.wahl-liste { display: grid; gap: 8px; margin: 4px 0 8px; }
.wahl-liste.zwei { grid-template-columns: 1fr; }
@media (min-width: 640px) { .wahl-liste.zwei { grid-template-columns: 1fr 1fr; } }
.wahl { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; min-height: var(--touch); border: 1px solid var(--grau-rand-2); border-radius: var(--radius); background: var(--weiss); cursor: pointer; font-weight: 400; }
.wahl:hover { border-color: var(--hn-blue); }
.wahl.aktiv { border-color: var(--hn-logo-blue); box-shadow: inset 0 0 0 1px var(--hn-logo-blue); background: #f5f9fd; }
.wahl input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--hn-logo-blue); }
.wahl b { display: block; color: var(--hn-text); }
.wahl small { display: block; color: var(--hn-text-2); font-size: .82rem; line-height: 1.4; }
fieldset legend.label { padding: 0; }
.unterbereich { margin-top: 12px; padding: 12px; background: var(--grau-zeile); border-radius: var(--radius); border: 1px solid var(--grau-rand); }
.unterbereich > label:first-child, .unterbereich > .check:first-child { margin-top: 0; }
.zeiten-tabelle th.auswahl, .zeiten-tabelle td.auswahl { width: 36px; padding-right: 0; }
.zeiten-tabelle input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--hn-logo-blue); }
.umbuchen-leiste { position: sticky; bottom: 16px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; margin: 0 0 12px; background: var(--hn-navy); color: #fff; border-radius: var(--radius); box-shadow: var(--schatten-hoch); }
.umbuchen-leiste select, .umbuchen-leiste input { width: auto; flex: 1 1 200px; min-width: 0; }
.umbuchen-leiste .btn.dunkel { background: #fff; color: var(--hn-navy); border-color: #fff; }
@media (max-width: 1023px) { .umbuchen-leiste { bottom: calc(var(--nav-unten) + 12px); } }
.abschnitte-eingabe td { vertical-align: middle; padding: 6px 8px; }
.abschnitte-eingabe input, .abschnitte-eingabe select { min-height: 40px; padding: 6px 8px; }
.abschnitte-eingabe .zahl-feld { width: 84px; text-align: right; }
.abschnitte-eingabe .zahl-feld.kurz { width: 64px; }
@media (max-width: 760px) {
  .abschnitte-tabelle thead { display: none; }
  .abschnitte-tabelle, .abschnitte-tabelle tbody, .abschnitte-tabelle tr, .abschnitte-tabelle td { display: block; width: auto; }
  .abschnitte-tabelle tr { padding: 12px; border-bottom: 1px solid var(--grau-rand); }
  .abschnitte-tabelle tr:last-child { border-bottom: 0; }
  .abschnitte-tabelle td { border: 0; padding: 2px 0; }
  .abschnitte-tabelle td.rechts { text-align: left; padding-top: 6px; }
  .tabelle-rahmen:has(.abschnitte-tabelle) { overflow: visible; }
}

/* ---------- Steuerung (B5) ---------- */
.gewerk-karte .gk-kopf h2 { margin: 0; }
.gewerk-karte .gk-kopf .rechts { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.wochenbalken .bedarf.eng { background: var(--hn-navy); box-shadow: inset 0 3px 0 var(--fehler); }
.wochenbalken .kap { z-index: 1; }
.legende-zeile { font-size: .8rem; color: var(--hn-text-2); margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.legende-zeile i { display: inline-block; width: 12px; height: 10px; vertical-align: -1px; }
.legende-zeile i.l-bedarf { background: var(--hn-logo-blue); border-radius: 2px; }
.legende-zeile i.l-kap { height: 0; border-top: 2px solid var(--hn-text); }
details.zahlen { margin-top: 8px; }
details.zahlen summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--hn-logo-blue); min-height: 32px; display: flex; align-items: center; }
.tabelle.kompakt th, .tabelle.kompakt td { padding: 4px 8px; font-size: .82rem; }
.matrix th.heute { color: var(--hn-logo-blue); }
.matrix tr.gruppe th { background: var(--weiss); text-align: left; padding-top: 10px; border-left: 0; border-right: 0; }
.matrix td.name small { font-size: .72rem; }
.matrix tfoot td { background: var(--grau-zeile); }
.m-legende { display: inline-block; padding: 1px 8px; border: 1px solid var(--grau-rand); border-radius: 3px; font-size: .75rem; }
.m-legende.ueber { background: var(--fehler-bg); color: var(--fehler); }
.m-legende.voll { background: var(--ok-bg); }
.m-legende.wenig { color: var(--hn-text-3); }
.wochen-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.w-chip { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 2px 6px; border: 1px solid var(--grau-rand); border-radius: 3px; font-size: .82rem; font-weight: 600; }
.w-chip small { font-weight: 400; font-size: .68rem; color: var(--hn-text-2); }
.w-chip.ueber { background: var(--fehler-bg); color: var(--fehler); }
.w-chip.voll { background: var(--ok-bg); }
.w-chip.wenig { color: var(--hn-text-3); }

/* ---------- Stundenkonto (B6) ---------- */
.saldo-gross { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.konten-tabelle td { vertical-align: middle; }
.tabelle thead tr.unterkopf th { font-weight: 400; font-size: .7rem; padding-top: 0; color: var(--hn-text-3); }
details.tage-details summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; }
details.tage-details[open] summary { margin-bottom: 8px; }
@media (max-width: 760px) { .konten-tabelle .breit { display: none; } }

/* ---------- Medien (B7) ---------- */
.abschnitt-titel { margin: 20px 0 8px; }
.foto-aufnahme .knopfleiste { flex-wrap: wrap; }
.foto-aufnahme label.btn { cursor: pointer; }
.foto-aufnahme .auswahl { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--grau-rand); }
.foto-vorschau { position: relative; aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; background: var(--grau-zeile); }
.foto-vorschau img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-vorschau .weg { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(23,44,70,.8); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.doku-text { margin: 0 0 8px; }
.doku-aktionen { display: inline-flex; gap: 12px; }
.vollbild .leiste.unten { justify-content: space-between; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.vollbild .leiste .text small { color: #c9d6e4; }
.fotos.galerie { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.fotos.galerie a { aspect-ratio: auto; display: flex; flex-direction: column; background: var(--weiss); border: 1px solid var(--grau-rand); }
.fotos.galerie img { aspect-ratio: 4 / 3; height: auto; }
.fotos .bildtext { font-size: .75rem; color: var(--hn-text-2); padding: 4px 6px; text-align: left; line-height: 1.3; }
.chips .trenner { width: 1px; align-self: stretch; background: var(--grau-rand-2); margin: 4px 4px; }
.ablage-liste { list-style: none; padding: 0; margin: 8px 0 0; font-size: .85rem; }
.ablage-liste li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--grau-rand); }
.ablage-liste li span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.warteschlange { margin-top: 0; }

/* ---------- Start Buero/GF ---------- */
.start-kopf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 4px 0 16px; background: var(--weiss); border: 1px solid var(--grau-rand); border-radius: var(--radius); box-shadow: var(--schatten); overflow: hidden; }
.start-text { padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; }
.start-text h1 { margin: 0; }
.start-text .unterzeile { margin: 6px 0 0; color: var(--hn-text-2); }
.start-bild { display: none; background-size: cover; background-position: center 40%; min-height: 120px; }
@media (min-width: 900px) { .start-kopf { grid-template-columns: minmax(0, 1fr) 38%; } .start-bild { display: block; } }
.kennzahlen .wert small { white-space: nowrap; }
.status.hinweis, .status.fehler, .status.ok { padding: 2px 8px; margin: 0; }   /* R1-UX 10: Status nie als Block */
button.link { background: none; border: 0; padding: 0; color: var(--hn-logo-blue); text-decoration: underline; cursor: pointer; font: inherit; min-height: 32px; }
button.link.klein, .link.klein { font-size: .8rem; }

/* ---------- Zeiten (B8) ---------- */
.wochen-titel { padding: 0 8px; white-space: nowrap; }
.pruef-leiste { position: sticky; top: 64px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; padding: 8px 0 12px; background: var(--grau-seite); }
.pruef-leiste .nebentext { margin-right: auto; }
.pruef-person .karte-kopf h2 { font-size: 1.05rem; }
.pruef-tabelle td { vertical-align: top; }
.pruef-tabelle th.auswahl, .pruef-tabelle td.auswahl { width: 32px; padding-right: 0; }
.pruef-tabelle input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--hn-logo-blue); }
.pruef-zeile { line-height: 1.45; }
.pruef-zeile + .pruef-zeile { margin-top: 2px; }
.kz-form { display: flex; gap: 6px; align-items: center; }
.kz-form select { min-height: 36px; padding: 4px 8px; width: auto; }
.tag-eingabe td { vertical-align: middle; padding: 6px; }
.tag-eingabe input, .tag-eingabe select { min-height: 40px; padding: 6px 8px; }
.tag-eingabe input[type=time] { width: 110px; }
.klein { font-size: .82rem; }

/* ---------- Stammdaten (B9) ---------- */
.chip-check { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border: 1px solid var(--grau-rand-2); border-radius: 20px; background: var(--weiss); margin: 0; font-weight: 400; }
.chip-check input { width: 18px; height: 18px; accent-color: var(--hn-logo-blue); }
.soll-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.soll-raster label { margin-top: 0; text-align: center; }
.soll-raster input { text-align: center; padding-left: 4px; padding-right: 4px; }
@media (max-width: 480px) { .soll-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
code.passwort { font-size: 1.1rem; font-weight: 700; padding: 2px 8px; background: var(--weiss); border: 1px solid var(--hinweis-rand); border-radius: 3px; user-select: all; }
.regel h3 { margin: 0; }
.kuenftig { margin: 4px 0; padding: 8px 12px; }
.kolonne-zeile { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--grau-rand); }
.tabelle tr.markiert td { background: var(--ok-bg); }

/* B10 Erfahrungswerte */
.erfahrung-kopf { margin-bottom: 16px; }
.karte.erfahrung + .karte.erfahrung { margin-top: 16px; }
.karte.erfahrung .karte-kopf { align-items: flex-start; gap: 12px; }
.karte.erfahrung h2 { margin: 0 0 2px; }
.tabelle tr.auffaellig td { background: var(--hinweis-bg); }
.liste li.auffaellig { background: var(--hinweis-bg); }
.erfahrung-tabelle td { vertical-align: top; }
.erfahrung-tabelle .status { font-weight: 500; }
details.faelle summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 4px; font-size: .88rem; }
.faelle-liste { margin: 4px 0 0; padding-left: 18px; font-size: .84rem; color: var(--hn-text-2); max-width: 46ch; }
.faelle-liste li + li { margin-top: 2px; }
.unterbereich.anpassen { text-align: left; min-width: 220px; }
.anpassen-handy { padding: 0 16px 12px; }
.text-hinweis { color: var(--hinweis-text); font-weight: 600; }

/* B11 Arbeitsbericht */
.bericht-spalten { display: grid; gap: 0 16px; }
@media (min-width: 1024px) { .bericht-spalten { grid-template-columns: 1fr 1fr; } .bericht-formular, .bericht-dokument { max-width: 1100px; } }
.zeit-fest { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grau-rand); }
.zeit-fest small { color: var(--hn-text-2); }
.zeitzeile { border: 1px solid var(--grau-rand); border-radius: var(--radius); padding: 10px 12px 12px; margin-top: 10px; background: var(--grau-zeile); }
.einsatz-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.zeitzeile .zeile > div { position: relative; }
.zeitzeile .jetzt { position: absolute; right: 0; top: 12px; font-size: .8rem; min-height: 0; }
.material-zeile { border-bottom: 1px solid var(--grau-rand); padding-bottom: 12px; margin-bottom: 12px; }
.material-zeile .zeile.drei > div > label { margin-top: 0; }
.mit-knopf { display: flex; gap: 8px; align-items: center; }
.mit-knopf input { flex: 1; min-width: 0; }
.kollege-wahl { border: 1px dashed var(--grau-rand-2); border-radius: var(--radius); padding: 10px 12px; }
.karte.hervor { border: 2px solid var(--hn-logo-blue); }
canvas.signatur { display: block; width: 100%; height: 180px; border: 1px solid var(--grau-rand-2); border-radius: var(--radius); background: #fff
  linear-gradient(to right, transparent 0 8%, var(--grau-rand) 8% 92%, transparent 92%) no-repeat 0 78% / 100% 1px; touch-action: none; }
.rechtstext { font-size: .8rem; }
details.ohne-unterschrift { margin-top: 14px; }
details.ohne-unterschrift summary { cursor: pointer; min-height: var(--touch); display: flex; align-items: center; color: var(--hn-logo-blue); font-weight: 600; }
.bericht-fuss { justify-content: center; margin-top: 4px; }
.bericht-dokument h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hn-logo-blue); margin: 16px 0 4px; }
.bericht-dokument .zeile h3 { margin-top: 0; }
ul.punkte { margin: 0; padding-left: 18px; }
.knopf-paar { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.urlaub-zurueck { padding: 0 16px 12px; }
@media (max-width: 420px) { .material-zeile .zeile.drei { grid-template-columns: 1fr 1fr; } .material-zeile .zeile.drei > div:last-child { grid-column: 1 / -1; } }
.lohn-liste .zeile-inhalt { flex-wrap: wrap; }
.lohn-oeffnen, .lohn-hinweis { margin: 0 16px 12px; }

/* B12 Teilen */
.teilen-vorschau { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.teilen-vorschau figure { margin: 0; }
.teilen-vorschau img, .teilen-vorschau .datei-symbol { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--grau-rand); background: var(--grau-zeile); font-weight: 700; color: var(--hn-text-2); }
.teilen-vorschau figcaption { font-size: .74rem; color: var(--hn-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
fieldset.ohne-rahmen { border: 0; padding: 0; margin: 0; min-width: 0; }
/* R3-A11y 3: Dateiauswahl hinter einem Label-Knopf zeigt den Fokus am Knopf */
label.btn:focus-within, label.btn:has(input:focus-visible) { box-shadow: var(--fokus); }
.btn.primaer.mittel:hover { background: var(--hn-logo-blue); border-color: var(--hn-logo-blue); }
/* R3-A11y 2: Plantafel per Tastatur. Je planbarer Zelle ein Knopf, sichtbar bei Fokus */
.plantafel td.zelle { position: relative; }
.zelle-knopf { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; padding: 0; border: 1px solid var(--hn-blue-dunkel); border-radius: var(--radius);
  background: var(--weiss); color: var(--hn-blue-dunkel); font-weight: 700; line-height: 1; opacity: 0; z-index: 3; cursor: pointer; }
.zelle-knopf:focus-visible, td.zelle:hover .zelle-knopf { opacity: 1; }
.plantafel .pe:focus-visible { box-shadow: var(--fokus); }
.plantafel .zellen-liste { min-height: 40px; }   /* leere Zellen nehmen beim Ziehen etwas auf */

/* ---- R3 Soll: Barrierefreiheit, Touchziele, kleine Layoutfehler ---- */
/* Fokus nie hinter der unteren Leiste (A11y 5) */
html:has(body.monteur) { scroll-padding-bottom: calc(var(--nav-unten) + 16px + env(safe-area-inset-bottom)); }
/* Fokus in Feldern deutlich (A11y 6), Raender 3:1 (A11y 8) */
input[type=text], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], input[type=email], input[type=tel], select, textarea { border-color: #8a919b; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--hn-blue-dunkel); box-shadow: var(--fokus); }
.login-links input:focus-visible { border-color: #a9cdee; box-shadow: 0 0 0 2px #172c46, 0 0 0 4px #a9cdee; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--hn-blue-dunkel); outline-offset: 2px; box-shadow: none; }
canvas.signatur { border-color: #8a919b; }
/* Fokus an drei Einzelstellen (A11y 7) */
.nav-unten a:focus-visible { box-shadow: inset 0 0 0 3px var(--hn-blue-dunkel); }
.nav-unten a.aktiv:focus-visible { box-shadow: inset 0 3px 0 var(--hn-logo-blue), inset 0 0 0 3px var(--hn-blue-dunkel); }
.eintrag-block.aus-bericht:focus-visible { box-shadow: var(--fokus); }
.ansicht-wechsel a:focus-visible { box-shadow: inset 0 0 0 2px var(--hn-blue-dunkel), inset 0 0 0 4px #fff; }
/* Touchziele im Monteur-Bereich mindestens 44 px (A11y 9, UX-Handy 5) */
body.monteur .btn.klein, body.monteur .chip { min-height: 44px; }
.vollbild .leiste .btn { min-height: 48px; }
.foto-vorschau .weg { width: 44px; height: 44px; }
/* „jetzt“ als eigener Knopf neben dem Zeitfeld */
.zeitzeile .zeile > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; align-items: end; }
.zeitzeile .zeile > div > label { grid-column: 1 / -1; }
.zeitzeile .jetzt { position: static; min-height: 44px; min-width: 44px; padding: 0 10px; }
/* Felder sprengen bei 360 px nichts (UX-Handy 3) */
.zeile > div { min-width: 0; }
.zeile input, .zeile select { min-width: 0; }
/* Zurueck-Link mit festem Pfeil (UX-Desktop 8) */
.zurueck { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.zurueck svg { width: 18px; height: 18px; flex: none; }
/* Dialogfuss bleibt sichtbar (UX-Desktop 7) */
.dialog .formular-fuss { position: sticky; bottom: -20px; background: var(--weiss); margin: 12px -20px -20px; padding: 12px 20px 20px; box-shadow: 0 -10px 12px -10px rgba(23,44,70,.25); z-index: 2; }
/* Taetigkeit in der Tagesbearbeitung lesbar (UX-Desktop 3) */
.tag-eingabe textarea.taetigkeit { min-height: 0; min-width: 260px; resize: vertical; }
.meldung-zu { margin-left: 12px; min-width: 32px; min-height: 32px; border: 0; background: transparent; color: inherit; font-size: 1.2rem; cursor: pointer; }
/* Konflikt in der Plantafel nicht nur als Farbe (A11y 12) */
.konflikt-zeichen { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--fehler); color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 16px; text-align: center; z-index: 2; }
/* Konfliktzeichen ueberdeckt den ersten Eintrag nicht (R3-Nachpruefung) */
.konflikt-zeichen + .zellen-liste { padding-top: 18px; }
/* Sprunglink zum Inhalt (R3-A11y 14): erst bei Tastaturfokus sichtbar */
.sprunglink { position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 10px 16px; background: var(--hn-blue-dunkel); color: #fff; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.sprunglink:focus { top: 8px; box-shadow: var(--fokus); }
main:focus { outline: none; }
/* F1-Polish 9: Chips und Umschalter mit 4-px-Ecken wie Knoepfe (Bauplan 10) */
.chip, .chip-check { border-radius: var(--radius); }

/* ---- F2-Polish ---- */
/* 2, 7: Feld mit Fehler rot umrandet, auch im Fokus; Satz darunter (.feldfehler) */
input.fehlerhaft, select.fehlerhaft, textarea.fehlerhaft, input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--fehler); box-shadow: 0 0 0 1px var(--fehler); }
input[aria-invalid="true"]:focus-visible, select[aria-invalid="true"]:focus-visible, textarea[aria-invalid="true"]:focus-visible { border-color: var(--fehler); box-shadow: 0 0 0 1px var(--fehler), var(--fokus); }
.feldfehler { font-weight: 600; }
/* 8: Teile einer Metazeile brechen nur zwischen den Teilen um (Fmt::teile) */
.teil { display: inline-block; max-width: 100%; }
/* 9: gewaehlte Baustelle: der Name nimmt die Zeile; reicht der Platz nicht (Handy), stehen die Knoepfe darunter rechts */
.kachel.gestapelt { flex-wrap: wrap; row-gap: 0; }
.kachel.gestapelt .kachel-text { flex: 1 1 260px; min-width: 0; }
.kachel-knoepfe { display: flex; flex: 0 0 auto; margin: 2px -8px -4px auto; gap: 4px; }
/* 2: Meldung nimmt ihre Textbreite (bis zum Rand), statt sich auf die halbe Seite zu stauchen */
.meldung { width: max-content; }
/* 13: Fotos in der Warteschlange als Karte an der Stelle der Auswahl */
.sende-liste { list-style: none; padding-left: 0; padding-right: 0; padding-bottom: 0; margin-bottom: 0; display: grid; gap: 8px; }
.sende-liste li { display: flex; align-items: center; gap: 12px; }
.sende-liste img { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; flex: none; background: var(--grau-zeile); }
.sende-liste b { display: block; font-size: .92rem; overflow-wrap: anywhere; }
.sende-liste small { display: block; color: var(--hn-text-2); }
.sende-liste .lade { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
.sende-liste li.abgelehnt small { color: var(--fehler); }
/* 16: Label-Knoepfe ohne den Abstand normaler Labels; am Handy drei gleiche Spalten */
label.btn { margin: 0; }
@media (max-width: 640px) {
  .foto-aufnahme > .knopfleiste { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foto-aufnahme > .knopfleiste .btn { padding: 0 8px; gap: 6px; }
}
/* 10: Prozent im Plantafel-Fuss wie in den Personenzeilen (rechts, gleiche Schrift) */
.plantafel tfoot td.auslastung { font-size: inherit; }
/* 5: Umschalter der Plan-Leiste als verbundene Gruppe in Hoehe und Staerke der Knoepfe daneben */
.plan-werkzeuge .chips { gap: 0; flex-wrap: nowrap; }
.plan-werkzeuge .chip { min-height: 36px; padding: 0 12px; font-size: .85rem; font-weight: 600; border-radius: 0; }
.plan-werkzeuge .chip + .chip { margin-left: -1px; }
.plan-werkzeuge .chip:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.plan-werkzeuge .chip:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.plan-werkzeuge .chip.aktiv { position: relative; z-index: 1; }
.plantafel tbody th.person { text-align: left; }
/* 15: Leseansicht (gesperrtes fieldset) sieht gesperrt aus: Felder grau, keine Pflichtsterne */
input:disabled, select:disabled, textarea:disabled { background: var(--grau-zeile); color: var(--hn-text-2); border-color: var(--grau-rand-2); cursor: not-allowed; }
fieldset:disabled .pflicht, fieldset:disabled label .auto { display: none; }
fieldset:disabled .chip-check { background: var(--grau-zeile); color: var(--hn-text-2); cursor: not-allowed; }
fieldset:disabled ::placeholder { color: transparent; }
/* 14: Arbeitsbericht in der Monteur-Ansicht einspaltig, auch am Laptop (main ist dort 680 px breit) */
@media (min-width: 1024px) { body.monteur .bericht-spalten { grid-template-columns: minmax(0, 1fr); } }
/* 17: Start: Karten so hoch wie ihr Inhalt; „umbuchen“ als Aktion (Link), nicht als Status; am Handy Knoepfe unter dem Namen */
.start-raster { align-items: start; }
.start-spalte { display: grid; gap: 16px; align-content: start; min-width: 0; }
.start-spalte > .karte { margin-bottom: 0; }
.link-text { color: var(--hn-logo-blue); font-weight: 600; font-size: .85rem; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
@media (max-width: 600px) { .urlaub-wunsch .zeile-inhalt { flex-wrap: wrap; } .urlaub-wunsch .knopf-paar { flex: 1 1 100%; } }
