/* v1.9.1-dev.18 – einheitliche Bauteilnomenklatur: vollständiger Name, Kennzeichen in Klammern */
:root {
  font-size: 15px;
  color-scheme: light;
  --bg: #eef1f3;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --surface: #f6f7f8;
  --surface-2: #e5e8eb;
  --line: rgba(48, 57, 64, 0.18);
  --text: #20282e;
  --muted: #66727b;
  --accent: #0068b4;
  --accent-2: #59636b;
  --warn: #946500;
  --danger: #b64040;
  --shadow: 0 18px 50px rgba(28, 34, 39, 0.14);
  --radius: 14px;
  --topbar-h: 66px;
  --status-h: 30px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
noscript { display: block; padding: 1rem; background: #7f1d1d; }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 15, 21, 0.95);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 310px;
}
.brand--button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.brand--button:hover .brand__mark,
.brand--button:focus-visible .brand__mark {
  border-color: rgba(103, 212, 255, 0.55);
  background: rgba(103, 212, 255, 0.09);
  box-shadow: 0 0 28px rgba(103, 212, 255, 0.18);
}
.brand--button:focus-visible {
  outline: 2px solid rgba(103, 212, 255, 0.65);
  outline-offset: 6px;
  border-radius: 10px;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(103, 212, 255, 0.24);
  border-radius: 10px;
  background: rgba(103, 212, 255, 0.05);
  box-shadow: 0 0 22px rgba(103, 212, 255, 0.12);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.brand__mark img {
  display: block;
  width: 70px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.42));
}
.brand__copy { display: block; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: 0.01em; }
.brand small {
  max-width: 360px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.topbar__tools { display: flex; align-items: end; gap: 10px; }
.search { display: grid; gap: 3px; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.search input {
  width: min(34vw, 390px); height: 36px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; background: var(--surface); color: var(--text); outline: none;
}
.search input:focus { border-color: rgba(103, 212, 255, 0.62); box-shadow: 0 0 0 3px rgba(103, 212, 255, 0.10); }

.button {
  min-height: 36px; border: 1px solid rgba(103, 212, 255, 0.34); border-radius: 10px;
  padding: 0 13px; background: rgba(103, 212, 255, 0.13); cursor: pointer;
}
.button:hover { background: rgba(103, 212, 255, 0.22); }
.button--ghost { border-color: var(--line); background: var(--surface); }

.app-shell {
  height: calc(100vh - var(--topbar-h) - var(--status-h));
  display: grid; grid-template-columns: 270px minmax(380px, 1fr) 330px;
}

.panel {
  min-width: 0; padding: 15px; overflow: auto; background: var(--panel);
  scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.panel--left { border-right: 1px solid var(--line); }
.panel--right { border-left: 1px solid var(--line); }
.panel section + section { margin-top: 22px; }
.panel h2 { margin: 0 0 10px; font-size: 0.83rem; text-transform: uppercase; letter-spacing: 0.10em; color: #c6d8df; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }

.badge {
  min-width: 28px; padding: 3px 8px; border-radius: 999px; text-align: center;
  font-size: 0.74rem; color: var(--accent); background: rgba(103, 212, 255, 0.10);
}

.filter-list { display: grid; gap: 7px; }
.filter {
  display: grid; grid-template-columns: 17px 11px 1fr; align-items: center; gap: 8px;
  min-height: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,0.02); cursor: pointer; user-select: none;
}
.filter:hover { border-color: rgba(103, 212, 255, 0.28); }
.filter input { margin: 0; accent-color: var(--accent); }
.filter__swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 10px var(--swatch); }
.filter__name { font-size: 0.82rem; }

.component-list { display: grid; gap: 7px; }
.component-card {
  width: 100%; display: grid; grid-template-columns: 38px 1fr; gap: 9px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.02);
  text-align: left; cursor: pointer;
}
.component-card:hover, .component-card.is-selected { border-color: rgba(103, 212, 255, 0.55); background: rgba(103, 212, 255, 0.09); }
.component-card__code {
  display: grid; place-items: center; min-height: 32px; border-radius: 8px; background: var(--surface-2);
  color: var(--accent); font-size: 0.72rem; font-weight: 800;
}
.component-card strong { display: block; font-size: 0.81rem; }
.component-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.69rem; }

.viewport-wrap { position: relative; min-width: 0; overflow: hidden; background:
  radial-gradient(circle at 52% 48%, rgba(34, 72, 92, 0.22), transparent 50%),
  linear-gradient(180deg, #071017 0%, #09151d 100%); }
#viewport { width: 100%; height: 100%; display: block; touch-action: none; }
.viewport-toolbar {
  position: absolute; top: 13px; left: 50%; transform: translateX(-50%);
  z-index: 24;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  width: max-content; max-width: min(760px, calc(100% - 220px));
  padding: 6px; border: 1px solid var(--line); border-radius: 13px;
  background: rgba(7, 15, 21, 0.74); backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.chip {
  min-height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 0.75rem;
}
.chip:hover { color: var(--text); }
.chip.is-active { color: var(--text); border-color: var(--line); background: var(--surface); }

.loading-state {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  color: var(--muted); background: rgba(7, 15, 21, 0.88); transition: opacity .25s ease;
}
.loading-state.is-hidden { opacity: 0; pointer-events: none; }
.spinner { width: 27px; height: 27px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 370px;
  padding: 20px; border: 1px solid rgba(255,133,133,.3); border-radius: var(--radius); background: rgba(50,16,20,.9);
}
.error-card p { margin-bottom: 0; color: #ffc7c7; }

.orientation { position: absolute; right: 17px; bottom: 16px; display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: .63rem; letter-spacing: .1em; }
.orientation i { width: 1px; height: 28px; background: linear-gradient(var(--accent), transparent); }
.orientation i::before { content:""; display: block; width: 7px; height: 7px; border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); transform: translate(-3px, 0) rotate(45deg); }

.inspector { min-height: 330px; }
.empty-state { display: grid; place-items: center; padding: 40px 10px; text-align: center; color: var(--muted); }
.empty-state__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 1.4rem; }
.empty-state h2 { margin: 13px 0 6px; color: var(--text); }
.empty-state p { max-width: 230px; margin: 0; line-height: 1.5; font-size: .83rem; }

.inspector__code { color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.inspector h1 { margin: 5px 0 8px; font-size: 1.28rem; }
.inspector__desc { margin: 0 0 14px; color: #b5c7cf; line-height: 1.55; font-size: .84rem; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 13px 0; }
.fact { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.fact span, .source-card span { display: block; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.fact strong { display: block; margin-top: 4px; font-size: .78rem; }
.accuracy { display: flex; align-items: center; gap: 7px; margin: 12px 0; font-size: .77rem; color: #bdd0d8; }
.source-card { padding: 10px; border-left: 2px solid var(--accent); background: rgba(103,212,255,.06); border-radius: 0 9px 9px 0; }
.source-card strong { display: block; margin: 4px 0; font-size: .78rem; }
.source-card small { color: var(--muted); line-height: 1.45; }

.fact--wide {
  grid-column: 1 / -1;
}
.fact--wide strong {
  line-height: 1.45;
  font-weight: 600;
}

.source-disclosure {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  overflow: hidden;
}
.source-disclosure > summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
  padding: 10px 11px;
  cursor: pointer;
  list-style: none;
  color: #c4d5dc;
  user-select: none;
}
.source-disclosure > summary::-webkit-details-marker { display: none; }
.source-disclosure > summary::before {
  content: "▸";
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--accent);
  transform-origin: center;
  transition: transform 140ms ease;
}
.source-disclosure[open] > summary::before { transform: rotate(90deg); }
.source-disclosure > summary span {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.source-disclosure > summary strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 700;
}
.source-disclosure > summary small {
  grid-column: 1 / -1;
  padding-left: 17px;
  color: var(--muted);
  font-size: .65rem;
}
.source-disclosure__body {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
  border-top: 1px solid rgba(103,212,255,.10);
}
.source-disclosure__body .source-card {
  margin-top: 8px;
  padding: 8px 9px;
  background: rgba(103,212,255,.045);
}

.route-planner { border-top: 1px solid var(--line); padding-top: 18px; }
.route-planner > label:not(.toggle-row) {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  color: var(--muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.route-planner select {
  width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 9px; background: var(--surface); color: var(--text);
}
.route-hidden-toggle {
  margin-top: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}
.route-notice {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 104, 180, .22);
  border-radius: 10px;
  background: rgba(0, 104, 180, .07);
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.4;
}
.route-notice strong { color: var(--accent); font-size: .72rem; }
.route-notice--communication {
  border-color: rgba(122, 76, 170, .25);
  background: rgba(122, 76, 170, .07);
}
.route-notice--communication strong { color: #7446a0; }
.route-notice--warning {
  border-color: rgba(148, 101, 0, .28);
  background: rgba(148, 101, 0, .08);
}
.route-notice--warning strong { color: var(--warn); }
.route-actions { display: flex; gap: 7px; margin-top: 10px; }
.route-result {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: .75rem;
  line-height: 1.4;
}
.route-result li { margin: 0; }
.route-result__node > button,
.route-result__step > button:last-child {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.route-result__edge {
  display: grid;
  grid-template-columns: 12px auto;
  gap: 0 5px;
  width: 100%;
  border: 0;
  padding: 2px 6px 4px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.route-result__edge > span { grid-row: 1 / span 2; align-self: center; color: var(--accent); }
.route-result__edge strong { color: var(--accent); font-size: .66rem; font-weight: 700; }
.route-result__edge small {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .62rem;
}
.route-result__empty {
  padding: 8px 9px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: .68rem;
}
.button.is-disabled { opacity: .58; }

.statusbar {
  height: var(--status-h); display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 13px; border-top: 1px solid var(--line); background: #071017; color: var(--muted); font-size: .67rem;
}
.statusbar__legend { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; margin-left: 9px; border-radius: 50%; }
.dot--exact { background: var(--accent-2); }
.dot--placed { background: var(--warn); }
.dot--schematic { background: var(--accent); }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 225px minmax(330px, 1fr) 290px; }
}
@media (max-width: 820px) {
  html, body { overflow: auto; }
  .topbar { position: sticky; top: 0; z-index: 10; height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding-block: 10px; }
  .topbar__tools { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .app-shell { height: auto; min-height: calc(100vh - 130px); grid-template-columns: 1fr; }
  .panel--left, .panel--right { border: 0; }
  .panel--left { order: 2; }
  .viewport-wrap { order: 1; height: 60vh; min-height: 430px; }
  .panel--right { order: 3; }
  .statusbar { position: sticky; bottom: 0; }
  .statusbar__legend { display: none; }
}


/* v0.2 – Varianten, Topologie und Quellenregister */
.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field-control {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}
.helper-text {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.45;
}
.text-button {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.69rem;
  cursor: pointer;
}
.text-button:hover { text-decoration: underline; }

.viewport-wrap { isolation: isolate; }
.view-layer {
  position: absolute;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity 140ms ease;
}
.view-layer.is-active {
  visibility: visible;
  opacity: 1;
}
.view-switch {
  position: absolute;
  z-index: 25;
  top: 13px;
  left: 13px;
  display: flex;
  padding: 5px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 15, 21, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.view-switch__button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.view-switch__button.is-active {
  color: #06131a;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  font-weight: 700;
}
.viewport-toolbar { top: 13px; }

.topology-layer {
  padding: 68px 14px 14px;
  background:
    radial-gradient(circle at 50% 45%, rgba(42, 97, 122, 0.18), transparent 58%),
    linear-gradient(180deg, #071017, #09151d);
}
.topology-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 10px 9px;
}
.topology-header strong,
.topology-header small { display: block; }
.topology-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}
.topology-scroller {
  height: calc(100% - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(rgba(120, 190, 220, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 220, 0.035) 1px, transparent 1px),
    rgba(5, 14, 20, 0.74);
  background-size: 24px 24px;
}
#topologySvg {
  display: block;
  width: max(100%, 1600px);
  height: 1160px;
  min-height: 100%;
}
.topology-edge {
  fill: none;
  opacity: 0.68;
  cursor: pointer;
  transition: opacity 120ms ease, stroke-width 120ms ease;
}
.topology-edge:hover {
  opacity: 1;
  stroke-width: 8px;
}
.topology-edge.accuracy-schematic_route { stroke-dasharray: 8 6; }
.topology-edge.is-muted { opacity: 0.07; }
.topology-edge.is-route {
  opacity: 1;
  stroke-width: 9px;
  filter: url(#nodeGlow);
}
.topology-node {
  cursor: pointer;
  transition: opacity 120ms ease;
}
.topology-node rect {
  transition: transform 120ms ease, fill 120ms ease, stroke-width 120ms ease;
  transform-box: fill-box;
  transform-origin: center;
}
.topology-node:hover rect { transform: scale(1.06); }
.topology-node.is-selected rect {
  fill: #193746;
  stroke-width: 5;
  filter: url(#nodeGlow);
}
.topology-node.is-route rect {
  fill: #173647;
  stroke-width: 4;
}
.topology-node.is-muted { opacity: 0.18; }
.topology-node__code {
  fill: #effaff;
  font: 800 15px/1 system-ui, sans-serif;
}
.topology-node__name {
  fill: #a9bec8;
  font: 11px/1 system-ui, sans-serif;
}

.related-block {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}
.related-block > span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.related-link {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.related-link:hover {
  border-color: rgba(103, 212, 255, 0.5);
  background: rgba(103, 212, 255, 0.08);
}
.related-link strong { color: var(--accent); font-size: 0.76rem; }
.related-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}
.related-link small { color: var(--muted); font-size: 0.64rem; }

.related-link--indirect {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  border-style: dashed;
  background: rgba(103, 212, 255, 0.035);
}
.related-link--indirect strong {
  color: #8bc7df;
  font-size: 0.66rem;
}
.indirect-block {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,0.018);
}
.indirect-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
}
.indirect-block > summary small {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(103, 212, 255, 0.12);
  color: var(--accent);
  text-align: center;
  font-size: 0.62rem;
}
.indirect-block > p {
  margin: 0;
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}
.indirect-block__list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}

.route-result button:hover {
  border-color: rgba(0, 104, 180, .42);
  color: var(--accent);
}

.source-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: #0b1821;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
}
.source-dialog::backdrop {
  background: rgba(2, 8, 12, 0.78);
  backdrop-filter: blur(5px);
}
.source-dialog__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 20, 28, 0.97);
}
.source-dialog__header strong,
.source-dialog__header small { display: block; }
.source-dialog__header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}
.source-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.source-entry {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.025);
}
.source-entry span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.source-entry strong { font-size: 0.88rem; }
.source-entry p {
  margin: 7px 0;
  color: #c5d5dc;
  font-size: 0.76rem;
  line-height: 1.5;
}
.source-entry dl {
  display: grid;
  gap: 4px;
  margin: 0;
}
.source-entry dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
}
.source-entry dt,
.source-entry dd {
  margin: 0;
  font-size: 0.68rem;
}
.source-entry dt { color: var(--muted); }
.source-entry dd { color: #dbe8ed; }

@media (max-width: 980px) {
  .view-switch {
    left: 50%;
    transform: translateX(-50%);
  }
  .viewport-toolbar {
    top: 58px;
  }
  .topology-layer { padding-top: 110px; }
}

@media (max-width: 720px) {
  .topbar__tools .button { padding: 0 8px; }
  #sourceRegisterButton { display: none; }
  .view-switch__button { padding: 0 8px; font-size: 0.72rem; }
}


/* v0.3 – Raumstruktur, Kabelkorridore und Schnittansicht */
.model-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}
.model-stats span {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,0.025);
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.3;
}
.model-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 0.92rem;
}

.viewport-toolbar {
  max-width: calc(100% - 310px);
  flex-wrap: wrap;
  justify-content: center;
  z-index: 24;
}
.camera-presets {
  position: absolute;
  z-index: 24;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  max-width: min(510px, calc(100% - 110px));
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(7, 15, 21, 0.76);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.mini-chip {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(20, 37, 48, 0.88);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
}
.mini-chip:hover,
.mini-chip:focus-visible {
  color: var(--text);
  border-color: rgba(103, 212, 255, 0.45);
  background: rgba(103, 212, 255, 0.12);
}

.cutaway-panel {
  padding-top: 2px;
}
.cutaway-panel label,
.cutaway-grid label {
  color: var(--muted);
  font-size: 0.68rem;
}
.cutaway-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 10px;
}
.cutaway-grid select,
.route-planner select {
  width: 100%;
  min-height: 34px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--text);
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
}
.toggle-row input {
  accent-color: var(--accent);
}
.toggle-row--compact {
  min-height: 24px;
}
.range-field {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.preset-grid .mini-chip {
  width: 100%;
}
.dot--channel {
  background: #44c7c0;
  box-shadow: 0 0 9px rgba(68, 199, 192, 0.75);
}

@media (max-width: 1180px) {
  .viewport-toolbar {
    top: 58px;
    max-width: calc(100% - 28px);
  }
}
@media (max-width: 820px) {
  .viewport-toolbar {
    top: 58px;
    max-width: calc(100% - 20px);
  }
  .camera-presets {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}


/* Fahrzeugdarstellung und beschriftungsarme 3D-Ansicht */
.vehicle-display-panel {
  padding-top: 2px;
}
.control-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}
.vehicle-display-panel .range-field {
  margin-top: 2px;
}
.vehicle-display-panel .range-field span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.68rem;
}
.vehicle-display-panel .range-field strong {
  color: var(--accent);
  font-weight: 700;
}
.field-stack {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.68rem;
}
.field-stack select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--text);
}


/* v0.5 – Einbauort-Zonen, Systemfokus und korridorgeführte Leitungen */
.focus-control,
.location-focus-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.focus-control .field-stack,
.location-focus-panel .field-stack {
  margin-top: 0;
}
.focus-control .route-actions,
.location-focus-panel .route-actions {
  margin-top: 8px;
}
.button--wide {
  width: 100%;
  margin-top: 8px;
}
.related-link--static {
  cursor: default;
  opacity: 0.72;
}
.related-link--static:hover {
  border-color: var(--line);
  background: rgba(255,255,255,0.025);
}
.viewport-toolbar .chip {
  white-space: nowrap;
}
.location-focus-panel .helper-text {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .viewport-toolbar {
    max-width: calc(100% - 20px);
  }
}


/* v0.6 – Leitungsanalyse, Pfadfluss und kompakter Arbeitsbereich */
:root {
  --left-panel-w: 270px;
  --right-panel-w: 330px;
}

.app-shell {
  grid-template-columns: var(--left-panel-w) minmax(380px, 1fr) var(--right-panel-w);
  transition: grid-template-columns .2s ease;
}

.topbar__panel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.button--compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: .72rem;
}

.button.is-active,
.button[aria-pressed="true"] {
  border-color: rgba(103, 212, 255, .62);
  background: rgba(103, 212, 255, .18);
  color: #f2fbff;
}

body.left-panel-collapsed {
  --left-panel-w: 0px;
}

body.right-panel-collapsed {
  --right-panel-w: 0px;
}

body.left-panel-collapsed .panel--left,
body.right-panel-collapsed .panel--right {
  min-width: 0;
  width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.panel--left,
.panel--right {
  transition: opacity .18s ease, padding .18s ease;
}

.scene-tooltip {
  position: absolute;
  z-index: 30;
  max-width: 320px;
  pointer-events: none;
  transform: translate(14px, 14px);
  padding: 9px 11px;
  border: 1px solid rgba(103, 212, 255, .34);
  border-radius: 10px;
  background: rgba(5, 13, 18, .94);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .42);
  color: var(--text);
  font-size: .73rem;
  line-height: 1.4;
  backdrop-filter: blur(12px);
}

.scene-tooltip strong,
.scene-tooltip span,
.scene-tooltip small {
  display: block;
}

.scene-tooltip strong {
  margin-bottom: 2px;
  color: #effaff;
}

.scene-tooltip span {
  color: #bed1d9;
}

.scene-tooltip small {
  margin-top: 3px;
  color: var(--muted);
}

.endpoint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 13px 0;
}

.endpoint-card {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.endpoint-card:hover {
  border-color: rgba(103, 212, 255, .48);
  background: rgba(103, 212, 255, .08);
}

.endpoint-card span,
.endpoint-card small {
  display: block;
}

.endpoint-card span {
  color: var(--muted);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.endpoint-card strong {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: .8rem;
}

.endpoint-card small {
  margin-top: 3px;
  color: #c4d5dc;
  font-size: .7rem;
  line-height: 1.35;
}

.spec-table {
  display: grid;
  gap: 1px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(100px, .78fr) minmax(0, 1.22fr);
  gap: 10px;
  padding: 8px 10px;
  background: rgba(12, 25, 34, .96);
}

.spec-row span {
  color: var(--muted);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.spec-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #dcebf0;
  font-size: .74rem;
  font-weight: 600;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(103, 212, 255, .26);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(103, 212, 255, .08);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.connection-badge i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--wire-color, var(--accent));
  box-shadow: 0 0 9px var(--wire-color, var(--accent));
}

.related-link[data-connection-id] {
  cursor: pointer;
}

.topology-edge.is-selected {
  opacity: 1 !important;
  filter: url(#nodeGlow);
  stroke-width: 8 !important;
}

.dot--flow {
  background: #f7fbff;
  box-shadow: 0 0 8px #67d4ff;
}

#viewport {
  cursor: grab;
  touch-action: none;
}

#viewport.is-interactive {
  cursor: pointer;
}

#viewport.is-navigating,
#viewport.is-navigating.is-interactive {
  cursor: grabbing;
}

body.is-fullscreen .topbar {
  background: rgba(5, 12, 17, .98);
}

@media (max-width: 1280px) {
  .topbar__panel-controls .button--compact {
    padding-inline: 8px;
  }

  .topbar__tools {
    gap: 6px;
  }

  .search input {
    width: min(26vw, 310px);
  }
}

@media (max-width: 1050px) {
  :root {
    --left-panel-w: 225px;
    --right-panel-w: 290px;
  }
}

@media (max-width: 820px) {
  :root {
    --left-panel-w: 1fr;
    --right-panel-w: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar__panel-controls {
    order: 3;
    width: 100%;
  }

  body.left-panel-collapsed .panel--left,
  body.right-panel-collapsed .panel--right {
    display: none;
  }
}


/* v0.6.1 · eindeutige Fahrzeugseiten und entzerrte Beschriftungen */
.view-side-indicator {
  position: absolute;
  z-index: 25;
  right: 18px;
  top: 76px;
  display: grid;
  min-width: 220px;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(103, 212, 255, 0.26);
  border-radius: 10px;
  background: rgba(7, 15, 21, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.view-side-indicator strong {
  color: var(--text);
  font-size: 0.74rem;
}
.view-side-indicator span {
  color: var(--accent);
  font-size: 0.66rem;
}

.side-legend {
  display: grid;
  gap: 6px;
  margin: 11px 0;
}
.side-legend span {
  display: block;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}
.side-legend strong {
  display: inline-block;
  min-width: 28px;
  margin-right: 4px;
}
.side-legend__left strong { color: var(--accent); }
.side-legend__right strong { color: var(--warn); }

.side-evidence {
  margin: -3px 0 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--warn);
  border-radius: 0 8px 8px 0;
  background: rgba(248, 207, 100, 0.06);
  color: #c8d6dc;
  font-size: 0.72rem;
  line-height: 1.45;
}
.side-evidence strong { color: var(--warn); }


/* v1.9.0-rc.9 – Massepunkt-44-Topologie und Massepfad-Arbeitsplatz */
.knowledge-note {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(248, 207, 100, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(248, 207, 100, 0.10), rgba(103, 212, 255, 0.045));
  color: #d7e4e9;
}
.knowledge-note__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 7px;
}
.knowledge-note__header span {
  color: var(--warn);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.knowledge-note__header strong {
  padding: 3px 7px;
  border: 1px solid rgba(103, 212, 255, 0.24);
  border-radius: 999px;
  background: rgba(103, 212, 255, 0.07);
  color: var(--accent);
  font-size: .62rem;
  font-weight: 700;
}
.knowledge-note h2 {
  margin: 0 0 7px;
  color: #f4f8fa;
  font-size: .90rem;
  line-height: 1.25;
}
.knowledge-note > p {
  margin: 0 0 10px;
  color: #c7d7de;
  font-size: .75rem;
  line-height: 1.5;
}
.knowledge-note__column {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(103, 212, 255, 0.12);
}
.knowledge-note__column h3 {
  margin: 0 0 5px;
  color: #9fe4b7;
  font-size: .68rem;
  letter-spacing: .02em;
}
.knowledge-note__column--limits h3 {
  color: var(--warn);
}
.knowledge-note__column ul {
  margin: 0;
  padding-left: 17px;
}
.knowledge-note__column li {
  margin: 4px 0;
  color: #bfd0d7;
  font-size: .70rem;
  line-height: 1.45;
}


.camera-presets {
  max-width: min(680px, calc(100% - 110px));
}

@media (max-width: 900px) {
  .view-side-indicator {
    right: 10px;
    top: 70px;
    min-width: 0;
    max-width: 210px;
  }
  .view-side-indicator span { display: none; }
}


/* v0.8 – quellengebundener Stecker-/Pin-Modus */
.pin-detail-toggle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.pin-dialog {
  width: min(1120px, calc(100vw - 28px));
}

.pin-dialog__filter {
  position: sticky;
  top: 65px;
  z-index: 2;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 20, 28, 0.97);
}

.search--dialog {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
}

.search--dialog input {
  width: 100%;
}

.pin-register {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.pin-register-entry {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.024);
}

.pin-register-entry__heading {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(103, 212, 255, 0.055);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.pin-register-entry__heading:hover {
  background: rgba(103, 212, 255, 0.11);
}

.pin-register-entry__heading span {
  color: var(--accent);
  font-weight: 800;
}

.pin-register-entry__heading strong {
  font-size: 0.82rem;
}

.pin-register-entry__heading small {
  color: var(--muted);
  font-size: 0.66rem;
}

.pin-block {
  margin: 13px 0;
}

.pin-block__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.pin-block__heading span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pin-block__heading small {
  color: var(--accent);
  font-size: 0.64rem;
}

.pin-table {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.pin-row {
  display: grid;
  grid-template-columns: 22px minmax(74px, 0.55fr) minmax(150px, 1.35fr) minmax(150px, 1.2fr) minmax(160px, 1.35fr) 50px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  padding: 8px 10px;
  background: #0d1d27;
  color: var(--text);
  text-align: left;
  font: inherit;
}

button.pin-row {
  width: 100%;
  cursor: pointer;
}

.pin-row.is-actionable:hover {
  background: rgba(103, 212, 255, 0.085);
}

.pin-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pin-row__pin {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.pin-row__function {
  color: #e2edf1;
  font-size: 0.72rem;
  font-weight: 650;
}

.pin-row__wire,
.pin-row__target {
  color: #b8cbd3;
  font-size: 0.68rem;
  line-height: 1.35;
}

.pin-row__confidence {
  justify-self: end;
  padding: 3px 5px;
  border-radius: 999px;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.confidence-high {
  color: #98ecc0;
  background: rgba(75, 190, 125, 0.12);
}

.confidence-medium {
  color: var(--warn);
  background: rgba(248, 207, 100, 0.12);
}

.confidence-unknown {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.pin-row > small {
  grid-column: 3 / -1;
  color: var(--warn);
  font-size: 0.63rem;
  line-height: 1.35;
}

.pin-row--compact {
  grid-template-columns: 20px minmax(68px, 0.55fr) minmax(120px, 1.2fr);
  border-radius: 0;
}

.pin-row--compact .pin-row__wire,
.pin-row--compact .pin-row__target {
  grid-column: 2 / -1;
}

.pin-row--compact .pin-row__confidence {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
}

.wire-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background:
    linear-gradient(135deg,
      var(--wire-primary, #71808a) 0 46%,
      var(--wire-secondary, #71808a) 46% 54%,
      var(--wire-primary, #71808a) 54% 100%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--wire-primary, #71808a) 35%, transparent);
}

.conductor-block {
  display: grid;
  gap: 1px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.conductor-block > span {
  padding: 7px 9px;
  background: rgba(103, 212, 255, 0.07);
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.conductor-row {
  display: grid;
  grid-template-columns: 20px 78px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  background: #0d1d27;
}

.conductor-row strong {
  color: var(--accent);
  font-size: 0.7rem;
}

.conductor-row span {
  min-width: 0;
  color: #d4e1e6;
  font-size: 0.68rem;
}

.conductor-row small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.62rem;
}

.topology-edge-label {
  fill: #dbeaf0;
  stroke: rgba(5, 13, 18, 0.95);
  stroke-width: 4px;
  paint-order: stroke fill;
  font: 600 9px/1 system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}

.topology-edge-label:hover {
  fill: var(--accent);
  font-weight: 800;
}

.pin-register-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  #pinRegisterButton {
    display: none;
  }

  .pin-row {
    grid-template-columns: 20px 72px minmax(0, 1fr);
  }

  .pin-row__wire,
  .pin-row__target,
  .pin-row__confidence {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .pin-register-entry__heading {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .pin-register-entry__heading small {
    grid-column: 2;
  }
}


/* v0.9 – Systemregister und zuschaltbare Sensorik */
.detail-level-control {
  margin-top: 10px;
}

.system-dialog {
  width: min(1080px, calc(100vw - 32px));
}

.system-register {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.system-entry {
  --system-color: var(--accent);
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--system-color) 34%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--system-color) 8%, transparent), transparent 58%),
    rgba(255,255,255,0.022);
}

.system-entry__head {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: start;
  gap: 10px;
}

.system-entry__head > i {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--system-color);
  box-shadow: 0 0 15px color-mix(in srgb, var(--system-color) 70%, transparent);
}

.system-entry__head strong,
.system-entry__head small {
  display: block;
}

.system-entry__head strong {
  font-size: 0.92rem;
}

.system-entry__head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.system-entry__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.system-entry__stats span {
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.62rem;
  text-align: center;
}

.system-entry__stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.84rem;
}

.system-entry__coverage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.65rem;
}

.system-entry__coverage > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}

.system-entry__coverage > div i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--system-color);
}

.system-entry__coverage strong {
  color: var(--text);
  font-size: 0.68rem;
}

.system-entry > p {
  margin: 0;
  color: #bfd0d8;
  font-size: 0.68rem;
  line-height: 1.45;
}

.system-entry__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.system-entry__actions .button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 0.68rem;
}

@media (max-width: 850px) {
  .system-register {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #systemRegisterButton { display: none; }
}


/* v1.1 – Studioqualität und formnahe Technikbauteile */
.render-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.render-controls-grid .field-stack {
  margin-top: 10px;
}
@media (min-width: 1500px) {
  .render-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
#viewport {
  image-rendering: auto;
}


.about-dialog {
  width: min(960px, calc(100vw - 32px));
}
.about-dialog__body {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(320px, 1.12fr);
  min-height: 390px;
}
.about-dialog__hero {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 52% 38%, rgba(103, 212, 255, 0.15), transparent 43%),
    linear-gradient(160deg, rgba(103, 212, 255, 0.06), rgba(7, 15, 21, 0.2));
}
.about-dialog__hero img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
}
.about-dialog__content {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 28px;
  color: var(--text);
}
.about-dialog__content > p {
  margin: 0;
  color: #c9d8df;
  line-height: 1.65;
}
.about-dialog__grid {
  display: grid;
  gap: 10px;
}
.about-dialog__grid article {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(103, 212, 255, 0.04);
}
.about-dialog__grid strong {
  color: var(--accent);
}
.about-dialog__grid span {
  color: var(--muted);
  line-height: 1.45;
}
.about-dialog__note {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted) !important;
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .brand {
    min-width: 0;
  }
  .brand__mark {
    width: 58px;
  }
  .brand__mark img {
    width: 54px;
  }
  .brand small {
    max-width: 240px;
  }
}

@media (max-width: 760px) {
  .about-dialog__body {
    grid-template-columns: 1fr;
  }
  .about-dialog__hero {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .about-dialog__hero img {
    max-height: 210px;
  }
}


/* v1.5.0 · Bauteil-Arbeitsplatz */
.inspection-workbench {
  margin: 12px 0 14px;
  padding: 11px;
  border: 1px solid rgba(103, 212, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(103, 212, 255, 0.055), rgba(255,255,255,0.018)),
    rgba(5, 14, 20, 0.42);
}
.inspection-workbench__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.inspection-workbench__heading span {
  color: #d9f5ff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.inspection-workbench__heading small {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
}
.inspection-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.inspection-actions .button {
  min-width: 0;
  justify-content: center;
}
.inspection-wire-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: #b9ccd4;
  font-size: .71rem;
  cursor: pointer;
}
.inspection-wire-toggle input {
  accent-color: var(--accent);
}
.inspection-context-grid {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}
.inspection-context-grid > div {
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  background: rgba(0,0,0,.12);
}
.inspection-context-grid span,
.inspection-context-grid strong,
.inspection-context-grid small {
  display: block;
}
.inspection-context-grid span {
  color: var(--muted);
  font-size: .61rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.inspection-context-grid strong {
  margin-top: 3px;
  color: #d9eaf0;
  font-size: .72rem;
  line-height: 1.35;
}
.inspection-context-grid small {
  margin-top: 3px;
  color: #8299a3;
  font-size: .62rem;
  line-height: 1.35;
}
@media (max-width: 1180px) {
  .inspection-actions {
    grid-template-columns: 1fr;
  }
}


/* v1.6.0 · Light Theme und ruhige Arbeitsoberfläche */
html, body {
  background: var(--bg);
  color: var(--text);
}
::selection {
  background: rgba(0, 104, 180, 0.18);
}
.topbar,
body.is-fullscreen .topbar {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(43, 72, 87, 0.06);
}
.brand__mark {
  border-color: rgba(0, 104, 180, 0.20);
  background: rgba(0, 104, 180, 0.045);
  box-shadow: 0 5px 18px rgba(39, 76, 94, 0.10);
}
.brand--button:hover .brand__mark,
.brand--button:focus-visible .brand__mark {
  border-color: rgba(0, 104, 180, 0.42);
  background: rgba(0, 104, 180, 0.085);
  box-shadow: 0 6px 24px rgba(0, 104, 180, 0.14);
}
.search input,
.field-control,
.button--ghost {
  background: #ffffff;
  color: var(--text);
}
.search input:focus,
.field-control:focus {
  border-color: rgba(0, 104, 180, 0.58);
  box-shadow: 0 0 0 3px rgba(0, 104, 180, 0.10);
}
.button {
  border-color: rgba(0, 104, 180, 0.28);
  background: rgba(0, 104, 180, 0.09);
}
.button:hover,
.button.is-active {
  background: rgba(0, 104, 180, 0.16);
}
.panel {
  background: rgba(255, 255, 255, 0.92);
}
.panel h2,
.inspector h1,
.source-dialog strong {
  color: #243943;
}
.filter,
.component-card,
.fact,
.related-link,
.endpoint-card,
.source-entry,
.pin-register-entry,
.system-entry,
.side-legend span {
  background: rgba(247, 250, 252, 0.96);
}
.filter:hover,
.component-card:hover,
.related-link:hover,
.endpoint-card:hover {
  border-color: rgba(0, 104, 180, 0.30);
  background: rgba(0, 104, 180, 0.055);
}
.component-card.is-selected {
  background: rgba(0, 104, 180, 0.10);
}
.viewport-toolbar,
.view-switch,
.loading-state,
.view-side-indicator,
.scene-tooltip {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(43, 72, 87, 0.18);
  box-shadow: 0 14px 34px rgba(31, 48, 58, 0.14);
}
.scene-tooltip strong,
.topology-node__code,
.inspection-workbench__heading span {
  color: #16303b;
}
.scene-tooltip span,
.route-result,
.endpoint-card small,
.source-entry p,
.source-entry dd,
.spec-row strong,
.pin-row__function,
.pin-row__wire,
.pin-row__target,
.conductor-row span,
.system-entry > p,
.about-dialog__content > p,
.side-evidence,
.inspection-wire-toggle,
.inspection-context-grid strong,
.inspection-context-grid small {
  color: #4d626d;
}
.spec-row,
.pin-row,
.conductor-row {
  background: #f7fafc;
}
.source-dialog {
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(31, 48, 58, 0.22);
}
.source-dialog::backdrop {
  background: rgba(48, 64, 72, 0.34);
}
.source-dialog__header,
.pin-dialog__filter {
  background: rgba(255, 255, 255, 0.98);
}
.topology-node.is-selected rect {
  fill: #d9edf6;
}
.topology-node.is-route rect {
  fill: #dff1ee;
}
.topology-node__code {
  fill: #16303b;
}
.topology-node__name {
  fill: #5f727d;
}
.topology-edge-label {
  fill: #304852;
  stroke: rgba(255, 255, 255, 0.96);
}
.statusbar {
  background: rgba(255, 255, 255, 0.96);
  color: #536873;
}
.about-dialog__hero {
  background:
    radial-gradient(circle at 52% 38%, rgba(0, 104, 180, 0.12), transparent 43%),
    linear-gradient(160deg, rgba(0, 104, 180, 0.05), rgba(232, 239, 243, 0.45));
}
.inspection-workbench {
  border-color: rgba(0, 104, 180, 0.18);
  background:
    linear-gradient(145deg, rgba(0, 104, 180, 0.055), rgba(255,255,255,0.72)),
    rgba(245, 249, 251, 0.92);
}
.inspection-context-grid > div {
  border-color: rgba(43, 72, 87, 0.12);
  background: rgba(255, 255, 255, 0.72);
}
.inspection-toggles {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}
.inspection-toggles .inspection-wire-toggle {
  margin-top: 0;
  background: rgba(0, 104, 180, 0.045);
}
.inspection-wire-toggle span small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .61rem;
  line-height: 1.3;
}
.inspection-wire-toggle:has(input:disabled) {
  opacity: .52;
  cursor: not-allowed;
}
.error-card {
  background: #fff3f3;
  border-color: rgba(182, 64, 64, 0.26);
}
.error-card p {
  color: #8d3535;
}
.dot--flow {
  background: #ffffff;
}

.view-switch {
  background: rgba(255, 255, 255, 0.94);
}
.view-switch__button.is-active {
  color: #ffffff;
  background: linear-gradient(145deg, #0068b4, #16856d);
}
.topology-layer {
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 104, 180, 0.10), transparent 58%),
    linear-gradient(180deg, #f7fafc, #eaf0f3);
}
.topology-scroller {
  background:
    linear-gradient(rgba(43, 72, 87, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 72, 87, 0.055) 1px, transparent 1px),
    rgba(255, 255, 255, 0.76);
  background-size: 24px 24px;
}


/* v1.9.0-rc.1 · quellengebundener Sicherungs-/Relaisdialog */
.protection-dialog {
  width: min(1240px, calc(100vw - 32px));
  max-width: 1240px;
  max-height: min(900px, calc(100vh - 32px));
  padding: 0;
}

.protection-dialog__notice {
  margin: 14px 18px 0;
  padding: 11px 13px;
  border: 1px solid rgba(148, 101, 0, 0.24);
  border-radius: 10px;
  background: rgba(248, 207, 100, 0.13);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.protection-dialog__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 16px;
  min-height: 0;
  padding: 16px 18px 20px;
}

.protection-panel-visual {
  display: grid;
  gap: 16px;
  min-width: 0;
  overflow: auto;
  padding: 2px 4px 10px 2px;
}

.protection-section {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.protection-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.protection-section__heading h3 {
  margin: 0;
  font-size: 0.95rem;
}

.protection-section__heading small {
  color: var(--muted);
  font-size: 0.72rem;
}

.protection-grid {
  --protection-columns: 1;
  display: grid;
  grid-template-columns: repeat(var(--protection-columns), minmax(44px, 1fr));
  gap: 7px;
  min-width: calc(var(--protection-columns) * 51px);
}

.protection-device {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 6px 4px;
  border: 1px solid rgba(43, 72, 87, 0.28);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.protection-device strong {
  font-size: 0.88rem;
  line-height: 1;
}

.protection-device span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.protection-device:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 104, 180, 0.65);
}

.protection-device:focus-visible {
  outline: 3px solid rgba(0, 104, 180, 0.38);
  outline-offset: 2px;
}

.protection-device.is-selected {
  border-color: var(--accent);
  background: rgba(0, 104, 180, 0.1);
  box-shadow: 0 0 0 2px rgba(0, 104, 180, 0.16);
}

.protection-device--relay {
  min-height: 68px;
}

.protection-device--not_fitted,
.protection-device--not_documented {
  border-style: dashed;
  background: rgba(97, 116, 126, 0.06);
}

.protection-device--not_fitted {
  opacity: 0.68;
}

.protection-device--variant_dependent::after {
  content: "V";
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--warn);
  font-size: 0.58rem;
  font-weight: 800;
}

.protection-device--spacer {
  visibility: hidden;
  pointer-events: none;
}

.protection-device-details {
  min-width: 0;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-strong);
}

.protection-detail__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.protection-detail__title h3 {
  margin: 3px 0 0;
  font-size: 1.2rem;
}

.protection-detail__label {
  margin: 10px 0 14px;
  font-weight: 700;
  line-height: 1.35;
}

.protection-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.protection-status--verified {
  border-color: rgba(22, 133, 109, 0.34);
  color: var(--accent-2);
}

.protection-status--variant_dependent {
  border-color: rgba(148, 101, 0, 0.34);
  color: var(--warn);
}

.protection-consumers,
.protection-components {
  margin-top: 14px;
}

.protection-consumers h4,
.protection-components h4 {
  margin: 0 0 7px;
  font-size: 0.78rem;
}

.protection-consumers ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.protection-consumers li + li {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .protection-dialog__workspace {
    grid-template-columns: 1fr;
  }

  .protection-device-details {
    max-height: 310px;
  }
}

@media (max-width: 620px) {
  .protection-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .protection-dialog__notice {
    margin-inline: 10px;
  }

  .protection-dialog__workspace {
    padding: 12px 10px 16px;
  }

  .protection-section {
    padding: 10px;
  }
}


.protection-register-launch {
  width: 100%;
  margin-top: 10px;
}


.ground44-dialog-launch {
  margin-top: 0.55rem;
}

.ground-path-action {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(0, 104, 180, 0.22);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(0, 104, 180, 0.08), rgba(22, 133, 109, 0.05));
}

.ground-path-action > div:first-child {
  display: grid;
  gap: 0.24rem;
}

.ground-path-action span,
.ground44-details__title span,
.ground44-route-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ground-path-action strong {
  font-size: 0.86rem;
  line-height: 1.45;
}

.ground-path-action small {
  color: var(--muted);
  line-height: 1.45;
}

.ground-path-action__buttons,
.ground44-details__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ground44-dialog {
  width: min(1240px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.ground44-dialog__notice {
  margin: 0 1rem 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(148, 101, 0, 0.25);
  border-radius: 10px;
  background: rgba(148, 101, 0, 0.07);
  color: var(--muted);
  line-height: 1.5;
}

.ground44-dialog__notice strong {
  color: var(--text);
}

.ground44-dialog__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 1rem;
  min-height: 560px;
  padding: 0 1rem 1rem;
}

.ground44-map,
.ground44-details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.ground44-map {
  overflow: auto;
  padding: 1rem;
}

.ground44-map__root {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.ground44-map__root small {
  color: var(--muted);
}

.ground44-map__split {
  position: relative;
  width: min(72%, 640px);
  height: 36px;
  margin: 0.45rem auto 0;
  border-top: 2px solid rgba(0, 104, 180, 0.32);
}

.ground44-map__split::before {
  position: absolute;
  top: -32px;
  left: 50%;
  width: 2px;
  height: 32px;
  background: rgba(0, 104, 180, 0.32);
  content: "";
}

.ground44-map__split span {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 38px;
  background: rgba(0, 104, 180, 0.32);
}

.ground44-map__split span:first-child { left: 0; }
.ground44-map__split span:last-child { right: 0; }

.ground44-map__branches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ground44-branch {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.ground44-branch header {
  min-height: 82px;
}

.ground44-branch h3 {
  margin: 0;
  font-size: 0.95rem;
}

.ground44-branch header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ground44-chain {
  display: grid;
  gap: 0.65rem;
}

.ground44-chain__step {
  display: grid;
  gap: 0.45rem;
}

.ground44-chain__connector {
  justify-self: center;
  color: var(--accent);
  font-size: 1.05rem;
  transform: rotate(90deg);
}

.ground44-node {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 42px;
  padding: 0.48rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.ground44-node:hover,
.ground44-node:focus-visible {
  border-color: rgba(0, 104, 180, 0.5);
  outline: none;
}

.ground44-node.is-selected {
  border-color: var(--accent);
  background: rgba(0, 104, 180, 0.11);
  box-shadow: 0 0 0 2px rgba(0, 104, 180, 0.08);
}

.ground44-node strong {
  min-width: 2.8rem;
  color: var(--accent);
  font-size: 0.78rem;
}

.ground44-node span {
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.ground44-node--root {
  width: min(360px, 100%);
  min-height: 56px;
  border-width: 2px;
  background: rgba(0, 104, 180, 0.08);
}

.ground44-node--junction {
  border-style: dashed;
  background: rgba(97, 116, 126, 0.07);
}

.ground44-consumers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(97, 116, 126, 0.18);
}

.ground44-consumers .ground44-node {
  min-height: 36px;
  padding: 0.4rem 0.5rem;
}

.ground44-details {
  overflow: auto;
  padding: 1rem;
}

.ground44-details__title h3 {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
}

.ground44-details > p {
  color: var(--muted);
  line-height: 1.55;
}

.ground44-route-summary {
  display: grid;
  gap: 0.35rem;
  margin: 0.9rem 0;
  padding: 0.8rem;
  border-radius: 10px;
  background: rgba(22, 133, 109, 0.08);
}

.ground44-route-summary strong {
  line-height: 1.5;
}

.ground44-route-summary small {
  color: var(--muted);
}

.ground44-route-summary--open {
  background: rgba(148, 101, 0, 0.08);
}

@media (max-width: 980px) {
  .ground44-dialog__workspace {
    grid-template-columns: 1fr;
  }

  .ground44-details {
    max-height: 420px;
  }
}

@media (max-width: 720px) {
  .ground44-map__branches,
  .ground44-consumers {
    grid-template-columns: 1fr;
  }

  .ground44-map__split {
    display: none;
  }

  .ground44-branch header {
    min-height: 0;
  }
}


.a99-dialog-launch {
  margin-top: 0.55rem;
}

.a99-path-action {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid rgba(188, 92, 36, 0.24);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(207, 92, 35, 0.08), rgba(148, 101, 0, 0.05));
}

.a99-path-action > div:first-child {
  display: grid;
  gap: 0.24rem;
}

.a99-path-action span,
.a99-details__title span,
.a99-route-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.a99-path-action strong {
  font-size: 0.86rem;
  line-height: 1.45;
}

.a99-path-action small,
.a99-route-summary small {
  color: var(--muted);
  line-height: 1.45;
}

.a99-path-action__buttons,
.a99-details__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.a99-dialog {
  width: min(1240px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.a99-dialog__notice {
  margin: 0 1rem 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(188, 92, 36, 0.25);
  border-radius: 10px;
  background: rgba(188, 92, 36, 0.07);
  color: var(--muted);
  line-height: 1.5;
}

.a99-dialog__notice strong {
  color: var(--text);
}

.a99-dialog__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 1rem;
  min-height: 580px;
  padding: 0 1rem 1rem;
}

.a99-map,
.a99-details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.a99-map {
  display: grid;
  align-content: start;
  gap: 1rem;
  overflow: auto;
  padding: 1rem;
}

.a99-source-block,
.a99-consumer-block {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.a99-source-block header,
.a99-consumer-block header {
  margin-bottom: 0.8rem;
}

.a99-source-block h3,
.a99-consumer-block h3 {
  margin: 0;
  font-size: 0.98rem;
}

.a99-source-block header p,
.a99-consumer-block header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.a99-source-block {
  display: grid;
  justify-items: center;
}

.a99-source-block header {
  justify-self: stretch;
}

.a99-source-block__inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.a99-arrow {
  margin: 0.45rem 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.a99-node {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.a99-node:hover,
.a99-node:focus-visible {
  border-color: rgba(188, 92, 36, 0.55);
  outline: none;
}

.a99-node.is-selected {
  border-color: #bc5c24;
  background: rgba(188, 92, 36, 0.11);
  box-shadow: 0 0 0 2px rgba(188, 92, 36, 0.08);
}

.a99-node strong {
  min-width: 3.1rem;
  color: #bc5c24;
  font-size: 0.78rem;
}

.a99-node span {
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.a99-node--controller,
.a99-node--junction {
  width: min(420px, 100%);
  min-height: 54px;
}

.a99-node--junction {
  border-style: dashed;
  border-width: 2px;
  background: rgba(188, 92, 36, 0.07);
}

.a99-node--fuse {
  background: rgba(148, 101, 0, 0.06);
}

.a99-consumer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.a99-consumer-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.a99-consumer-card__feeds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.a99-consumer-card__feeds span,
.a99-consumer-card__feeds button {
  min-height: 28px;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(188, 92, 36, 0.22);
  border-radius: 999px;
  background: rgba(188, 92, 36, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
}

.a99-consumer-card__feeds button {
  cursor: pointer;
}

.a99-consumer-card__feeds button:hover,
.a99-consumer-card__feeds button:focus-visible {
  border-color: #bc5c24;
  color: var(--text);
  outline: none;
}

.a99-details {
  overflow: auto;
  padding: 1rem;
}

.a99-details__title h3 {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
}

.a99-details > p {
  color: var(--muted);
  line-height: 1.55;
}

.a99-route-summary {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0;
  padding: 0.8rem;
  border-radius: 10px;
  background: rgba(188, 92, 36, 0.08);
}

.a99-route-summary strong {
  line-height: 1.5;
}

.a99-route-summary .button {
  justify-self: start;
  margin-top: 0.2rem;
}

.a99-route-summary--open {
  background: rgba(148, 101, 0, 0.08);
}

@media (max-width: 980px) {
  .a99-dialog__workspace {
    grid-template-columns: 1fr;
  }

  .a99-details {
    max-height: 440px;
  }
}

@media (max-width: 720px) {
  .a99-source-block__inputs,
  .a99-consumer-grid {
    grid-template-columns: 1fr;
  }
}


/* v1.9.0-rc.9 – Datenqualitäts- und Coverage-Audit */
.quality-dialog-launch {
  margin-top: 0.55rem;
}

.quality-dialog {
  width: min(1240px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.quality-dialog__notice {
  margin: 0 1rem 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(148, 101, 0, 0.25);
  border-radius: 10px;
  background: rgba(148, 101, 0, 0.07);
  color: var(--muted);
  line-height: 1.5;
}

.quality-dialog__notice strong {
  color: var(--text);
}

.quality-report {
  display: grid;
  gap: 1rem;
  overflow: auto;
  max-height: calc(100vh - 180px);
  padding: 0 1rem 1rem;
}

.quality-section {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.quality-section > h3,
.quality-section__head h3 {
  margin: 0;
  font-size: 1rem;
}

.quality-section > p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.quality-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.quality-limit {
  margin: 0.8rem 0 0;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(148, 101, 0, 0.07);
  color: var(--muted);
  line-height: 1.5;
}

.quality-badge {
  flex: 0 0 auto;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.quality-badge--ok {
  border-color: rgba(22, 133, 109, 0.28);
  color: var(--accent-2);
}

.quality-badge--warn {
  border-color: rgba(148, 101, 0, 0.3);
  color: var(--warn);
}

.quality-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.quality-metric {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
}

.quality-metric strong {
  color: var(--accent);
  font-size: 1.15rem;
}

.quality-metric span {
  color: var(--muted);
  font-size: 0.73rem;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.quality-grid > article {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
}

.quality-grid > article > strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
}

.quality-grid dl {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.quality-grid dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.quality-grid dt,
.quality-grid dd {
  margin: 0;
}

.quality-grid dd {
  color: var(--text);
  font-weight: 700;
}

.quality-grid--compact > article {
  display: grid;
  gap: 0.25rem;
}

.quality-grid--compact > article > strong {
  margin: 0;
  color: var(--accent);
  font-size: 1.05rem;
}

.quality-grid--compact > article > span {
  color: var(--muted);
  font-size: 0.73rem;
}

.quality-table-wrap {
  overflow: auto;
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.quality-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--panel-strong);
  font-size: 0.75rem;
}

.quality-table th,
.quality-table td {
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.quality-table thead th {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quality-table th:first-child {
  text-align: left;
}

.quality-table tbody tr:last-child th,
.quality-table tbody tr:last-child td {
  border-bottom: 0;
}

.quality-open-pins,
.quality-issues {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.quality-open-pins {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quality-open-pins article,
.quality-issue {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
}

.quality-open-pins article {
  display: grid;
  gap: 0.3rem;
}

.quality-open-pins strong {
  color: var(--accent);
  font-size: 0.8rem;
}

.quality-open-pins span,
.quality-open-pins small {
  color: var(--muted);
  font-size: 0.7rem;
}

.quality-open-pins p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.quality-issue__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.quality-issue__head strong {
  font-size: 0.83rem;
}

.quality-issue__head span {
  flex: 0 0 auto;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgba(148, 101, 0, 0.08);
  color: var(--warn);
  font-size: 0.66rem;
  font-weight: 700;
}

.quality-issue p {
  margin: 0.55rem 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.quality-issue small {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.67rem;
  overflow-wrap: anywhere;
}

.quality-issue__refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.quality-entity-link,
.quality-entity-ref {
  min-height: 28px;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.69rem;
}

.quality-entity-link {
  cursor: pointer;
}

.quality-entity-link:hover,
.quality-entity-link:focus-visible {
  border-color: rgba(0, 104, 180, 0.5);
  color: var(--text);
  outline: none;
}

.quality-empty {
  color: var(--muted);
}

@media (max-width: 980px) {
  .quality-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .quality-metrics,
  .quality-grid,
  .quality-open-pins {
    grid-template-columns: 1fr;
  }

  .quality-section__head,
  .quality-issue__head {
    display: grid;
  }

  .quality-badge,
  .quality-issue__head span {
    justify-self: start;
  }
}


/* v1.9.0-rc.10 · Tastatur- und Fokusgrundlage */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 0.6rem;
  left: 0.6rem;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

body :is(
  button,
  input,
  select,
  textarea,
  summary,
  a[href],
  [role="button"],
  [role="option"],
  [role="tab"],
  [tabindex]
):focus-visible {
  outline: 3px solid rgba(15, 111, 159, 0.78) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(0, 104, 180, 0.14) !important;
}

.component-card[role="option"][aria-selected="true"] {
  border-width: 2px;
}

.view-switch__button[role="tab"][aria-selected="true"] {
  border-bottom: 3px solid var(--accent);
  font-weight: 800;
}

.view-layer[role="tabpanel"]:focus-visible {
  outline-offset: -4px !important;
}

dialog[open] {
  scroll-margin-block: 1rem;
}

dialog[open] .source-dialog__header {
  position: sticky;
  top: 0;
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}

/* v1.9.0-rc.15 · Zoom, große Schrift und responsive UI-Dichte */
:root {
  --tap-target: 40px;
  --dialog-gutter: clamp(0.5rem, 2vw, 1rem);
}

html {
  min-width: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body,
.app-shell,
.topbar,
.topbar__tools,
.topbar__panel-controls,
.viewport-wrap,
.panel,
.source-dialog,
.source-dialog__header,
.source-dialog__header > div {
  min-width: 0;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

.panel,
.source-list,
.system-register,
.pin-register,
.protection-panel-visual,
.protection-device-details,
.ground44-map,
.ground44-details,
.a99-map,
.a99-details,
.quality-report,
.topology-scroller {
  scrollbar-gutter: stable;
}

.panel,
.source-entry,
.pin-row,
.system-entry,
.protection-device-details,
.ground44-details,
.a99-details,
.quality-section,
.quality-issue,
.statusbar,
.source-dialog__header {
  overflow-wrap: anywhere;
}

.source-dialog {
  --dialog-max: 860px;
  width: min(var(--dialog-max), calc(100dvw - (2 * var(--dialog-gutter))));
  max-width: calc(100dvw - (2 * var(--dialog-gutter)));
  max-height: calc(100dvh - (2 * var(--dialog-gutter)));
}

.about-dialog { --dialog-max: 960px; }
.system-dialog { --dialog-max: 1080px; }
.pin-dialog { --dialog-max: 1120px; }
.protection-dialog,
.ground44-dialog,
.a99-dialog,
.quality-dialog { --dialog-max: 1240px; }

.source-dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.source-dialog__header,
.pin-dialog__filter,
.protection-dialog__notice,
.ground44-dialog__notice,
.a99-dialog__notice,
.quality-dialog__notice {
  flex: 0 0 auto;
}

.source-list,
.system-register,
.pin-register,
.about-dialog__body,
.protection-dialog__workspace,
.ground44-dialog__workspace,
.a99-dialog__workspace,
.quality-report {
  min-height: 0;
  overflow: auto;
}

.source-list,
.system-register,
.pin-register,
.quality-report {
  flex: 1 1 auto;
}

.pin-dialog__filter {
  position: static;
}

.topbar__tools,
.topbar__panel-controls,
.route-actions,
.a99-path-action__buttons,
.a99-details__actions {
  flex-wrap: wrap;
}

.topology-header {
  height: auto;
  min-height: 48px;
}

.statusbar {
  height: auto;
  min-height: var(--status-h);
}

.chip.is-active,
.view-switch__button[aria-selected="true"],
.component-card[aria-selected="true"],
.protection-device.is-selected,
.ground44-node.is-selected,
.a99-node.is-selected {
  font-weight: 800;
}

.chip.is-active {
  border-width: 2px;
}

.chip.is-active::before {
  content: "✓";
  margin-right: 0.3rem;
  font-weight: 900;
}

.protection-device.is-selected,
.ground44-node.is-selected,
.a99-node.is-selected {
  position: relative;
  border-width: 2px;
}

.protection-device.is-selected::before,
.ground44-node.is-selected::after,
.a99-node.is-selected::after {
  position: absolute;
  z-index: 1;
  top: 0.25rem;
  right: 0.35rem;
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--panel-strong);
  content: "✓";
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.component-card[aria-selected="true"] {
  border-left-width: 5px;
}

.topology-node[aria-pressed="true"] rect {
  stroke-width: 4;
}

@media (max-width: 1280px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding-block: 0.55rem;
  }

  .topbar__tools {
    flex: 1 1 620px;
    justify-content: flex-end;
  }

  .search {
    flex: 1 1 260px;
  }

  .search input {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .source-dialog__header {
    align-items: flex-start;
  }

  .source-dialog__header > div {
    flex: 1 1 auto;
  }

  .system-register {
    grid-template-columns: 1fr;
  }

  .protection-dialog__workspace,
  .ground44-dialog__workspace,
  .a99-dialog__workspace {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --tap-target: 44px;
    --dialog-gutter: 0.35rem;
  }

  .topbar {
    position: sticky;
    inset-block-start: 0;
    align-items: stretch;
    gap: 0.65rem;
    padding:
      max(0.65rem, env(safe-area-inset-top))
      max(0.65rem, env(safe-area-inset-right))
      0.65rem
      max(0.65rem, env(safe-area-inset-left));
  }

  .brand {
    width: 100%;
    min-width: 0;
  }

  .brand__mark {
    flex: 0 0 auto;
  }

  .brand__copy {
    min-width: 0;
  }

  .brand small {
    max-width: none;
    overflow-wrap: anywhere;
  }

  .topbar__tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.5rem;
  }

  .topbar__tools > .search,
  .topbar__panel-controls {
    grid-column: 1 / -1;
  }

  .topbar__panel-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.5rem;
  }

  .topbar__tools > .button,
  .topbar__panel-controls .button {
    width: 100%;
    min-height: var(--tap-target);
    white-space: normal;
  }

  #sourceRegisterButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-shell {
    min-height: 0;
  }

  .viewport-wrap {
    height: clamp(340px, 55svh, 540px);
    min-height: 340px;
  }

  .panel {
    overflow: visible;
    padding: clamp(0.75rem, 3vw, 1rem);
  }

  .viewport-toolbar,
  .camera-presets {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .viewport-toolbar {
    top: 3.75rem;
    transform: none;
  }

  .camera-presets {
    bottom: 0.5rem;
  }

  .chip,
  .mini-chip,
  .view-switch__button {
    flex: 0 0 auto;
    min-height: var(--tap-target);
  }

  .view-switch {
    top: 0.5rem;
    left: 0.5rem;
    max-width: calc(100% - 1rem);
    overflow-x: auto;
  }

  .topology-layer {
    padding: 7.25rem 0.5rem 0.5rem;
  }

  .topology-header {
    min-height: 0;
    align-items: flex-start;
    padding-inline: 0.25rem;
  }

  .statusbar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding:
      0.5rem
      max(0.75rem, env(safe-area-inset-right))
      max(0.5rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
    line-height: 1.35;
  }

  .source-dialog__header {
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .source-dialog__header .dialog-close-button {
    min-width: var(--tap-target);
    min-height: var(--tap-target);
    padding-inline: 0.75rem;
  }

  .protection-dialog__notice,
  .ground44-dialog__notice,
  .a99-dialog__notice,
  .quality-dialog__notice {
    margin-inline: 0.65rem;
  }

  .protection-dialog__workspace,
  .ground44-dialog__workspace,
  .a99-dialog__workspace,
  .quality-report {
    padding-inline: 0.65rem;
  }
}

@media (max-width: 560px) {
  .brand__mark {
    width: 54px;
    height: 38px;
  }

  .brand__mark img {
    width: 50px;
    height: 34px;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .brand small {
    font-size: 0.68rem;
  }

  .topbar__tools {
    grid-template-columns: 1fr;
  }

  .topbar__tools > .search,
  .topbar__panel-controls,
  .topbar__tools > .button {
    grid-column: 1;
  }

  .topbar__panel-controls {
    grid-template-columns: 1fr;
  }

  .viewport-wrap {
    height: clamp(300px, 50svh, 420px);
    min-height: 300px;
  }

  .view-side-indicator {
    display: none;
  }

  .source-dialog {
    width: calc(100dvw - 0.5rem);
    max-width: calc(100dvw - 0.5rem);
    max-height: calc(100dvh - 0.5rem);
    border-radius: 12px;
  }

  .source-dialog__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .source-dialog__header small {
    line-height: 1.35;
  }

  .about-dialog__body,
  .search--dialog,
  .source-entry dl div,
  .fact-grid,
  .cutaway-grid,
  .route-actions {
    grid-template-columns: 1fr;
  }

  .about-dialog__hero {
    min-height: 150px;
    padding: 0.75rem;
  }

  .about-dialog__hero img {
    max-height: 145px;
  }

  .about-dialog__content {
    padding: 1rem;
  }

  .source-list,
  .system-register,
  .pin-register,
  .quality-report {
    padding: 0.65rem;
  }

  .protection-dialog__workspace,
  .ground44-dialog__workspace,
  .a99-dialog__workspace {
    gap: 0.65rem;
  }

  .quality-table {
    min-width: 620px;
  }

  .statusbar {
    align-items: flex-start;
  }
}

@media (pointer: coarse) {
  button,
  select,
  input[type="search"],
  input[type="text"],
  .component-card,
  .filter,
  .ground44-node,
  .a99-node,
  .quality-entity-link,
  .quality-entity-ref {
    min-height: 44px;
  }

  .text-button {
    min-height: 44px;
    padding-inline: 0.5rem;
  }

  .protection-device {
    min-width: 44px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(23, 37, 45, 0.52);
    --muted: #3e5059;
  }

  .button,
  .chip,
  .mini-chip,
  .component-card,
  .filter,
  .source-entry,
  .system-entry,
  .protection-device,
  .ground44-node,
  .a99-node {
    border-width: 2px;
  }

  .statusbar__legend .dot {
    border: 1px solid currentColor;
  }
}

@media (forced-colors: active) {
  .chip.is-active,
  .view-switch__button[aria-selected="true"],
  .component-card[aria-selected="true"],
  .protection-device.is-selected,
  .ground44-node.is-selected,
  .a99-node.is-selected,
  .topology-node[aria-pressed="true"] rect {
    stroke: Highlight;
    stroke-width: 4;
    forced-color-adjust: auto;
  }

  .filter__swatch,
  .statusbar__legend .dot {
    border: 1px solid CanvasText;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-layer,
  .component-card,
  .protection-device,
  .chip,
  .mini-chip {
    scroll-behavior: auto;
    transition: none !important;
  }
}



/* v1.9.0-rc.15 – mobiler Arbeitsmodus ohne überlagernde Kopfzeile */
.mobile-menu-toggle {
  display: none;
}

@media (max-width: 820px) {
  html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-padding-top: 0.5rem;
  }

  body {
    width: 100%;
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  .topbar {
    position: static;
    inset: auto;
    z-index: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-height: none;
    align-items: center;
  }

  .brand {
    width: auto;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    min-width: 5.25rem;
    min-height: var(--tap-target);
    align-items: center;
    justify-content: center;
    align-self: start;
  }

  .mobile-menu-toggle::after {
    margin-inline-start: 0.4rem;
    content: "▾";
    font-size: 0.8em;
  }

  .mobile-menu-toggle[aria-expanded="true"]::after {
    content: "▴";
  }

  .topbar__tools {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  .topbar__tools.is-mobile-open {
    display: grid;
  }

  .app-shell {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .panel {
    overflow: visible;
  }

  .viewport-wrap {
    position: relative;
    overflow: hidden;
  }

  .statusbar {
    position: static;
    inset: auto;
  }
}

@media (max-width: 820px) and (orientation: landscape) {
  .topbar {
    padding-block: 0.45rem;
  }

  .brand small {
    display: none;
  }

  .viewport-wrap {
    height: max(320px, 72svh);
  }
}

@media (min-width: 821px) {
  .topbar__tools {
    display: flex !important;
  }
}


/* v1.9.0-rc.15 – Mobile-Density-Fix nach realem iPhone-SE-Befund */
@media (max-width: 820px) {
  body {
    scroll-padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
  }

  .view-switch {
    right: 0.5rem;
    left: 0.5rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    max-width: none;
    transform: none;
    overflow: visible;
  }

  .view-switch__button {
    width: 100%;
    min-width: 0;
    padding-inline: 0.65rem;
    white-space: nowrap;
  }

  .topology-layer {
    padding: 4.15rem 0.5rem 0.5rem;
  }

  .topology-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0 0.25rem 0.5rem;
  }

  .topology-header .button {
    min-height: var(--tap-target);
  }

  .topology-scroller {
    min-height: 0;
  }

  .app-shell::after {
    display: block;
    grid-column: 1 / -1;
    height: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    content: "";
  }
}

@media (max-width: 560px) {
  .viewport-wrap {
    height: clamp(390px, 62svh, 520px);
    min-height: 390px;
  }

  .view-switch {
    top: 0.4rem;
    right: 0.4rem;
    left: 0.4rem;
    padding: 0.25rem;
    gap: 0.25rem;
  }

  .view-switch__button {
    min-height: 42px;
    font-size: 0.75rem;
  }

  .topology-layer {
    padding: 3.8rem 0.4rem 0.4rem;
  }

  .topology-header {
    min-height: 56px;
  }

  .topology-header strong {
    font-size: 0.96rem;
  }

  .topology-header small {
    font-size: 0.71rem;
    line-height: 1.3;
  }
}

@media (max-width: 820px) and (orientation: landscape) {
  body {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4.5rem);
  }

  .viewport-wrap {
    height: clamp(300px, 76svh, 520px);
    min-height: 300px;
  }

  .topology-layer {
    padding-top: 3.7rem;
  }
}


/* v1.9.0-rc.15 – Legacy-3D, Standardebene und temporärer Einbaukontext */
.section-heading__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter.is-context-only {
  outline: 1px dashed color-mix(in srgb, var(--swatch) 72%, #ffffff 28%);
  outline-offset: 2px;
  background: color-mix(in srgb, var(--swatch) 9%, transparent);
}

.filter__context-badge {
  margin-inline-start: auto;
  min-width: 1.65rem;
  padding: 0.1rem 0.38rem;
  border: 1px solid color-mix(in srgb, var(--swatch) 68%, #ffffff 32%);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.2;
  text-align: center;
}

.error-card__actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

#topologySvg[data-layout="compact-filtered"] {
  min-width: 100%;
  min-height: 100%;
}

@media (max-width: 820px) {
  .section-heading__actions {
    gap: 0.35rem;
  }

  .section-heading__actions .text-button {
    min-height: 38px;
    padding-inline: 0.42rem;
  }
}

@media (forced-colors: active) {
  .filter.is-context-only {
    outline: 2px dashed CanvasText;
  }

  .filter__context-badge {
    border-color: CanvasText;
  }
}


/* v1.9.0 – kompakte Desktop-Arbeitsleiste und AUA-Leerlauf-/Luftpfad */
@media (min-width: 821px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
    gap: 0.75rem;
    padding-inline: 10px;
  }

  .brand {
    min-width: 0;
    max-width: 390px;
  }

  .brand__mark {
    width: 64px;
    height: 40px;
  }

  .brand__mark img {
    width: 60px;
    height: 36px;
  }

  .brand small {
    max-width: 300px;
  }

  .topbar__tools {
    display: grid !important;
    grid-template-columns: minmax(230px, 1fr) auto auto;
    min-width: 0;
    align-items: end;
    gap: 8px;
  }

  .topbar__search {
    min-width: 0;
  }

  .topbar__search input {
    width: 100%;
    min-width: 0;
  }

  .topbar__panel-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .topbar__panel-controls .button {
    padding-inline: 10px;
  }
}

.topbar-more {
  position: relative;
  align-self: end;
}

.topbar-more > summary,
.layer-menu > summary {
  list-style: none;
}

.topbar-more > summary::-webkit-details-marker,
.layer-menu > summary::-webkit-details-marker {
  display: none;
}

.topbar-more > summary::after,
.layer-menu > summary::after {
  margin-inline-start: 0.45rem;
  content: "▾";
  font-size: 0.72em;
}

.topbar-more[open] > summary::after,
.layer-menu[open] > summary::after {
  content: "▴";
}

.topbar-more__menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 220px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.topbar-more__menu .button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.layer-menu {
  position: absolute;
  z-index: 28;
  top: 13px;
  left: 222px;
}

.layer-menu__summary {
  min-height: 42px;
  padding-inline: 14px;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.94);
}

.layer-menu .viewport-toolbar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  width: min(520px, calc(100vw - 620px));
  min-width: 360px;
  max-width: 520px;
  transform: none;
  padding: 10px;
  gap: 9px;
  background: rgba(255, 255, 255, 0.98);
}

.layer-menu__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.layer-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.layer-menu__grid .chip {
  width: 100%;
  min-width: 0;
  border-color: var(--line);
  background: rgba(247, 250, 252, 0.9);
  text-align: left;
}

.layer-menu__grid .chip.is-active {
  border-color: rgba(0, 104, 180, 0.45);
  background: rgba(0, 104, 180, 0.12);
}

.idle-airpath-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
}

.idle-airpath-dialog__notice {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 101, 0, 0.24);
  border-radius: 12px;
  background: rgba(255, 224, 122, 0.14);
  color: var(--muted);
}

.idle-airpath-dialog__notice strong {
  color: var(--text);
}

.idle-airpath-dialog__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 14px;
  min-height: 520px;
  padding: 14px 16px 16px;
}

.idle-airpath-map,
.idle-airpath-details {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.idle-airpath-map {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.idle-airpath-lane {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.idle-airpath-lane header {
  display: grid;
  gap: 2px;
}

.idle-airpath-lane header small {
  color: var(--muted);
}

.idle-airpath-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.idle-airpath-subnodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-inline-start: 20%;
}

.idle-airpath-node {
  display: grid;
  min-width: 132px;
  min-height: 66px;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 2px solid rgba(137, 230, 168, 0.72);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.idle-airpath-node span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.idle-airpath-node.is-functional {
  border-style: dashed;
}

.idle-airpath-node.is-mechanical {
  border-color: rgba(148, 101, 0, 0.58);
}

.idle-airpath-node.is-selected {
  box-shadow: 0 0 0 4px rgba(0, 104, 180, 0.16);
  border-color: var(--accent);
}

.idle-airpath-arrow {
  color: var(--accent-2);
  font-weight: 800;
}

.idle-airpath-arrow--mechanical {
  color: var(--warn);
  font-size: 0.78rem;
}

.idle-airpath-lane--mechanical {
  border-style: dashed;
}

.idle-airpath-flow--mechanical {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(148, 101, 0, 0.35);
}

.idle-airpath-details {
  padding: 14px;
}

.idle-airpath-details__heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
}

.idle-airpath-details__heading > span {
  display: grid;
  min-width: 68px;
  min-height: 42px;
  place-items: center;
  border-radius: 10px;
  background: rgba(137, 230, 168, 0.18);
  color: #17633c;
  font-weight: 800;
}

.idle-airpath-details__heading div {
  display: grid;
  gap: 3px;
}

.idle-airpath-details__heading small {
  color: var(--muted);
}

.idle-airpath-details__facts {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.idle-airpath-details__facts div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  padding-block: 7px;
  border-bottom: 1px solid var(--line);
}

.idle-airpath-details__facts dt {
  color: var(--muted);
}

.idle-airpath-details__facts dd {
  margin: 0;
}

.idle-airpath-details__relations ul {
  display: grid;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.idle-airpath-details__relations li {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(0, 104, 180, 0.07);
}

.idle-airpath-details__relations li span {
  color: var(--muted);
  font-size: 0.72rem;
}

.idle-airpath-details__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 1380px) and (min-width: 821px) {
  .brand {
    max-width: 245px;
  }

  .brand small {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar__tools {
    grid-template-columns: minmax(190px, 1fr) auto auto;
  }

  .topbar__panel-controls .button {
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  .layer-menu .viewport-toolbar {
    width: min(470px, calc(100vw - 520px));
    min-width: 330px;
  }
}

@media (max-width: 1040px) and (min-width: 821px) {
  .brand small {
    display: none;
  }

  .topbar {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .topbar__panel-controls #toggleLeftPanelButton,
  .topbar__panel-controls #toggleRightPanelButton {
    max-width: 42px;
    overflow: hidden;
    color: transparent;
    position: relative;
  }

  .topbar__panel-controls #toggleLeftPanelButton::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text);
    content: "☰";
  }

  .topbar__panel-controls #toggleRightPanelButton::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text);
    content: "ⓘ";
  }
}

@media (max-width: 820px) {
  .topbar-more {
    width: 100%;
  }

  .topbar-more > summary {
    width: 100%;
  }

  .topbar-more__menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
  }

  .layer-menu {
    top: 3.65rem;
    right: 0.4rem;
    left: auto;
  }

  .layer-menu__summary {
    min-height: 42px;
  }

  .layer-menu .viewport-toolbar {
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    width: min(92vw, 430px);
    min-width: min(92vw, 330px);
    max-width: 92vw;
  }

  .layer-menu__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .idle-airpath-dialog__workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .idle-airpath-map,
  .idle-airpath-details {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .layer-menu__summary {
    padding-inline: 10px;
    font-size: 0.75rem;
  }

  .idle-airpath-flow,
  .idle-airpath-subnodes {
    display: grid;
    grid-template-columns: 1fr;
    padding-inline-start: 0;
  }

  .idle-airpath-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .idle-airpath-node {
    width: 100%;
  }

  .idle-airpath-details__facts div {
    grid-template-columns: 1fr;
  }
}


/* v1.9.0 – Desktop-Steuerleiste und responsive Arbeitsdialoge */
@media (min-width: 821px) {
  .viewport-wrap {
    --desktop-view-switch-width: 280px;
    --desktop-viewport-control-gap: 12px;
  }

  .view-switch {
    width: var(--desktop-view-switch-width);
    box-sizing: border-box;
  }

  .view-switch__button {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
  }

  .layer-menu {
    left: calc(
      13px
      + var(--desktop-view-switch-width)
      + var(--desktop-viewport-control-gap)
    );
  }

  .system-dialog,
  .pin-dialog,
  .protection-dialog,
  .ground44-dialog,
  .a99-dialog,
  .quality-dialog,
  .idle-airpath-dialog {
    --dialog-max: 90dvw;
    width: 90dvw;
    max-width: 90dvw;
    height: 90dvh;
    max-height: 90dvh;
    margin: auto;
  }

  .idle-airpath-dialog__workspace {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .idle-airpath-map,
  .idle-airpath-details {
    min-height: 0;
  }

  .protection-dialog__workspace,
  .ground44-dialog__workspace,
  .a99-dialog__workspace,
  .quality-report,
  .system-register,
  .pin-register {
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (min-width: 821px) and (max-width: 1120px) {
  .viewport-wrap {
    --desktop-view-switch-width: 258px;
    --desktop-viewport-control-gap: 10px;
  }

  .view-switch__button {
    padding-inline: 8px;
    font-size: 0.82rem;
  }
}


/* v1.9.0 – Fachdialog im Mehr-Menü und AUA-Systemebene */
.source-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.topbar-more__menu #qualityDialogButton {
  margin-top: 0;
}

@media (max-width: 560px) {
  .source-dialog__actions {
    width: 100%;
    justify-content: stretch;
  }

  .source-dialog__actions .button {
    flex: 1 1 auto;
  }
}


/* v1.9.0 – Inhaltssensitiver 2D-Zoom und Auto-Fit */
.topology-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.topology-zoom__button {
  min-width: 2.35rem;
  padding-inline: 0.6rem;
  font-size: 1rem;
  font-weight: 800;
}

.topology-zoom__value {
  min-width: 4.7rem;
  font-variant-numeric: tabular-nums;
}

.topology-zoom__fit[aria-pressed="true"] {
  border-width: 2px;
  font-weight: 800;
}

#topologySvg {
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  transform: none;
  transform-origin: 0 0;
}

.topology-scroller {
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

@media (max-width: 820px) {
  .topology-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .topology-zoom {
    width: 100%;
    justify-content: stretch;
  }

  .topology-zoom__button {
    flex: 0 0 2.75rem;
  }

  .topology-zoom__value {
    flex: 0 0 5rem;
  }

  .topology-zoom__fit {
    flex: 1 1 auto;
  }
}

@media (max-width: 420px) {
  .topology-zoom {
    gap: 0.25rem;
  }

  .topology-zoom__button {
    flex-basis: 2.5rem;
    min-width: 2.5rem;
  }

  .topology-zoom__value {
    flex-basis: 4.5rem;
    min-width: 4.5rem;
  }
}


/* v1.9.0 – Kontextklarheit und einheitliche Dropdown-Typografie */
.filter {
  grid-template-columns: 17px 11px minmax(0, 1fr) auto;
}

.filter__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter__context-badge {
  margin-inline-start: 0;
  min-width: auto;
  padding: 0.14rem 0.45rem;
  white-space: nowrap;
  font-size: 0.64rem;
  font-weight: 760;
  line-height: 1.1;
}

.system-context-legend {
  margin: 0.45rem 0.15rem 0.75rem;
  padding: 0.5rem 0.6rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  font-size: 0.66rem;
  line-height: 1.38;
}

.system-context-legend strong {
  color: var(--text);
}

.topbar-more > summary.toolbar-menu-summary,
.layer-menu > summary.toolbar-menu-summary {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  height: 40px;
  box-sizing: border-box;
  padding: 0 13px;
  gap: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 520;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

.topbar-more > summary.toolbar-menu-summary::after,
.layer-menu > summary.toolbar-menu-summary::after {
  display: inline-block;
  margin-inline-start: 0.48rem;
  font-size: 0.68rem;
  line-height: 1;
  transform: translateY(0);
}

.layer-menu__summary.toolbar-menu-summary {
  min-height: 40px;
  padding-inline: 13px;
}

@media (max-width: 820px) {
  .filter {
    grid-template-columns: 17px 11px minmax(0, 1fr) auto;
  }

  .filter__context-badge {
    font-size: 0.62rem;
  }
}

@media (max-width: 420px) {
  .filter__context-badge {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* v1.9.0 – Desktop-Informationsarchitektur */
.component-browser {
  margin: 0;
  border: 0;
}

.component-browser__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  cursor: pointer;
  color: var(--text);
  list-style: none;
}

.component-browser__summary::-webkit-details-marker {
  display: none;
}

.component-browser__summary::before {
  content: "▾";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.72rem;
  transform: rotate(-90deg);
  transition: transform 0.16s ease;
}

.component-browser[open] > .component-browser__summary::before {
  transform: rotate(0deg);
}

.component-browser__summary > span:first-of-type {
  flex: 1 1 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.component-browser__body {
  padding-top: 8px;
}

.component-browser__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.component-browser__search label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.component-browser__search input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--text);
}

.component-browser__search .button {
  min-height: 34px;
  padding-inline: 9px;
  font-size: 0.68rem;
}

.component-browser__hint {
  margin: 6px 0 9px;
  font-size: 0.62rem;
}

.component-list__empty {
  margin: 0;
  padding: 14px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.45;
}

.display-settings-dialog {
  width: min(980px, 90dvw);
  max-height: 90dvh;
}

.display-settings-dialog__body {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(280px, 0.84fr);
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.display-settings-dialog__body > section {
  min-width: 0;
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.display-settings-dialog .vehicle-display-panel,
.display-settings-dialog .cutaway-panel {
  padding-top: 14px;
}

.display-settings-dialog .vehicle-display-panel .section-heading,
.display-settings-dialog .cutaway-panel .section-heading {
  margin-bottom: 8px;
}

.display-settings-dialog .render-controls-grid {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 760px) {
  .display-settings-dialog__body {
    grid-template-columns: 1fr;
  }

  .display-settings-dialog .render-controls-grid {
    grid-template-columns: 1fr;
  }
}


/* v1.9.1-dev.7 – gemeinsames Modul „Motorregelung bei Leerlauf- und Lastübergängen“ */

.scenario-dialog {
  width: min(1500px, calc(100vw - 32px));
  max-height: min(960px, calc(100vh - 32px));
}

.scenario-dialog__notice {
  margin: 10px 16px 0;
  padding: 9px 12px;
  border: 1px solid rgba(148, 101, 0, 0.28);
  border-radius: 10px;
  background: rgba(255, 224, 122, 0.14);
  color: var(--muted);
  line-height: 1.4;
}

.scenario-dialog__notice strong {
  color: var(--text);
}

.scenario-dialog__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 16px 0;
}

.scenario-tab {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.scenario-tab.is-active {
  border-width: 2px;
  border-color: var(--accent);
  background: rgba(0, 104, 180, 0.12);
  font-weight: 700;
}

.scenario-legend-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.scenario-legend-details > summary {
  min-height: 36px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.scenario-legend-details__items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.scenario-legend-details__item {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.scenario-legend-details__item > span,
.scenario-details__heading > span {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
}

.scenario-legend-details__item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

[data-scenario-class="documented"],
.scenario-node--documented {
  border-style: solid;
  border-color: rgba(0, 104, 180, 0.72);
}

[data-scenario-class="variant"],
.scenario-node--variant {
  border-style: double;
  border-color: rgba(148, 101, 0, 0.74);
}

[data-scenario-class="functional"],
.scenario-node--functional {
  border-style: dashed;
  border-color: rgba(90, 99, 117, 0.76);
}

[data-scenario-class="open"],
.scenario-node--open {
  border-style: dotted;
  border-color: rgba(180, 72, 72, 0.76);
}

.scenario-dialog__workspace {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 16px 16px;
}

.scenario-map {
  display: grid;
  align-content: start;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.scenario-map__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(0, 104, 180, 0.08);
}

.scenario-map__summary strong {
  font-size: 0.98rem;
}

.scenario-map__summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.scenario-graph-scroll {
  min-width: 0;
  min-height: 660px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(rgba(0, 104, 180, 0.025), rgba(0, 104, 180, 0.025)),
    var(--surface);
}

.scenario-graph {
  display: block;
  width: 100%;
  min-width: 1120px;
  height: 660px;
}

.scenario-graph-node-wrap,
.scenario-graph-edge {
  transition: opacity 140ms ease, filter 140ms ease;
}

.scenario-graph-node-wrap.is-muted,
.scenario-graph-edge.is-muted {
  opacity: 0.16;
  filter: saturate(0.35);
}

.scenario-graph-node {
  display: grid;
  width: 100%;
  height: 100%;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border-width: 2px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scenario-graph-node small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scenario-graph-node strong {
  line-height: 1.22;
}

.scenario-graph-node span {
  color: var(--muted);
  font-size: 0.7rem;
}

.scenario-graph-node.is-selected,
.scenario-support-chip.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(0, 104, 180, 0.2), 0 0 0 4px rgba(0, 104, 180, 0.13);
}

.scenario-graph-node:focus-visible,
.scenario-support-chip:focus-visible,
.scenario-graph-edge__label:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.scenario-graph-edge {
  color: rgba(0, 104, 180, 0.82);
}

.scenario-graph-edge--variant {
  color: rgba(148, 101, 0, 0.76);
}

.scenario-graph-edge--functional {
  color: rgba(90, 99, 117, 0.78);
}

.scenario-graph-edge--open {
  color: rgba(180, 72, 72, 0.78);
}

.scenario-graph-edge__path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scenario-graph-edge--variant .scenario-graph-edge__path {
  stroke-width: 4;
  stroke-dasharray: 1 5;
}

.scenario-graph-edge--functional .scenario-graph-edge__path {
  stroke-dasharray: 10 7;
}

.scenario-graph-edge--open .scenario-graph-edge__path {
  stroke-dasharray: 2 7;
}

.scenario-graph-edge__path--secondary {
  stroke-width: 2.4;
}

.scenario-arrow {
  fill: rgba(0, 104, 180, 0.82);
}

.scenario-arrow--variant {
  fill: rgba(148, 101, 0, 0.76);
}

.scenario-arrow--functional {
  fill: rgba(90, 99, 117, 0.78);
}

.scenario-arrow--open {
  fill: rgba(180, 72, 72, 0.78);
}

.scenario-graph-edge__label {
  cursor: pointer;
}

.scenario-graph-edge__label rect {
  fill: rgba(255, 255, 255, 0.96);
  stroke: currentColor;
  stroke-width: 1.25;
}

.scenario-graph-edge__label text {
  fill: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 8.75px;
  font-weight: 650;
  pointer-events: none;
}

.scenario-graph-edge.is-selected .scenario-graph-edge__path {
  stroke-width: 5;
}

.scenario-graph-edge.is-selected .scenario-graph-edge__label rect {
  stroke-width: 3;
}

.scenario-supporting-paths {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.84);
}

.scenario-supporting-paths > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 11px;
  cursor: pointer;
  list-style-position: inside;
}

.scenario-supporting-paths > summary span {
  display: grid;
  gap: 2px;
  margin-inline-start: 6px;
}

.scenario-supporting-paths > summary small {
  color: var(--muted);
  font-weight: 400;
}

.scenario-supporting-paths__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 11px 11px;
}

.scenario-supporting-paths__body section {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.scenario-supporting-paths__body section > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}


.scenario-supporting-paths__body .scenario-support-section--wide {
  grid-column: 1 / -1;
}

.scenario-support-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.scenario-support-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.76rem;
  line-height: 1.35;
}

.scenario-support-table th,
.scenario-support-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.scenario-support-table th:last-child,
.scenario-support-table td:last-child {
  border-inline-end: 0;
}

.scenario-support-table tbody tr:last-child > * {
  border-bottom: 0;
}

.scenario-support-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong, var(--surface));
  color: var(--text);
  font-weight: 800;
}

.scenario-support-table tbody th {
  min-width: 110px;
  background: rgba(0, 104, 180, 0.035);
  font-weight: 750;
}

.scenario-support-chips,
.scenario-support-sequences {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scenario-support-sequences {
  display: grid;
}

.scenario-support-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.scenario-support-sequence > span {
  color: var(--muted);
  font-weight: 800;
}

.scenario-support-chip {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 8px;
  border-width: 2px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.scenario-support-chip small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.scenario-support-chip span {
  font-size: 0.75rem;
}

.scenario-statement-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.scenario-statement-panel {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 104, 180, 0.045);
}

.scenario-statement-panel--not-documented {
  background: rgba(180, 72, 72, 0.055);
}

.scenario-statement-panel--bridge {
  background: rgba(148, 101, 0, 0.055);
}

.scenario-statement-panel ul {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
  padding-inline-start: 18px;
}

.scenario-statement-panel p {
  margin: 7px 0 0;
  line-height: 1.45;
}

.scenario-details {
  position: absolute;
  z-index: 8;
  inset-block: 12px 16px;
  inset-inline-end: 16px;
  width: min(390px, calc(100% - 48px));
  overflow: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(25, 36, 48, 0.24);
}

.scenario-details[hidden] {
  display: none;
}

.scenario-details__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.scenario-details__heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
}

.scenario-details__heading > span {
  min-width: 72px;
  min-height: 42px;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 104, 180, 0.08);
}

.scenario-details__heading > div {
  display: grid;
  gap: 3px;
}

.scenario-details__heading small {
  color: var(--muted);
}

.scenario-details > p {
  line-height: 1.5;
}

.scenario-details__facts {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.scenario-details__facts div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 8px;
  padding-block: 7px;
  border-bottom: 1px solid var(--line);
}

.scenario-details__facts dt {
  color: var(--muted);
}

.scenario-details__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.scenario-details__list {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(0, 104, 180, 0.06);
}

.scenario-details__list--limits {
  background: rgba(180, 72, 72, 0.07);
}

.scenario-details__list ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-inline-start: 19px;
}

.scenario-details__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 920px) {
  .scenario-map__summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .scenario-supporting-paths__body,
  .scenario-statement-panels {
    grid-template-columns: 1fr;
  }

  .scenario-details {
    inset-inline: 12px;
    width: auto;
  }
}

@media (max-width: 560px) {
  .scenario-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .scenario-dialog__notice,
  .scenario-dialog__tabs,
  .scenario-dialog__workspace {
    margin-inline: 0;
    padding-inline: 9px;
  }

  .scenario-graph {
    min-width: 900px;
  }

  .scenario-support-sequence {
    align-items: stretch;
  }

  .scenario-support-chip {
    max-width: 100%;
  }
}



@media (max-width: 1100px) {
  .scenario-legend-details__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .scenario-legend-details__items {
    grid-template-columns: 1fr;
  }
}

/* v1.9.1-dev.7 – Motorregelungsmodul gemäß 5-%-Randvertrag */
@media (min-width: 821px) {
  .scenario-dialog {
    --dialog-max: 90dvw;
    width: 90dvw;
    max-width: 90dvw;
    height: 90dvh;
    max-height: 90dvh;
    margin: auto;
  }
}


@media (max-width: 760px) {
  .scenario-graph-scroll {
    min-height: 585px;
  }

  .scenario-graph {
    height: 585px;
  }
}


.workspace-launcher-heading {
  margin-top: 0.85rem;
  margin-bottom: 0.45rem;
}


/* v1.9.1-dev.18 – Navigationsgerüst auf dem Weg zu 1.9.2 */
:root {
  --left-panel-w: 292px;
  --left-panel-rail-w: 58px;
}

.primary-nav {
  padding: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 97%, var(--surface-2));
}

.primary-nav__head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 58px;
  padding: 10px 10px 9px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 97%, transparent);
  backdrop-filter: blur(12px);
}

.primary-nav__identity {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.primary-nav__title {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.primary-nav__subtitle {
  color: var(--muted);
  font-size: .65rem;
  white-space: nowrap;
}

.nav-collapse-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.nav-collapse-button:hover,
.nav-collapse-button:focus-visible {
  border-color: rgba(0, 104, 180, .42);
  background: rgba(0, 104, 180, .08);
  outline: none;
}

.primary-nav__groups {
  height: calc(100% - 58px);
  overflow-y: auto;
  padding: 8px;
  scrollbar-gutter: stable;
}

.nav-group {
  margin: 0 0 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
}

.nav-group[open] {
  border-color: var(--line);
  background: rgba(255, 255, 255, .42);
}

.nav-group > summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 4px 7px 4px 5px;
  border-radius: 9px;
  color: var(--text);
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group > summary::after {
  content: "›";
  color: var(--muted);
  font-size: 1rem;
  transform: rotate(0deg);
  transition: transform .16s ease;
}

.nav-group[open] > summary::after {
  transform: rotate(90deg);
}

.nav-group > summary:hover,
.nav-group > summary:focus-visible {
  background: rgba(0, 104, 180, .07);
  outline: none;
}

.nav-group__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 104, 180, .14);
  border-radius: 8px;
  background: rgba(0, 104, 180, .055);
  color: var(--accent);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: -.02em;
}

.nav-group__body {
  display: grid;
  gap: 7px;
  padding: 3px 7px 10px 46px;
}

.nav-group__body--actions {
  gap: 5px;
}

.nav-action {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 37px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.nav-action:hover,
.nav-action:focus-visible {
  border-color: rgba(0, 104, 180, .18);
  background: rgba(0, 104, 180, .07);
  outline: none;
}

.nav-action.is-nav-active,
.nav-action[aria-current="page"] {
  border-color: rgba(0, 104, 180, .26);
  background: rgba(0, 104, 180, .11);
  color: #0f668e;
}

.nav-action__icon {
  display: grid;
  place-items: center;
  min-width: 29px;
  min-height: 27px;
  padding-inline: 2px;
  border-radius: 7px;
  background: rgba(0, 104, 180, .07);
  color: var(--accent);
  font-size: .62rem;
  font-weight: 850;
}

.nav-subsection {
  display: grid;
  gap: 6px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--line);
}

.nav-subsection__title,
.nav-inline-heading > span {
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-inline-heading {
  gap: 8px;
  margin-bottom: 2px;
}

.nav-inline-heading .section-heading__actions {
  display: flex;
  gap: 6px;
}

.nav-subdetails {
  margin-top: 2px;
  border-top: 1px solid var(--line);
}

.nav-subdetails > summary {
  padding: 7px 0 2px;
  color: var(--muted);
  font-size: .66rem;
  cursor: pointer;
}

.nav-view-actions {
  display: grid;
  gap: 5px;
}

.nav-component-browser {
  margin-top: 3px;
  border-top: 1px solid var(--line);
}

.nav-component-browser .component-browser__summary {
  padding-inline: 0;
}

/* Im Rail-Modus bleibt die Hauptnavigation sichtbar statt vollständig zu verschwinden. */
body.left-panel-collapsed {
  --left-panel-w: var(--left-panel-rail-w);
}

body.left-panel-collapsed .panel--left.primary-nav {
  display: block;
  min-width: var(--left-panel-rail-w);
  width: var(--left-panel-rail-w);
  padding: 0;
  border-right: 1px solid var(--line);
  opacity: 1;
  overflow: hidden;
  pointer-events: auto;
}

body.left-panel-collapsed .primary-nav__head {
  justify-content: center;
  padding-inline: 6px;
}

body.left-panel-collapsed .primary-nav__identity,
body.left-panel-collapsed .nav-group__label,
body.left-panel-collapsed .nav-group > summary::after,
body.left-panel-collapsed .nav-group__body {
  display: none;
}

body.left-panel-collapsed .nav-collapse-button {
  width: 38px;
}

body.left-panel-collapsed .primary-nav__groups {
  padding: 8px 6px;
  overflow: hidden;
}

body.left-panel-collapsed .nav-group {
  border-color: transparent;
  background: transparent;
}

body.left-panel-collapsed .nav-group > summary {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 42px;
  padding: 4px 0;
}

body.left-panel-collapsed .nav-group__icon {
  width: 38px;
  height: 34px;
}

/* Die obere Leiste bleibt global; Register/Analyse sind ab dev.18 links einsortiert. */
.topbar__tools {
  gap: 8px;
}

@media (max-width: 1050px) and (min-width: 821px) {
  :root {
    --left-panel-w: 264px;
  }

  .nav-group__body {
    padding-left: 39px;
  }
}

@media (max-width: 820px) {
  .primary-nav {
    order: 2;
    width: 100%;
    max-height: none;
  }

  .primary-nav__groups {
    height: auto;
    overflow: visible;
  }

  body.left-panel-collapsed .panel--left.primary-nav {
    display: none;
  }
}


/* v1.9.1-dev.19 – Kontextnavigation, reduzierte Topbar und rechter Inspektor-Dock */
:root {
  --topbar-h: 60px;
  --context-toolbar-h: 56px;
  --right-panel-w: 320px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(180px, 0.8fr) minmax(420px, 1.55fr);
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 10px;
}

.brand {
  min-width: 0;
  max-width: 330px;
  gap: 9px;
}

.brand__mark {
  width: 64px;
  height: 40px;
}

.brand__mark img {
  width: 60px;
  height: 36px;
}

.brand__copy strong {
  font-size: .9rem;
}

.brand__copy small {
  margin-top: 1px;
  font-size: .63rem;
}

.topbar-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .7rem;
  white-space: nowrap;
  overflow: hidden;
}

.topbar-breadcrumb span,
.topbar-breadcrumb strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-breadcrumb strong {
  color: var(--text);
  font-size: .72rem;
  font-weight: 750;
}

.topbar-breadcrumb__separator {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.topbar__tools {
  display: grid !important;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  min-width: 0;
  align-items: end;
  gap: 7px;
}

.topbar__search {
  min-width: 0;
}

.topbar__search input {
  width: 100%;
  min-width: 0;
}

.topbar-global-action,
.topbar-more > summary {
  white-space: nowrap;
}

.viewport-wrap {
  --context-toolbar-inline: 10px;
}

.context-toolbar {
  position: absolute;
  z-index: 31;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(145px, .7fr) auto minmax(150px, .7fr);
  align-items: center;
  gap: 10px;
  height: var(--context-toolbar-h);
  padding: 8px var(--context-toolbar-inline);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .965);
  box-shadow: 0 3px 12px rgba(31, 48, 58, .055);
  backdrop-filter: blur(14px);
}

.context-toolbar__identity {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.context-toolbar__identity span {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.context-toolbar__identity strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: .75rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-toolbar .view-switch {
  position: static !important;
  inset: auto !important;
  display: flex;
  width: auto !important;
  min-width: 248px;
  max-width: none !important;
  transform: none !important;
  padding: 3px;
  margin: 0;
  overflow: visible !important;
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
}

.context-toolbar .view-switch__button {
  min-height: 32px;
  flex: 1 1 0;
}

.context-toolbar__actions {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.context-toolbar__actions .context-action[hidden] {
  display: none !important;
}

.context-toolbar__actions #toggleRightPanelButton {
  min-width: 92px;
}

body.right-panel-collapsed .context-toolbar__actions #toggleRightPanelButton {
  border-color: rgba(0, 104, 180, .34);
  background: rgba(0, 104, 180, .08);
}

.view-layer {
  inset: var(--context-toolbar-h) 0 0;
}

#threeView .layer-menu {
  top: 13px;
  left: 13px;
}

#threeView .viewport-toolbar {
  top: 13px;
}

.topology-layer {
  padding: 10px 14px 14px;
}

.topology-header {
  height: 50px;
  padding-top: 0;
}

.topology-scroller {
  height: calc(100% - 50px);
}

.inspector-dock {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.inspector-dock__head {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 8px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 97%, var(--surface));
}

.inspector-dock__head > div {
  display: grid;
  gap: 1px;
}

.inspector-dock__head span {
  color: var(--muted);
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.inspector-dock__head strong {
  font-size: .78rem;
}

.inspector-dock__head small {
  max-width: 145px;
  color: var(--muted);
  font-size: .59rem;
  line-height: 1.25;
  text-align: right;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 252, .94);
}

.inspector-tab {
  min-width: 0;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .68rem;
  font-weight: 750;
  cursor: pointer;
}

.inspector-tab:hover,
.inspector-tab:focus-visible {
  border-color: rgba(0, 104, 180, .2);
  background: rgba(0, 104, 180, .06);
  outline: none;
}

.inspector-tab.is-active {
  border-color: rgba(0, 104, 180, .28);
  background: rgba(0, 104, 180, .11);
  color: #0f668e;
}

.inspector-dock__panel {
  min-height: 0;
  padding: 12px 13px 18px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.inspector-dock__panel[hidden] {
  display: none !important;
}

.inspector-dock__panel .panel section + section {
  margin-top: 0;
}

.inspector-dock__panel > section {
  margin: 0;
}

.inspector-dock__panel .location-focus-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.inspector-dock__panel .route-planner {
  margin-top: 0;
}

/* Arbeitsdialoge verwenden ihre Ansichtsreiter als lokale Kontextnavigation. */
.scenario-dialog__tabs {
  position: sticky;
  top: 58px;
  z-index: 5;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  scrollbar-width: thin;
}

.scenario-tab {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 9px;
  padding: 6px 11px;
}

.scenario-tab.is-active {
  border-width: 1px;
  box-shadow: inset 0 -2px 0 var(--accent);
}

@media (max-width: 1180px) and (min-width: 821px) {
  .topbar {
    grid-template-columns: minmax(200px, auto) minmax(140px, .55fr) minmax(360px, 1.45fr);
    gap: 8px;
  }

  .brand__copy small {
    display: none;
  }

  .topbar-breadcrumb {
    font-size: .64rem;
  }

  .context-toolbar {
    grid-template-columns: minmax(0, .45fr) auto minmax(112px, .45fr);
  }

  .context-toolbar__identity strong {
    max-width: 210px;
  }
}

@media (max-width: 900px) and (min-width: 821px) {
  .topbar-breadcrumb {
    display: none;
  }

  .topbar {
    grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
  }

  .context-toolbar__identity {
    display: none;
  }

  .context-toolbar {
    grid-template-columns: auto minmax(150px, 1fr);
  }
}

@media (max-width: 820px) {
  :root {
    --context-toolbar-h: 54px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    min-height: var(--topbar-h);
    gap: 8px;
  }

  .topbar-breadcrumb {
    display: none;
  }

  .topbar__tools {
    display: none !important;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
  }

  .topbar__tools.is-mobile-open {
    display: grid !important;
  }

  .topbar__tools > .search {
    grid-column: 1 / -1;
  }

  .context-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 6px 7px;
  }

  .context-toolbar__identity {
    display: none;
  }

  .context-toolbar .view-switch {
    min-width: 0;
    width: 100% !important;
  }

  .context-toolbar__actions {
    min-width: auto;
  }

  .context-toolbar__actions #flowToggleButton {
    display: none;
  }

  .context-toolbar__actions #toggleRightPanelButton {
    min-width: 44px;
    width: 44px;
    overflow: hidden;
    color: transparent;
    position: relative;
  }

  .context-toolbar__actions #toggleRightPanelButton::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text);
    content: "ⓘ";
  }

  .view-switch {
    right: auto !important;
    left: auto !important;
  }

  .topology-layer {
    padding: 8px;
  }

  .inspector-dock {
    order: 3;
  }

  .scenario-dialog__tabs {
    top: 0;
    padding-inline: 9px;
  }
}

@media (max-width: 560px) {
  .brand__mark {
    width: 54px;
    height: 36px;
  }

  .brand__mark img {
    width: 50px;
    height: 32px;
  }

  .context-toolbar .view-switch__button {
    min-height: 40px;
    font-size: .72rem;
    padding-inline: 7px;
  }
}


/* v1.9.1-dev.20 – Arbeitsplatz-Tabzeile dauerhaft sichtbar */
.scenario-dialog {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.scenario-dialog > .source-dialog__header {
  position: relative;
  top: auto;
  z-index: 7;
}

.scenario-dialog__notice {
  min-width: 0;
}

.scenario-dialog__tabs {
  position: relative;
  top: auto;
  z-index: 6;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.scenario-dialog__workspace {
  min-height: 0;
  overflow: hidden;
}

.scenario-map {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

@media (max-width: 560px) {
  .scenario-dialog {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .scenario-dialog__tabs {
    top: auto;
  }
}


/* v1.9.1-dev.21 – Navigation/3D-Polish und neutrale UI mit #0068b4 */

:root {
  --success: #16856d;
}

/* Semantische Erfolgsmarker bleiben bewusst grün; die allgemeine UI nicht. */
.dot--exact {
  background: var(--success);
}

.protection-status--verified,
.quality-badge--ok {
  color: var(--success);
}

/* Die 3D/2D-Umschaltung und das Ebenenmenü bilden eine gemeinsame obere Einheit. */
.context-toolbar__view-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.context-toolbar__view-controls .view-switch {
  position: static !important;
  inset: auto !important;
  display: flex;
  width: auto !important;
  min-width: 248px;
  max-width: none !important;
  transform: none !important;
  margin: 0;
}

.context-toolbar__view-controls .layer-menu {
  position: relative !important;
  inset: auto !important;
  z-index: 38;
  flex: 0 0 auto;
}

.context-toolbar__view-controls .layer-menu[hidden] {
  display: none !important;
}

.context-toolbar__view-controls .layer-menu__summary {
  min-height: 38px;
  padding-inline: 12px;
  border-color: rgba(48, 57, 64, .18);
  background: #f4f6f7;
  box-shadow: none;
}

.context-toolbar__view-controls .layer-menu[open] .layer-menu__summary {
  border-color: rgba(0, 104, 180, .42);
  background: rgba(0, 104, 180, .09);
  color: var(--accent);
}

.context-toolbar__view-controls .layer-menu .viewport-toolbar {
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(520px, calc(100vw - 80px));
  min-width: min(420px, calc(100vw - 80px));
  max-width: 520px;
  border-color: rgba(48, 57, 64, .18);
  background: rgba(250, 251, 252, .985);
  box-shadow: 0 16px 36px rgba(28, 34, 39, .16);
}

.context-toolbar .view-switch {
  border-color: rgba(48, 57, 64, .17);
  background: #f1f3f4;
}

.context-toolbar .view-switch__button {
  color: #65717a;
}

.context-toolbar .view-switch__button.is-active {
  color: #fff;
  background: #0068b4;
  box-shadow: 0 2px 8px rgba(0, 104, 180, .2);
}

/* Keine zweite Ebenen-Schaltfläche mehr frei im 3D-Viewport. */
#threeView > .layer-menu {
  display: none !important;
}

/* Kamerapresets über die gesamte verfügbare Breite. */
.camera-presets {
  right: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  width: auto;
  max-width: none;
  gap: 5px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(48, 54, 59, .94);
}

.camera-presets .mini-chip {
  width: 100%;
  min-width: 0;
  color: #dfe4e7;
  border-color: rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .035);
}

.camera-presets .mini-chip:hover,
.camera-presets .mini-chip:focus-visible {
  color: #fff;
  border-color: rgba(0, 104, 180, .72);
  background: rgba(0, 104, 180, .30);
}

/* Arbeitsplatz: lokale Navigation zuerst, Aussagegrenze danach. */
.scenario-dialog {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.scenario-dialog__tabs {
  padding: 8px 16px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid rgba(48, 57, 64, .12);
  background: #f2f4f5;
}

.scenario-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 8px;
  background: #f8f9fa;
}

.scenario-tab.is-active {
  border-color: #0068b4;
  background: rgba(0, 104, 180, .10);
  color: #005a9b;
}

.scenario-dialog__notice {
  margin: 8px 16px 0;
}

/* Etwas weniger grün/blauer UI-Chrome; Fachdatenfarben bleiben erhalten. */
.statusbar {
  background: #30363b;
}

.nav-group > summary,
.inspector-dock__head,
.inspector-tabs,
.context-toolbar {
  background-color: rgba(250, 251, 252, .97);
}

.nav-action.is-nav-active,
.nav-action[aria-current="page"],
.inspector-tab.is-active {
  color: #005a9b;
}

.layer-menu__grid .chip.is-active {
  border-color: rgba(0, 104, 180, .48);
  background: rgba(0, 104, 180, .10);
  color: #005a9b;
}

@media (max-width: 980px) {
  .context-toolbar {
    grid-template-columns: minmax(110px, .55fr) auto minmax(110px, .55fr);
  }

  .context-toolbar__view-controls {
    gap: 4px;
  }

  .context-toolbar__view-controls .view-switch {
    min-width: 210px;
  }

  .context-toolbar__view-controls .layer-menu__summary {
    padding-inline: 9px;
  }
}

@media (max-width: 760px) {
  .context-toolbar__view-controls {
    justify-content: flex-start;
  }

  .context-toolbar__view-controls .layer-menu .viewport-toolbar {
    right: auto;
    left: 0;
    min-width: min(360px, calc(100vw - 32px));
  }

  .camera-presets {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }
}


/* v1.9.1-dev.22 – vertikale Entzerrung, stabile Menüs und Arbeitsplatz-Reiter */

/*
 * Die globale Kopfzeile benötigt genug reale Höhe für Suchlabel + 40-px-Control.
 * Gleichzeitig erhält sie einen eigenen hohen Stacking-Kontext, damit das
 * Optionen-Menü nicht hinter Kontexttoolbar oder Viewport geraten kann.
 */
:root {
  --topbar-h: 72px;
  --context-toolbar-h: 60px;
}

.topbar {
  position: relative;
  z-index: 100;
  overflow: visible;
  padding-block: 7px;
}

.topbar__search input {
  height: 40px;
}

.topbar-global-action,
.topbar-more > summary.toolbar-menu-summary {
  min-height: 40px;
  height: 40px;
}

.topbar-more__menu {
  z-index: 160;
}

/* 3D/2D, Ebenen und Inspektor erhalten dieselbe vertikale Control-Höhe. */
.context-toolbar {
  padding-block: 9px;
}

.context-toolbar .view-switch__button,
.context-toolbar__view-controls .layer-menu__summary,
.context-toolbar__actions .button {
  min-height: 40px;
}

/*
 * Die Arbeitsplatz-Reiter dürfen als Grid-Autozeile nicht auf ihre reine
 * Content-Höhe zusammenschrumpfen. 54 px = 36-px-Reiter + vertikale Luft.
 * Damit werden Unterkante/Text auch bei horizontalem Overflow nicht abgeschnitten.
 */
.scenario-dialog {
  grid-template-rows: auto minmax(54px, max-content) auto minmax(0, 1fr);
}

.scenario-dialog__tabs {
  min-height: 54px;
  align-items: center;
  padding-block: 8px;
}

.scenario-tab {
  min-height: 36px;
  height: 36px;
  padding-block: 0;
  line-height: 1.2;
}

/* Ebenenvorgaben folgen der hellen Explorer-Chrome statt dem alten Dark-Viewport-Look. */
.layer-menu__actions .mini-chip {
  width: auto;
  min-width: 74px;
  min-height: 34px;
  border-width: 1px;
  border-color: rgba(48, 57, 64, .18);
  background: #f6f7f8;
  color: #465159;
}

.layer-menu__actions .mini-chip:hover,
.layer-menu__actions .mini-chip:focus-visible {
  border-color: rgba(0, 104, 180, .42);
  background: rgba(0, 104, 180, .08);
  color: #005a9b;
  outline: none;
}

@media (max-width: 820px) {
  .topbar {
    padding-block: 7px;
  }

  .scenario-dialog__tabs {
    min-height: 54px;
  }
}
