/* ==========================================================================
   AwSV-Anlagenkataster — Oberfläche
   Gestaltungsidee: technisches Katasterblatt. Papierton, Haarlinien,
   Monospace für alle Messwerte, Serife für Gesetzeszitate.
   Alle Schriften liegen lokal vor — die Anwendung lädt nichts nach.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
/* „hidden“ heißt verborgen — auch dort, wo eine Klasse display setzt. */
[hidden] { display: none !important; }

:root {
  /* Tahoma liegt auf Windows und macOS vor. Kräftiger und nüchterner als die
     modernen Systemschriften – vertraut für alle, die mit älteren
     Office-Fassungen arbeiten. Verdana und Lucida als Rückfallebenen. */
  --sans: Tahoma, Verdana, "Lucida Grande", "Lucida Sans Unicode",
          "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", Charter, Palatino, "Hoefler Text", Georgia, serif;
  --mono: "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono",
          monospace;

  /* Vier Helligkeitsstufen bilden die Ebenen ab:
     Titelleiste/Menüband hell, Navigation getönt, Arbeitsfläche dunkler,
     Karten darauf wieder hell. */
  --chrom:        #ffffff;   /* Ebene 1: Titelleiste, Menüband */
  --chrom-2:      #eceade;   /* Ebene 2: Reiterleiste, Navigation */
  --grund:        #dedac9;   /* Ebene 3: Arbeitsfläche */
  --flaeche:      #fbfaf6;   /* Ebene 4: Karten */
  --flaeche-2:    #f1eee4;
  --linie:        #cfc8b6;
  --linie-stark:  #a89f88;

  /* Tinte */
  --tinte:        #1c2320;
  --tinte-2:      #4a544f;
  /* Sekundärtext. Vorher #7b847e — 3,7:1 auf dem Blatt, 2,8:1 auf der
     Arbeitsfläche, beides unter dem WCAG-Minimum von 4,5:1. Jetzt 6,0:1
     bzw. 4,5:1. */
  --tinte-3:      #59625d;

  /* Domänenfarbe: Wasser */
  --wasser:       #0d6473;
  --wasser-hell:  #dcebec;
  --wasser-tief:  #08424c;
  --marke:        #003366;   /* Firmenblau */

  /* Gefährdungsstufen: eine Rangfolge, keine Ampel. Grün hieße „sicher“
     (DIN EN ISO 7010) — eine Anlage der Stufe A enthält aber
     wassergefährdende Stoffe. Deshalb von Schiefer über Ocker und Orange
     zu Rostbraun; das kräftige Rot bleibt Verboten und Überfälligem
     vorbehalten. Alle Werte mindestens 5,7:1 auf dem Blatt. */
  --stufe-a:      #4a6573;
  --stufe-b:      #7f5e12;
  --stufe-c:      #a2491a;
  --stufe-d:      #7a2617;
  --verbot:       #8a1020;
  --verbot-flaeche:#f7e6e6;

  /* Radius-Skala: freundlich gerundet, ohne die technische Dichte zu verlieren */
  --radius-xs: 5px;    /* Marken, kleine Zahlenfelder */
  --radius-s:  8px;    /* Eingaben, Knöpfe, Zeilen */
  --radius:    12px;   /* Blätter, Karten */
  --radius-l:  16px;   /* Stempel */
  --radius-pill: 999px;/* Plaketten */
  --schatten: 0 1px 2px rgba(28,35,32,.05), 0 8px 24px rgba(28,35,32,.06);

  --sidebar: 232px;
  --liste: 330px;

  color-scheme: light;
}

:root[data-thema="dunkel"] {
  --chrom:        #232a2e;
  --chrom-2:      #1a2023;
  --grund:        #0f1315;
  --flaeche:      #1b2124;
  --flaeche-2:    #262e33;
  --linie:        #333d43;
  --linie-stark:  #4d5960;
  --tinte:        #e6e8e5;
  --tinte-2:      #a8b2b0;
  --tinte-3:      #98a39f;
  --wasser:       #4fb3c4;
  --wasser-hell:  #16333a;
  --wasser-tief:  #8ed3e0;
  --marke:        #6ea8dc;   /* Firmenblau, für dunklen Grund aufgehellt */
  --stufe-a:      #8fb0c0;
  --stufe-b:      #c9a13c;
  --stufe-c:      #dd8449;
  --stufe-d:      #e0805f;
  --verbot:       #e0707d;
  --verbot-flaeche:#3a1b20;
  --schatten: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --chrom:#232a2e; --chrom-2:#1a2023;
    --grund:#0f1315; --flaeche:#1b2124; --flaeche-2:#262e33;
    --linie:#333d43; --linie-stark:#4d5960;
    --tinte:#e6e8e5; --tinte-2:#a8b2b0; --tinte-3:#98a39f;
    --wasser:#4fb3c4; --wasser-hell:#16333a; --wasser-tief:#8ed3e0;
    --marke:#6ea8dc;
    --stufe-a:#8fb0c0; --stufe-b:#c9a13c; --stufe-c:#dd8449; --stufe-d:#e0805f;
    --verbot:#e0707d; --verbot-flaeche:#3a1b20;
    --schatten: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  /* Vorher 13,5 px — rund ein Drittel unter der Zeichenhöhe, die die
     DGUV-Information 215-450 für Bildschirmarbeit ansetzt. Größer stellt
     der Schalter in der Titelleiste (ArbStättV Anhang 6.2). */
  font-size: 15px;
  line-height: 1.5;
  color: var(--tinte);
  background: var(--grund);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ Layout */
/* Vier Ebenen, bewusst über Helligkeit getrennt:
   1 Titelleiste + Menüband  hell   – was ich tun kann
   2 Reiter + Navigation     getönt – wo ich bin
   3 Arbeitsfläche           dunkel – der Inhalt
   4 Karten darauf           hell   – die einzelnen Datensätze            */
.fenster {
  display: grid;
  grid-template-rows: 40px 30px auto 1fr 24px;
  height: 100vh;
  overflow: hidden;
  background: var(--grund);
}

/* --------------------------------------------------- Ebene 1: Titelleiste */
.titelleiste {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: var(--chrom);
  color: var(--tinte);
  user-select: none;
}
.firmenmarke { display: flex; flex: 0 0 auto; }
.firmenmarke svg, .firmenmarke img {
  height: 21px; width: auto; max-width: 130px; display: block;
  border-radius: var(--radius-xs);
}
.firmenmarke svg .tile  { fill: var(--marke); }
.firmenmarke svg .glyph { fill: #fff; }
.firmenmarke.eigenes img { height: 23px; max-width: 160px; }
.firmenname { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.titelleiste .trenner { width: 1px; height: 16px; background: var(--linie); }
.anwendungsname { font-size: 12.5px; font-weight: 700; color: var(--tinte-2); }
.dokumenttitel {
  font-size: 12.5px; color: var(--tinte-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.titel-rechts { margin-left: auto; display: flex; gap: 4px; }
.titelknopf {
  background: none; border: 0; color: var(--tinte-3);
  width: 26px; height: 24px; border-radius: var(--radius-xs);
  cursor: pointer; display: grid; place-items: center;
}
.titelknopf:hover { background: var(--chrom-2); color: var(--tinte); }

/* ------------------------------------------ Ebene 2: Registerkarten */
.menuband-reiter {
  display: flex; align-items: stretch; gap: 0;
  padding: 0 10px;
  background: var(--chrom-2);
  border-top: 1px solid var(--linie);
}
.menuband-reiter button {
  font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 0 17px;
  border: 0; background: none; cursor: pointer;
  color: var(--tinte-2);
  white-space: nowrap;
  position: relative;
}
.menuband-reiter button:hover { color: var(--tinte); background: rgba(0,0,0,.045); }
/* Die aktive Karte wird auf die Höhe des Menübands gehoben und verbindet
   sich mit ihm – dadurch ist erkennbar, dass beides zusammengehört. */
.menuband-reiter button[aria-selected="true"] {
  background: var(--chrom);
  color: var(--marke);
  box-shadow: inset 0 2px 0 var(--marke);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}

/* ------------------------------------------------- Ebene 2: Menüband */
.menuband {
  display: flex; align-items: stretch;
  padding: 7px 12px 4px;
  background: var(--chrom);
  border-bottom: 1px solid var(--linie-stark);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow-x: auto;
  z-index: 3;
}
.mb-gruppe {
  display: flex; flex-direction: column;
  padding: 0 13px;
  border-right: 1px solid var(--linie);
  min-width: 0;
}
.mb-gruppe:last-child { border-right: 0; }
.mb-knoepfe { display: flex; gap: 3px; align-items: stretch; flex: 1; }
.mb-gruppe > .titel {
  text-align: center; font-size: 9.5px; color: var(--tinte-3);
  letter-spacing: .07em; text-transform: uppercase;
  padding-top: 4px; margin-top: 3px;
}
.mb-stapel { display: flex; flex-direction: column; gap: 2px; justify-content: center; }

button.mb-gross, button.mb-klein {
  font: inherit; background: none; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-s);
  color: var(--tinte); text-align: center;
}
button.mb-gross {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 5px 10px; min-width: 62px; font-size: 11.5px; line-height: 1.15;
}
button.mb-klein {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 9px; font-size: 12px; text-align: left; white-space: nowrap;
}
button.mb-gross:hover, button.mb-klein:hover {
  background: var(--chrom-2); border-color: var(--linie);
}
button.mb-gross:disabled, button.mb-klein:disabled {
  opacity: .32; cursor: default; background: none; border-color: transparent;
}
.mb-gross .beschriftung { max-width: 84px; }

/* --------------------------------- Ebene 3: Navigation und Arbeitsfläche */
.arbeitsbereich { display: flex; overflow: hidden; }

.bereichsleiste {
  width: 186px; flex: 0 0 186px;
  background: var(--chrom-2);
  border-right: 1px solid var(--linie-stark);
  padding: 8px 0;
  overflow-y: auto;
}
.bereichsleiste .gruppe {
  padding: 12px 16px 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--tinte-3);
}
.bereichsleiste a {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px; margin: 1px 8px;
  border-radius: var(--radius-s);
  color: var(--tinte-2); text-decoration: none;
  font-size: 13px; font-weight: 700;
}
.bereichsleiste a svg { flex: 0 0 auto; opacity: .75; }
.bereichsleiste a .zahl {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  font-weight: 400; color: var(--tinte-3);
  background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius-pill); padding: 0 6px;
}
.bereichsleiste a:hover { background: rgba(0,0,0,.05); color: var(--tinte); }
.bereichsleiste a.aktiv {
  background: var(--flaeche); color: var(--marke);
  box-shadow: inset 2px 0 0 var(--marke);
}
.bereichsleiste a.aktiv svg { opacity: 1; }

.arbeitsflaeche { flex: 1; display: flex; overflow: hidden; background: var(--grund); }

/* --------------------------------------------------- Ebene 4: Statusleiste */
.statusleiste {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: var(--chrom-2);
  border-top: 1px solid var(--linie-stark);
  font-family: var(--mono); font-size: 10.5px; color: var(--tinte-2);
  white-space: nowrap; overflow: hidden;
}
.statusfueller { margin-left: auto; }
.statustrenner { width: 1px; height: 12px; background: var(--linie); }

/* Zweispaltig: Liste + Detail */
.spalte-liste {
  width: var(--liste);
  flex: 0 0 var(--liste);
  border-right: 1px solid var(--linie);
  display: flex;
  flex-direction: column;
  background: var(--flaeche);
  overflow: hidden;
}
.spalte-detail { flex: 1; overflow-y: auto; }
.einspaltig { flex: 1; overflow-y: auto; }

.listen-kopf {
  padding: 10px 12px;
  border-bottom: 1px solid var(--linie);
  display: flex; gap: 8px;
}
.listen-kopf input { flex: 1; }
.liste { overflow-y: auto; flex: 1; }

.eintrag {
  display: block;
  width: calc(100% - 16px);
  margin: 4px 8px;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.eintrag:hover { background: var(--flaeche-2); }
.eintrag.aktiv {
  background: var(--wasser-hell);
  border-color: color-mix(in srgb, var(--wasser) 40%, transparent);
  box-shadow: inset 2px 0 0 var(--wasser);
}
.eintrag .titel { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.eintrag .zeile2 {
  font-size: 11.5px; color: var(--tinte-3); margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* ------------------------------------------------------------------ Blätter */
.blatt {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  margin: 16px 18px;
  box-shadow: var(--schatten);
}
.blatt > h3 {
  margin: 0;
  padding: 11px 16px;
  font-size: 15.5px;
  color: var(--tinte);
  border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: 8px;
}
.blatt > h3 .norm {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  color: var(--tinte-3); letter-spacing: 0; text-transform: none;
}
.blatt-koerper { padding: 16px; }

/* ------------------------------------------------------------------ Formular */
.raster { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.f1{grid-column:span 1}.f2{grid-column:span 2}.f3{grid-column:span 3}
.f4{grid-column:span 4}.f5{grid-column:span 5}.f6{grid-column:span 6}
.f7{grid-column:span 7}.f8{grid-column:span 8}.f9{grid-column:span 9}
.f12{grid-column:span 12}
@media (max-width: 1100px) {
  .f3,.f4,.f5 { grid-column: span 6; }
}

.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld > label {
  /* Vorher 10,5 px graue Versalien mit Sperrung und 3,7:1 Kontrast — die
     kleinste, blasseste Schrift trug die wichtigste Orientierung. */
  font-size: 13.5px;
  color: var(--tinte-2);
  font-weight: 700;
}
/* Hinweise stehen sichtbar unter dem Feld, nicht hinter einem Fragezeichen:
   Was man zum richtigen Ausfüllen braucht, darf man nicht erst suchen
   müssen. Lange Hinweise zeigen zwei Zeilen, der Rest klappt auf. */
.feld .hilfe {
  font-size: 13px; color: var(--tinte-2); line-height: 1.45; margin-top: 2px;
}
.feld .hilfe .norm { font-family: var(--mono); font-size: 12px; color: var(--tinte-3); white-space: nowrap; }
.feld .hilfe.lang:not(.offen) .hilfetext {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.hilfe-mehr {
  border: 0; background: none; padding: 2px 0; margin: 0;
  color: var(--wasser); font: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

input[type=text], input[type=number], input[type=date], input[type=email],
input[type=tel], input[type=search], input[type=password], select, textarea {
  font: inherit;
  font-size: 14.5px;
  padding: 7px 9px;
  border: 1px solid var(--linie-stark);
  border-radius: var(--radius-s);
  background: var(--grund);
  color: var(--tinte);
  width: 100%;
  min-width: 0;
}
input[type=number], input[type=date] { font-family: var(--mono); font-size: 14px; }
textarea { resize: vertical; min-height: 62px; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--wasser) 45%, transparent);
  outline-offset: -1px;
  border-color: var(--wasser);
}
input::placeholder, textarea::placeholder { color: var(--tinte-3); }

.schalter {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--linie);
  border-radius: var(--radius-s);
  background: var(--grund);
  cursor: pointer;
}
.schalter input { margin: 2px 0 0; accent-color: var(--wasser); }
.schalter span { font-size: 12.5px; line-height: 1.35; }
.schalter:hover { border-color: var(--linie-stark); }

/* ------------------------------------------------------------------ Knöpfe */
button.knopf {
  font: inherit; font-size: 12.5px;
  padding: 6px 12px;
  border: 1px solid var(--linie-stark);
  border-radius: var(--radius-s);
  background: var(--flaeche);
  color: var(--tinte);
  cursor: pointer;
  white-space: nowrap;
}
button.knopf:hover { background: var(--flaeche-2); border-color: var(--tinte-3); }
button.knopf.haupt {
  background: var(--wasser); border-color: var(--wasser); color: #fff;
  font-weight: 600;
}
button.knopf.haupt:hover { background: var(--wasser-tief); border-color: var(--wasser-tief); }
button.knopf.gefahr { color: var(--verbot); border-color: color-mix(in srgb, var(--verbot) 40%, var(--linie)); }
button.knopf.gefahr:hover { background: var(--verbot-flaeche); }
button.knopf:disabled { opacity: .45; cursor: not-allowed; }
button.klein { padding: 3px 8px; font-size: 11.5px; }

.knopfzeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ Marken */
.marke-stufe {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  border: 1.5px solid currentColor; border-radius: var(--radius-xs);
}
.stufe-A { color: var(--stufe-a); }
.stufe-B { color: var(--stufe-b); }
.stufe-C { color: var(--stufe-c); }
.stufe-D { color: var(--stufe-d); }
.stufe-null { color: var(--tinte-3); }

.stempel {
  display: inline-flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px;
  width: 84px; height: 84px;
  border: 2.5px solid currentColor; border-radius: var(--radius-l);
  font-family: var(--mono);
  flex: 0 0 auto;
}
.stempel .buchstabe { font-size: 40px; font-weight: 700; line-height: 1; }
.stempel .wort { font-size: 8.5px; letter-spacing: .13em; text-transform: uppercase; }

.plakette {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .05em;
  padding: 1px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--linie-stark); color: var(--tinte-2);
  background: var(--flaeche-2);
  white-space: nowrap;
}
.plakette.wasser { color: var(--wasser); border-color: color-mix(in srgb, var(--wasser) 45%, transparent); background: var(--wasser-hell); }
.plakette.verbot { color: var(--verbot); border-color: color-mix(in srgb, var(--verbot) 45%, transparent); background: var(--verbot-flaeche); }
.plakette.warn   { color: var(--stufe-c); border-color: color-mix(in srgb, var(--stufe-c) 45%, transparent); background: color-mix(in srgb, var(--stufe-c) 10%, transparent); }
.plakette.ok     { color: var(--stufe-a); border-color: color-mix(in srgb, var(--stufe-a) 45%, transparent); background: color-mix(in srgb, var(--stufe-a) 10%, transparent); }

/* ------------------------------------------------------------------ Befunde */
.befund {
  border: 1px solid var(--linie);
  border-left: 3px solid var(--tinte-3);
  border-radius: var(--radius-s);
  padding: 10px 13px;
  margin-bottom: 8px;
  background: var(--grund);
}
.befund .kopfzeile {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.befund .titel { font-weight: 600; font-size: 13px; }
.befund .norm {
  font-family: var(--mono); font-size: 10.5px; color: var(--tinte-3);
  margin-left: auto; white-space: nowrap;
}
.befund .text { font-size: 12.5px; color: var(--tinte-2); line-height: 1.5; }
.befund blockquote {
  margin: 8px 0 0; padding: 6px 0 6px 12px;
  border-left: 2px solid var(--linie-stark);
  font-family: var(--serif); font-size: 13px; font-style: italic;
  color: var(--tinte-2); line-height: 1.45;
}
.befund.verbot   { border-left-color: var(--verbot); background: var(--verbot-flaeche); }
.befund.verbot .titel { color: var(--verbot); }
.befund.kritisch { border-left-color: var(--stufe-c); }
.befund.pflicht  { border-left-color: var(--wasser); }
.befund.info     { border-left-color: var(--linie-stark); }

/* ------------------------------------------------------------------ Tabellen */
table.gitter { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.gitter th {
  text-align: left; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--tinte-3); font-weight: 600;
  padding: 7px 9px; border-bottom: 1px solid var(--linie-stark);
  white-space: nowrap;
}
table.gitter td {
  padding: 7px 9px; border-bottom: 1px solid var(--linie);
  vertical-align: middle;
}
table.gitter tbody tr:hover { background: var(--flaeche-2); }
table.gitter tbody tr:last-child td { border-bottom: 0; }
table.gitter td:first-child { border-top-left-radius: var(--radius-s);
  border-bottom-left-radius: var(--radius-s); }
table.gitter td:last-child { border-top-right-radius: var(--radius-s);
  border-bottom-right-radius: var(--radius-s); }
table.gitter .zahl { font-family: var(--mono); text-align: right; }
table.gitter tr.klickbar { cursor: pointer; }

/* ------------------------------------------------------------------ Kennzahlen */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; }
.kennzahl {
  border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 12px 14px; background: var(--grund);
}
.kennzahl .wert { font-family: var(--mono); font-size: 25px; line-height: 1.1; font-weight: 600; }
.kennzahl .bez { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--tinte-3); margin-top: 4px; }

/* Stufen-Balken */
.stufenbalken { display: flex; height: 26px; border: 1px solid var(--linie); border-radius: var(--radius-s); overflow: hidden; }
.stufenbalken div {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff;
  min-width: 0;
}

/* ------------------------------------------------------------------ Diverses */
.leer {
  padding: 46px 24px; text-align: center; color: var(--tinte-3); font-size: 13px;
}
.leer .gross { font-family: var(--mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 6px; }

.trennlinie { height: 1px; background: var(--linie); margin: 14px 0; border: 0; }

.notiz {
  font-size: 12px; color: var(--tinte-2); line-height: 1.5;
  background: var(--flaeche-2); border: 1px solid var(--linie);
  border-radius: var(--radius-s); padding: 9px 11px;
}
.notiz.wasser { background: var(--wasser-hell); border-color: color-mix(in srgb, var(--wasser) 30%, transparent); }

.mono { font-family: var(--mono); }
.klein { font-size: 12.5px; }
.gedimmt { color: var(--tinte-3); }
.rechts { text-align: right; }

/* Meldung */
#meldung {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--tinte); color: var(--grund);
  padding: 10px 18px; border-radius: var(--radius); font-size: 12.5px;
  box-shadow: 0 6px 22px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .18s;
  z-index: 100; max-width: 70vw;
}
#meldung.sichtbar { opacity: 1; }
#meldung.fehler { background: var(--verbot); color: #fff; }

/* Ergebnis-Kopf der Anlagenbewertung */
.ergebnis-kopf { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ergebnis-fakten { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 12.5px; align-items: baseline; }
.ergebnis-fakten dt { color: var(--tinte-3); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.ergebnis-fakten dd { margin: 0; font-family: var(--mono); }

/* Stoffzeilen */
.stoffzeile {
  display: grid;
  grid-template-columns: minmax(120px,2fr) 84px 98px 92px 76px 108px 32px;
  gap: 8px; align-items: end;
  padding: 8px; margin-bottom: 6px;
  border: 1px solid var(--linie); border-radius: var(--radius-s); background: var(--grund);
}
.stoffzeile .kopf { font-size: 9.5px; }
/* Mit Anlagenteilen kommt eine Spalte für die Zuordnung dazu. */
.stoffzeile.mit-teil {
  grid-template-columns:
    minmax(115px,1.8fr) minmax(100px,1.3fr) 80px 94px 84px 70px 104px 32px;
}
/* Ausgenommene Positionen bleiben lesbar, sind aber sofort als Sonderfall
   erkennbar — sie verändern die maßgebende Menge. */
.stoffzeile.ausgenommen {
  background: var(--flaeche-2);
  border-left: 3px solid var(--stufe-c);
}
/* Der Mitzähl-Schalter ist der Ausnahmefall und bekommt eine eigene Zeile,
   statt den Alltagsfeldern Platz wegzunehmen. */
.stoffzeile .zaehlung {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px; padding-top: 7px;
  border-top: 1px dotted var(--linie);
}
.stoffzeile .zaehlung .schalter { padding: 3px 0; }
.stoffzeile .zaehlung input[type="text"] { flex: 1; min-width: 160px; }
@media (max-width: 1240px) {
  .stoffzeile, .stoffzeile.mit-teil { grid-template-columns: 1fr 1fr 1fr; }
}

/* Anlagenteile (§ 2 Abs. 9 S. 3 AwSV) */
.teilzeile {
  display: grid;
  grid-template-columns:
    minmax(130px,2fr) 58px 124px minmax(94px,1.1fr) 88px minmax(94px,1.1fr) 88px 32px;
  gap: 8px; align-items: end;
  padding: 8px; margin-bottom: 6px;
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--grund);
}
.teilzeile .kopf { font-size: 9.5px; }
.teilzeile button.weg {
  background: none; border: 1px solid var(--linie); border-radius: var(--radius-s);
  color: var(--tinte-3); cursor: pointer; height: 29px; width: 28px;
  font-size: 15px; line-height: 1;
}
.teilzeile button.weg:hover { color: var(--verbot); border-color: var(--verbot); }
@media (max-width: 1240px) {
  .teilzeile { grid-template-columns: 1fr 1fr 1fr; }
}

.teiluebersicht {
  margin-top: 12px; padding: 11px 13px 4px;
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--flaeche-2);
}
.teiluebersicht .kopf {
  display: flex; align-items: baseline; gap: 8px;
  font-weight: 600; font-size: 12.5px; margin-bottom: 6px;
}
.teiluebersicht .kopf .norm {
  font-family: var(--mono); font-size: 10.5px; color: var(--tinte-3);
  margin-left: auto;
}
.teiluebersicht table.gitter { font-size: 12px; }
.teiluebersicht tfoot td { border-bottom: none; padding-top: 9px; }
.teiluebersicht tr.warnzeile td { background: var(--verbot-flaeche); }
.stoffzeile button.weg {
  background: none; border: 1px solid var(--linie); border-radius: var(--radius-s);
  color: var(--tinte-3); cursor: pointer; height: 29px; width: 28px;
  font-size: 15px; line-height: 1;
}
.stoffzeile button.weg:hover { color: var(--verbot); border-color: var(--verbot); }

/* Zonen-Auswahl */
.zonenwahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px,1fr)); gap: 7px; }
.zonenwahl label {
  border: 1px solid var(--linie); border-radius: var(--radius-s); padding: 8px 9px;
  cursor: pointer; background: var(--grund); display: block;
}
.zonenwahl label:hover { border-color: var(--linie-stark); }
/* Visuell verborgen, aber fokussierbar und für Screenreader vorhanden. */
.zonenwahl input {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}
.zonenwahl label:has(input:checked) {
  border-color: var(--wasser); background: var(--wasser-hell);
  box-shadow: inset 0 0 0 1px var(--wasser);
}
.zonenwahl label:has(input:focus-visible) {
  outline: 2px solid var(--wasser); outline-offset: 2px;
}
.zonenwahl .z-nr { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.zonenwahl .z-txt { font-size: 11px; color: var(--tinte-3); line-height: 1.3; margin-top: 2px; }
.zonenwahl label:has(input:checked) .z-nr { color: var(--wasser); }

/* ------------------------------------------------------- Herleitung / Rechenweg */
pre.herleitung {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 13px 15px;
  background: var(--flaeche-2);
  border: 1px solid var(--linie);
  border-radius: var(--radius-s);
  color: var(--tinte-2);
  max-height: 60vh;
  overflow-y: auto;
}

details.rechenweg {
  border: 1px solid var(--linie);
  border-radius: var(--radius-s);
  background: var(--flaeche-2);
  overflow: hidden;
}
details.rechenweg > summary {
  cursor: pointer;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tinte-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
details.rechenweg > summary::-webkit-details-marker { display: none; }
details.rechenweg > summary::before {
  content: "▸";
  font-family: var(--mono);
  color: var(--wasser);
  transition: transform .15s ease;
  display: inline-block;
}
details.rechenweg[open] > summary::before { transform: rotate(90deg); }
details.rechenweg > summary:hover { color: var(--tinte); }
details.rechenweg > ol {
  margin: 0;
  padding: 4px 15px 14px 34px;
  font-size: 12.5px;
}
details.rechenweg > ol > li { margin-bottom: 11px; }
details.rechenweg > ol > li::marker { font-family: var(--mono); color: var(--wasser); }
.schritt-kopf { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.schritt-titel { font-weight: 600; }
.schritt-kopf .norm {
  font-family: var(--mono); font-size: 10.5px; color: var(--tinte-3);
  margin-left: auto;
}
details.rechenweg ul {
  margin: 4px 0 0; padding-left: 16px;
  color: var(--tinte-2); line-height: 1.5;
}
details.rechenweg ul li { margin-bottom: 2px; }

/* Hinweis-Knopf in Feldbeschriftungen */
button.hinweis {
  background: none; border: 0; cursor: pointer; padding: 0 0 0 3px;
  color: var(--wasser); font-size: 11px; line-height: 1;
}
button.hinweis:hover { color: var(--wasser-tief); }

/* ------------------------------------------------------------------ Fenster */
#herleitungsfenster { position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 5vh 4vw; }
#herleitungsfenster .ueberlagerung {
  position: absolute; inset: 0; background: rgba(12,16,18,.5);
  backdrop-filter: blur(2px);
}
#herleitungsfenster .fensterblatt {
  position: relative;
  background: var(--flaeche);
  border: 1px solid var(--linie-stark);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.3);
  max-width: 820px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column;
}
#herleitungsfenster h3 {
  margin: 0; padding: 13px 16px;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tinte-2); border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: 10px;
}
#herleitungsfenster h3 button { margin-left: auto; }
#herleitungsfenster .fensterkoerper { padding: 16px; overflow-y: auto; }

/* ------------------------------------------------------------- Fragezeichen */
/* Erklärungen stehen nicht mehr dauerhaft im Formular, sondern hinter einem
   kleinen Fragezeichen. Das hält die Masken ruhig, ohne die Rechtsgrundlage
   zu verstecken. */
.frage {
  /* Vorher 14 × 14 px und nur per Mausberührung: auf dem Handy unerreichbar,
     unter dem WCAG-Mindestmaß von 24 × 24 px (2.5.8). Jetzt öffnet ein Klick
     oder Tippen die Erklärung, sie bleibt offen, Esc oder ein Klick daneben
     schließt sie (WCAG 1.4.13). */
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex: 0 0 auto;
  margin-left: 6px; padding: 0; vertical-align: middle;
  border: 1.5px solid var(--linie-stark); border-radius: var(--radius-pill);
  background: var(--flaeche); color: var(--tinte-2);
  font: 700 12.5px/1 var(--sans); cursor: pointer;
  position: relative;
}
.frage::after { content: ""; position: absolute; inset: -4px; }
.frage:hover, .frage:focus-visible, .frage.offen {
  border-color: var(--marke); color: var(--marke);
  background: var(--wasser-hell); outline: none;
}
.frage .blase {
  position: absolute; top: calc(100% + 7px); left: -8px;
  width: max-content; max-width: 320px;
  padding: 9px 11px;
  background: var(--tinte); color: var(--grund);
  border-radius: var(--radius-s);
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
  font: 400 13.5px/1.5 var(--sans);
  text-align: left; text-transform: none; letter-spacing: normal;
  opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity .13s ease, transform .13s ease, visibility .13s;
  z-index: 90; white-space: normal; cursor: text;
}
.frage .blase::before {
  content: ""; position: absolute; bottom: 100%; left: 10px;
  border: 5px solid transparent; border-bottom-color: var(--tinte);
}
.frage .blase .norm {
  display: block; margin-top: 5px;
  font-family: var(--mono); font-size: 12px; opacity: .8;
}
.frage.offen .blase {
  opacity: 1; visibility: visible; transform: translateY(0);
}
/* Nahe am rechten Rand nach links ausrichten */
.frage.links .blase { left: auto; right: -8px; }
.frage.links .blase::before { left: auto; right: 10px; }

/* Blatt-Überschriften: Fragezeichen statt Normenkette */
.blatt > h3 .frage { margin-left: auto; }

/* ------------------------------------------------------------- Einführung */
#tour { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
#tour .scheinwerfer {
  position: absolute; border-radius: var(--radius-s);
  box-shadow: 0 0 0 3px var(--marke), 0 0 0 9999px rgba(10,16,20,.58);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
#tour .karte {
  position: absolute; width: 330px; max-width: calc(100vw - 32px);
  background: var(--flaeche); color: var(--tinte);
  border: 1px solid var(--linie-stark); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.34);
  padding: 16px 18px 14px; pointer-events: auto;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
#tour .schritt {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--marke); margin-bottom: 5px;
}
#tour h4 { margin: 0 0 6px; font-size: 15px; }
#tour p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--tinte-2); }
#tour .fuss { display: flex; align-items: center; gap: 8px; }
#tour .punkte { display: flex; gap: 5px; margin-right: auto; }
#tour .punkte i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--linie-stark); display: block;
}
#tour .punkte i.an { background: var(--marke); }

/* -------------------------------------------------------------- Platzhalter */
/* Bewusst als solcher erkennbar: gestrichelt, blass, ohne Bedienelemente.
   Nichts soll den Eindruck erwecken, hier ginge schon etwas. */
.platzhalter {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 26px 20px;
  border: 2px dashed var(--linie-stark); border-radius: var(--radius);
  color: var(--tinte-3); background: var(--flaeche-2);
  text-align: center;
}
.platzhalter .titel { font-size: 13px; font-weight: 700; margin-top: 6px; }
.platzhalter .unter { font-size: 11.5px; font-style: italic; }

/* ------------------------------------------------------- Sicherheitsdatenblätter */
.datenblatt {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 8px 11px; margin-bottom: 6px;
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--flaeche-2);
}
.datenblatt a { color: var(--marke); font-weight: 700; text-decoration: none; }
.datenblatt a:hover { text-decoration: underline; }
.datenblatt .weg { margin-left: auto; }

/* --------------------------------------------------------- Gefahrenpiktogramme */
/* Nur die zutreffenden werden gezeigt – klein, direkt beim Namen. */
.piktozeile { display: inline-flex; gap: 3px; margin-left: 7px; vertical-align: middle; }
img.piktomarke { display: block; }
.eintrag .titel img.piktomarke { margin-left: 2px; vertical-align: -3px; }
.belegzeile { display: flex; align-items: center; gap: 3px; min-height: 30px; }
ul.schlicht { margin: 0; padding-left: 18px; font-size: 13px; }
ul.schlicht li { margin-bottom: 3px; }

/* ------------------------------------------------------------ Rückhaltung */
.rueckhalt {
  margin-top: 12px; padding: 11px 13px;
  border: 1px solid var(--linie); border-left: 3px solid var(--marke);
  border-radius: var(--radius-s); background: var(--flaeche-2);
}
.rueckhalt .zeile {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 5px;
}
.rueckhalt .beschriftung { font-size: 12px; color: var(--tinte-2); }
.rueckhalt .wert { font-weight: 700; font-family: var(--mono); font-size: 13px; }
.rueckhalt .norm {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  color: var(--tinte-3);
}

/* ---------------------------------------------- Prüfungen (§§ 46 bis 48) */
/* Bewusst fließend statt starres Raster: die Prüfzeile trägt sieben Felder,
   die in einer festen Spaltenzahl schon bei mittleren Fensterbreiten
   überlaufen würden. */
.pruefzeile {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px;
  position: relative;
  padding: 8px 44px 8px 8px; margin-bottom: 6px;
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--grund);
}
.pruefzeile > .feld { flex: 1 1 132px; min-width: 0; }
.pruefzeile > .feld.schmal { flex: 0 0 128px; }
.pruefzeile input, .pruefzeile select { width: 100%; }
.pruefzeile .kopf { font-size: 9.5px; }
/* Ein offener Mangel ist keine Nebensache – er muss ins Auge fallen. */
.pruefzeile.offen { border-left: 3px solid var(--stufe-c); }
.pruefzeile .mangel {
  flex: 1 1 100%;
  display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
  margin-top: 2px; padding-top: 7px;
  border-top: 1px dotted var(--linie);
}
/* Die Felder im Mängelblock brauchen dieselben Regeln wie die der Kopfzeile –
   ohne min-width:0 sprengt ein Datumsfeld die Zeile. */
.pruefzeile .mangel > .feld { flex: 1 1 180px; min-width: 0; }
.pruefzeile .mangel > .feld.schmal { flex: 0 0 128px; }
.pruefzeile .mangel > .schalter { flex: 0 0 auto; }
.pruefzeile button.weg {
  position: absolute; top: 8px; right: 8px;
  background: none; border: 1px solid var(--linie); border-radius: var(--radius-s);
  color: var(--tinte-3); cursor: pointer; height: 29px; width: 28px;
  font-size: 15px; line-height: 1;
}
.pruefzeile button.weg:hover { color: var(--verbot); border-color: var(--verbot); }


/* ------------------------------------------- Fotos und Unterlagen (§ 43) */
.ablage {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.unterlage {
  position: relative; margin: 0;
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--grund); overflow: hidden;
}
.unterlage img, .unterlage .symbolfeld {
  display: block; width: 100%; height: 108px;
  object-fit: cover; background: var(--flaeche-2);
}
.unterlage .symbolfeld {
  display: flex; align-items: center; justify-content: center;
  color: var(--tinte-3);
}
.unterlage figcaption { padding: 6px 8px 7px; }
.unterlage .titel {
  display: block; font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unterlage .unter {
  display: block; font-size: 10.5px; color: var(--tinte-3); margin-top: 1px;
}
.unterlage.fehlt { border-color: var(--verbot); }
.unterlage button.weg {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; line-height: 1; font-size: 14px;
  border: 1px solid var(--linie); border-radius: var(--radius-s);
  background: var(--grund); color: var(--tinte-3); cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.unterlage:hover button.weg, .unterlage button.weg:focus-visible { opacity: 1; }
.unterlage button.weg:hover { color: var(--verbot); border-color: var(--verbot); }

/* ------------------------------------------------- Diagnose: Stand + Fehler */
.standkopf {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--linie);
}
.marke-version {
  font: 700 17px/1 var(--mono);
  padding: 8px 12px; border-radius: var(--radius-s);
  background: var(--marke); color: #fff; letter-spacing: .02em;
}
.bestandszeile {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--linie);
  font-size: 11.5px; color: var(--tinte-3);
}
.bestandszeile strong { color: var(--tinte); font-size: 12.5px; }

.protokoll { border: 1px solid var(--linie); border-radius: var(--radius-s); }
.fehlerzeile { border-bottom: 1px solid var(--linie); }
.fehlerzeile:last-child { border-bottom: 0; }
.fehlerzeile > summary {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; cursor: pointer; list-style: none;
}
.fehlerzeile > summary::-webkit-details-marker { display: none; }
.fehlerzeile > summary::before {
  content: "▸"; color: var(--tinte-3); font-size: 10px;
}
.fehlerzeile[open] > summary::before { content: "▾"; }
.fehlerzeile > summary:hover { background: var(--flaeche-2); }
.fehlerzeile .meldung { flex: 1 1 200px; min-width: 0; font-size: 12.5px; }
.fehlerzeile .stand { margin-left: auto; }
/* Ein Serverfehler ist etwas anderes als eine abgewiesene Eingabe. */
.fehlerzeile.schwer { border-left: 3px solid var(--verbot); }
.fehlerzeile pre.spur {
  margin: 0; padding: 10px 12px;
  background: var(--flaeche-2); border-top: 1px solid var(--linie);
  font: 11px/1.45 var(--mono); color: var(--tinte-2);
  overflow-x: auto; white-space: pre;
}
table.gitter tr.jetzt td { background: var(--wasser-hell); }

/* Nur auf schmalen Bildschirmen sichtbar; am Rechner stehen Liste und
   Formular nebeneinander, da wäre ein Zurück-Knopf sinnlos. */
.zurueck-liste { display: none; }

/* ==========================================================================
   Schmale Bildschirme — Handy und kleines Tablet
   Anspruch: alles muss gehen, was am Rechner geht. Nicht hübscher als nötig,
   aber vollständig bedienbar. Drei Spalten nebeneinander gibt es hier nicht,
   also wird gestapelt und umgeschaltet.
   ========================================================================== */
@media (max-width: 860px) {
  /* Feste Zeilenhöhen aufgeben; dvh statt vh wegen der Adressleiste, die
     auf Mobilgeräten ein- und ausfährt. */
  .fenster {
    grid-template-rows: 44px 36px auto 1fr;
    height: 100vh; height: 100dvh;
  }
  .statusleiste { display: none; }

  /* Titelleiste: Marke und Themenwechsel reichen. */
  .anwendungsname, .dokumenttitel, .titelleiste .trenner { display: none; }
  .titelleiste { padding: 0 10px; }
  .firmenname { font-size: 14px; }
  .titelknopf { width: 34px; height: 32px; }

  /* Registerkarten waagerecht scrollbar; es sind nur drei, sie passen. */
  .menuband-reiter { padding: 0 6px; overflow-x: auto; }
  .menuband-reiter button { padding: 0 13px; font-size: 13px; }
  /* Das Menüband bricht um, statt seitlich zu scrollen. Mit verborgenem
     Rollbalken lagen Befehle rechts außerhalb des Bildschirms, ohne dass
     etwas darauf hinwies — „Stand und Fehler“ unter Hilfe etwa war auf dem
     Handy unauffindbar. Lieber eine Zeile mehr als ein Befehl, den niemand
     findet. */
  .menuband {
    padding: 5px 8px 4px;
    flex-wrap: wrap; row-gap: 4px;
    overflow-x: visible;
  }
  .mb-knoepfe { flex-wrap: wrap; }
  .mb-gruppe { padding: 0 7px; }
  .mb-gruppe > .titel { display: none; }
  /* Beschriftungen nebeneinander statt untereinander — sonst überlagern
     sie sich, weil die Knöpfe zu schmal werden. */
  button.mb-gross {
    flex-direction: row; align-items: center; gap: 6px;
    padding: 7px 9px; min-width: 0; white-space: nowrap;
  }
  button.mb-gross span { font-size: 12px; }
  /* Die Breitenbremse der großen Knöpfe gilt nur für den zweizeiligen
     Satz am Rechner. Hier steht die Beschriftung in einer Zeile; mit der
     Bremse lief „Begriffe und Abkürzungen“ über den Knopf daneben. */
  button.mb-gross .beschriftung { max-width: none; }
  button.mb-klein { white-space: nowrap; }

  /* Navigation: aus der Spalte wird eine Leiste, die in mehrere Zeilen
     umbricht. Früher scrollte sie seitlich mit verborgenem Rollbalken; der
     letzte Eintrag „Stand und Fehler“ lag dann außerhalb des Bildschirms,
     und nichts verriet, dass da noch etwas kommt. Jetzt ist jeder Bereich
     sofort zu sehen. */
  .arbeitsbereich { flex-direction: column; overflow: hidden; }
  .bereichsleiste {
    width: auto; flex: 0 0 auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
    padding: 5px 8px;
    border-right: 0; border-bottom: 1px solid var(--linie-stark);
    overflow: visible;
  }
  .bereichsleiste .gruppe { display: none; }
  .bereichsleiste a {
    margin: 0; padding: 6px 9px; white-space: nowrap; font-size: 13px;
  }
  .bereichsleiste a.aktiv { box-shadow: inset 0 -2px 0 var(--marke); }

  /* Liste und Formular teilen sich den Platz nicht, sie lösen sich ab. */
  .arbeitsflaeche { flex-direction: column; }
  .spalte-liste {
    width: auto; flex: 1 1 auto; border-right: 0;
  }
  .spalte-detail { flex: 1 1 auto; }
  :root[data-mobil="detail"] .spalte-liste { display: none; }
  :root[data-mobil="liste"]  .spalte-detail { display: none; }

  .zurueck-liste {
    display: block; width: 100%;
    padding: 11px 14px; border: 0;
    border-bottom: 1px solid var(--linie);
    background: var(--chrom-2); color: var(--marke);
    font: 700 14px var(--sans); text-align: left; cursor: pointer;
    position: sticky; top: 0; z-index: 5;
  }

  /* Formulare: eine Spalte. Zwei nebeneinander sind auf 375 px unlesbar. */
  .raster { gap: 11px; }
  .raster > .feld { grid-column: span 12 !important; }

  /* Zeilen-Editoren untereinander statt nebeneinander. */
  .stoffzeile, .stoffzeile.mit-teil, .teilzeile {
    grid-template-columns: 1fr 1fr;
  }
  .stoffzeile .feld:first-child, .teilzeile .feld:first-child { grid-column: 1 / -1; }
  .stoffzeile button.weg, .teilzeile button.weg {
    grid-column: 1 / -1; width: 100%; height: 34px;
  }
  .pruefzeile { padding-right: 8px; }
  .pruefzeile button.weg { position: static; width: 100%; height: 34px; }
  .pruefzeile > .feld, .pruefzeile > .feld.schmal { flex: 1 1 100%; }

  /* Breite Tabellen dürfen im Blatt scrollen, statt die Seite zu sprengen. */
  .blatt-koerper { overflow-x: auto; }
  table.gitter { min-width: 520px; }

  /* Eingabefelder: unter 16 px zoomt iOS beim Antippen hinein. */
  input[type=text], input[type=number], input[type=date], input[type=email],
  input[type=tel], input[type=search], input[type=password], select, textarea {
    font-size: 16px;
  }
  .knopf, button.knopf { min-height: 38px; }

  .blatt { border-radius: var(--radius-s); }
  .blatt-koerper { padding: 12px; }
  .einspaltig { padding: 10px; }

  /* Das Hinweisband darf den Inhalt nicht verdecken. */
  #testband { font-size: 11px; padding: 6px 10px; }
  .fenster { padding-bottom: 42px; }

  /* Piktogramme und Ablage kleiner rastern. */
  .ablage { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .zonenwahl { grid-template-columns: 1fr 1fr; }
}

/* Handy: Menüband und Bereichsleiste eingeklappt. Aufgeklappt nahmen beide
   zusammen rund vier Fünftel der Höhe; von der Liste blieb ein Eintrag.
   Ein Druck auf eine Registerkarte öffnet ihr Band (huelle-klassisch.js,
   bandZeigen), die Bereichsleiste zeigt nur den offenen Bereich mit einem
   Pfeil zum Wechseln. Oben rechts steht nur das Personensymbol; Name und
   Rolle stehen im Kontomenü und im Tooltip. */
.bereich-wahl { display: none; }
@media (max-width: 860px) {
  html:not([data-band-offen]) .menuband { display: none; }
  .bereichsleiste .bereich-wahl {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px;
    padding: 4px 6px; border: 0; background: none; color: var(--tinte);
    font: 700 15px var(--sans); text-align: left; cursor: pointer;
  }
  .bereichsleiste .bereich-wahl .pfeil { margin-left: auto; color: var(--tinte-2); }
  .bereichsleiste[data-offen] .bereich-wahl .pfeil { transform: rotate(180deg); }
  .bereichsleiste:not([data-offen]) > a { display: none; }
  .bereichsleiste[data-offen] { padding-bottom: 8px; }
  .titelleiste .kontotext, .titelleiste .kontoknopf .pfeil {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* Sehr schmal (unter 430 px): Zeilen-Editoren ganz einspaltig. */
@media (max-width: 430px) {
  .stoffzeile, .stoffzeile.mit-teil, .teilzeile { grid-template-columns: 1fr; }
  .ablage { grid-template-columns: 1fr 1fr; }
  .zonenwahl { grid-template-columns: 1fr; }
  .menuband-reiter button { padding: 0 10px; }
}

/* Erklärungen auf dem Handy: „Zeigen mit der Maus“ gibt es dort nicht, und
   eine 320 px breite Blase neben einem Feld am rechten Rand wäre halb
   abgeschnitten. Auf schmalen Bildschirmen wird sie deshalb angetippt und
   legt sich als Streifen über die volle Breite. */
@media (max-width: 860px) {
  .frage { width: 28px; height: 28px; font-size: 14px; margin-left: 8px; }
  .frage .blase {
    position: fixed;
    left: 10px; right: 10px; bottom: 52px; top: auto;
    width: auto; max-width: none;
    padding: 13px 15px; font-size: 13.5px;
    transform: none;
  }
  .frage .blase::before { display: none; }
  .frage.links .blase { left: 10px; right: 10px; }
  .frage.offen .blase { opacity: 1; visibility: visible; transform: none; }
}

/* ------------------------------------------------------------ Wartebalken */
/* Ganz oben, über allem. Zwei Zustände: unbestimmt (wandernder Streifen,
   wenn die Dauer unbekannt ist) und bestimmt (echter Prozentwert beim
   Hochladen, wo der Browser den Fortschritt kennt). */
#wartebalken {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 500; pointer-events: none;
  opacity: 0; transition: opacity .18s;
  background: color-mix(in srgb, var(--marke) 18%, transparent);
}
#wartebalken.sichtbar { opacity: 1; }
#wartebalken .fuellung {
  height: 100%; width: 35%;
  background: var(--marke);
  border-radius: 0 2px 2px 0;
  animation: wandern 1.1s ease-in-out infinite;
  transition: width .2s ease-out;
}
/* Sobald eine Breite gesetzt ist, gilt der echte Wert statt der Wanderung. */
#wartebalken .fuellung[style*="width"] { animation: none; }
#wartebalken.fertig .fuellung { width: 100% !important; animation: none; }
@keyframes wandern {
  0%   { margin-left: -35%; }
  100% { margin-left: 100%; }
}
#wartebalken .wort {
  position: absolute; top: 7px; right: 12px;
  font: 11px var(--sans); color: var(--tinte-2);
  background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius-pill);
  padding: 2px 9px;
  box-shadow: var(--schatten);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  #wartebalken .fuellung { animation: none; width: 100%; opacity: .5; }
}

/* ------------------------------------------------- Warnhinweis als Notiz */
/* Wurde schon länger verwendet, war aber nie gestaltet — Warnungen sahen
   aus wie gewöhnliche Notizen. */
.notiz.warn {
  background: color-mix(in srgb, var(--stufe-c) 9%, var(--flaeche-2));
  border-color: color-mix(in srgb, var(--stufe-c) 40%, transparent);
  color: var(--tinte);
}

/* ------------------------------------------ Gefährdungsbeurteilung (EMKG) */
.emkg-gruppen {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.emkg-gruppe {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border: 1px solid var(--linie);
  border-radius: var(--radius-s); background: var(--flaeche-2);
}
.emkg-gruppe .modul {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tinte-3);
}
.emkg-gruppe strong { font-size: 18px; line-height: 1.2; }
.emkg-gesamt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.emkg-modul { border-top: 1px solid var(--linie); margin-top: 14px; padding-top: 14px; }
.emkg-modul .ergebnis-kopf { align-items: flex-start; flex-wrap: nowrap; }
.emkg-text { min-width: 0; }
.emkg-text .titel { font-weight: 600; font-size: 13.5px; }
.emkg-text ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--tinte-2); line-height: 1.5; }
.emkg-leitfaeden { margin: 10px 0 0 78px; font-size: 12.5px; display: grid; gap: 3px; }
.emkg-leitfaeden .mono { display: inline-block; min-width: 54px; color: var(--tinte-2); }
.stempel.klein { width: 62px; height: 62px; border-width: 2px; }
.stempel.klein .buchstabe { font-size: 26px; }
.stempel.klein .wort { font-size: 7.5px; }
@media (max-width: 860px) {
  .emkg-leitfaeden { margin-left: 0; }
}

/* Ankreuzfelder stehen als ganzer Satz im Feld. Die Versalien der
   Feldüberschriften machten daraus schwer lesbare Großbuchstabenblöcke. */
.feld > label.schalter {
  font-size: inherit; letter-spacing: normal; text-transform: none;
  color: var(--tinte); font-weight: 400;
}
/* Lange Bereichsnamen umbrechen statt abschneiden („Gefährdungs-
   beurteilung“, mit weichem Trennstrich im Namen). */
.bereichsleiste a span { min-width: 0; hyphens: manual; overflow-wrap: break-word; }


/* ----------------------------------------------------------- Schriftgröße */
/* Drei Stufen, wie die DGUV-Information 215-450 empfiehlt; die ArbStättV
   verlangt eine individuell einstellbare Zeichengröße. Vergrößert wird die
   ganze Oberfläche gleichmäßig, damit nichts aus dem Raster fällt. Auf dem
   Handy nicht — dort sind die Felder ohnehin auf 16 px gesetzt. */
.schriftwahl { display: inline-flex; align-items: flex-end; gap: 2px; margin-right: 6px; }
.schriftwahl button {
  border: 1px solid transparent; background: none; color: var(--tinte-2);
  font-family: var(--sans); font-weight: 700; line-height: 1;
  min-width: 26px; height: 26px; padding: 0 4px; border-radius: var(--radius-xs);
  cursor: pointer;
}
.schriftwahl button[data-schrift="normal"] { font-size: 12px; }
.schriftwahl button[data-schrift="gross"] { font-size: 15px; }
.schriftwahl button[data-schrift="sehr-gross"] { font-size: 18px; }
.schriftwahl button[aria-pressed="true"] {
  border-color: var(--linie-stark); background: var(--flaeche-2); color: var(--tinte);
}
@media (min-width: 861px) {
  html[data-schrift="gross"] { zoom: 1.15; }
  html[data-schrift="sehr-gross"] { zoom: 1.3; }
}
@media (max-width: 860px) { .schriftwahl { display: none; } }

/* ------------------------------------------------- Ungespeicherte Änderung */
#statusHinweis.ungespeichert { color: var(--stufe-c); font-weight: 700; }

/* ------------------------------------------------------------------ Dialog */
/* Ersetzt die Browser-Rückfrage „OK / Abbrechen“. Die wird reflexhaft
   weggeklickt; dieser Dialog nennt, was genau verloren geht, beschriftet die
   Knöpfe mit der Folge und hat den sicheren Knopf vorausgewählt. */
dialog.rueckfrage {
  border: 1px solid var(--linie-stark); border-radius: var(--radius);
  background: var(--flaeche); color: var(--tinte);
  padding: 0; width: min(500px, calc(100vw - 32px));
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
dialog.rueckfrage::backdrop { background: rgba(15,19,21,.45); }
dialog.rueckfrage h2 { margin: 0; padding: 16px 20px 0; font-size: 17px; }
dialog.rueckfrage .inhalt { padding: 10px 20px 4px; font-size: 14.5px; line-height: 1.55; color: var(--tinte-2); }
dialog.rueckfrage .inhalt ul { margin: 8px 0; padding-left: 20px; }
dialog.rueckfrage .knopfzeile { padding: 14px 20px 18px; justify-content: flex-end; }
dialog.rueckfrage button.knopf { min-height: 38px; padding: 0 16px; font-size: 14.5px; }

/* EMKG-Maßnahmenstufen eckig, Gefährdungsstufen rund: zwei Rangskalen
   dürfen sich nicht verwechseln lassen, nur weil sie ähnliche Farben tragen. */
.stempel.emkg { border-radius: 6px; }

/* Ein Satz, der das Ergebnis begründet — „warum C und nicht B“ —, vor dem
   ausführlichen Rechenweg. */
.stufenbegruendung { margin-top: 12px; font-size: 15px; font-weight: 700; line-height: 1.45; }
.frist-ueber { color: var(--verbot); font-weight: 700; }

/* ==========================================================================
   Konto und Rechte — Titelleiste, Nur-Ansehen, Dialoge, Anmeldeseite
   Gleiche Bausteine wie im Rest der Oberfläche: dieselben Farben, dieselbe
   große Grundschrift, Zustände immer auch als Wort.
   ========================================================================== */

/* ------------------------------------------------------ Konto oben rechts */
.konto { position: relative; display: flex; align-items: center; margin-right: 6px; }
.kontoknopf, .kontoname {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; max-width: 340px; padding: 0 10px;
  border-radius: var(--radius-s);
  font: 700 12.5px var(--sans); color: var(--tinte-2);
}
.kontoknopf {
  background: none; border: 1px solid var(--linie); cursor: pointer;
}
.kontoknopf:hover, .kontoknopf[aria-expanded="true"] {
  background: var(--chrom-2); border-color: var(--linie-stark); color: var(--tinte);
}
.kontoknopf:focus-visible, .kontomenue [role="menuitem"]:focus-visible {
  outline: 2px solid var(--marke); outline-offset: 1px;
}
.kontoknopf svg, .kontoname svg { flex: 0 0 auto; }
.kontotext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kontoknopf .pfeil { font-size: 10px; }
.kontomenue {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 120;
  min-width: 270px; max-width: calc(100vw - 20px); padding: 6px;
  background: var(--flaeche); color: var(--tinte);
  border: 1px solid var(--linie-stark); border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
  user-select: text;
}
.kontokopf {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--linie); font-size: 14.5px;
}
.kontokopf span { font-size: 12.5px; color: var(--tinte-3); }
.kontomenue [role="menuitem"] {
  display: block; width: 100%; min-height: 42px; padding: 9px 10px;
  background: none; border: 0; border-radius: var(--radius-s);
  font: 14.5px var(--sans); color: var(--tinte); text-align: left; cursor: pointer;
}
.kontomenue [role="menuitem"]:hover, .kontomenue [role="menuitem"]:focus {
  background: var(--wasser-hell);
}
#statusKonto { color: var(--tinte-2); }

@media (max-width: 860px) {
  .kontoknopf, .kontoname { height: 34px; max-width: 48vw; font-size: 13px; }
  .kontomenue { position: fixed; top: 48px; left: 8px; right: 8px; min-width: 0; }
}

/* ------------------------------------------------------ Nur zum Ansehen */
.nur-ansehen-band {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 16px 18px 0; padding: 11px 14px;
  background: var(--wasser-hell); color: var(--tinte);
  border: 1px solid color-mix(in srgb, var(--wasser) 35%, transparent);
  border-left: 4px solid var(--wasser); border-radius: var(--radius-s);
  font-size: 14px; line-height: 1.5;
}
.nur-ansehen-band svg { flex: 0 0 auto; margin-top: 2px; color: var(--wasser); }
/* Ändernde Knöpfe gibt es beim bloßen Ansehen nicht — auch keine, die eine
   Maske erst später nachzeichnet (Datenblätter, Unterlagen). */
.nur-ansehen button:not([data-lesen]):not(.frage):not(.hilfe-mehr):not(.zurueck-liste):not(.hinweis),
.nur-ansehen label[for="dokdatei"],
.nur-ansehen .nur-schreiben { display: none !important; }

/* Gesperrte Felder: gut lesbar, aber erkennbar nicht zum Tippen. Die
   Standardfarbe gesperrter Felder wäre zu blass für das, was man ja lesen
   soll. */
input[data-gesperrt], select[data-gesperrt], textarea[data-gesperrt] {
  background: var(--flaeche-2); color: var(--tinte); -webkit-text-fill-color: var(--tinte);
  border-style: dashed; opacity: 1; cursor: default;
}
.schalter:has(input[data-gesperrt]) { cursor: default; background: var(--flaeche-2); }
.zonenwahl label:has(input[data-gesperrt]) { cursor: default; }
.feldsperre {
  display: flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 12.5px; font-weight: 700; color: var(--tinte-2);
}
.feldsperre svg { flex: 0 0 auto; color: var(--tinte-3); }

/* ------------------------------------------------ Gesicherte Eingaben */
.entwurf-band {
  display: flex; flex-direction: column; gap: 10px;
  margin: 16px 18px 0; padding: 12px 14px;
  background: color-mix(in srgb, var(--stufe-b) 11%, var(--flaeche));
  border: 1px solid color-mix(in srgb, var(--stufe-b) 45%, transparent);
  border-left: 4px solid var(--stufe-b); border-radius: var(--radius-s);
  font-size: 14px; line-height: 1.5;
}
.entwurf-band button.knopf { min-height: 36px; font-size: 13.5px; }

/* --------------------------------------------------- Dialoge mit Eingaben */
dialog.formdialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto;
}
dialog.formdialog .inhalt { display: flex; flex-direction: column; gap: 12px; }
dialog.formdialog .inhalt > p { margin: 0; }
dialog.formdialog .feld > label { font-size: 14.5px; color: var(--tinte); }
dialog.formdialog input[type=text], dialog.formdialog input[type=password] {
  font-size: 16px; padding: 9px 11px; min-height: 42px;
}
dialog.formdialog .schalter span { font-size: 14px; }
dialog.formdialog .knopfzeile.nb-wahl { justify-content: flex-start; padding: 0; }

.feststelltaste {
  padding: 7px 11px; border-radius: var(--radius-s);
  border: 1px solid color-mix(in srgb, var(--stufe-c) 45%, transparent);
  background: color-mix(in srgb, var(--stufe-c) 10%, var(--flaeche));
  font-size: 14px; font-weight: 700; color: var(--tinte);
}
.formmeldung {
  padding: 9px 12px; border-radius: var(--radius-s);
  border: 1px solid color-mix(in srgb, var(--verbot) 40%, transparent);
  border-left: 4px solid var(--verbot);
  background: var(--verbot-flaeche); color: var(--tinte);
  font-size: 14px; line-height: 1.5;
}
.wartezeit {
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--linie); border-left: 4px solid var(--stufe-b);
  background: var(--flaeche-2); font-size: 14px; line-height: 1.5;
}
.wartezeit .uhr strong { font-size: 16px; }

ul.regeln {
  list-style: none; margin: -4px 0 0; padding: 0;
  display: grid; gap: 4px; font-size: 13.5px; line-height: 1.4;
}
ul.regeln li { display: flex; align-items: flex-start; gap: 7px; }
ul.regeln li svg { flex: 0 0 auto; margin-top: 1px; }
ul.regeln li.ok { color: var(--stufe-a); }
ul.regeln li.offen { color: var(--tinte-2); }

details.datenschutz > summary {
  display: inline-flex; align-items: center; min-height: 32px;
  color: var(--wasser); font-weight: 700; font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
details.datenschutz > p {
  margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--tinte-2);
}

/* ---------------------------------------------------------- Notfall-Blatt */
.notfallblatt {
  padding: 16px 18px; border: 2px dashed var(--linie-stark);
  border-radius: var(--radius); background: var(--flaeche-2); color: var(--tinte);
}
.nb-kopf {
  margin-bottom: 10px; font: 700 12px var(--sans);
  letter-spacing: .1em; text-transform: uppercase; color: var(--tinte-3);
}
.nb-angaben {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  margin: 0 0 12px; font-size: 14px;
}
.nb-angaben dt { color: var(--tinte-3); }
.nb-angaben dd { margin: 0; overflow-wrap: anywhere; }
.nb-codetitel { font-size: 12.5px; color: var(--tinte-3); }
.nb-code {
  margin: 2px 0 12px; font-size: 26px; font-weight: 700;
  letter-spacing: .08em; overflow-wrap: anywhere;
}
.notfallblatt p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.notfallblatt p:last-child { margin-bottom: 0; }
.nb-pruefung { display: flex; flex-direction: column; gap: 10px; }

/* Gedruckt wird nur das Blatt, nicht die Seite dahinter. */
#druckbereich { display: none; }
@media print {
  body.druckt > *:not(#druckbereich) { display: none !important; }
  body.druckt #druckbereich { display: block !important; padding: 12mm; }
  body.druckt { background: #fff; color: #000; }
  body.druckt .notfallblatt { border: 2px solid #000; background: #fff; color: #000; }
  body.druckt .nb-kopf, body.druckt .nb-angaben dt, body.druckt .nb-codetitel { color: #333; }
}

/* ----------------------------------------------------------- Anmeldeseite */
body.anmeldeseite {
  height: auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  /* Unten Platz für das Hinweisband der Testinstanz. */
  padding: 6vh 16px 72px;
  font-size: 16px;
}
.anmeldung { width: min(480px, 100%); }
.anmelde-marke {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px 4px;
  font: 700 14px var(--sans); color: var(--tinte-2);
}
.anmelde-marke svg { width: 42px; height: 27px; flex: 0 0 auto; }
.anmelde-marke svg .tile { fill: var(--wasser); }
.anmelde-marke svg .glyph { fill: #fff; }
.anmeldekarte {
  padding: 26px 28px 24px;
  background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius); box-shadow: var(--schatten);
}
.anmeldekarte h1 { margin: 0 0 14px; font-size: 22px; line-height: 1.3; }
.anmeldekarte h1:focus { outline: none; }
.anmeldekarte h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.anmeldekarte h2:focus { outline: none; }
.anmeldekarte .einleitung { margin: 0 0 16px; font-size: 15px; line-height: 1.55; color: var(--tinte-2); }
.anmeldekarte form, .anmeldekarte .schritt-inhalt { display: flex; flex-direction: column; gap: 14px; }
.anmeldekarte .feld > label { font-size: 15px; color: var(--tinte); }
.anmeldekarte .feld .hilfe { font-size: 14px; }
.anmeldekarte input[type=text], .anmeldekarte input[type=password] {
  font-size: 17px; padding: 10px 12px; min-height: 46px;
}
.anmeldekarte .schalter { align-items: center; }
.anmeldekarte .schalter input { width: 18px; height: 18px; margin: 0; }
.anmeldekarte .schalter span { font-size: 14.5px; }
.anmeldekarte button.knopf { min-height: 42px; padding: 0 16px; font-size: 15px; }
.anmeldekarte button.knopf.haupt.breit { width: 100%; min-height: 48px; font-size: 16px; }
.anmeldekarte .knopfzeile { gap: 10px; }
button.verweis {
  align-self: flex-start; min-height: 40px; padding: 6px 0;
  background: none; border: 0; cursor: pointer; text-align: left;
  font: 700 15px var(--sans); color: var(--wasser);
  text-decoration: underline; text-underline-offset: 3px;
}
button.verweis:hover { color: var(--wasser-tief); }
button.verweis:focus-visible, .anmeldekarte button.knopf:focus-visible {
  outline: 2px solid var(--marke); outline-offset: 2px;
}
.hinweisbox {
  margin: 0 0 16px; padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--wasser) 30%, transparent);
  border-left: 4px solid var(--wasser); border-radius: var(--radius-s);
  background: var(--wasser-hell); font-size: 14.5px; line-height: 1.5;
}
.hinweisbox.warn {
  border-color: color-mix(in srgb, var(--stufe-c) 40%, transparent);
  border-left-color: var(--stufe-c);
  background: color-mix(in srgb, var(--stufe-c) 9%, var(--flaeche));
}
.anmeldekarte .vergessen-text {
  padding: 12px 14px; border-radius: var(--radius-s);
  background: var(--flaeche-2); border: 1px solid var(--linie);
  font-size: 14.5px; line-height: 1.55;
}
.anmeldekarte .vergessen-text p { margin: 0 0 6px; }
.anmeldefuss { margin: 16px 4px 0; font-size: 14px; color: var(--tinte-2); }
.anmeldefuss .stand { margin-top: 10px; font: 11px var(--mono); color: var(--tinte-3); }
.anmeldekarte .vergessen-zusatz { margin: 12px 0 0; }
.anmeldekarte .vergessen-zusatz p, .anmeldekarte .hinweisbox p { margin: 0 0 8px; }
.anmeldekarte .hinweisbox p:last-child { margin-bottom: 0; }

/* Administrator wiederherstellen: eine Karte je Administrator, untereinander */
fieldset.adminwahl { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.adminwahl legend {
  margin: 0 0 8px; padding: 0; font-size: 15px; font-weight: 700; color: var(--tinte);
}
.anmeldekarte .wahlkarten { grid-template-columns: 1fr; }
.anmeldekarte .vl-weiter { margin: 0; font-size: 15px; line-height: 1.55; }

/* ------------------------------------------------------- Notfallzugang */
/* Rot wie Verbotenes: Solange der Notfallzugang offen ist, bekommt über die
   Anmeldeseite ein Administrator ein neues Passwort, ohne das alte zu
   kennen. Feste Farben in beiden Darstellungen — Weiß auf dem dunklen Rot
   hat 9,6:1; das aufgehellte Rot des Dunkelmodus trüge kein Weiß. */
.notfallband {
  padding: 7px 14px; background: #8a1020; color: #fff;
  font: 700 14px/1.45 var(--sans); text-align: center;
}
.fenster.mit-notfallband { grid-template-rows: auto 40px 30px auto 1fr 24px; }
.anmeldung > .notfallband { margin: 0 0 14px; border-radius: var(--radius-s); }
@media (max-width: 860px) {
  .fenster.mit-notfallband { grid-template-rows: auto 44px 36px auto 1fr; }
  .notfallband { padding: 6px 10px; font-size: 13px; }
}
@media (max-width: 520px) {
  body.anmeldeseite { padding-top: 14px; }
  .anmeldekarte { padding: 20px 16px; }
  .anmeldekarte h1 { font-size: 20px; }
}

/* Nur für Bildschirmleser: angesagt, aber nicht doppelt zu sehen. */
.nur-vorlesen {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Benutzerverwaltung, Änderungsprotokoll, Änderungsangaben
   Große Schrift wie im Rest, Zustände immer als Wort. Farben aus den
   vorhandenen Tönen: Wasser für „Information“, Ocker für „Achtung, warten“,
   Schiefer für „in Ordnung“ — Rot bleibt Verboten und Gelöschtem vorbehalten.
   ========================================================================== */

/* -------------------------------------------- Zustand eines Kontos (7.3) */
.zustandsschild {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: var(--radius-pill);
  border: 1px solid var(--linie-stark); background: var(--flaeche-2);
  font: 700 12px/1.3 var(--sans); color: var(--tinte-2);
  text-align: center;
}
.zustandsschild.aktiv {
  color: var(--stufe-a); background: color-mix(in srgb, var(--stufe-a) 12%, var(--flaeche));
  border-color: color-mix(in srgb, var(--stufe-a) 45%, transparent);
}
.zustandsschild.passwort {
  color: var(--wasser-tief); background: var(--wasser-hell);
  border-color: color-mix(in srgb, var(--wasser) 45%, transparent);
}
.zustandsschild.wartet {
  color: var(--tinte); background: color-mix(in srgb, var(--stufe-b) 16%, var(--flaeche));
  border-color: color-mix(in srgb, var(--stufe-b) 55%, transparent);
}
.zustandsschild.aus { color: var(--tinte-3); background: var(--flaeche-2); border-style: dashed; }

/* Listeneintrag: links Name und Zeile darunter, rechts das Schild. Ein
   langes Schild („muss eigenes Passwort festlegen“) rückt unter den Namen,
   statt ihn auf drei Zeilen zu quetschen — rechtsbündig bleibt es trotzdem. */
.kontoeintrag { display: flex !important; flex-wrap: wrap; align-items: center;
  gap: 4px 10px; }
.kontoeintrag .ke-text { display: flex; flex-direction: column; min-width: 0;
  flex: 1 1 170px; }
.kontoeintrag .titel { font-size: 14px; }
.kontoeintrag .zeile2 { font-size: 12.5px; overflow-wrap: anywhere; }
.kontoeintrag .zustandsschild { margin-left: auto; }
.listen-fuss {
  padding: 10px 14px 12px; border-top: 1px solid var(--linie);
  font-size: 13px; line-height: 1.45; color: var(--tinte-2); background: var(--flaeche-2);
}

/* Hinweisband „nur ein Administrator“ */
.hinweisband {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 16px 18px 0; padding: 11px 14px;
  background: color-mix(in srgb, var(--stufe-b) 11%, var(--flaeche)); color: var(--tinte);
  border: 1px solid color-mix(in srgb, var(--stufe-b) 45%, transparent);
  border-left: 4px solid var(--stufe-b); border-radius: var(--radius-s);
  font-size: 14px; line-height: 1.5;
}
.hinweisband svg { flex: 0 0 auto; margin-top: 2px; color: var(--stufe-b); }

/* Kopf der Personenmaske */
.kontokopf-gross { display: flex; flex-direction: column; gap: 6px; }
.kk-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kk-name { font-size: 19px; font-weight: 700; }
.kk-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--tinte-2); }

/* Kästen: gelb = warten, blau = Hinweis, grau = deaktiviert */
.kasten {
  margin: 16px 18px 0; padding: 12px 15px;
  border: 1px solid var(--linie); border-left: 4px solid var(--linie-stark);
  border-radius: var(--radius-s); background: var(--flaeche);
  font-size: 14.5px; line-height: 1.5;
}
.kasten p { margin: 0 0 8px; }
.kasten p:last-child { margin-bottom: 0; }
.kasten .knopfzeile { margin-top: 4px; }
.kasten.gelb {
  background: color-mix(in srgb, var(--stufe-b) 13%, var(--flaeche));
  border-color: color-mix(in srgb, var(--stufe-b) 50%, transparent);
  border-left-color: var(--stufe-b);
}
.kasten.blau {
  background: var(--wasser-hell);
  border-color: color-mix(in srgb, var(--wasser) 35%, transparent);
  border-left-color: var(--wasser);
}
.kasten.grau { background: var(--flaeche-2); border-style: dashed; border-left-style: solid; }

/* ------------------------------------- Auswahlkarten für Rolle und Bereich */
.wahlkarten {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.wahlkarte {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--linie-stark); border-radius: var(--radius);
  background: var(--flaeche);
}
.wahlkarte:hover { border-color: var(--tinte-3); }
/* Wie bei der Zonenwahl: Optionsfeld unsichtbar, aber mit Tastatur und
   Bildschirmleser bedienbar (Pfeiltasten wechseln innerhalb der Gruppe). */
.wahlkarte input {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; white-space: nowrap; clip: rect(0 0 0 0); clip-path: inset(50%);
}
.wahlkarte .wk-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wahlkarte .wk-titel { font-size: 15.5px; font-weight: 700; }
.wahlkarte .wk-text { font-size: 14px; line-height: 1.45; color: var(--tinte-2); }
.wahlkarte .wk-gewaehlt {
  display: none; align-items: center; gap: 3px; margin-left: auto;
  font-size: 12.5px; font-weight: 700; color: var(--wasser);
}
.wahlkarte:has(input:checked) {
  border-color: var(--wasser); background: var(--wasser-hell);
  box-shadow: inset 0 0 0 1px var(--wasser);
}
.wahlkarte:has(input:checked) .wk-gewaehlt { display: inline-flex; }
.wahlkarte:has(input:focus-visible) { outline: 2px solid var(--marke); outline-offset: 2px; }
.wahlkarte:has(input:disabled) { cursor: default; opacity: .62; }
.wahlkarte:has(input:disabled:checked) { opacity: .85; }
.wahlkarte:has(input:disabled):hover { border-color: var(--linie-stark); }

.kt-haekchen { display: flex; flex-direction: column; gap: 10px; }
.schalter.gross { padding: 10px 12px; align-items: flex-start; }
.schalter.gross input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.schalter.gross span { font-size: 14.5px; line-height: 1.5; }

.anmeldename-zeile { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  min-height: 36px; padding: 6px 0; }
.anmeldename-zeile strong { font-size: 15px; }
button.verweis.klein { min-height: 30px; padding: 2px 0; font-size: 14px; }

.blatt-koerper > .einleitung { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--tinte-2); }
.spalte-detail .blatt-koerper > .formmeldung { margin-bottom: 12px; }
.spalte-detail .blatt-koerper > .feldsperre { margin-top: 10px; }
.spalte-detail .blatt-koerper > .hilfe { margin-top: 10px; font-size: 13.5px; color: var(--tinte-2); }

/* „So sieht es für … aus“ — dieselbe Rechtetabelle wie im Server */
.vorschau {
  padding: 13px 15px; border-radius: var(--radius-s);
  border: 1px solid color-mix(in srgb, var(--wasser) 30%, transparent);
  background: var(--flaeche-2);
}
.vs-titel { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.vs-inhalt { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  font-size: 14px; line-height: 1.45; }
.vs-inhalt p { margin: 0; }
.vs-kopf { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 4px; }
.vs-ja .vs-kopf { color: var(--stufe-a); }
.vs-nein .vs-kopf { color: var(--tinte-2); }
.vs-spalte ul { margin: 0; padding-left: 20px; }
.vs-spalte li { margin-bottom: 3px; }

/* „Weitere Aktionen“, bewusst eingeklappt */
details.weitere { margin-top: 14px; border-top: 1px solid var(--linie); padding-top: 10px; }
details.weitere > summary {
  cursor: pointer; font-weight: 700; font-size: 14px; color: var(--tinte-2);
  min-height: 32px; display: inline-flex; align-items: center;
}
.weitere-inhalt { padding: 6px 0 2px; font-size: 14px; }
.weitere-inhalt p { margin: 0 0 10px; }

/* ------------------------------------- Vorläufiges Passwort und Zettel */
dialog.vorlaeufigfenster { width: min(560px, calc(100vw - 32px)); }
dialog.vorlaeufigfenster h2 { font-size: 20px; }
/* Untereinander statt nebeneinander: Das Passwort bekommt die ganze Breite
   und bricht so nicht mitten im Wort um. */
.vl-angaben {
  display: grid; grid-template-columns: 1fr; gap: 2px;
  margin: 0; padding: 14px 16px; border-radius: var(--radius);
  border: 2px dashed var(--linie-stark); background: var(--flaeche-2);
  font-size: 15px;
}
.vl-angaben dt { color: var(--tinte-2); font-size: 13.5px; }
.vl-angaben dd { margin: 0 0 10px; overflow-wrap: anywhere; color: var(--tinte); }
.vl-angaben dd:last-child { margin-bottom: 0; }
.vl-name { font-size: 18px; font-weight: 700; }
.vl-passwort { font-size: 26px; font-weight: 700; letter-spacing: .04em; }

.zugangszettel {
  padding: 16px 18px; border: 2px dashed var(--linie-stark);
  border-radius: var(--radius); background: var(--flaeche-2); color: var(--tinte);
}
.zugangszettel p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.zz-passwort { font-size: 22px; font-weight: 700; letter-spacing: .04em; }
@media print {
  body.druckt .zugangszettel { border: 2px solid #000; background: #fff; color: #000; }
  body.druckt .zugangszettel .nb-angaben dt { color: #333; }
}

/* ------------------------------------- Assistent „Anmeldung einschalten“ */
dialog.assistent { width: min(580px, calc(100vw - 32px)); }
dialog.assistent .inhalt { font-size: 15.5px; }
.schrittanzeige {
  margin: 0; font: 700 12.5px var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--wasser);
}
h3.schritt-ueberschrift { margin: 0; font-size: 18px; line-height: 1.35; color: var(--tinte); }

/* Startkarte am Einzelplatz (7.1) */
.startkarte { display: flex; flex-direction: column; gap: 14px; }
.startkarte .sk-text { margin: 0; font-size: 15.5px; line-height: 1.6; max-width: 62ch; }
.startkarte .notiz { font-size: 13.5px; max-width: 70ch; }
button.knopf.gross { min-height: 44px; padding: 0 20px; font-size: 15px; }
.namenszeile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.nz-name { font-size: 17px; font-weight: 700; }
.namenszeile + .hilfe { font-size: 13.5px; color: var(--tinte-2); margin-bottom: 10px; }

/* --------------------------------------- Unterste Zeile jeder Detailmaske */
.aenderungsangaben {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 18px 22px; padding: 0 2px;
  font-size: 13.5px; color: var(--tinte-2);
}
.aenderungsangaben .aa-text:empty { display: none; }

/* --------------------------------------------- Änderungsprotokoll (7.7) */
.protokollfilter {
  display: grid; gap: 10px 14px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.protokollfilter .pf-eigen { display: contents; }
.protokollfilter .feld > label { font-size: 14px; color: var(--tinte); }
.protokollkopf {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; color: var(--tinte-2);
}
#pf-hinweis { margin-bottom: 10px; font-size: 13.5px; }
.tabellenhuelle { overflow-x: auto; }
table.protokolltabelle { font-size: 13.5px; }
table.protokolltabelle td { vertical-align: top; }
table.protokolltabelle .pt-zeit { white-space: nowrap; font-size: 12.5px; }
table.protokolltabelle .pt-wer { min-width: 130px; }
table.protokolltabelle .pt-was { min-width: 130px; }
table.protokolltabelle .pt-satz { min-width: 150px; }
table.protokolltabelle .pt-einzelheiten { min-width: 240px; }
details.einzelheiten > summary {
  cursor: pointer; list-style: none; display: block;
}
details.einzelheiten > summary::-webkit-details-marker { display: none; }
details.einzelheiten > summary::before {
  content: "▸ "; color: var(--wasser); font-family: var(--mono);
}
details.einzelheiten[open] > summary::before { content: "▾ "; }
details.einzelheiten .ez-mehr {
  display: block; margin-top: 2px; color: var(--wasser); font-weight: 700; font-size: 12.5px;
}
details.einzelheiten[open] .ez-mehr { display: none; }
details.einzelheiten ul { margin: 4px 0 0; padding-left: 18px; }
details.einzelheiten li { margin-bottom: 2px; }

dialog.verlaufsfenster { width: min(960px, calc(100vw - 32px)); }
dialog.verlaufsfenster .inhalt { font-size: 14px; }

/* ------------------------------------------------------ Hilfe-Fenster */
.hilfefenster pre.herleitung { max-height: none; }
.hilfekarten { margin-bottom: 18px; }
.hilfekarten h4, .hilfetext h4 { margin: 0 0 8px; font-size: 15.5px; }
.hilfekarten .notiz { margin-bottom: 10px; font-size: 13.5px; }
.hk-reihe { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 10px; }
.hilfekarte {
  padding: 12px 14px; border: 1px solid var(--linie); border-radius: var(--radius);
  background: var(--flaeche-2);
}
.hilfekarte h5 { margin: 0 0 8px; font-size: 15px; }
.hilfekarte ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.hilfekarte li { margin-bottom: 5px; }
.hk-zusatz { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--tinte-2); }
.hilfetext { font-size: 14.5px; line-height: 1.55; color: var(--tinte); max-width: 72ch; }
.hilfetext p { margin: 0 0 14px; }
.hilfetext ul { margin: 0 0 14px; padding-left: 20px; }
.hilfetext li { margin-bottom: 5px; }

@media (max-width: 860px) {
  .wahlkarten { grid-template-columns: 1fr; }
  .vl-passwort { font-size: 23px; }
  table.protokolltabelle { min-width: 640px; }
}
.feld > .formmeldung { margin-top: 6px; font-size: 13.5px; padding: 7px 10px; }

/* ------------------------------------- Filter Werk/Abteilung über Listen */
.listen-filter {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end;
  padding: 8px 12px 10px; border-bottom: 1px solid var(--linie);
}
.listen-filter.aktiv { background: var(--wasser-hell); }
.lf-feld { display: flex; flex-direction: column; gap: 3px; flex: 1 1 130px; min-width: 0; }
.lf-feld > span { font-size: 12px; font-weight: 600; color: var(--tinte-2); }
.lf-feld select { width: 100%; }
.eintrag .treffergrund {
  margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--wasser-tief);
}
.filterzeile { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filterzeile .lf-feld { flex: 0 1 220px; }
.filterzeile .schalter { align-self: flex-end; }
.bereichsleiste a .zahl.faellig {
  color: var(--verbot); border-color: color-mix(in srgb, var(--verbot) 45%, transparent);
  background: var(--verbot-flaeche); font-weight: 600; white-space: nowrap;
}

/* ------------------------------------------- Verwendungen eines Stoffs */
.stoffzeile.verwendungszeile {
  grid-template-columns: minmax(130px,1.1fr) minmax(110px,1fr) minmax(150px,2fr)
    minmax(100px,1fr) minmax(120px,1.4fr) 32px;
}
.verwendungszeile .kopf { font-size: 11px; }
.fundstellen { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linie); }
.fundstellen ul { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
@media (max-width: 1240px) {
  .stoffzeile.verwendungszeile { grid-template-columns: 1fr 1fr 1fr; }
}

/* ------------------------------------- Gefährdungsbeurteilung: Schritte */
.schrittmarke {
  display: inline-block; margin-right: 4px; padding: 1px 8px;
  border-radius: var(--radius-pill); background: var(--marke); color: var(--flaeche);
  font-size: 12px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px;
  white-space: nowrap;
}
#modulhaut .schrittmarke, #modulbrand .schrittmarke {
  background: var(--flaeche-2); color: var(--tinte-2); border: 1px solid var(--linie-stark);
}
.schrittleiste {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 6px;
  margin: 16px 18px 0;
}
.schritt-knopf {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 9px; text-align: left; cursor: pointer; font: inherit; color: var(--tinte);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius-s);
}
.schritt-knopf:hover { border-color: var(--tinte-3); }
.schritt-knopf .nr { font-family: var(--mono); font-size: 11px; color: var(--tinte-3); white-space: nowrap; }
.schritt-knopf .nr::before { content: 'Schritt '; }
.schritt-knopf .name { font-weight: 600; font-size: 13px; }
.schritt-knopf .stand { font-size: 12px; color: var(--stufe-c); }
.schritt-knopf.fertig .stand { color: var(--stufe-a); }
.schritt-ergebnis { margin-top: 4px; }
.schritt-ergebnis .emkg-gruppen { margin-top: 4px; }

/* --------------------------------------- Schritt 5: Schutzmaßnahmen */
.m-einleitung { margin-bottom: 10px; font-size: 13.5px; }
.m-gruppe { margin-top: 14px; }
.m-gruppe:first-child { margin-top: 0; }
.m-gruppe h4 { margin: 0 0 8px; font-size: 14px; }
.massnahme {
  padding: 10px 12px 12px; margin-bottom: 8px;
  border: 1px solid var(--linie); border-left: 3px solid var(--stufe-c);
  border-radius: var(--radius-s); background: var(--flaeche);
}
.massnahme.erledigt { border-left-color: var(--stufe-a); }
.massnahme.nicht-mehr { border-left-color: var(--linie-stark); background: var(--flaeche-2); }
.massnahme.nicht-mehr .lf-titel, .massnahme.nicht-mehr .lf-nr { color: var(--tinte-3); }
.m-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; }
.m-kopf .lf-nr { font-weight: 700; min-width: 3.2em; }
.m-kopf .lf-titel { font-weight: 600; font-size: 14px; }
.m-kopf button.weg {
  margin-left: auto; background: none; border: 1px solid var(--linie);
  border-radius: var(--radius-s); color: var(--tinte-3); cursor: pointer;
  height: 29px; width: 28px; font-size: 15px; line-height: 1;
}
.m-kopf button.weg:hover { color: var(--verbot); border-color: var(--verbot); }
.massnahme > .hilfe, .massnahme .standwahl + .hilfe {
  font-size: 13px; color: var(--tinte-2); line-height: 1.45; margin: 4px 0 8px;
}
.m-raster { margin-top: 4px; }
.m-raster textarea { min-height: 54px; }
fieldset.standwahl {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0;
}
fieldset.standwahl legend {
  float: left; margin: 0 6px 0 0; padding: 7px 0; font-size: 12.5px; font-weight: 600;
  color: var(--tinte-2);
}
fieldset.standwahl label {
  position: relative; display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--linie-stark); border-radius: var(--radius-pill);
  background: var(--flaeche); font-size: 14px;
}
fieldset.standwahl label:hover { background: var(--flaeche-2); }
fieldset.standwahl input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
fieldset.standwahl label:focus-within { outline: 2px solid var(--wasser); outline-offset: 2px; }
fieldset.standwahl label.gewaehlt {
  /* Schrift in der Kartenfarbe: hell auf dunklem Blau, dunkel auf dem
     aufgehellten Blau des dunklen Themas — beides gut lesbar. */
  background: var(--wasser); border-color: var(--wasser); color: var(--flaeche); font-weight: 700;
}
fieldset.standwahl input:disabled + span { cursor: default; }
.nur-ansehen fieldset.standwahl label { cursor: default; }
.nur-ansehen fieldset.standwahl label:not(.gewaehlt) { opacity: .6; }
.m-fuss { margin-top: 12px; }
.massnahmenliste td { vertical-align: top; }
.massnahmenliste td:first-child { min-width: 128px; }
.massnahmenliste select { min-width: 140px; }

/* E-Mail zu lang: Text zum Kopieren */
.mailschritte { margin: 12px 0; padding-left: 22px; font-size: 14px; line-height: 1.55; }
textarea.mailtext {
  width: 100%; min-height: 220px; margin-top: 12px; font-family: var(--mono); font-size: 12.5px;
}
kbd {
  font-family: var(--mono); font-size: 12px; padding: 0 5px;
  border: 1px solid var(--linie-stark); border-radius: var(--radius-xs); background: var(--flaeche-2);
}

@media (max-width: 860px) {
  .schrittleiste { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 12px 0; }
  .stoffzeile.verwendungszeile { grid-template-columns: 1fr 1fr; }
  .stoffzeile.verwendungszeile .feld:first-child { grid-column: 1 / -1; }
  .stoffzeile.verwendungszeile button.weg { grid-column: 1 / -1; width: 100%; height: 34px; }
  fieldset.standwahl label { flex: 1 1 calc(50% - 6px); justify-content: center; }
  fieldset.standwahl legend { float: none; width: 100%; padding: 0 0 2px; }
  .filterzeile .lf-feld { flex: 1 1 100%; }
  table.massnahmenliste { min-width: 860px; }
}
