.topology-header, .topology-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: #1b1716;
}
#network-lab .topology-header h2 {
  margin: 0;
  color: #fff1e5;
  font: 400 clamp(1.25rem, 3vw, 1.8rem)/1.1 "Archivo Black", sans-serif;
  letter-spacing: -.06em;
}
.topology-header p { color: #cfb3a0; font-size: 12px; margin: 6px 0 0; }
.topology-header .actions { flex-wrap: wrap; }
.topology-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  border-block: 1px solid var(--line);
}
.topology-scroll {
  overflow: auto;
  max-height: 610px;
  scrollbar-color: #865639 #201613;
  background: #211613;
}
.topology-scroll:focus-visible { outline: 2px solid #ffc394; outline-offset: -2px; }
#topology-board {
  position: relative;
  min-width: 540px;
  min-height: 344px;
  background:
    radial-gradient(ellipse at 50% 42%, #67381d61, transparent 63%),
    radial-gradient(circle, #93664c69 1px, transparent 1px) 0 0 / 18px 18px,
    #201613;
}
#topology-links, #topology-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
#topology-links { pointer-events: none; }
.emulator .topology-node {
  --node-accent: #ff9a59;
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 154px;
  height: 64px;
  padding: 9px;
  border: 1px solid #694735;
  border-radius: 9px;
  background: linear-gradient(150deg,#37241c,#281d18);
  box-shadow: 0 6px 15px #140b095f;
  user-select: none;
  touch-action: none;
  cursor: grab;
  text-align: left;
}
.emulator .topology-node[data-kind="device"] { background: linear-gradient(135deg,#59331e,#362219); }
.emulator .topology-node[data-kind="wired"], .emulator .topology-node[data-kind="laptop"] { --node-accent: #e7c7a6; }
.emulator .topology-node[data-kind="uplink"] { --node-accent: #f8bc79; }
.emulator .topology-node[data-attached="true"] { border-color: #a76b43; }
.emulator .topology-node[aria-pressed="true"] {
  z-index: 1;
  border-color: #ffb078;
  box-shadow: 0 0 0 2px #b4643866, 0 6px 18px #140b0990;
}
.emulator .topology-node.dragging { z-index: 2; cursor: grabbing; }
.topology-labels { display: grid; min-width: 0; gap: 5px; }
.topology-labels strong, .topology-labels small { overflow: hidden; text-overflow: ellipsis; }
.topology-labels strong { color: #ffeada; font-size: 12px; line-height: 1.15; }
.topology-labels small { color: #caad98; font-size: 10px; }
.topology-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  height: 27px;
  color: var(--node-accent);
  background: #261814;
  border: 1px solid #74513a;
  border-radius: 6px;
}
.topology-icon::before, .topology-icon::after { content: ""; position: absolute; }
[data-kind="device"] .topology-icon::before {
  width: 16px; height: 12px; background: currentColor;
  clip-path: polygon(0 25%,18% 25%,18% 0,85% 0,85% 22%,100% 22%,100% 78%,85% 78%,85% 100%,18% 100%,18% 75%,0 75%);
}
[data-kind="device"] .topology-icon::after { width: 7px; height: 5px; background: #5c371e; }
[data-kind="wifi"] .topology-icon::before { width: 15px; height: 12px; border-top: 2px solid; border-radius: 50%; top: 7px; }
[data-kind="wifi"] .topology-icon::after { width: 5px; height: 5px; border-top: 2px solid; border-radius: 50%; top: 12px; box-shadow: 0 3px 0 -1px currentColor; }
[data-kind="laptop"] .topology-icon::before { width: 12px; height: 8px; border: 1px solid; top: 6px; }
[data-kind="laptop"] .topology-icon::after { width: 17px; height: 2px; background: currentColor; top: 17px; }
[data-kind="wired"] .topology-icon::before { width: 13px; height: 9px; border: 1px solid; }
[data-kind="wired"] .topology-icon::after { width: 7px; height: 4px; background: repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 3px); }
[data-kind="uplink"] .topology-icon::before { width: 13px; height: 13px; border: 1px solid; border-radius: 50%; }
[data-kind="uplink"] .topology-icon::after { width: 13px; height: 4px; border-block: 1px solid; }
.topology-inspector { padding: 16px; min-width: 0; background: #1c1613; border-left: 1px solid var(--line); }
#network-lab .topology-caption { color: #f3a570; font-size: 11px; margin: 0 0 8px; }
.topology-inspector h3 { margin: 0 0 7px; font-size: 17px; overflow-wrap: anywhere; }
.topology-inspector p, .topology-inspector output { color: #cfb3a0; font-size: 12px; line-height: 1.5; }
.topology-inspector fieldset { border: 0; padding: 0; min-width: 0; margin: 0; }
.topology-properties { font-size: 12px; display: grid; gap: 4px; margin: 16px 0; }
.topology-properties dt { color: #d5aa8a; }
.topology-properties dd { color: #ffe5d4; margin: 0 0 7px; overflow-wrap: anywhere; }
#network-lab #network-form, .topology-action-form { display: grid; justify-items: start; gap: 10px; margin: 12px 0; }
#network-lab label, #network-lab .network-field { width: 100%; }
#network-lab .check { font-size: 11px; }
#network-lab input[name], #network-lab select { width: 100%; max-width: 100%; }
#network-lab input[type="checkbox"] { width: auto; }
#network-lab .topology-remove { color: #ffb38f; }
#network-result[data-error="true"] { color: #ffad99; }
.topology-footer { justify-content: start; font-size: 11px; color: #cdb5a5; }
.topology-footer span { display: inline-flex; align-items: center; gap: 7px; }
.topology-footer .topology-tip { margin-left: auto; }
.legend-line { width: 19px; border-top: 1px dashed #b4886e; }
.legend-line.live { border-top: 2px solid #ffa367; }
@media (max-width: 1110px) {
  .topology-workspace { grid-template-columns: minmax(0,1fr); }
  .topology-inspector { border-left: 0; border-top: 1px solid var(--line); }
  #network-lab #network-form { grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); align-items: end; }
}
@media (max-width: 560px) {
  .workspace-bar .view-switch { flex-wrap: wrap; }
  .topology-footer .topology-tip { margin-left: 0; }
}
.topology-radio-settings { display: grid; width: 100%; gap: 8px; }
.topology-client-add { width: 100%; }
.topology-client-add summary, .topology-packets summary { cursor: pointer; color: #ffbf92; font-size: 12px; }
#topology-actions { display: grid; gap: 8px; justify-items: start; }
.topology-action-form input { width: 100%; }
.topology-packets { width: 100%; min-width: 0; }
.topology-packets pre { margin: 8px 0; max-height: 225px; overflow: auto; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; color: #f3d9c6; }
#network-lab .topology-engine {
  width: auto;
  min-width: 130px;
  padding-inline-end: 4px;
  gap: 4px;
}
#network-lab .topology-engine select {
  color: #ffe1ca;
  background: #28201b;
  border: 1px solid #6b4732;
  border-radius: 6px;
  min-height: 28px;
  padding: 3px 6px;
  font: inherit;
}
