/* Marhold-Design-System: ein Blau (nur Flächen), schwarze Schrift auf Weiß, eckige Formen */
:root {
  --blau: #2AABDC; --blau-hell: #DFF2FA; --blau-tief: #0E6F96; --tinte: #14181B; --leise: #5B6770; --linie: #C9D0D5; --grau: #EEF1F3; --papier: #fff;
  --rot: #B3261E; --gelb: #F2A900; --gruen: #2E7D32;
}
* { box-sizing: border-box; }
html { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; font-size: 14px; color: var(--tinte); background: var(--papier); }
body { margin: 0; }
b, strong, th, h2, h3, .knopf, legend, summary { font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
code { font-family: Menlo, Consolas, monospace; font-size: 12px; background: var(--grau); padding: 1px 4px; }

.kopf { display: flex; align-items: center; gap: 20px; background: var(--blau); padding: 12px 24px; flex-wrap: wrap; }
.logo { height: 40px; display: block; }
.kopf-titel { font-size: 20px; font-weight: 700; }
.kopf-projekt { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.netz { background: var(--tinte); color: var(--papier); padding: 4px 10px; font-weight: 700; }
.netz.ausstehend { background: var(--gelb); color: var(--tinte); }

main { padding: 20px 24px 60px; }
select, input, textarea { font: inherit; font-weight: 400; color: var(--tinte); background: var(--papier); border: 1px solid var(--tinte); border-radius: 0; padding: 6px 8px; max-width: 100%; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2314181B' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { width: 100%; resize: vertical; }
select:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, tr:focus-visible { outline: 3px solid var(--tinte); outline-offset: 1px; }

.knopf { font: inherit; font-weight: 700; color: var(--tinte); background: var(--papier); border: 1px solid var(--tinte); border-radius: 0; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.knopf:hover { background: var(--grau); }
.knopf.voll { background: var(--blau); }
.knopf.voll:hover { background: var(--blau-hell); }
.knopf[aria-pressed="true"] { background: var(--tinte); color: var(--papier); }
.knopf.klein { padding: 3px 8px; font-size: 12px; }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.karte { border: 1px solid var(--linie); padding: 12px 14px; }
.karte.gesamt { background: var(--blau-hell); border-color: var(--blau-hell); }
.karte h4 { margin: 0 0 6px; font-size: 13px; font-weight: 400; color: var(--leise); }
.karte .haupt { font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.karte .fuss { margin: 6px 0 0; color: var(--leise); font-size: 12px; }
.balken { height: 6px; background: var(--grau); margin-top: 8px; }
.balken span { display: block; height: 100%; background: var(--blau); }

.reiter { display: flex; gap: 0; border-bottom: 2px solid var(--tinte); margin-bottom: 14px; flex-wrap: wrap; }
.reiter button { font: inherit; font-weight: 700; background: none; border: 0; border-radius: 0; padding: 9px 16px; cursor: pointer; color: var(--tinte); }
.reiter button[aria-selected="true"] { background: var(--tinte); color: var(--papier); }
.zahl { display: inline-block; min-width: 18px; padding: 0 5px; background: var(--rot); color: var(--papier); font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.zahl:empty { display: none; }
.reiter button[aria-selected="true"] .zahl { background: var(--papier); color: var(--tinte); }

.leiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.leiste input[type="search"] { flex: 1 1 260px; max-width: 460px; }
.leiste label { display: flex; align-items: center; gap: 6px; }
.haken { display: flex; align-items: center; gap: 6px; }
.haken input { width: 18px; height: 18px; margin: 0; }
.abstand { flex: 1; }
.leise { color: var(--leise); }
.hinweis { color: var(--leise); margin: 0 0 12px; max-width: 80ch; }

.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--linie); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 9px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
th { background: var(--blau); position: sticky; top: 0; white-space: nowrap; }
td.z, th.z { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.klick { cursor: pointer; }
tbody tr.klick:hover td { background: var(--grau); }
td.nummer { font-weight: 700; white-space: nowrap; }
td.kennz { white-space: nowrap; }
.status { display: inline-block; padding: 1px 7px; border: 1px solid var(--linie); font-size: 12px; white-space: nowrap; }
.status.Gezogen { border-color: var(--blau); background: var(--blau-hell); }
.status.Angeklemmt { border-color: var(--blau); background: var(--blau); }
.status.Geprüft { border-color: var(--tinte); background: var(--tinte); color: var(--papier); }
.fortschritt { display: inline-flex; gap: 1px; }
.fortschritt i { display: inline-block; width: 8px; height: 14px; background: var(--grau); }
.fortschritt i.halb { background: var(--blau-hell); }
.fortschritt i.voll { background: var(--blau); }
.ader-farbe { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--linie); vertical-align: -1px; margin-right: 4px; }

.papierkorb { margin-top: 16px; color: var(--leise); }
.papierkorb div { margin-top: 8px; }
.papierkorb button { margin-left: 8px; }

/* Baustellenmodus: große Karten, große Knöpfe */
.kabel-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kkarte { border: 1px solid var(--linie); padding: 12px; display: grid; gap: 8px; }
.kkarte .kk-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kkarte .kk-nr { font-size: 22px; font-weight: 700; }
.kkarte .kk-weg { font-size: 16px; }
.kkarte .kk-weg b { font-weight: 700; }
.kkarte .kk-knoepfe { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.kkarte .kk-knoepfe .knopf { padding: 12px 6px; text-align: center; font-size: 15px; }
.kkarte .knopf[aria-pressed="true"] { background: var(--blau); color: var(--tinte); }
.kkarte .kk-adern { font-size: 12px; color: var(--leise); }
body.baustelle .reiter button:not([data-ansicht="kabel"]):not([data-ansicht="geraete"]):not([data-ansicht="klemmenplan"]):not([data-ansicht="baustand"]) { display: none; }
body.baustelle #ansicht-geraete .hinweis { display: none; }
body.baustelle main { padding: 12px; }
body.baustelle .leiste label:not(.haken) { display: none; }
body.baustelle .leiste .knopf:not(#baustelle) { display: none; }
body.baustelle #uebersicht { display: none; }
body.baustelle .leiste input[type="search"] { font-size: 18px; padding: 10px; max-width: none; }

.kp-kopf { margin-bottom: 10px; font-size: 16px; }
.kp-kopf b { font-size: 18px; }
.pruef { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--linie); cursor: pointer; }
.pruef:hover { background: var(--grau); }
.pruef .stufe { flex: 0 0 80px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pruef .stufe::before { content: ""; width: 10px; height: 10px; display: inline-block; background: var(--leise); }
.pruef.fehler .stufe::before { background: var(--rot); }
.pruef.warnung .stufe::before { background: var(--gelb); }
.pruef .kabel { flex: 0 0 120px; font-weight: 700; }

.schilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.schild { border: 1px solid var(--tinte); padding: 8px 10px; font-family: Menlo, Consolas, monospace; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.schild b { font-size: 15px; }
.schild .leise { font-family: inherit; }

.formular label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-weight: 700; }
.formular label input, .formular label select, .formular label textarea { font-weight: 400; }
.formular label small { font-weight: 300; }
.formular .haken { flex-direction: row; align-items: center; }
.formular .raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.formular .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.formular .feld { margin-bottom: 10px; }
.formular.schmal { max-width: 560px; margin-bottom: 28px; }
.knoepfe { display: flex; gap: 10px; justify-content: space-between; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.knoepfe .gruppe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.knoepfe .gruppe:last-child { margin-left: auto; }
#adern-tabelle input { width: 100%; min-width: 60px; padding: 4px 6px; }
#adern-tabelle td { padding: 4px 6px; }
#adern-tabelle td.kennung { white-space: nowrap; font-weight: 700; }
#adern-tabelle input[type="checkbox"] { width: 18px; height: 18px; }
.bereiche { list-style: none; padding: 0; margin: 0 0 10px; }
.bereiche li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--linie); }

dialog { border: 1px solid var(--tinte); border-radius: 0; padding: 20px 24px; width: min(960px, 96vw); max-height: 94vh; overflow: auto; }
dialog::backdrop { background: rgba(20, 24, 27, .4); }
#dialog-geraet, #dialog-typ, #dialog-projekt, #dialog-schnell { width: min(560px, 96vw); }

.meldung { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--tinte); color: var(--papier); padding: 10px 16px; font-weight: 700; z-index: 10; max-width: 90vw; }
.meldung button { margin-left: 12px; font: inherit; background: var(--papier); color: var(--tinte); border: 0; padding: 4px 10px; cursor: pointer; }
.leer { color: var(--leise); padding: 24px 0; }

@media (max-width: 720px) {
  main { padding: 12px; }
  .kopf { padding: 10px 12px; gap: 10px; }
  .kopf-projekt { margin-left: 0; flex: 1 1 100%; }
  .kopf-projekt select { flex: 1; }
  .reiter button { padding: 8px 10px; }
  .karten { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .formular .zwei { grid-template-columns: 1fr; }
  dialog { padding: 14px; }
  .knopf { padding: 10px 14px; }
}

@media print {
  .kopf, .reiter, .leiste, .karten, .hinweis, .papierkorb, .meldung { display: none !important; }
  main { padding: 0; }
  section[hidden] { display: none; }
  th { background: var(--grau); position: static; }
  .schilder { grid-template-columns: repeat(3, 1fr); }
  .schild { break-inside: avoid; }
}

/* Handy: Kabel zuerst, Kennzahlen und Exporte weg, Filter kompakt */
@media (max-width: 720px) {
  #uebersicht, #export-kabel, #export-adern, #projekt-neu, #anzahl, main .hinweis { display: none; }
  .leiste label:not(.haken) { font-size: 12px; }
  .leiste select { padding: 8px 6px; }
  .leiste input[type="search"] { flex-basis: 100%; max-width: none; font-size: 16px; padding: 10px; }
  .kabel-karten { grid-template-columns: 1fr; }
  .kopf-titel { font-size: 18px; }
}

/* Sortierbare Spalten */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: var(--blau-hell); }
th[data-sort].auf::after { content: " ▲"; font-size: 10px; }
th[data-sort].ab::after { content: " ▼"; font-size: 10px; }
.karte.klick { cursor: pointer; }
.karte.klick:hover { background: var(--grau); }
.karte.gesamt.klick:hover { background: var(--blau-hell); }
.fortschritt-balken { display: inline-block; width: 120px; height: 10px; background: var(--grau); vertical-align: middle; margin-right: 6px; }
.fortschritt-balken span { display: block; height: 100%; background: var(--blau); }

/* Plan */
.ebenen { display: flex; gap: 0; border: 1px solid var(--tinte); }
.ebenen button { font: inherit; font-weight: 700; background: var(--papier); border: 0; border-right: 1px solid var(--tinte); padding: 7px 14px; cursor: pointer; color: var(--tinte); }
.ebenen button:last-child { border-right: 0; }
.ebenen button[aria-selected="true"] { background: var(--tinte); color: var(--papier); }
.modus { display: flex; gap: 0; }
.modus .knopf { border-right-width: 0; }
.modus .knopf:last-child { border-right-width: 1px; }
.plan-rahmen { border: 1px solid var(--linie); background: var(--papier); overflow: hidden; touch-action: none; }
#plan { display: block; width: 100%; height: auto; max-height: 70vh; }
#plan.bearbeiten { cursor: crosshair; }
#plan.platzieren { cursor: copy; }
#plan .hull { fill: var(--grau); stroke: var(--linie); stroke-width: 2; }
#plan .bereich rect { fill: var(--blau); fill-opacity: .14; stroke: var(--blau-tief); stroke-width: 1.5; }
#plan .bereich.aktiv rect { fill-opacity: .30; stroke: var(--blau-tief); stroke-width: 4; }
#plan .bereich text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 700; fill: var(--blau-tief); pointer-events: none; }
#plan.bearbeiten .bereich rect { cursor: move; }
#plan .griff { fill: var(--papier); stroke: var(--blau-tief); stroke-width: 1.5; cursor: nwse-resize; }
#plan .kabel { fill: none; stroke-width: 3; stroke-linecap: round; cursor: pointer; }
#plan .kabel.Geplant, #plan .kabel.Bestellt, #plan .kabel.leer { stroke: #9AA5AD; }
#plan .kabel.Gezogen { stroke: var(--blau); }
#plan .kabel.Angeklemmt { stroke: var(--blau-tief); stroke-width: 4; }
#plan .kabel.Geprüft { stroke: var(--tinte); stroke-width: 4; }
#plan .kabel.fremd { stroke-dasharray: 6 5; }
#plan .kabel:hover { stroke-width: 6; }
#plan .kabel-text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--leise); pointer-events: none; }
#plan .geraet circle { fill: var(--papier); stroke: var(--tinte); stroke-width: 2; cursor: pointer; }
#plan .geraet.verteiler circle { fill: var(--tinte); }
#plan .geraet text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--tinte); pointer-events: none; paint-order: stroke; stroke: var(--papier); stroke-width: 3px; vector-effect: non-scaling-stroke; }
#plan.bearbeiten .geraet circle { cursor: move; }
#plan .entwurf { fill: var(--blau); fill-opacity: .2; stroke: var(--blau-tief); stroke-dasharray: 4 3; }
.plan-legende { font-size: 12px; color: var(--leise); margin-top: 8px; }
.plan-legende span { display: inline-flex; align-items: center; gap: 5px; }
.plan-legende .lin { display: inline-block; width: 22px; height: 3px; background: #9AA5AD; }
.plan-legende .lin.gezogen { background: var(--blau); }
.plan-legende .lin.angeklemmt { background: var(--blau-tief); height: 4px; }
.plan-legende .lin.geprueft { background: var(--tinte); height: 4px; }
.plan-legende .lin.fremd { background: repeating-linear-gradient(90deg, #9AA5AD 0 6px, transparent 6px 11px); }

/* Trassen */
#plan .trasse polyline { fill: none; stroke: #C9D0D5; stroke-width: 10; stroke-linejoin: round; stroke-linecap: round; cursor: pointer; }
#plan .trasse polyline:hover { stroke: #B5C9D6; }
#plan .trasse.aktiv polyline { stroke: var(--blau); }
#plan .trasse.aktiv text { fill: var(--blau-tief); }
#plan .geraet.aktiv circle { stroke: var(--blau-tief); stroke-width: 5; fill: var(--blau-hell); }
#plan .geraet.aktiv text { fill: var(--blau-tief); font-weight: 700; }
#plan .kabel.aktiv { stroke: var(--blau-tief) !important; stroke-width: 7 !important; }
#plan .halo { fill: none; stroke: var(--blau); stroke-width: 10; stroke-opacity: .35; pointer-events: none; }
#plan .trasse text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 700; fill: var(--leise); pointer-events: none; }
#plan .tgriff { fill: var(--papier); stroke: var(--leise); stroke-width: 1.5; cursor: move; }
#plan.trasse { cursor: crosshair; }
#plan .entwurf-linie { fill: none; stroke: var(--blau-tief); stroke-width: 3; stroke-dasharray: 6 4; }
#plan .kabel { fill: none; }
.plan-legende .lin.trasse { background: #C9D0D5; height: 6px; }
#kabel-planlaenge button { font: inherit; font-size: 11px; padding: 1px 6px; margin-left: 4px; border: 1px solid var(--tinte); background: var(--papier); cursor: pointer; }

[hidden] { display: none !important; }

#plan.verschieben { cursor: grabbing; }
#plan .geraet.schwebt circle { stroke: var(--blau-tief); stroke-width: 3; fill: var(--blau-hell); }
#plan .geraet.schwebt text { fill: var(--blau-tief); }

/* Fotos */
.fotos { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.fotos .foto { position: relative; width: 110px; height: 82px; border: 1px solid var(--linie); background: var(--grau); cursor: pointer; overflow: hidden; }
.fotos .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos .foto span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(20,24,27,.72); color: var(--papier); font-size: 11px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fotos .foto.laedt { display: flex; align-items: center; justify-content: center; color: var(--leise); font-size: 12px; }
.kkarte .fotos { margin: 0; }
.kkarte .fotos .foto { width: 72px; height: 54px; }
.kkarte .kk-knoepfe.vier { grid-template-columns: 1fr 1fr 1fr 1fr; }
.kkarte .kk-knoepfe .knopf.foto-knopf { background: var(--blau-hell); }
.lightbox { width: min(1200px, 96vw); padding: 10px; }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto 10px; }
.foto-text { font-weight: 700; }

/* Baustand */
.baustaende { display: grid; gap: 14px; }
.baustand { border: 1px solid var(--linie); padding: 14px 16px; display: grid; gap: 10px; }
.baustand .bs-kopf { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.baustand .bs-datum { font-size: 20px; font-weight: 700; }
.baustand .bs-titel { font-size: 16px; font-weight: 700; }
.baustand .bs-notiz { white-space: pre-wrap; max-width: 90ch; }
.baustand .bs-kennzahlen { display: flex; gap: 18px; flex-wrap: wrap; color: var(--leise); }
.baustand .bs-kennzahlen b { color: var(--tinte); font-size: 16px; }
.baustand table { width: auto; font-size: 12px; }
.baustand th { background: var(--grau); position: static; }
.baustand .bs-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.baustand h4 { margin: 4px 0 0; font-size: 13px; color: var(--leise); font-weight: 400; }
body.baustelle .baustand .bs-knoepfe .knopf { padding: 12px 14px; font-size: 15px; }

#plan .fang { stroke: var(--blau-tief); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }

/* System-Chips */
.chips { gap: 6px; margin-bottom: 10px; }
.chips:empty { display: none; }
.chips .chip { font: inherit; font-weight: 700; font-size: 12px; padding: 4px 10px; border: 1px solid var(--tinte); background: var(--papier); cursor: pointer; }
.chips .chip[aria-pressed="true"] { background: var(--tinte); color: var(--papier); }
.chips .chip.alle { border-color: var(--leise); color: var(--leise); }
.chips .chip.alle[aria-pressed="true"] { background: var(--leise); color: var(--papier); }
.chips .leise { font-size: 12px; }
body.baustelle .chips .chip { padding: 8px 12px; font-size: 14px; }

.anhang { margin: 6px 0 4px; }
.anhang h4 { margin: 0 0 4px; font-size: 13px; color: var(--leise); font-weight: 400; }
.anhang .liste { display: flex; flex-wrap: wrap; gap: 6px; }
.anhang .liste button { font: inherit; font-size: 12px; border: 1px solid var(--linie); background: var(--papier); padding: 3px 8px; cursor: pointer; }
.anhang .liste button b { font-weight: 700; }

#kp-tabelle tr.gruppe td { background: var(--grau); font-weight: 700; font-size: 12px; padding: 4px 9px; border-bottom: 1px solid var(--linie); }

/* Zoom: Linienstärken bleiben auf dem Bildschirm konstant */
#plan .kabel, #plan .trasse polyline, #plan .bereich rect, #plan .fang, #plan .entwurf, #plan .entwurf-linie, #plan .hull, #plan .geraet circle, #plan .griff, #plan .tgriff { vector-effect: non-scaling-stroke; }
#plan.schieben, #plan.ansehen { cursor: grab; }
#plan.ansehen .geraet circle, #plan.ansehen .kabel, #plan.ansehen .bereich rect, #plan.ansehen .trasse polyline { cursor: pointer; }
.zoom .knopf { min-width: 34px; text-align: center; }

/* Menüband (Ribbon) im Plan: feste, flache Höhe, kein Umbruch, bei Platzmangel seitlich scrollen */
.ribbon { border: 1px solid var(--tinte); margin-bottom: 10px; }
.ribbon-tabs { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--tinte); background: var(--grau); padding-right: 8px; height: 36px; }
.ribbon-tabs [role="tab"] { font: inherit; font-weight: 700; background: none; border: 0; border-right: 1px solid var(--linie); padding: 0 14px; height: 36px; cursor: pointer; color: var(--tinte); white-space: nowrap; }
.ribbon-tabs [role="tab"][aria-selected="true"] { background: var(--papier); height: 37px; margin-bottom: -1px; }
.ribbon-tabs .modus .knopf { padding: 4px 10px; }
.rib-hinweis { font-size: 11px; margin: 0 12px; text-align: right; line-height: 1.2; max-width: 46ch; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ribbon-panel { display: flex; gap: 0; flex-wrap: nowrap; overflow-x: auto; background: var(--papier); height: 62px; }
.ribbon-panel[hidden] { display: none; }
.rib-gruppe { display: flex; flex-direction: column; justify-content: space-between; padding: 6px 12px 4px; border-right: 1px solid var(--linie); flex: none; }
.rib-gruppe:last-child { border-right: 0; }
.rib-zeile { display: flex; align-items: center; gap: 8px; white-space: nowrap; height: 32px; }
.rib-zeile .knopf, .rib-zeile select, .rib-zeile .ebenen button { padding: 5px 10px; }
.rib-zeile .ebenen { height: 30px; }
.rib-zeile .haken { gap: 4px; }
.rib-titel { font-size: 10px; color: var(--leise); line-height: 1; }
.ribbon .knopf[aria-pressed="true"] { background: var(--tinte); color: var(--papier); }
.zoom-stand { min-width: 36px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .rib-hinweis { display: none; } }

/* Kästen (Verteiler, Schaltschränke, Klemmenkästen) als Rechtecke */
#plan .geraet rect { fill: var(--tinte); stroke: var(--tinte); stroke-width: 2; cursor: pointer; vector-effect: non-scaling-stroke; }
#plan .geraet.aktiv rect { fill: var(--blau-hell); stroke: var(--blau-tief); stroke-width: 5; }
#plan .geraet.schwebt rect { fill: var(--blau-hell); stroke: var(--blau-tief); stroke-width: 3; }
#plan.geraete .geraet circle, #plan.geraete .geraet rect { cursor: move; }
#plan.bereiche { cursor: crosshair; }
#plan.bereiche .bereich rect { cursor: move; }
#plan.trassen .trasse polyline { cursor: move; }

/* Schaltbild */
.sb-rahmen { border: 1px solid var(--linie); overflow: auto; max-height: 75vh; background: var(--papier); }
#schaltbild { display: block; }
#schaltbild .knoten rect { fill: var(--papier); stroke: var(--tinte); stroke-width: 1.5; cursor: pointer; }
#schaltbild .knoten.kasten rect { fill: var(--grau); stroke-width: 2.5; }
#schaltbild .knoten.quelle rect { fill: var(--blau-hell); }
#schaltbild .knoten.aktiv rect { stroke: var(--blau-tief); stroke-width: 4; }
#schaltbild .knoten text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--tinte); pointer-events: none; }
#schaltbild .knoten .kz { font-weight: 700; }
#schaltbild .knoten .nm { fill: var(--leise); }
#schaltbild .gruppe rect { fill: none; stroke: var(--blau); stroke-width: 1; stroke-dasharray: 3 3; }
#schaltbild .gruppe text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 700; fill: var(--blau-tief); }
#schaltbild .spalte { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--leise); }
#schaltbild .kante { fill: none; stroke-width: 2.5; stroke-linejoin: round; cursor: pointer; }
#schaltbild .kante.Geplant, #schaltbild .kante.Bestellt, #schaltbild .kante.leer { stroke: #9AA5AD; }
#schaltbild .kante.Gezogen { stroke: var(--blau); }
#schaltbild .kante.Angeklemmt { stroke: var(--blau-tief); stroke-width: 3.5; }
#schaltbild .kante.Geprüft { stroke: var(--tinte); stroke-width: 3.5; }
#schaltbild .kante:hover { stroke-width: 6; }
#schaltbild .kante-text { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; fill: var(--leise); pointer-events: none; paint-order: stroke; stroke: var(--papier); stroke-width: 3px; }
#schaltbild .kante-text.hover { fill: var(--blau-tief); font-weight: 700; font-size: 12px; }
#schaltbild .kante-hover { fill: none; stroke: var(--blau-tief); stroke-width: 6; stroke-linejoin: round; pointer-events: none; }
@media print { .sb-rahmen { max-height: none; overflow: visible; border: 0; } }

#plan-info .chip.klein { font-size: 11px; padding: 2px 7px; margin: 2px 0; border: 1px solid var(--tinte); background: var(--papier); cursor: pointer; font-weight: 700; }
#plan-info .chip.klein:hover { background: var(--blau-hell); }
