/* Modul netzplan – nur CSS-Variablen aus style.css verwenden (Hell/Dunkel) */
.np-tools { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-bottom: .75rem; }
.np-tools select { width: auto; max-width: min(34rem, 100%); min-width: 14rem; }
.np-tools label.chk { display: inline-flex; gap: .35rem; align-items: center; font-size: .88rem; color: var(--text); margin: 0; cursor: pointer; }
.np-tools .sep { width: 1px; align-self: stretch; background: var(--line); }

.np-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .np-wrap { grid-template-columns: minmax(0, 1fr); } }
.np-canvas { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; height: calc(100vh - 230px); min-height: 520px; }
.np-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
.np-svg.pan { cursor: grabbing; }
.np-zoom { position: absolute; right: .6rem; top: .6rem; display: flex; flex-direction: column; gap: .3rem; }
.np-zoom button { width: 2rem; height: 2rem; padding: 0; line-height: 1; font-size: 1.1rem; }
.np-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .45rem .6rem; box-shadow: var(--shadow); font-size: .82rem; max-width: 20rem; }
.np-tip[hidden] { display: none; }
.np-tip b { display: block; margin-bottom: .15rem; }

.np-side { display: flex; flex-direction: column; gap: .8rem; max-height: calc(100vh - 230px); overflow: auto; }
.np-side .panel { padding: .8rem .9rem; margin: 0; }
.np-side h3 { margin: 0 0 .4rem; font-size: .95rem; }
.np-side ol.kette { list-style: none; margin: 0; padding: 0; }
.np-side ol.kette li { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .2rem .5rem; padding: .3rem 0; border-top: 1px solid var(--line); font-size: .85rem; align-items: start; }
.np-side ol.kette li:first-child { border-top: 0; }
.np-side ol.kette .eb { color: var(--muted); font: 500 .7rem/1.6 var(--mono); text-transform: uppercase; }
.np-side ol.kette .ext { color: var(--bad); }
.np-side ul.kom { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .84rem; }
.np-side ul.kom li.krit { color: var(--bad); }
.np-legend { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .35rem .6rem; align-items: center; font-size: .82rem; }
.np-legend .ic { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: .3rem; grid-column: 1 / -1; font-size: .76rem; }
.np-legend .ic span { display: flex; align-items: center; gap: .25rem; }

/* Legenden-Mini-SVGs */
.np-legend svg.np-svg { background: none; cursor: auto; width: 44px; height: 14px; overflow: visible; }
.np-legend .ic svg.np-svg { width: 22px; height: 22px; flex: none; }

/* ---- SVG (alle Regeln unter .np-svg, damit der SVG-Export sie mitnehmen kann) ---- */
.np-svg .np-ic { color: var(--text); fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.np-svg .np-n { cursor: pointer; }
.np-svg .np-frame { fill: var(--panel); stroke: var(--line); stroke-width: 2.5; }
.np-svg .s0 .np-frame { stroke: var(--muted); stroke-dasharray: 4 3; stroke-width: 1.8; }
.np-svg .s1 .np-frame { stroke: var(--s1); }
.np-svg .s2 .np-frame { stroke: var(--s2); }
.np-svg .s3 .np-frame { stroke: var(--s3); }
.np-svg .np-n:hover .np-frame { fill: var(--panel-2); }
.np-svg .np-n.sel .np-frame { stroke-width: 4; filter: drop-shadow(0 0 4px var(--focus)); }
.np-svg .np-lbl { fill: var(--text); font: 600 11px var(--font); text-anchor: middle; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.np-svg .np-badge { fill: var(--brand); }
.np-svg .np-badget { fill: var(--brand-ink); font: 700 10px var(--font); text-anchor: middle; }
.np-svg .cia { stroke: none; fill: var(--line); }
.np-svg .cia.c1 { fill: var(--s1); }
.np-svg .cia.c2 { fill: var(--s2); }
.np-svg .cia.c3 { fill: var(--s3); }
.np-svg .np-n.ext .np-frame { fill: var(--panel-2); stroke: var(--bad); stroke-dasharray: 6 4; stroke-width: 2; }
.np-svg .np-n.gp .np-frame { fill: var(--brand-soft); stroke: var(--brand); }

.np-svg .np-bus .np-frame { fill: var(--brand-soft); }
.np-svg .np-bus:hover .np-frame { fill: var(--panel-3); }
.np-svg .np-bus.aussen .np-frame { fill: var(--bad-soft); }
.np-svg .np-buslbl { fill: var(--text); font: 600 11px var(--font); }
.np-svg .np-bus .np-ic { stroke-width: 2; }

.np-svg .np-e { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .75; }
.np-svg .np-e.krit { stroke: var(--bad); stroke-dasharray: 7 4; opacity: .95; stroke-width: 1.9; }
.np-svg .np-e:hover { stroke-width: 3; opacity: 1; }
.np-svg .np-e.pfad { stroke: var(--brand); stroke-width: 3; opacity: 1; stroke-dasharray: 9 6; animation: np-flow 1s linear infinite; }
.np-svg .np-e.pfad.krit { stroke: var(--bad); }
.np-svg .np-ar { fill: var(--muted); }
.np-svg .np-ar-k { fill: var(--bad); }
.np-svg .np-ar-p { fill: var(--brand); }
@keyframes np-flow { to { stroke-dashoffset: -30; } }
@media (prefers-reduced-motion: reduce) { .np-svg .np-e.pfad { animation: none; } }

.np-svg .np-z { stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 5 4; cursor: pointer; }
.np-svg .np-z.r { fill: var(--brand); fill-opacity: .08; }
.np-svg .np-z.g { fill: var(--muted); fill-opacity: .07; }
.np-svg .np-z.pfad { stroke: var(--brand); stroke-width: 2; fill-opacity: .16; }
.np-svg .np-zl { fill: var(--muted); font: 600 10px var(--font); text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }

.np-svg .dim { opacity: .18; }
.np-svg .np-e.dim { opacity: .08; }
.np-svg .np-z.dim { opacity: .35; }

@media print {
  .np-tools, .np-zoom, .np-side, .np-tip { display: none !important; }
  .np-wrap { display: block; }
  .np-canvas { height: 128mm; min-height: 0; border: 0; break-inside: avoid; }
  .np-svg { background: none; }
  .np-canvas, .np-svg {
    --panel: #fff; --panel-2: #f5f8fb; --panel-3: #e9eff5; --text: #1b2733; --muted: #5b6b7a; --line: #c7d0d9;
    --brand: #1f5f8b; --brand-soft: #e3eef6; --brand-ink: #fff; --bad: #a32a2a; --bad-soft: #f8e1e1;
    --s1: #2e7d32; --s2: #b26a00; --s3: #b3261e; --focus: #2b7bb9;
  }
  .np-svg .np-e.pfad { animation: none; }
}
