.cfg-help-wiring .cfg-layout-help-card {
  width: min(1240px, 100%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.cfg-help-wiring .cfg-layout-help-body { min-height: 0; overflow: auto; padding: 0; }
.cfg-help-wiring .cfg-layout-help-foot { border-top: 1px solid #354258; }
.cfg-help-wiring [data-rack-wiring-view] {
  --wire-accent: #7dd3fc;
  --wire-text: #e2e8f0;
  --wire-muted: #a7b6ca;
  --wire-line: #354258;
  --wire-panel: #1a2230;
  color: var(--wire-text);
  padding: clamp(12px, 2vw, 22px);
  font-size: 13px;
}
.cfg-wire-toolbar, .cfg-wire-terminate, .cfg-wire-cord, .cfg-wire-existing form, .cfg-wire-links li {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: end;
}
.cfg-wire-toolbar { justify-content: space-between; align-items: center; }
.cfg-wire-toolbar b { display: block; font-size: 16px; }
.cfg-wire-toolbar span, .cfg-wire-input small, .cfg-wire-links small { display: block; color: var(--wire-muted); }
.cfg-wire-feedback { margin: 8px 0 14px; color: var(--wire-accent); min-height: 1.4em; }
.cfg-wire-layout { display: grid; grid-template-columns: minmax(170px, 240px) minmax(0, 1fr); gap: 16px; }
.cfg-wire-layout h3 { font-size: 14px; margin: 0 0 9px; }
.cfg-wire-input-list { max-height: min(45vh, 480px); overflow: auto; margin: 5px -3px 10px; padding: 3px; }
.cfg-wire-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--wire-line);
  background: var(--wire-panel);
  color: var(--wire-text);
  border-radius: 8px;
  text-align: start;
  width: 100%;
  padding: 7px;
  margin-block: 4px;
  cursor: pointer;
  overflow-wrap: anywhere;
  font: inherit;
}
.cfg-wire-input[aria-pressed="true"] { border-color: var(--wire-accent); background: #19394a; }
.cfg-wire-input[hidden] { display: none; }
.cfg-wire-status { font-size: 10px; color: #f9cf86; flex: none; white-space: nowrap; }
.cfg-wire-status.is-connected { color: #8cebb3; }
.cfg-wire-status.is-invalid { color: #ff9eab; }
.cfg-wire-plan details, .cfg-wire-existing { margin-top: 10px; border-top: 1px solid var(--wire-line); padding-top: 8px; }
.cfg-wire-layout summary { cursor: pointer; color: var(--wire-text); }
.cfg-wire-layout label { display: grid; gap: 4px; min-width: 0; color: var(--wire-muted); }
.cfg-wire-layout label[hidden] { display: none; }
.cfg-wire-layout :is(input, select) {
  padding: 6px;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  border: 1px solid var(--wire-line);
  background: #121a25;
  border-radius: 5px;
  color: var(--wire-text);
}
.cfg-wire-existing form { margin-top: 8px; align-items: stretch; flex-direction: column; }
.cfg-wire-terminate { margin-bottom: 12px; }
.cfg-wire-terminate label { flex: 1 1 155px; }
.cfg-wire-cord { margin-top: 10px; }
.cfg-wire-cord label { flex: 1 1 118px; }
.cfg-wire-cord label:has(input) { flex: 0 1 80px; }
.cfg-wire-device-list {
  max-height: min(46vh, 510px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 3px;
}
.cfg-wire-device-stack { display: grid; gap: 7px; position: relative; }
.cfg-wire-trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.cfg-wire-trace path { fill: none; stroke: #7dd3fc; stroke-width: 2.4; stroke-dasharray: 5 4; stroke-linecap: round; filter: drop-shadow(0 1px 2px #020617); animation: cfg-wire-flow .75s linear 3; }
.cfg-wire-trace path.is-fiber { stroke: #dfb7ff; }
.cfg-wire-device {
  border: 1px solid #596577;
  background: linear-gradient(180deg, #283241 0, #171e28 45%, #202a39 100%);
  box-shadow: inset 0 1px #ffffff16, inset 0 -1px #0007;
  border-radius: 5px;
  padding: 8px;
}
.cfg-wire-device h4 { font-size: 12px; margin: 0 0 6px; }
.cfg-wire-face { display: flex; flex-wrap: wrap; gap: 3px; user-select: none; }
.cfg-wire-port-group { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; max-width: 100%; }
.cfg-wire-key { display: flex; gap: 4px 12px; flex-wrap: wrap; color: var(--wire-muted); padding: 0 4px 4px; font-size: 11px; }
.cfg-wire-key span::before { content: ""; display: inline-block; width: 9px; height: 7px; margin-inline-end: 4px; border: 1px solid #8795a7; border-radius: 2px; }
.cfg-wire-key .is-poe::before { border-color: #f6cb6b; }
.cfg-wire-key .is-uplink::before { border-color: #83dfae; }
.cfg-wire-key .is-fiber::before { border-color: #bc9def; }
.cfg-wire-port {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  align-content: start;
  min-width: 32px;
  padding: 3px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--wire-text);
  background: transparent;
  font: inherit;
  cursor: crosshair;
}
.cfg-wire-port small { font-size: 9px; }
.cfg-wire-socket {
  display: block;
  width: 23px;
  height: 16px;
  border: 1px solid #8795a7;
  background: repeating-linear-gradient(90deg, #be9865 0 1px, transparent 1px 3px) top 3px center / 15px 4px no-repeat, #0e1219;
  border-radius: 2px 2px 4px 4px;
  box-shadow: inset 0 0 0 2px #283240;
}
.cfg-wire-port.is-poe .cfg-wire-socket { border-color: #f6cb6b; }
.cfg-wire-port.is-uplink .cfg-wire-socket { border-color: #83dfae; }
.cfg-wire-port.is-fiber .cfg-wire-socket { height: 13px; margin-block: 2px 1px; background: #151120; border: 2px solid #bc9def; border-radius: 2px; }
.cfg-wire-port.is-circuit { color: #ccf4ff; background: #074d66; border-color: var(--wire-accent); }
.cfg-wire-port.is-from, .cfg-wire-port.is-to { background: #3b2c66; border-color: #c7acff; }
.cfg-wire-layout :is(button,input,select,summary):focus-visible { outline: 2px solid #b1e5ff; outline-offset: 1px; }
.cfg-wire-circuit {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 11px;
}
.cfg-wire-circuit li {
  position: relative;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid #48849c;
  background: #123144;
  animation: cfg-wire-reveal .22s ease-out both;
}
.cfg-wire-circuit li:nth-child(2) { animation-delay: .045s; }
.cfg-wire-circuit li:nth-child(3) { animation-delay: .09s; }
.cfg-wire-circuit li:nth-child(n+4) { animation-delay: .135s; }
.cfg-wire-circuit li:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 35%; color: var(--wire-accent); }
.cfg-wire-circuit small { display: block; color: #b1dbea; }
.cfg-wire-issues, .cfg-wire-links { list-style: none; margin: 6px 0 0; padding: 0; }
.cfg-wire-issues li { padding: 5px 8px; border-inline-start: 3px solid #f9cf86; background: #302719; margin-bottom: 4px; }
.cfg-wire-issues li.is-error { border-color: #f88c9d; background: #39232d; }
.cfg-wire-issue-link { padding: 0; border: 0; background: transparent; color: #b1e5ff; text-decoration: underline; font: inherit; cursor: pointer; }
.cfg-wire-links li { justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--wire-line); }
@keyframes cfg-wire-reveal { from { opacity: .45; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@keyframes cfg-wire-flow { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { .cfg-wire-circuit li, .cfg-wire-trace path { animation: none; } }
@media (max-width: 720px) {
  .cfg-wire-layout { grid-template-columns: minmax(0, 1fr); }
  .cfg-wire-input-list { max-height: 180px; }
  .cfg-wire-device-list { max-height: 300px; }
}
