/* Systec IT-Dokumentation - Weboberfläche
   Grundsatz: dichte Darstellung. Eingabefelder werden nie über die ganze
   Fensterbreite gezogen; die Felder eines Eintrags stehen in einem Raster,
   das sich nach der verfügbaren Breite richtet. */

:root {
  --gruen: #16a05e;
  --gruen-dunkel: #0f7544;
  --gruen-hell: #e6f4ec;
  --kopf: #17181a;
  --bg: #ffffff;
  --flaeche: #f7f9f8;
  --seite: #f3f6f4;
  --rand: #e2e7e4;
  --rand-stark: #cdd6d1;
  --text: #1f2320;
  /* Beschriftungen waren zu hell und zu klein, um sie am Bildschirm
     bequem zu lesen. Beide Grautöne sind deutlich dunkler als früher
     (--leise war #6b7671, --grau #8a9490). */
  --leise: #47504c;
  --grau: #6c7772;
  --rot: #b3261e;
  --zeile: 30px;
  /* Schrift: auf Mac, iPhone und iPad die Systemschrift (San Francisco),
     unter Windows die dortige. So wirkt die Oberfläche überall wie ein
     Programm des jeweiligen Systems und nicht wie eine fremde Webseite. */
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text",
             "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  /* Runde Ecken wie unter macOS: Knöpfe und Felder weich, Listenzeilen
     etwas runder, weil sie als Kachel unterlegt werden. */
  --rund: 7px;
  --rund-gross: 8px;
  --schatten: 0 1px 1.5px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  font-family: var(--schrift);
  font-size: 13px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.versteckt { display: none !important; }
.wachsen { flex: 1; }
.leise { color: var(--leise); }
.fehler { color: var(--rot); min-height: 1.2em; margin: 4px 0; }

/* ------------------------------------------------------------------ Logo */
.logo-wort { color: var(--gruen); font: italic 700 19px var(--schrift); }
.logo-pfeile { display: inline-flex; gap: 2px; margin-left: 5px; vertical-align: -2px; }
.logo-pfeile i {
  width: 0; height: 0; display: inline-block;
  border-left: 9px solid var(--gruen);
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.logo-pfeile i:nth-child(2) { border-left-color: #0e8f8a; }
.logo-pfeile i:nth-child(3) { border-left-color: #e8a33d; }
.logo-zusatz { color: #9aa0a6; font-size: 9px; margin-top: 2px; }

/* -------------------------------------------------------------- Anmeldung */
.anmelde-huelle {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--seite);
}
.anmeldekarte {
  width: 400px; background: var(--bg); border: 1px solid var(--rand);
  border-radius: 8px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.10);
}
.anmelde-kopf { background: var(--kopf); padding: 16px 22px; }
.anmelde-inhalt { padding: 22px; }
.anmelde-inhalt h1 { font-size: 17px; margin: 0 0 2px; }
.anmelde-inhalt label {
  display: block; margin: 14px 0 4px; font-size: 12px; color: var(--text);
}
.anmelde-inhalt input {
  width: 100%; padding: 9px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--rand-stark); border-radius: var(--rund); background: var(--bg);
}
.anmelde-inhalt input:focus { outline: 2px solid var(--gruen); border-color: var(--gruen); }

/* --------------------------------------------------------------- Knöpfe */
.knopf {
  font: 500 12px var(--schrift); padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--rand-stark); border-radius: var(--rund);
  background: var(--bg); color: var(--text); white-space: nowrap;
  box-shadow: var(--schatten);
  /* damit ein Sinnbild und der Text daneben auf einer Linie sitzen */
  display: inline-flex; align-items: center; justify-content: center;
}
.knopf:hover { background: #eef1ef; }
.knopf:active { background: #e4e9e6; }
.knopf.primaer { background: var(--gruen); border-color: var(--gruen); color: #fff; font-weight: 600; }
.knopf.primaer:hover { background: var(--gruen-dunkel); }
.knopf.dunkel { background: #2b2d30; border-color: #3a3d41; color: #fff; }
.knopf.dunkel:hover { background: #3a3d41; }
.knopf.gefahr { color: var(--rot); }
.knopf.gefahr:hover { background: #fbeceb; }
.knopf.klein { padding: 4px 9px; font-size: 11px; }
.knopf.winzig {
  padding: 2px 7px; font-size: 11px; border-color: transparent;
  background: transparent; box-shadow: none;
}
.knopf.winzig:hover { background: rgba(0,0,0,.06); }
.knopf.breit { width: 100%; margin-top: 16px; padding: 10px; font-size: 14px; }
.knopf:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* --------------------------------------------------------------- Aufbau */
#programm { height: 100%; display: flex; flex-direction: column; }

.kopf {
  background: var(--kopf); color: #fff; display: flex; align-items: center;
  gap: 18px; padding: 0 16px; height: 48px; flex: none;
}
.kunde-wahl { display: flex; align-items: center; gap: 6px; }

/* Kundenauswahl mit Suche. Ein <select> lässt nur den Anfang eines Namens
   anspringen; bei vielen Kunden sucht man damit zu lange. Hier wird getippt
   und die Liste filtert mit - auch nach Kundennummer und Standort. */
.kundenfeld { position: relative; }
.kundenfeld input {
  background: #26282b; color: #fff; border: 1px solid #3a3d41;
  border-radius: var(--rund); padding: 5px 24px 5px 10px; font-size: 12px;
  width: 320px; font-family: inherit;
}
.kundenfeld input:focus {
  outline: none; border-color: var(--gruen);
  box-shadow: 0 0 0 2px rgba(22,160,94,.35);
}
.kundenfeld input::placeholder { color: #7d848b; }
.kundenpfeil {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #9aa0a6; cursor: pointer;
  font-size: 11px; padding: 3px 5px; line-height: 1;
}
.kundenpfeil:hover { color: #fff; }
.kundenliste {
  position: absolute; left: 0; top: calc(100% + 3px); z-index: 90;
  width: 380px; max-height: 60vh; overflow: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--bg); color: var(--text);
  border: 1px solid var(--rand-stark); border-radius: 5px;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.kundenliste li {
  padding: 5px 12px; font-size: 12px; cursor: pointer; line-height: 1.35;
}
.kundenliste li .zusatz { display: block; font-size: 10px; color: var(--leise); }
.kundenliste li.aktiv { background: var(--gruen); color: #fff; }
.kundenliste li.aktiv .zusatz { color: rgba(255,255,255,.85); }
.kundenliste li.leer { color: var(--leise); cursor: default; }

/* --------------------------------------------------------- Objektvorlagen */
.vorlagen-raster {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px;
  margin-top: 10px;
}
.vorlagen-liste {
  max-height: 54vh; overflow: auto; border: 1px solid var(--rand);
  border-radius: 4px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.vorlagen-liste .breit { width: 100%; margin-bottom: 6px; }
/* Suchfeld bleibt beim Rollen oben stehen */
.vorlagen-liste .v-suche {
  position: sticky; top: -6px; z-index: 2; width: 100%; margin: 0 0 6px;
  padding: 6px 8px; font-size: 12px; border: 1px solid var(--rand-stark);
  border-radius: 4px; background: var(--bg);
  box-shadow: 0 -6px 0 var(--bg);
}
.vorlagen-liste .v-suche:focus { outline: none; border-color: var(--gruen); }
.vorlagen-liste .v-suche-leer { margin: 6px 4px; font-size: 12px; }
.vorlagen-eintrag {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center;
  gap: 4px; padding: 5px 7px; border-radius: 3px; cursor: pointer;
  font-size: 12px;
}
.vorlagen-eintrag:hover { background: #eef1ef; }
.vorlagen-eintrag.aktiv { background: var(--gruen); color: #fff; }
.vorlagen-eintrag .zahl { grid-column: 2 / 4; font-size: 10px; color: var(--leise); }
.vorlagen-eintrag.aktiv .zahl { color: rgba(255,255,255,.85); }
.vorlagen-eintrag .marke {
  font-size: 9px; text-transform: uppercase; letter-spacing: .04em;
  background: #e3dcc4; color: #6b5f38; border-radius: 3px; padding: 1px 5px;
}
.vorlagen-eintrag.aktiv .marke { background: rgba(255,255,255,.28); color: #fff; }
.vorlagen-maske { max-height: 54vh; overflow: auto; }
.vorlagen-kopf { display: flex; gap: 6px; margin-bottom: 8px; }
.v-symbol { width: 46px; text-align: center; font-size: 15px; }
.v-name { flex: 1; font-weight: 600; }
.v-felder { display: flex; flex-direction: column; gap: 3px; }
.v-feld { display: grid; grid-template-columns: 1fr 150px auto auto auto; gap: 4px; }
.v-feld input, .v-feld select { font-size: 12px; padding: 3px 6px; }
.v-feld .v-optionen { grid-column: 1 / 3; font-size: 12px; padding: 4px 6px; margin: 0 0 6px 14px; resize: vertical; border-left: 3px solid var(--gruen); }
.vorlagen-fuss { display: flex; gap: 6px; align-items: center; margin-top: 12px; }
.v-kategorien { margin-top: 10px; border: 1px solid var(--rand); border-radius: 6px; padding: 6px 8px; }
.v-kategorien summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.v-kat-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 10px; margin-top: 6px; }
.v-kat-raster .schalter { font-size: 12px; }

/* -------------------------------------------------------- ReadMe zuordnen */
/* Fast bildschirmfüllend: Text und Maske wachsen mit dem Fenster, nicht
   das Fenster mit dem Inhalt. */
.dialog.breit.rz-dialog, .dialog.rz-dialog { width: 98vw; max-width: 98vw; height: 96vh; max-height: 96vh; }
.dialog.rz-dialog .dialog-inhalt { flex: 1; min-height: 0; display: flex; overflow: hidden; padding: 12px 16px; }
.dialog.rz-dialog .dialog-fuss { padding: 8px 16px; }
.rz-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1fr); gap: 16px; }
.rz-links, .rz-rechts { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rz-kopf { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.rz-kopf input[type="search"] { flex: 1; min-width: 140px; padding: 4px 8px; font-size: 12px; }
.rz-text {
  flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--rand); border-radius: 6px;
  background: var(--flaeche); font-family: Consolas, "Courier New", monospace; font-size: 12px;
  line-height: 1.5; padding: 4px 0;
}
.rz-zeile { display: flex; gap: 6px; padding: 0 8px 0 2px; white-space: pre; cursor: pointer; }
.rz-zeile.leer { cursor: default; }
.rz-zeile:hover { background: #eef1ef; }
.rz-zeile.benutzt { background: var(--gruen-hell); }
.rz-zeile.benutzt .rz-inhalt { color: var(--leise); }
.rz-zeile.treffer { outline: 1px solid #e8a33d; background: #fff4de; }
.rz-zeile.armiert { background: var(--gruen); color: #fff; }
.rz-zeile.armiert .rz-inhalt { color: #fff; }
.rz-griff { cursor: grab; color: var(--grau); user-select: none; flex: none; width: 14px; text-align: center; }
.rz-zeile:hover .rz-griff { color: var(--gruen-dunkel); }
.rz-inhalt { user-select: text; min-width: 0; }
.rz-hilfe { margin: 6px 0 0; font-size: 11px; }
.rz-wahl { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 8px; }
.rz-wahl label { font-size: 11px; color: var(--leise); margin-top: 4px; }
/* Rechte Spalte so hoch wie der Text links; die Maske nimmt den Rest und
   rollt selbst - »Objekt anlegen« bleibt immer sichtbar. */
.rz-rechts { height: 100%; }
.rz-maske { flex: 1; min-height: 120px; overflow: auto; border: 1px solid var(--rand); border-radius: 6px; padding: 6px 8px; }
.rz-feld { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px; align-items: center; margin: 3px 0; }
.rz-feld label { font-size: 11px; color: var(--leise); text-align: right; }
.rz-feld .rz-ziel { width: 100%; padding: 4px 7px; font-size: 12px; border: 1px solid var(--rand-stark); border-radius: 4px; }
.rz-feld textarea.rz-ziel { resize: vertical; }
.rz-ziel.ziel-bereit { border-color: var(--gruen); box-shadow: 0 0 0 2px rgba(22,160,94,.18); }
.rz-ziel.ziel-ueber { border-color: var(--gruen-dunkel); background: var(--gruen-hell); }
.rz-abschnitt { font-size: 11px; font-weight: 700; color: var(--gruen-dunkel); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 2px; border-bottom: 1px solid var(--rand); }
.rz-knoepfe { display: flex; gap: 8px; margin-top: 8px; }
.rz-angelegt { margin-top: 8px; font-size: 12px; }
@media (max-width: 1100px) { .dialog.rz-dialog .dialog-inhalt { overflow: auto; display: block; } .rz-raster { grid-template-columns: 1fr; } .rz-text { flex: none; height: 40vh; } .rz-rechts { height: auto; } .rz-maske { flex: none; max-height: 50vh; } }

/* -------------------------------------------------------------- Changelog */
.dialog.breit.cl-dialog, .dialog.cl-dialog { width: min(1300px, 96vw); max-width: 96vw; height: 88vh; }
.dialog.cl-dialog .dialog-inhalt { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.cl-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; }
.cl-links { display: flex; flex-direction: column; min-height: 0; }
.cl-links input[type="search"] { padding: 6px 8px; font-size: 12px; margin-bottom: 6px; border: 1px solid var(--rand-stark); border-radius: 4px; }
.cl-liste { flex: 1; overflow: auto; border: 1px solid var(--rand); border-radius: 6px; padding: 4px; }
.cl-eintrag { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.cl-eintrag:hover { background: #eef1ef; }
.cl-eintrag.aktiv { background: var(--gruen); color: #fff; }
.cl-nr { font-weight: 700; font-size: 12px; }
.cl-datum { font-size: 11px; color: var(--leise); text-align: right; }
.cl-eintrag.aktiv .cl-datum, .cl-eintrag.aktiv .cl-titel { color: rgba(255,255,255,.9); }
.cl-titel { grid-column: 1 / 3; font-size: 11px; color: var(--leise); }
.cl-marke { font-size: 9px; font-weight: 700; text-transform: uppercase; background: #e8a33d; color: #fff; border-radius: 3px; padding: 1px 4px; vertical-align: 1px; }
.cl-inhalt { overflow: auto; padding: 0 8px 12px 4px; font-size: 13px; line-height: 1.55; }
.cl-inhalt h3 { margin: 2px 0 0; font-size: 17px; }
.cl-inhalt h4 { margin: 16px 0 4px; font-size: 13px; color: var(--gruen-dunkel); }
.cl-inhalt ul { margin: 4px 0 8px; padding-left: 20px; }
.cl-inhalt li { margin: 3px 0; }
.cl-inhalt code { font-family: Consolas, monospace; font-size: 12px; background: var(--flaeche); padding: 0 3px; border-radius: 3px; }
.cl-inhalt .cl-hinweis { border-left: 3px solid var(--gruen); padding: 4px 10px; background: var(--flaeche); }
.cl-bild { max-width: 100%; border: 1px solid var(--rand); border-radius: 6px; margin: 6px 0; cursor: zoom-in; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.changelog-neu { color: #e8a33d; }

/* ------------------------------------------------------------- Anleitung */
/* Derselbe Zuschnitt wie der Changelog: links die Kapitel mit Suchfeld,
   rechts der Text. Nur breiter - die Abbildungen brauchen Platz. */
.dialog.breit.an-dialog, .dialog.an-dialog { width: min(1340px, 96vw); max-width: 96vw; height: 90vh; }
.dialog.an-dialog .dialog-inhalt { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.an-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
.an-links { display: flex; flex-direction: column; min-height: 0; }
.an-links input[type="search"] { padding: 7px 9px; font-size: 12.5px; margin-bottom: 6px; border: 1px solid var(--rand-stark); border-radius: var(--rund); }
.an-liste { flex: 1; overflow: auto; border: 1px solid var(--rand); border-radius: var(--rund-gross); padding: 4px; }
.an-eintrag { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 6px; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.an-eintrag:hover { background: #eef1ef; }
.an-eintrag.aktiv { background: var(--gruen); color: #fff; }
.an-titel { font-size: 12.5px; font-weight: 600; }
/* Die Stichwörter stehen klein darunter: Sie sagen, was in diesem Kapitel
   zu finden ist, ohne dass man es aufschlagen muss. */
.an-worte { grid-column: 1 / 3; font-size: 10.5px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-eintrag.aktiv .an-worte { color: rgba(255,255,255,.85); }
.an-zahl { align-self: center; font-size: 10px; font-weight: 700; background: var(--gruen-hell); color: var(--gruen-dunkel); border-radius: 9px; padding: 1px 7px; }
.an-eintrag.aktiv .an-zahl { background: rgba(255,255,255,.9); color: var(--gruen-dunkel); }
.an-inhalt { overflow: auto; padding: 0 10px 16px 4px; font-size: 13.5px; line-height: 1.6; }
.an-inhalt h3 { margin: 2px 0 10px; font-size: 19px; }
.an-inhalt h4 { margin: 20px 0 5px; font-size: 13.5px; color: var(--gruen-dunkel); }
.an-inhalt ul, .an-inhalt ol { margin: 5px 0 10px; padding-left: 22px; }
.an-inhalt li { margin: 4px 0; }
/* Die nummerierten Punkte gehören zu den Ziffern in der Abbildung darüber -
   deshalb dürfen sie nicht wie gewöhnlicher Text aussehen. */
.an-inhalt ol li::marker { color: var(--gruen-dunkel); font-weight: 700; }
.an-inhalt p { margin: 8px 0; }
.an-inhalt code { font-family: Consolas, monospace; font-size: 12.5px; background: var(--flaeche); padding: 0 4px; border-radius: 3px; }
.an-inhalt hr { border: 0; border-top: 1px solid var(--rand); margin: 22px 0; }
.an-inhalt .cl-hinweis { border-left: 3px solid var(--gruen); padding: 7px 12px; background: var(--flaeche); border-radius: 0 var(--rund) var(--rund) 0; }
.an-inhalt table.liste { margin: 8px 0; }
.an-inhalt .cl-bildzeile { margin: 12px 0; }
/* Die Abbildungen sind Zeichnungen (SVG) - sie dürfen groß werden, ohne zu
   verpixeln, und stehen deshalb über die ganze Breite. */
.an-inhalt .cl-bild { width: 100%; max-width: 900px; cursor: zoom-in; }
.an-inhalt mark { background: #ffe9a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.an-stichwort { font-size: 12px; color: var(--leise); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--rund); padding: 6px 10px; }

/* ------------------------------------- »Weitermachen, wo Sie waren?«
   Steht vor dem ersten Blick in den Bestand. Kein gewöhnliches Fenster: Es
   lässt sich nicht wegklicken, denn ohne Antwort ginge es nicht weiter. */
.ort-huelle {
  position: fixed; inset: 0; z-index: 400; display: flex;
  align-items: center; justify-content: center;
  background: rgba(23,24,26,.45); padding: 16px;
}
.ort-karte {
  background: var(--bg); border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,.3); max-width: 420px; width: 100%;
}
.ort-karte h3 { margin: 0 0 6px; font-size: 17px; }
.ort-karte p { margin: 4px 0; font-size: 12.5px; }
.ort-kunde {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 !important; padding: 10px 12px;
  background: var(--gruen-hell); border-radius: var(--rund-gross);
  font-size: 14px !important; color: var(--gruen-dunkel);
}
.ort-kunde .ort-sinnbild { width: 18px; height: 18px; }
.ort-knoepfe {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px;
  flex-wrap: wrap;
}

/* Zuordnen in der Import-Vorschau: Was der Leser nicht selbst trifft, legt
   man hier auf ein vorhandenes Feld. */
.zu-ziel { font-size: 11.5px; max-width: 190px; padding: 2px 4px; }
.zu-aus td { color: var(--leise); background: var(--flaeche); }

/* ------------------------------------------------------------ Infocenter */
.infocenter-knopf { position: relative; font-size: 14px; padding: 5px 10px; }
.infocenter-knopf .infocenter-zahl:empty { display: none; }
.infocenter-zahl {
  position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: #e8a33d; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.infocenter-knopf.dringend .infocenter-zahl { background: var(--rot); }
.infocenter {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 95; width: 420px;
  max-width: calc(100vw - 24px); background: var(--bg); color: var(--text);
  border: 1px solid var(--rand-stark); border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0,0,0,.25); display: flex; flex-direction: column;
  max-height: 70vh;
}
.ic-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--rand); font-size: 13px; }
.ic-kopf .leise { font-size: 11px; }
.ic-liste { overflow: auto; }
.ic-zeile { display: grid; grid-template-columns: 1fr; gap: 1px; padding: 7px 12px 7px 10px; border-left: 3px solid #e8a33d; border-bottom: 1px solid var(--rand); color: inherit; text-decoration: none; }
.ic-zeile.dringend { border-left-color: var(--rot); }
.ic-zeile:hover { background: var(--gruen-hell); }
.ic-titel { font-weight: 600; font-size: 12px; }
.ic-kunde { font-size: 11px; color: var(--leise); }
.ic-frist { font-size: 11px; }
.ic-frist b { font-weight: 600; }
.ic-zeile.dringend .ic-frist b { color: var(--rot); }
.ic-fuss { padding: 8px 12px; border-top: 1px solid var(--rand); text-align: right; }

/* ------------------------------------------------ Suche in Auswahllisten */
.suchwahl {
  position: fixed; z-index: 450; background: var(--bg); color: var(--text);
  border: 1px solid var(--gruen); border-radius: 5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden;
}
.suchwahl input[type="search"] {
  margin: 6px; padding: 5px 8px; font-size: 13px;
  border: 1px solid var(--rand-stark); border-radius: 4px;
}
.suchwahl input[type="search"]:focus { outline: 2px solid var(--gruen); border-color: var(--gruen); }
.suchwahl-liste { overflow: auto; padding-bottom: 4px; }
.suchwahl-eintrag { padding: 5px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suchwahl-eintrag.gewaehlt { font-weight: 600; }
.suchwahl-eintrag:hover { background: var(--gruen-hell); }
.suchwahl-eintrag.zeiger { background: var(--gruen); color: #fff; }
.suchwahl-eintrag.aus { color: var(--leise); cursor: default; }
.suchwahl-leer { padding: 8px 10px; color: var(--leise); font-size: 12px; }

/* ------------------------------------------------------------ Symbolwahl */
.symbolknopf { font-size: 17px; line-height: 1; padding: 3px 6px; min-width: 42px; }
.vorlagen-kopf .symbolknopf { width: 46px; }
.symbolwahl {
  position: fixed; z-index: 400; background: var(--bg); color: var(--text);
  border: 1px solid var(--rand-stark); border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; flex-direction: column;
  overflow: hidden;
}
.symbolwahl-kopf { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--rand); }
.symbolwahl-kopf input { font-size: 12px; padding: 4px 7px; border: 1px solid var(--rand-stark); border-radius: 4px; }
.symbolwahl-kopf input[type="search"] { flex: 1; min-width: 0; }
.symbolwahl-kopf #sw-eigen { width: 64px; text-align: center; font-size: 15px; }
.symbolwahl-liste { overflow: auto; padding: 4px 8px 8px; }
.symbolwahl-gruppe { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin: 8px 0 3px; }
.symbolwahl-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; }
.sw-sym { font-size: 19px; line-height: 1; height: 34px; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; font-family: "Segoe UI Emoji", "Segoe UI Symbol", sans-serif; }
.sw-sym:hover { background: var(--gruen-hell); border-color: var(--gruen); }
.sw-sym.aktiv { background: var(--gruen-hell); border-color: var(--gruen-dunkel); }
.vorlagen-eintrag.ausgeblendet .knoepfe { display: flex; gap: 4px; }

/* --------------------------------------------- Kategorien aus dem Katalog */
.klappmenue.kat-menue { left: 0; right: auto; top: auto; bottom: calc(100% + 4px); min-width: 230px; max-height: 60vh; overflow: auto; }
.kat-menue .kopfzeile { font-size: 10px; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px 2px; }
.kat-menue .leer { font-size: 12px; color: var(--leise); padding: 6px 8px; }
.katalog-eintrag .marke.standard { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.katalog-vorlagen { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; margin-top: 6px; }
.katalog-vorlagen .schalter { font-size: 12px; }
.katalog-vorlagen .schalter .leise { font-size: 10px; }
.zf-felder { font-size: 12px; margin: 6px 0 0; padding-left: 18px; max-height: 26vh; overflow: auto; }

/* ------------------------------------------------------------ ReadMe-Ablage */
.readme-kopf { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.readme-kopf select { max-width: 340px; }
.readme-kopf input[type="search"] { width: 220px; }
.readme-text { margin: 0; max-height: 64vh; overflow: auto; white-space: pre; font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.45; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px; padding: 10px 12px; user-select: text; tab-size: 8; }
.readme-text mark { background: #ffe066; color: inherit; padding: 0; }
.readme-text mark.aktuell { background: #ff9f1c; }

/* ----------------------------------------------------------- Netzwerkplan */
.plan-huelle {
  position: fixed; inset: 0; z-index: 95; background: var(--bg);
  display: flex; flex-direction: column;
}
/* Dialoge aus dem Plan heraus (Objekt bearbeiten, dazuholen) liegen darüber */
body.plan-offen #dialog-huelle { z-index: 120; }
body.plan-offen .kg-huelle { z-index: 125; }
.plan-menue {
  position: fixed; z-index: 140; min-width: 230px; max-height: 80vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--rand-stark); border-radius: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,.18); padding: 5px; font-size: 13px;
}
.plan-menue .pm-titel { display: flex; align-items: center; gap: 7px;
  padding: 5px 9px 3px; font-weight: 600; color: var(--leise); font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em; }
.plan-menue .pm-punkt { display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; background: none; border: 0;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--text); font: inherit; }
.plan-menue .pm-punkt:hover { background: var(--gruen-hell); }
.plan-menue .pm-punkt.aktiv { font-weight: 600; }
.plan-menue .pm-trenner { height: 1px; background: var(--rand); margin: 4px 0; }
.pm-liste { max-height: 50vh; overflow: auto; margin-top: 8px; border: 1px solid var(--rand); border-radius: 4px; }
.pm-wahl { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--rand);
  cursor: pointer; font-weight: normal; }
.pm-wahl:hover { background: var(--flaeche); }
.pm-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 16px; margin-top: 8px; }
.pm-feld { display: flex; flex-direction: column; gap: 2px; font-weight: normal; }
.pm-feld > span { font-size: 12px; color: var(--leise); }
.pm-abschnitt { grid-column: 1 / -1; font-weight: 600; margin-top: 8px; border-bottom: 1px solid var(--rand); }
.plan-kopf {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-bottom: 1px solid var(--rand); background: var(--seite); flex: none;
}
.plan-kopf .trenner { width: 1px; height: 18px; background: var(--rand); margin: 0 4px; }
.plan-hinweis {
  padding: 5px 14px; font-size: 11px; color: var(--leise);
  border-bottom: 1px solid var(--rand); background: var(--bg); flex: none;
}
.plan-hinweis.aktiv { background: #eef7f1; color: var(--gruen-dunkel); }
.plan-flaeche { flex: 1; overflow: auto; background: #f7f9f8; min-height: 0; }
#plan-svg { display: block; }
/* Raster als Orientierung beim Schieben */
.plan-flaeche { background-image:
  linear-gradient(to right, rgba(0,0,0,.045) 1px, transparent 1px),
  linear-gradient(to bottom, rgba(0,0,0,.045) 1px, transparent 1px);
  background-size: 25px 25px; }

.pk-kasten { cursor: grab; }
.pk-kasten.zieht { cursor: grabbing; }
.pk-grund { fill: #fff; stroke: #cfd8d3; stroke-width: 1; }
.pk-kasten:hover .pk-grund { stroke: var(--gruen); }
.pk-kasten.gewaehlt .pk-grund { stroke: var(--gruen); stroke-width: 2.5; }
.pk-titel { font: 700 12px "Segoe UI", sans-serif; fill: #1b1b1b; }
.pk-art   { font: 700 9px "Segoe UI", sans-serif; fill: #fff; letter-spacing: .04em; }
.pk-ip    { font: 11px Consolas, "Courier New", monospace; fill: #5c6560; }
.pk-vm    { font: 10px "Segoe UI", sans-serif; fill: #4a5450; }
.pk-zusatz { font: 10px "Segoe UI", sans-serif; fill: #5c6560; }
.pk-warn  { font: 10px "Segoe UI", sans-serif; fill: #b4442e; }
.pk-kante { stroke: #9fb3a8; stroke-width: 2; fill: none; }
.pk-kante-klick { stroke: transparent; stroke-width: 12; fill: none; cursor: pointer; }
.pk-kante-klick:hover + .pk-kante, .pk-kante.hervor { stroke: var(--rot); stroke-width: 3; }
/* Aus der Verkabelung abgeleitet: eigene Farbe, damit man sieht, wo
   eine Linie herkommt - und kein Klickfang, denn geaendert wird sie
   in der Verkabelung, nicht hier. */
.pk-kabel { stroke: #4f83bd; stroke-width: 2.5; }
.pk-portnummer { font-size: 11px; fill: #4f83bd; font-weight: 600; }
.menuefeld { position: relative; }
.klappmenue {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 90;
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  background: var(--bg); border: 1px solid var(--rand-stark);
  border-radius: 10px; box-shadow: 0 8px 22px rgba(0,0,0,.22); min-width: 150px;
}
.klappmenue .knopf {
  justify-content: flex-start; text-align: left; border: 0;
  box-shadow: none; border-radius: 6px;
}
.klappmenue .knopf:disabled { opacity: .45; }
/* Trennt die Anleitung vom Rest: Sie erklärt das Programm, alles darunter
   verändert es. */
.menue-linie { height: 1px; background: var(--rand); margin: 3px 6px; }
.suche { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
/* nur das Suchfeld selbst - nicht das Kontrollkästchen daneben */
.suche > input[type="search"] {
  width: 240px; padding: 5px 11px; border-radius: 14px; font-size: 12px;
  border: 1px solid #3a3d41; background: #26282b; color: #fff;
  font-family: inherit;
}
.kopf .schalter { color: #b9bfc4; font-size: 11px; }
.kopf-rechts { display: flex; align-items: center; gap: 10px; }
.speicherstand { font-size: 11px; color: #9aa0a6; min-width: 78px; text-align: right; }
.speicherstand.aktiv { color: var(--gruen); }

.werkzeuge {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-bottom: 1px solid var(--rand); background: var(--bg); flex: none;
}
.trenner { width: 1px; height: 18px; background: var(--rand); margin: 0 6px; }
.schalter {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
  color: var(--leise); cursor: pointer; white-space: nowrap;
}
.schalter input { margin: 0; }
.schalter .sinnbild { width: 15px; height: 15px; }

/* Drei Spalten: schmal, schmal, Rest */
.raster {
  flex: 1; display: grid; grid-template-columns: 228px 300px 1fr;
  min-height: 0; background: var(--rand); gap: 1px;
}
.spalte { background: var(--bg); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.spalte-kategorien { background: var(--seite); }
.spalte-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--leise); border-bottom: 1px solid var(--rand); flex: none;
}
.spalte-liste .spalte-kopf, .spalte-detail .spalte-kopf { font-size: 12px; color: var(--text); }
.spalte-fuss {
  display: flex; gap: 4px; padding: 7px 10px; border-top: 1px solid var(--rand);
  flex: none; flex-wrap: wrap;   /* lieber zwei Zeilen als abgeschnitten */
}

/* ------------------------------------------------------ Sinnbilder
   Die Kategorien und Vorlagen tragen ein Emoji als Symbol. Gezeichnet
   wird daraus - wo es eines gibt - ein einfarbiges Strichsinnbild im
   Stil von SF Symbols (siehe sinnbilder.js). Es nimmt die Schriftfarbe
   der Zeile an, ist also in der gewählten Zeile automatisch richtig. */
.sinnbild { width: 17px; height: 17px; flex: none; display: block; }
.sinnbild-zeichen { font-size: 15px; line-height: 1; }
.symbol, .sym {
  display: inline-flex; align-items: center; justify-content: center;
}
.knopf .sinnbild { width: 15px; height: 15px; }
.knopf .sinnbild + .knopf-text { margin-left: 5px; }
/* Knöpfe, in denen nur ein Sinnbild steht, brauchen keine Textbreite. */
.knopf[data-sinnbild]:not([data-sinnbild-text]) { padding-left: 6px; padding-right: 6px; }
.knopf.winzig .sinnbild { width: 14px; height: 14px; }
.plan-menue .sinnbild { width: 15px; height: 15px; color: var(--leise); }
.plan-menue .pm-punkt:hover .sinnbild { color: var(--gruen-dunkel); }
.sw-sym { display: inline-flex; align-items: center; justify-content: center; }
.sw-sym .sinnbild { width: 21px; height: 21px; }
.symbolknopf .sinnbild { width: 19px; height: 19px; }

/* Kategorien - Seitenleiste im Stil von macOS: die Zeile wird nicht über
   die ganze Breite eingefärbt, sondern als abgerundete Kachel unterlegt,
   die gewählte grün getönt mit dunkler Schrift. */
.kategorien { list-style: none; margin: 0; padding: 5px 6px; overflow: auto; flex: 1; }
.kategorien li {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: var(--rund-gross); cursor: pointer;
  font-size: 12.5px; line-height: 1.45;
}
.kategorien li:hover { background: rgba(0,0,0,.05); }
.kategorien li.aktiv { background: var(--gruen-hell); color: var(--text); font-weight: 600; }
.kategorien li.aktiv .zahl { color: var(--gruen-dunkel); }
.kategorien .symbol { width: 16px; text-align: center; }
/* Unterkategorien: eingerückt. Davor steht ein schlichtes »+« bzw. »−«,
   das sie zeigt und wieder verbirgt - deutlich größer als das frühere
   Dreieck, aber ohne Rahmen und Kasten. */
.kategorien .klapp {
  width: 13px; flex: none; text-align: center; cursor: pointer;
  font: 400 15px/1 var(--schrift); color: var(--gruen);
  user-select: none;
}
.kategorien .klapp.leer { cursor: inherit; }
.kategorien .klapp:not(.leer):hover { color: var(--gruen-dunkel); }
.kategorien li.unterkategorie { padding-left: 21px; font-size: 12px; }
.kategorien li.unterkategorie .symbol { width: 14px; }
.kategorien li.aktiv .klapp { color: var(--gruen-dunkel); }
.katalog-eintrag.unterkategorie .name { padding-left: 16px; }
/* Das Plus im Spaltenkopf: nur das Zeichen, dafür groß genug, um es zu
   sehen. Beim Überfahren hinterlegt es sich. */
.plus-knopf {
  width: 24px; height: 24px; flex: none; padding: 0; cursor: pointer;
  border: 0; border-radius: var(--rund); background: transparent; color: var(--gruen);
  font: 400 21px/1 var(--schrift);
  display: inline-flex; align-items: center; justify-content: center;
}
.plus-knopf:hover { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.plus-knopf:disabled { opacity: .4; cursor: default; background: transparent; }
.spalte-kategorien .spalte-kopf { padding: 6px 8px 6px 12px; gap: 8px; }
.spalte-kategorien .spalte-fuss { align-items: center; }
.kategorien .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kategorien .zahl { color: var(--grau); font-size: 11px; }

/* Filter über der Objektliste (erscheint erst bei langen Listen) */
.listenfilter { padding: 6px 8px 2px; flex: none; }
.listenfilter input[type="search"] {
  width: 100%; padding: 5px 10px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--rand-stark); border-radius: 14px;
  background: var(--flaeche); color: var(--text);
}
.listenfilter input[type="search"]:focus {
  outline: none; border-color: var(--gruen); background: var(--bg);
  box-shadow: 0 0 0 2px var(--gruen-hell);
}
.eintraege li.listenfilter-leer { cursor: default; padding: 10px; font-size: 12px; }
.eintraege li.listenfilter-leer:hover { background: transparent; }

/* Einträge - wie die Kategorien als abgerundete Kachel statt mit
   Trennstrichen; das gewählte Objekt steht grün getönt darin. */
.eintraege { list-style: none; margin: 0; padding: 5px 6px; overflow: auto; flex: 1; }
.eintraege li {
  padding: 6px 9px; border-radius: var(--rund-gross); cursor: pointer; line-height: 1.35;
}
.eintraege li:hover { background: rgba(0,0,0,.04); }
.eintraege li.aktiv { background: var(--gruen-hell); }
.eintraege .titel { font-weight: 600; font-size: 13px; }
.eintraege .kennz { font-size: 11.5px; color: var(--leise); font-family: Consolas, monospace; }
.eintraege li.archiviert .titel { color: var(--grau); font-weight: 500; text-decoration: line-through; }
.eintraege li.archiviert .kennz { color: #b3bdb8; }
.eintraege li.archiviert .marke { margin-left: 6px; text-decoration: none; }

.archiv-hinweis {
  margin: 0 18px 10px; padding: 7px 11px; border-radius: 4px;
  background: #f4f1e6; border: 1px solid #e3dcc4; color: #6b5f38;
  font-size: 11px;
}
/* Angaben zur abgelegten Originaldatei. Grün, solange sie unverändert ist -
   gelb, sobald am Inhalt gearbeitet wurde. */
.anhang-hinweis {
  margin: 0 18px 10px; padding: 7px 11px; border-radius: 4px;
  background: #eef7f1; border: 1px solid #cfe6d9; color: #2b5f47;
  font-size: 11px;
}
.anhang-hinweis.geaendert {
  background: #f4f1e6; border-color: #e3dcc4; color: #6b5f38;
}
/* Der Dateiinhalt braucht Platz und eine feste Schrift. */
.feld.mehrzeilig textarea.wert.datei {
  min-height: 420px; font-family: Consolas, "Courier New", monospace;
  font-size: 11px; line-height: 1.45; white-space: pre; overflow-wrap: normal;
  tab-size: 8;
}

/* --------------------------------------------------------------- Detail */
.spalte-detail { overflow: auto; }
.detail-kopf {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 4px;
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.titelfeld {
  flex: 1; min-width: 0; font-size: 19px; font-weight: 700; border: 0;
  border-bottom: 1px solid transparent; padding: 3px 0; background: transparent; color: var(--text);
}
.titelfeld:hover { border-bottom-color: var(--rand); }
.titelfeld:focus { outline: none; border-bottom-color: var(--gruen); }
.detail-aktionen { display: flex; gap: 6px; align-items: center; }
.detail-aktionen select {
  padding: 4px 8px; font-size: 11px; border: 1px solid var(--rand-stark);
  border-radius: var(--rund); background: var(--bg); max-width: 180px;
  font-family: inherit; box-shadow: var(--schatten);
}
.detail-info { padding: 0 18px 10px; font-size: 11px; }

/* Feldraster.
   Zwei Dinge halten die Eingabefelder benutzbar:
   1. Eine Spalte wird erst ab 560 px aufgemacht - lieber untereinander als
      vier zerquetschte Spalten nebeneinander.
   2. Die Werkzeugknöpfe schweben über dem rechten Rand des Feldes, statt in
      jeder Zeile fest Platz zu belegen. Das gibt rund 80 px je Feld zurück.
   Die Spaltenzahl lässt sich unten rechts fest vorgeben. */
.felder {
  display: grid; gap: 3px 32px; padding: 4px 18px 10px;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  align-items: start;
}
.felder.spalten-1 { grid-template-columns: minmax(0, 820px); }
.felder.spalten-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.felder.spalten-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.feld {
  position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr);
  align-items: center; gap: 10px; padding: 2px 0;
}
/* Die Feldnamen stehen so dunkel und so groß da wie der Wert daneben -
   vorher waren sie 11 px hellgrau und am Bildschirm schlecht zu lesen. */
.feld > label {
  font-size: 12.5px; color: var(--text); text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feld input.wert, .feld textarea.wert, .feld select.wert {
  width: 100%; padding: 4px 9px; font-size: 13px; border: 1px solid var(--rand);
  border-radius: 6px; background: var(--bg); color: var(--text); min-height: var(--zeile);
  font-family: inherit;
}
.feld select.wert { max-width: 700px; cursor: pointer; }
.feld select.wert:focus { outline: none; border-color: var(--gruen); box-shadow: 0 0 0 2px var(--gruen-hell); }
/* Einzeilige Felder nicht endlos in die Breite ziehen - ein Feld für eine
   MAC-Adresse braucht keine 900 px. Mehrzeilige dürfen breit werden. */
.feld input.wert { max-width: 700px; }
.feld input.wert:hover, .feld textarea.wert:hover { border-color: var(--rand-stark); }
.feld input.wert:focus, .feld textarea.wert:focus { outline: none; border-color: var(--gruen); box-shadow: 0 0 0 2px var(--gruen-hell); }
.feld input.mono, .feld textarea.mono { font-family: Consolas, "Courier New", monospace; }
/* Werkzeuge schweben rechts über dem Feld - sie kosten keine Feldbreite. */
.feld .werkzeug {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 2px; opacity: 0; transition: opacity .1s;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff 22%);
  padding-left: 18px; border-radius: 6px;
}
.feld:hover .werkzeug, .feld:focus-within .werkzeug { opacity: 1; }
/* Nur noch zwei Knöpfe je Feld - kopieren und (bei Kennwörtern) anzeigen.
   Weil sie allein stehen, dürfen sie größer und damit leichter zu treffen
   sein als die frühere Reihe aus sechs Zeichen. */
.feld .werkzeug button {
  border: 0; background: transparent; cursor: pointer; padding: 4px 6px;
  color: var(--leise); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.feld .werkzeug button .sinnbild { width: 18px; height: 18px; }
.feld .werkzeug button:hover { background: rgba(0,0,0,.09); color: var(--text); }
.feld.mehrzeilig { grid-column: 1 / -1; align-items: start; }
.feld.mehrzeilig > label { padding-top: 6px; }
.feld.mehrzeilig textarea.wert { min-height: 62px; resize: vertical; }
.feld.mehrzeilig .werkzeug { top: 4px; transform: none; }

.abschnitt {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  margin: 14px 0 2px;
}
.abschnitt input {
  font-size: 12px; font-weight: 700; color: var(--gruen-dunkel);
  letter-spacing: .03em; text-transform: uppercase; border: 0;
  background: transparent; padding: 2px 0; width: 260px;
}
.abschnitt input:focus { outline: none; border-bottom: 1px solid var(--gruen); }
.abschnitt .linie { flex: 1; height: 2px; background: var(--gruen-hell); }

.notizblock { padding: 6px 18px 12px; max-width: 900px; }
.notizblock label { display: block; font-size: 12.5px; color: var(--text); margin-bottom: 4px; }
.notizblock textarea {
  width: 100%; padding: 7px 10px; font-size: 13px; border: 1px solid var(--rand);
  border-radius: 6px; resize: vertical; font-family: inherit; color: var(--text);
}
.notizblock textarea:focus { outline: none; border-color: var(--gruen); }

.detail-fuss {
  display: flex; gap: 6px 8px; align-items: center; padding: 10px 18px 14px;
  border-top: 1px solid var(--rand); position: sticky; bottom: 0;
  background: var(--bg); flex-wrap: wrap;   /* nichts wird abgeschnitten */
}
.detail-fuss .wachsen { min-width: 0; }
.detail-fuss select {
  padding: 3px 7px; font-size: 11px; border: 1px solid var(--rand-stark);
  border-radius: var(--rund); background: var(--bg); color: var(--text);
  font-family: inherit;
}
.leerhinweis { padding: 70px 20px; text-align: center; color: var(--leise); }
.leer-symbol { font-size: 38px; opacity: .35; display: flex; justify-content: center; }
.leer-symbol .sinnbild { width: 46px; height: 46px; stroke-width: 1.2; }

/* --------------------------------------------------------------- Fußzeile */
.fuss {
  display: flex; gap: 18px; align-items: center; padding: 5px 14px;
  border-top: 1px solid var(--rand); background: var(--flaeche);
  font-size: 11px; color: var(--leise); flex: none; white-space: nowrap;
}
.fuss > span:first-child {
  overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left;
  max-width: 46vw;
}
.fuss .warnung { color: var(--rot); font-weight: 600; }

/* ---------------------------------------------------------------- Dialog */
.dialog-huelle {
  position: fixed; inset: 0; background: rgba(20,24,22,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.dialog {
  background: var(--bg); border-radius: 12px; min-width: 420px; max-width: 92vw;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.dialog-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--rand); font-weight: 700;
}
.dialog-inhalt { padding: 16px; overflow: auto; }
.dialog-fuss {
  display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px;
  border-top: 1px solid var(--rand);
}
.dialog label { display: block; font-size: 12px; color: var(--text); margin: 10px 0 4px; }
.dialog input[type=text], .dialog input[type=password], .dialog select, .dialog textarea {
  width: 100%; padding: 7px 10px; font-size: 13px; border: 1px solid var(--rand-stark);
  border-radius: var(--rund); font-family: inherit; color: var(--text);
}
.dialog input:focus, .dialog select:focus, .dialog textarea:focus { outline: none; border-color: var(--gruen); }
.dialog .zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dialog .rollenwahl label { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; color: var(--text); font-size: 12px; }
.dialog .rollenwahl small { display: block; color: var(--grau); font-size: 11px; }

/* ----------------------------------------------------- Rechte je Benutzer
   Zehn Zeilen mit Erklärung. Sie stehen in einem eigenen, scrollenden Kasten:
   Ohne den schöbe die Liste die Knöpfe des Fensters aus dem Bild. */
.dialog .rechteliste {
  max-height: 34vh; overflow: auto; border: 1px solid var(--rand);
  border-radius: 6px; padding: 6px 8px; background: var(--flaeche);
}
.dialog .rechtzeile {
  display: flex; gap: 8px; align-items: flex-start; margin: 6px 0;
  color: var(--text); font-size: 12px;
}
.dialog .rechtzeile small { display: block; color: var(--grau); font-size: 11px; }
.dialog .rechtzeile input { margin-top: 2px; }

table.liste { width: 100%; border-collapse: collapse; font-size: 12px; }
table.liste th {
  text-align: left; font-weight: 600; color: var(--leise); font-size: 11px;
  border-bottom: 1px solid var(--rand); padding: 5px 8px; position: sticky; top: 0; background: var(--bg);
}
table.liste td { padding: 4px 8px; border-bottom: 1px solid #f2f5f3; vertical-align: top; }
table.liste tr:hover td { background: var(--flaeche); }
table.liste td.mono { font-family: Consolas, monospace; }
.marke { display: inline-block; padding: 1px 6px; border-radius: 9px; font-size: 10px; background: var(--gruen-hell); color: var(--gruen-dunkel); }
.marke.grau { background: #eceff0; color: var(--leise); }
.marke.rot { background: #fbeceb; color: var(--rot); font-weight: 600; }

/* ----------------------------------------------------------- Eigenes Logo
   Es tritt an die Stelle des Schriftzugs, oben links und auf der
   Anmeldeseite. Die Höhe ist gedeckelt, die Breite ergibt sich - sonst
   sprengt ein breites Querformat die Kopfleiste. */
.eigenes-logo { max-height: 26px; max-width: 190px; display: block; }
.eigenes-logo.gross { max-height: 46px; max-width: 100%; }

/* ------------------------------------------------ Konfiguration (VPN-ZIP) */
.konfigzeile {
  display: flex; align-items: center; gap: 8px;
  margin: 0 18px 10px; padding: 6px 11px; border-radius: 4px;
  background: var(--flaeche); border: 1px solid var(--rand); font-size: 11px;
}
.konfigzeile .konfig-text { color: var(--leise); }
.konfigzeile.gefuellt {
  background: #eef7f1; border-color: #cfe6d9;
}
.konfigzeile.gefuellt .konfig-text { color: #2b5f47; }

/* ------------------------------------------------------------- Bilder */
.bilderblock { padding: 2px 18px 14px; max-width: 1100px; }
.bilder-kopf {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
  font-size: 11px; color: var(--leise);
  text-transform: uppercase; letter-spacing: .04em;
}
.bilder-galerie {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.bilder-galerie .leerhinweis { padding: 10px 0; text-align: left; grid-column: 1 / -1; }
.kachel {
  border: 1px solid var(--rand); border-radius: 5px; overflow: hidden;
  background: var(--flaeche); display: flex; flex-direction: column;
}
.kachel .bildflaeche {
  height: 96px; display: flex; align-items: center; justify-content: center;
  background: #eceff0; cursor: zoom-in; overflow: hidden;
}
.kachel .bildflaeche img { width: 100%; height: 100%; object-fit: cover; }
/* Was der Browser nicht darstellen kann (in aller Regel HEIC), bekommt eine
   Kachel mit Dateiendung statt eines kaputten Bildsymbols. */
.kachel .ersatz {
  font-size: 11px; color: var(--leise); text-align: center; padding: 6px;
  cursor: default;
}
.kachel .ersatz b { display: block; font-size: 15px; color: var(--grau); }
.kachel .fuss { padding: 4px 6px; font-size: 10px; }
.kachel .fuss .name {
  display: block; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600;
}
.kachel .fuss .zusatz { color: var(--leise); }
.kachel .kachel-notiz {
  width: 100%; border: 0; border-top: 1px solid var(--rand);
  padding: 3px 6px; font-size: 11px; font-family: inherit; color: var(--text);
  background: var(--bg);
}
.kachel .kachel-notiz:focus { outline: none; background: #fffdf3; }
.kachel .werkzeuge-kachel {
  display: flex; gap: 2px; padding: 2px 4px; border-top: 1px solid var(--rand);
  background: var(--bg);
}

/* --------------------------------------------------------- Bildschau */
.schau {
  position: fixed; inset: 0; z-index: 70; background: rgba(12,14,13,.92);
  display: flex; flex-direction: column;
}
.schau-kopf {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  color: #e8ece9; font-size: 12px; background: rgba(0,0,0,.35);
}
.schau-kopf .knopf { background: #2b2d30; border-color: #3a3d41; color: #fff; }
.schau-kopf .knopf:hover { background: #3a3d41; }
.schau-flaeche {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 14px;
}
.schau-flaeche img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Netz und Verkabelung über den Feldern eines Eintrags */
.netzzeile {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 6px 10px; margin-bottom: 8px; font-size: 11px;
  background: #eef4ff; border: 1px solid #d3e0f2; border-radius: 4px;
  color: #2c4a70;
}
.netzzeile .nz-stueck { white-space: nowrap; }
.netzzeile b { font-weight: 600; }
.netzzeile .nz-mehr { margin-left: auto; color: #2c4a70; }

/* ------------------------------------------------- Netze und Adressen */
.n-frei td:nth-child(2) { color: var(--gruen-dunkel); }
.n-belegt td { background: var(--flaeche); }
.n-konflikt td { background: #fdeceb; }
.n-konflikt td:nth-child(2) { color: var(--rot); font-weight: 600; }
.n-gateway td { background: #eef4ff; }
.n-dhcp td:nth-child(2) { color: var(--leise); }
.n-reserviert td { background: #fff6e0; }
.n-reserviert td:nth-child(2) { color: #8a5a00; font-weight: 600; }
.n-belegung { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n-belegung .knopf { white-space: nowrap; }
.ip-werkzeug { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 6px; }
.ip-werkzeug input[type="search"] { width: 200px; }
.ip-werkzeug .knopf.aktiv { background: var(--gruen-dunkel); color: #fff; border-color: var(--gruen-dunkel); }
.ip-markieren { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px;
  padding: 8px 10px; background: var(--flaeche); border-radius: 6px; }
.ip-markieren > div { display: flex; flex-direction: column; }
.ip-markieren input { width: 220px; }
.ip-frei-liste { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; margin: 8px 0; }
.ip-frei-liste .mono { font-size: 15px; }
.ip-frei-liste .knoepfe { display: flex; gap: 6px; }
td.ip-aktion { white-space: nowrap; text-align: right; }
#ti-text { width: 100%; font-size: 12px; }
/* Zwei-Faktor-Anmeldung */
.zf-raster { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
@media (max-width: 700px) { .zf-raster { grid-template-columns: 1fr; } }
/* Größe kommt aus dem SVG selbst (segno, ohne viewBox - skalieren schnitte ab) */
.zf-qr svg { display: block; background: #fff; border: 1px solid var(--rand); border-radius: 6px; }
.zf-ohne-qr { width: 200px; padding: 16px; border: 1px dashed var(--rand-stark); border-radius: 6px; }
.zf-schritte { margin: 0 0 10px 18px; padding: 0; line-height: 1.5; }
.zf-schritte li { margin-bottom: 6px; }
.zf-schluessel { font-size: 15px; letter-spacing: .05em; padding: 6px 8px; margin: 4px 0;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 4px; user-select: all; word-break: break-all; }
.zf-notfall { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 28px; font-size: 16px;
  padding: 12px 16px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px; user-select: all; }
.klein-hinweis { font-size: 11px; margin: 2px 0 0; }
.anmelde-oder { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px;
  color: var(--leise); font-size: 12px; }
.anmelde-oder::before, .anmelde-oder::after { content: ""; flex: 1; border-top: 1px solid var(--rand); }
.pk-neu { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rand); }
label.haken { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; cursor: pointer; }
label.haken input { margin-top: 3px; width: auto; }
.ti-liste { max-height: 58vh; overflow: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.ti-objekt { border: 1px solid var(--rand); border-left-width: 4px; border-radius: 5px; padding: 6px 8px; }
.ti-objekt.ti-neu { border-left-color: var(--gruen-dunkel); }
.ti-objekt.ti-ergaenzen { border-left-color: #c08a1e; }
.ti-objekt.ti-gleich { opacity: .65; }
.ti-kopf { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-weight: normal; cursor: pointer; }
.ti-werte { width: 100%; font-size: 12px; margin-top: 4px; border-collapse: collapse; }
.ti-werte td { padding: 1px 4px; vertical-align: top; }
.ti-werte td:first-child { width: 40%; }

/* Verkabelung: viele schmale Felder, deshalb kleiner und ohne Rahmenlärm. */
table.verkabelung td { padding: 2px 4px; }
table.verkabelung input, table.verkabelung select {
  width: 100%; min-width: 74px; font-size: 11px; padding: 3px 5px;
  border: 1px solid transparent; background: transparent;
}
table.verkabelung input:hover, table.verkabelung select:hover,
table.verkabelung input:focus, table.verkabelung select:focus {
  border-color: var(--rand); background: var(--bg);
}
table.verkabelung .schmal { min-width: 46px; max-width: 60px; }

/* ------------------------------------------------- Zwei-Faktor-Tresor */
/* Der Code ist hier der Inhalt, nicht die Beschriftung: groß, in
   Zifferngleichschrift und als Knopf, weil man ihn anklickt, um ihn zu
   kopieren. Der Balken darunter zeigt, wie lange er noch gilt. */
table.tresor td { vertical-align: middle; }
.tr-code {
  font: 600 20px/1 ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas,
        monospace;
  letter-spacing: .06em; padding: 4px 8px; cursor: pointer;
  color: var(--gruen-dunkel); background: var(--gruen-hell);
  border: 1px solid transparent; border-radius: var(--rund);
}
.tr-code:hover { border-color: var(--gruen); }
.tr-zeit { white-space: nowrap; }
.tr-balken {
  display: inline-block; width: 54px; height: 6px; margin-right: 6px;
  background: var(--rand); border-radius: 3px; overflow: hidden;
  vertical-align: middle;
}
.tr-balken i {
  display: block; height: 100%; background: var(--gruen);
  /* Ohne Übergang ruckelt der Balken sekundenweise. */
  transition: width .9s linear;
}
/* Letzte Sekunden: Der Code läuft ab, das Eintippen lohnt nicht mehr. */
.tr-knapp .tr-balken i { background: #d98324; }
.tr-knapp .tr-rest { color: #8a5214; }
.tr-rest { font-variant-numeric: tabular-nums; }
.tr-aktionen { white-space: nowrap; text-align: right; }
.tr-maske {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px; align-items: end;
}
.tr-maske label { display: flex; flex-direction: column; gap: 3px; }
.tr-maske .tr-breit { grid-column: 1 / -1; }
.tr-maske input, .tr-maske select, .tr-maske textarea { width: 100%; }
.tr-werkzeuge { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-geheimtext {
  display: inline-block; padding: 6px 8px; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: var(--rund);
  word-break: break-all;
}
/* Gültig, aber prüfenswert - kein Fehler, deshalb nicht in Rot. */
.tr-warnung { color: #8a5214; margin: 4px 0; }
.tr-qr { margin-top: 8px; }
.tr-qr svg { width: 190px; height: 190px; }

/* ------------------------------------------------- Kennwortgenerator */
/* Über dem gewöhnlichen Dialog (50) und unter der Bildschau (70): Er geht
   auch aus einem offenen Fenster heraus auf. */
.kg-huelle { z-index: 60; }
.kg-huelle .dialog { min-width: 460px; }
/* Eingabefeld und Würfel nebeneinander, ohne dass das Feld schrumpft. */
.kg-neben { display: flex; gap: 6px; align-items: stretch; }
.kg-neben input { flex: 1; }
.kg-ausgabe {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 10px 12px; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: 5px;
}
.kg-wert {
  flex: 1; font-size: 17px; letter-spacing: .04em; word-break: break-all;
  user-select: all;                  /* ein Doppelklick greift alles */
}
.kg-schwach { color: var(--rot); }
.kg-mittel { color: #9a6a00; }
.kg-stark { color: var(--gruen-dunkel); }
.kg-laenge { display: flex; align-items: center; gap: 10px; }
.kg-laenge input[type=range] { flex: 1; }
.kg-laenge input[type=number] { width: 68px; }
.kg-zeile { display: block; margin: 3px 0; }
.kg-feld {
  width: 100%; margin-top: 4px; padding: 5px 8px; font-size: 12px;
  font-family: Consolas, monospace;
}
.kg-feld:disabled { background: var(--flaeche); color: var(--leise); }

/* Rechenfeld: sichtbar nichts zum Hineinschreiben. */
.wert.berechnet {
  background: var(--flaeche); color: var(--grau); font-style: italic;
  cursor: default;
}
/* Der Laufzeitverlauf: eine Zeile je Vertragszeitraum. Grau hinterlegt wie
   jedes Rechenfeld, aber in normaler Schrift und mit Ziffern fester Breite -
   die Datumsspalten sollen untereinanderstehen, und vier Zeilen kursiv in
   Grau wären nur schwerer zu lesen. */
.feld.mehrzeilig textarea.wert.berechnet {
  background: var(--flaeche); color: var(--text); cursor: default;
  font-style: normal; font-variant-numeric: tabular-nums; line-height: 1.6;
}

/* Vertragsfristen */
.frist-bald td { background: #fff6da; }
.frist-abgelaufen td { background: #fdeceb; }
/* Gekündigt: kein Handlungsbedarf mehr - die Zeile tritt zurück. */
.frist-gekuendigt td { background: var(--flaeche); color: var(--leise); }
.frist-gekuendigt td a { color: var(--leise); }
.frist-zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Programmwechsel bei offener Seite: auffällig, aber nicht im Weg. */
.neuladen-band {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 14px; font-size: 12px;
  background: #fff6da; border-bottom: 1px solid #e8d79a; color: #6b5311;
}
.neuladen-band .knopf { margin-left: auto; }

/* Das PDF bekommt die ganze Fläche - es wird gelesen, nicht betrachtet. */
.schau-flaeche iframe {
  width: 100%; height: 100%; border: 0; border-radius: 4px; background: #fff;
}
/* Die PDF-Kachel: kein Bild, aber auch kein Platzhalter für ein fehlendes -
   sie sagt, was da liegt, und lädt zum Öffnen ein. */
.kachel .pdfflaeche {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; width: 100%; height: 100%;
  background: var(--flaeche); cursor: pointer;
}
.kachel .pdfflaeche .zeichen { font-size: 26px; line-height: 1; }
.kachel .pdfflaeche b {
  font-size: 11px; letter-spacing: .06em; color: var(--rot);
}
.kachel .pdfflaeche span { font-size: 10px; color: var(--leise); }
.kachel .pdfflaeche:hover { background: var(--rand); }

/* Im Objekt steht das PDF offen da: eine Kachel über die ganze Breite mit
   dem eingebauten Betrachter des Browsers. Blättern, suchen und drucken
   kann der von selbst - dafür braucht es kein eigenes Fenster. */
.kachel.pdf-kachel { grid-column: 1 / -1; }
.kachel.pdf-kachel .bildflaeche {
  height: auto; cursor: default; background: #f4f6f5; padding: 0;
}
.kachel.pdf-kachel .pdf-inline {
  width: 100%; height: min(70vh, 720px); min-height: 320px;
  border: 0; display: block; background: #fff;
}
@media (max-width: 700px) {
  .kachel.pdf-kachel .pdf-inline { height: 62vh; min-height: 260px; }
}

/* ------------------------------------------------------- Kundenimport */
.import-raster { display: flex; flex-direction: column; gap: 10px; }
/* ------------------------------- Kundenmaske mit Werten aus dem Import
   Links die Maske, rechts die Werte der gewählten Zeile. Gezogen wird von
   rechts nach links - jeder Wert dorthin, wo er hingehört. */
/* »width«, nicht »min-width«: min-width schlägt max-width, der Dialog
   liefe auf einem schmalen Bildschirm über den Rand hinaus. */
.dialog.breit { width: min(1240px, 96vw); }
.kunde-mit-import {
  display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px;
}
.import-werte {
  border-left: 1px solid var(--rand); padding-left: 14px; min-width: 0;
  display: flex; flex-direction: column;
}
.import-werte h4 { margin: 0 0 6px; font-size: 12px; }
.import-werte .import-tabelle { max-height: 52vh; flex: 1; }
/* Zellen sind das Griffstück - jede einzelne lässt sich ins Feld ziehen. */
.import-tabelle td.zieh-zelle { cursor: grab; }
.import-tabelle td.zieh-zelle:hover {
  background: var(--gruen-hell); box-shadow: inset 0 0 0 1px var(--gruen);
}
.import-tabelle td.zieh-zelle.armiert {
  background: var(--gruen); color: #fff; cursor: cell;
}
/* Schmales Fenster: Die Tabelle rückt unter die Maske, statt sie zu quetschen. */
@media (max-width: 900px) {
  .kunde-mit-import { grid-template-columns: 1fr; gap: 10px; }
  .import-werte {
    border-left: 0; border-top: 1px solid var(--rand);
    padding-left: 0; padding-top: 10px;
  }
  .import-werte .import-tabelle { max-height: 30vh; }
}
.import-werte h4 {
  margin: 0 0 2px; font-size: 12px;
}
.wert-liste {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 46vh; overflow: auto; margin-top: 8px;
}
.wertchip {
  border: 1px solid var(--rand-stark); border-radius: 5px;
  padding: 4px 8px; background: var(--flaeche); cursor: grab;
  font-size: 12px; user-select: none;
}
.wertchip:hover { border-color: var(--gruen); background: var(--gruen-hell); }
.wertchip.armiert {
  background: var(--gruen); border-color: var(--gruen); color: #fff;
  cursor: cell;
}
.wertchip .spalte {
  display: block; font-size: 10px; color: var(--leise);
  text-transform: uppercase; letter-spacing: .03em;
}
.wertchip.armiert .spalte { color: #d6f0e2; }
.wertchip .inhalt {
  display: block; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.wertchip.benutzt { opacity: .5; }
/* Ablagefläche: jedes Eingabefeld der Maske */
.dialog input.ziel-bereit, .dialog textarea.ziel-bereit {
  border-color: var(--gruen); background: #f4fbf7;
}
.dialog input.ziel-ueber, .dialog textarea.ziel-ueber {
  border-color: var(--gruen); background: var(--gruen-hell);
  box-shadow: inset 0 0 0 1px var(--gruen);
}

/* Verknüpfen per Ziehen: Die Feldkästen sind die Ablageflächen, die
   Spaltenköpfe der Tabelle das, was man anfasst. */
.zuord-raster {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.zuord-feld {
  border: 1px dashed var(--rand-stark); border-radius: 5px;
  padding: 5px 8px; background: var(--flaeche);
  display: flex; align-items: baseline; gap: 6px; min-height: 40px;
}
.zuord-feld .feldname {
  font-size: 11px; color: var(--leise); flex: none;
}
.zuord-feld .quelle {
  flex: 1; font-size: 12px; color: var(--grau); font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zuord-feld.belegt {
  border-style: solid; border-color: var(--gruen); background: var(--gruen-hell);
}
.zuord-feld.belegt .quelle {
  color: var(--gruen-dunkel); font-style: normal; font-weight: 600;
}
/* Während des Ziehens: Wohin darf ich? Und wo bin ich gerade? */
.zuord-feld.bereit { border-color: var(--gruen); background: #f2fbf6; }
.zuord-feld.ueber {
  border-color: var(--gruen); background: var(--gruen);
}
.zuord-feld.ueber .feldname, .zuord-feld.ueber .quelle { color: #fff; }
.zuord-feld .loesen { flex: none; color: var(--leise); }

/* Spaltenkopf der Tabelle - das Griffstück */
.import-tabelle th.zieh { cursor: grab; user-select: none; }
.import-tabelle th.zieh:hover { background: var(--gruen-hell); }
.import-tabelle th.zieh.armiert {
  background: var(--gruen); color: #fff; cursor: cell;
}
.import-tabelle th .feldmarke {
  display: block; font-weight: 400; font-size: 10px;
  color: var(--gruen-dunkel);
}
.import-tabelle th.zieh.armiert .feldmarke { color: #d6f0e2; }
.import-tabelle { max-height: 40vh; overflow: auto; border: 1px solid var(--rand); }
.import-tabelle table { border-collapse: collapse; font-size: 11px; width: 100%; }
.import-tabelle th, .import-tabelle td {
  border-bottom: 1px solid var(--rand); padding: 3px 6px; text-align: left;
  white-space: nowrap; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis;
}
.import-tabelle thead th { position: sticky; top: 0; background: var(--flaeche); }
.import-tabelle tr.kopfzeile td { color: var(--leise); font-style: italic; }
.import-tabelle td.zugeordnet { background: var(--gruen-hell); }

/* ------------------------------------------- Bestandsimport: Zusortieren
   Die Kategorienleiste ist eine Ablagefläche: Ein Vorschlag aus der Tabelle
   darunter wird auf die Kategorie gezogen, in die er gehört. */
.kp-katleiste {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
  max-height: 22vh; overflow: auto; padding: 6px;
  border: 1px dashed var(--rand-stark); border-radius: 6px;
  background: var(--flaeche);
}
.kp-kat-ziel {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--rand-stark); border-radius: 14px;
  padding: 3px 9px; font-size: 12px; background: var(--bg);
  user-select: none;
}
.kp-kat-ziel .kname { white-space: nowrap; }
.kp-kat-ziel b {
  background: var(--rand); border-radius: 9px; padding: 0 6px;
  font-size: 11px;
}
.kp-kat-ziel small { color: var(--leise); font-size: 10px; }
.kp-kat-ziel.belegt { border-color: var(--gruen); }
.kp-kat-ziel.belegt b { background: var(--gruen); color: #fff; }
.kp-kat-ziel.bereit {
  border-color: var(--gruen); background: #f2fbf6; cursor: cell;
}
.kp-kat-ziel.ueber {
  background: var(--gruen); border-color: var(--gruen); color: #fff;
}
.kp-kat-ziel.ueber small, .kp-kat-ziel.ueber b { color: #fff; }
/* Der Vorschlag selbst ist das Griffstück. */
.liste td.zieh-zelle { cursor: grab; }
.liste td.zieh-zelle:hover {
  background: var(--gruen-hell); box-shadow: inset 0 0 0 1px var(--gruen);
}
.liste td.zieh-zelle.armiert {
  background: var(--gruen); color: #fff; cursor: cell;
}
/* Was kein Feld gefunden hat, wird oben beim Namen genannt - sonst fällt es
   erst nach dem Import auf, und dann steht es in der Notiz. */
p.kp-offen {
  margin: 8px 0; padding: 7px 10px; border-radius: 6px;
  background: #fff6da; border: 1px solid #e6cf8a; font-size: 12px;
}
p.kp-offen .knopf { margin-left: 6px; }

/* Zuordnen: links die offenen Zeilen, rechts die Felder der Vorlage. */
.zuord-kopf {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 12px; margin-bottom: 6px;
}
.zuord-kopf select { font-size: 12px; padding: 2px 4px; min-width: 170px; }
.zuord-zwei {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px; margin-top: 8px;
}
.zuord-saeule { min-width: 0; }
.zuord-saeule h4 { margin: 0 0 4px; font-size: 12px; }
.zuord-saeule .zuord-raster { max-height: 46vh; overflow: auto; }
.zuord-abschnitt {
  grid-column: 1 / -1; font-size: 11px; font-weight: 600;
  color: var(--leise); text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--rand); padding: 6px 0 2px;
}
.zuord-feld.neu { border-style: dotted; }
.zuord-feld.neu .feldname { color: var(--gruen-dunkel); }
@media (max-width: 900px) {
  .zuord-zwei { grid-template-columns: 1fr; }
}

/* Seite an Seite: links die Datei, rechts die Felder - je eine Hälfte.
   Der Text wird dabei **nicht** umgebrochen: Eine gewachsene readme.txt ist
   in Spalten geschrieben, und umgebrochen ist ihre Geräteliste unlesbar. */
.dialog.weit { width: min(1840px, 99vw); }
.zuord-zwei.halbe { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.zuord-zwei.halbe .quelle-text {
  /* »width« ausdruecklich: Ein <pre> mit »white-space: pre« schrumpft sonst
     auf seinen laengsten Zeilenrest und laesst die halbe Spalte leer. */
  width: 100%; white-space: pre; overflow: auto; max-height: 66vh;
  font-size: 12px; line-height: 1.4; background: var(--bg);
}
.zuord-zwei.halbe .zuord-raster { max-height: 66vh; }

/* Zuordnen: links wahlweise die offenen Zeilen oder die ganze Datei. */
.sicht-wahl { float: right; font-weight: 400; }
.sicht-wahl .knopf.an {
  background: var(--gruen); color: #fff; border-color: var(--gruen);
}
.zuord-saeule .quelle-text { max-height: 46vh; }
.zuord-kopf .kz-titel {
  font-size: 12px; padding: 2px 5px; min-width: 220px; margin-left: 4px;
}

/* ----------------------------------- Bestandsimport: der Text der Datei
   Links die readme.txt, rechts die Maske. Markiert wird mit der Maus, und
   was schon ein Objekt geworden ist, bleibt im Text hinterlegt stehen. */
.quelle-zwei {
  display: grid; gap: 14px; margin-top: 8px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.quelle-text {
  margin: 0; max-height: 56vh; overflow: auto; padding: 8px 10px;
  border: 1px solid var(--rand); border-radius: 6px;
  background: var(--flaeche); font-size: 11.5px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; cursor: text;
}
.quelle-text mark { background: #fff3c4; border-radius: 2px; }
.quelle-maske { min-width: 0; }
.quelle-maske h4 { margin: 0 0 4px; font-size: 12px; }
.qt-schau {
  margin: 0 0 8px; max-height: 16vh; overflow: auto; padding: 6px 8px;
  border: 1px solid var(--rand); border-radius: 5px; background: var(--flaeche);
  font-size: 11px; white-space: pre-wrap; word-break: break-word;
}
.qt-zeile { display: block; font-size: 11px; color: var(--leise); margin-bottom: 6px; }
.qt-zeile input, .qt-zeile select {
  display: block; width: 100%; font-size: 12px; padding: 3px 5px;
  margin-top: 2px;
}
.qt-eintrag {
  display: flex; align-items: baseline; gap: 6px; font-size: 12px;
  border-bottom: 1px solid var(--rand); padding: 4px 0;
}
.markiert-marke { color: var(--gruen-dunkel); }
@media (max-width: 900px) {
  .quelle-zwei { grid-template-columns: 1fr; }
  .quelle-text { max-height: 32vh; }
}

/* --------------------------------------------------------------- Hinweis */
.hinweis {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--kopf); color: #fff; padding: 8px 16px; border-radius: 20px;
  font-size: 12px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.hinweis.warnung { background: var(--rot); }

/* ------------------------------------------------------- Schmale Fenster */
@media (max-width: 1100px) {
  .raster { grid-template-columns: 180px 250px 1fr; }
  .suche > input[type="search"] { width: 160px; }
}
@media (max-width: 860px) {
  .felder, .felder.spalten-2, .felder.spalten-3 { grid-template-columns: 1fr; padding: 4px 12px; }
  .feld { grid-template-columns: 96px minmax(0, 1fr); }
  .feld .werkzeug { opacity: 1; }        /* ohne Maus dauerhaft sichtbar */
}

/* Niedrige, breite Bildschirme (16:9): die Höhe ist knapp, die Breite nicht.
   Kopf- und Fußbereiche schrumpfen, damit mehr Felder sichtbar bleiben. */
@media (min-width: 1400px) and (max-height: 900px) {
  .kopf { height: 44px; }
  .werkzeuge { padding: 4px 14px; }
  .detail-kopf { padding: 8px 18px 2px; }
  .titelfeld { font-size: 17px; }
  .detail-info { padding-bottom: 6px; }
  .notizblock textarea { min-height: 54px; }
}

/* Netzwerkscan einlesen */
.ns-leiste { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 8px; }
.ns-leiste input[type=search] { flex: 1 1 220px; min-width: 160px; }
.ns-fk { display: flex; gap: 6px; align-items: center; font-size: 12px; margin-left: auto; }
.ns-liste { max-height: 58vh; overflow: auto; display: grid; gap: 6px; padding-right: 4px; }
.ns-geraet { border: 1px solid var(--rand); border-left: 4px solid var(--gruen-dunkel); border-radius: 5px; padding: 6px 8px; }
.ns-geraet.ns-treffer { border-left-color: #c08a1e; }
.ns-geraet.ns-offen { background: #fff8e6; }
.ns-geraet.ns-aus { opacity: .5; border-left-color: var(--rand); }
.ns-kopf { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; }
.ns-ip { min-width: 104px; }
.ns-kopf .leise { font-size: 11px; }
.ns-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; align-items: center; }
.ns-zeile select, .ns-zeile input { font-size: 12px; padding: 3px 5px; }
.ns-aktion { max-width: 100%; }
.ns-neu-felder { display: contents; }
.ns-neu-felder.versteckt { display: none; }
.ns-titel { width: 180px; }
.ns-diff { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 4px; }
.ns-werte { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; }
.ns-feld { display: flex; flex-direction: column; font-size: 10px; color: var(--leise); flex: 0 1 150px; margin: 0; }
.ns-feld.ns-breit { flex: 1 1 260px; }
.ns-feld input { font-size: 12px; padding: 2px 5px; font-family: inherit; }
.ns-freigaben { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; align-items: center; }
.ns-freigabe { display: inline-flex; gap: 4px; align-items: center; margin: 0; font-size: 12px; }

/* Vorlagenwechsel: was mit den Feldern geschieht */
.vw-block { border-left: 3px solid var(--rand-stark); padding: 4px 0 4px 8px; margin: 8px 0; font-size: 12px; }
.vw-block.vw-gut { border-left-color: var(--gruen); }
.vw-block.vw-behalten { border-left-color: #c08a1e; }
.vw-block.vw-neu { border-left-color: #4f83bd; }
.vw-block.vw-weg { border-left-color: var(--rot); }
.vw-felder { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.vw-felder span { font-size: 12px; }
/* Vorwarnung vor dem Abmelden wegen Leerlauf */
.leerlauf-huelle { z-index: 200; }
.leerlauf-fenster { min-width: 0; width: min(420px, calc(100vw - 24px)); }
.leerlauf-fenster .leerlauf-zahl {
  font-size: 26px; font-weight: 700; color: var(--rot);
  text-align: center; margin: 14px 0 6px;
}
.leerlauf-fenster .leerlauf-zahl span { font-variant-numeric: tabular-nums; }

.prot-arten { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
/* Gescheiterte Anmeldungen und Kontosperren: die ganze Zeile rot getönt,
   mit rotem Balken links - im langen Protokoll sieht man sie so beim
   Durchblättern. */
.liste tr.prot-fehl > td { background: #fdf0ef; }
.liste tr.prot-fehl > td:first-child { box-shadow: inset 3px 0 0 var(--rot); }
.liste tr.prot-fehl > td:nth-child(2) { font-weight: 600; }
.marke.prot-marke {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fbeceb; color: var(--rot); font-weight: 600;
}
.marke.prot-marke .sinnbild { width: 13px; height: 13px; }
#vorlage-wechseln { font-size: 11px; }
/* Gegen die allgemeinen Formularstile des Dialogs (volle Breite, Abstand) */
#dialog-inhalt .ns-liste select, #dialog-inhalt .ns-liste input[type=text],
#dialog-inhalt .ns-leiste select, #dialog-inhalt .ns-leiste input {
  width: auto; margin: 0; min-height: 0; height: auto; padding: 3px 6px; font-size: 12px; }
#dialog-inhalt .ns-liste .ns-aktion { flex: 0 1 330px; min-width: 0; }
#dialog-inhalt .ns-liste .ns-titel { flex: 0 1 170px; min-width: 110px; }
#dialog-inhalt .ns-liste .ns-kat, #dialog-inhalt .ns-liste .ns-vorlage { flex: 0 1 190px; min-width: 0; }
#dialog-inhalt .ns-liste .ns-feld { display: flex; flex-direction: column; margin: 0; }
#dialog-inhalt .ns-liste .ns-feld input[type=text] { width: 100%; }
#dialog-inhalt .ns-liste .ns-freigabe { display: inline-flex; margin: 0; }
#dialog-inhalt .ns-leiste input[type=search] { flex: 1 1 220px; }
#dialog-inhalt .ns-liste input[type=checkbox] { width: auto; margin: 0; }
.ns-leiste .ns-fk { margin: 0 0 0 auto; }

/* ============================================ Tablet und Telefon (iPad, iPhone)
   Bis 900 px: Die Kategorien sind keine eigene Spalte mehr, sondern klappen
   über »☰« als Seitenleiste aus; daneben bleiben Liste und Objekt.
   Bis 700 px (Telefon): immer nur Liste *oder* Objekt, »‹ Liste« führt
   zurück. Die Schaltung macht app.js über body.mobil-detail und
   body.schublade-auf. */
.nur-schmal, .nur-handy, .schublade-grund { display: none; }

/* Fingerbedienung: größere Ziele, und Eingaben mit 16 px - kleiner zoomt
   Safari auf dem iPhone beim Antippen die ganze Seite heran. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .knopf { min-height: 34px; }
  .knopf.winzig { min-height: 30px; padding: 4px 8px; }
  .kategorien li { padding: 9px 14px; font-size: 14px; }
  .eintraege li { padding: 10px 14px; }
  .eintraege .titel { font-size: 14px; }
  .feld .werkzeug { opacity: 1; }
  /* Die Feldbeschriftung ist selbst ein Eingabefeld (umbenennen) - sie
     bleibt klein; wer sie antippt, bekommt eben den Zoom. */
  .feld > label input { font-size: 12px !important; }
}

@media (max-width: 900px) {
  .nur-schmal { display: inline-flex; }
  /* Kopf zweizeilig: oben Logo, Kunde, Menüs - darunter die Suche */
  .kopf { height: auto; flex-wrap: wrap; gap: 6px 10px; padding: 6px 10px;
          padding-top: max(6px, env(safe-area-inset-top)); }
  .logo .logo-wort { font-size: 16px; }
  .kunde-wahl { flex: 1 1 200px; min-width: 0; }
  .kundenfeld { flex: 1; min-width: 0; }
  .kundenfeld input { width: 100%; }
  .kundenliste { width: min(380px, calc(100vw - 20px)); }
  .kopf-rechts { gap: 6px; }
  .speicherstand { display: none; }
  .suche { order: 10; flex: 1 1 100%; margin-left: 0; }
  .suche > input[type="search"] { flex: 1; width: auto; min-width: 0; }
  /* Werkzeugleiste: eine Zeile, seitlich wischbar statt abgeschnitten */
  .werkzeuge { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 5px 10px;
               scrollbar-width: thin; }
  .werkzeuge > * { flex: none; }
  .werkzeuge .wachsen, .werkzeuge #mitbenutzer { display: none; }

  .raster { grid-template-columns: minmax(230px, 34%) minmax(0, 1fr); }
  .spalte-kategorien {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 45;
    width: min(300px, 84vw); transform: translateX(-102%);
    transition: transform .2s ease; box-shadow: 4px 0 24px rgba(0,0,0,.25);
    padding-top: env(safe-area-inset-top);
  }
  body.schublade-auf .spalte-kategorien { transform: none; }
  body.schublade-auf .schublade-grund {
    display: block; position: fixed; inset: 0; z-index: 44; background: rgba(20,24,22,.4);
  }
  .spalte-liste .spalte-kopf { justify-content: flex-start; gap: 8px; }
  .spalte-liste .spalte-kopf #listen-zahl { margin-left: auto; }
  .spalte-fuss { flex-wrap: wrap; }

  .detail-kopf { flex-wrap: wrap; padding: 10px 12px 4px; gap: 6px 8px; }
  .titelfeld { flex: 1 1 100%; font-size: 18px; order: 1; }
  #detail-zurueck { order: 0; }
  .detail-aktionen { order: 2; flex-wrap: wrap; }
  .detail-info { padding: 0 12px 8px; }

  /* Dialoge: fast volle Breite, nie breiter als der Bildschirm */
  .dialog { min-width: 0; width: calc(100vw - 16px); max-width: calc(100vw - 16px);
            max-height: calc(100dvh - 16px); }
  .dialog.breit, .dialog.weit, .dialog.cl-dialog, .dialog.an-dialog, .dialog.rz-dialog {
    width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
  .dialog-inhalt { padding: 12px; }
  .dialog .zweispaltig { grid-template-columns: 1fr; }
  .dialog-fuss { flex-wrap: wrap; padding: 10px 12px;
                 padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .dialog table.liste { display: block; overflow-x: auto; }
  .cl-raster { grid-template-columns: 1fr; grid-template-rows: 30vh minmax(0, 1fr); }
  .an-raster { grid-template-columns: 1fr; grid-template-rows: 30vh minmax(0, 1fr); gap: 10px; }
  .zf-raster { grid-template-columns: 1fr; }
  .klappmenue { max-height: 70vh; overflow: auto; }

  .fuss { padding-bottom: max(5px, env(safe-area-inset-bottom)); gap: 10px; }
  .fuss > span:first-child { display: none; }
  .fuss #fuss-info { overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 700px) {
  .nur-handy { display: inline-flex; }
  .kopf .knopf-text { display: none; }              /* nur ⚙ und 👤 */
  .kopf .schalter { display: none; }                  /* »alle Kunden« */
  #kunde-bearbeiten { display: none; }

  .raster { grid-template-columns: minmax(0, 1fr); }
  .spalte-detail { display: none; }
  body.mobil-detail .spalte-detail { display: flex; }
  body.mobil-detail .spalte-liste { display: none; }
  body:not(.mobil-detail) #detail-leer { display: none; }
  .feld { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 4px 0; }
  .feld > label, .feld > label input { text-align: left !important; }
  .feld > label { padding-right: 62px; }              /* Platz für die zwei Knöpfe */
  .feld .werkzeug { top: 0; transform: none; }
  .detail-fuss { padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .detail-fuss .schalter { display: none; }         /* Felder ordnen, Spalten */
  .titelfeld { flex: 1 1 160px; order: 1; }
  #detail-zurueck { order: 0; }
  .kopf .logo-pfeile, #kunde-neu { display: none; }
  .kopf { gap: 6px 8px; }
  .kunde-wahl { flex: 1 1 100px; }
  .kopf-rechts .knopf { padding: 4px 9px; }
  .dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
  .dialog.breit, .dialog.weit, .dialog.cl-dialog, .dialog.an-dialog, .dialog.rz-dialog {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; }
  .dialog-huelle { align-items: stretch; }
  .dialog { height: 100dvh; }
  .dialog-inhalt { flex: 1; }
  .anmeldekarte { width: calc(100vw - 24px); }
  .ns-titel { flex: 1 1 100% !important; }
}