.topology-canvas { display: flex; flex-direction: column; }
.topology-editor {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 440px;
  background: #fff;
  border: 1px solid #d9e3ee;
  border-radius: 10px;
  overflow: hidden;
}
.topology-toolbar { flex: none; }
.topology-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; }
.topology-controls input[type="search"] { width: 208px; }
.topology-controls .dv-search { margin: 0; }
.topology-edit { border-top: 1px solid #e8eef5; }
.topology-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: auto;
  font-size: 13px;
  color: #4b627c;
}
.topology-mode select { min-height: 30px; padding: 0 6px; border: 1px solid #d6e1ed; border-radius: 6px; background: #fff; }
.topology-controls [aria-pressed="true"] { color: #155cae; background: #eaf3ff; border-color: #9ec1eb; }
.topology-toolbar-divider { width: 1px; height: 20px; margin-inline: 4px; background: #dee7f2; }
.topology-save-spacer { flex: 1; }
.topology-small, .topology-edit [data-draft] { font-size: 12px; color: #576c83; }
.topology-feedback {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 12px;
  color: #704a14; background: #fff5e4; border-top: 1px solid #f1dfc0; font-size: 13px;
}
.topology-feedback p { margin: 0; }
.topology-work { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) 246px; min-height: 320px; border-top: 1px solid #d9e3ee; }
.topology-view { position: relative; min-width: 0; min-height: 0; background: #152235; overflow: hidden; touch-action: none; }
.topology-view[data-tool="hand"] { cursor: grab; }
.topology-view[data-tool="arrow"] { cursor: crosshair; }
.topology-view[data-tool="hand"]:active { cursor: grabbing; }
.topology-view canvas, .topology-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.topology-overlay { pointer-events: none; }
.topology-hit {
  position: absolute; top: 0; left: 0; padding: 0; border: 0; border-radius: 7px;
  background: transparent; pointer-events: auto;
}
.topology-hit:focus-visible { outline-color: #9ae9dd; }
.topology-hit-zone { z-index: 0; }
.topology-hit-device, .topology-hit-box, .topology-hit-text { z-index: 1; }
.topology-view[data-tool="hand"] .topology-hit, .topology-view[data-tool="arrow"] .topology-hit { cursor: inherit; }
.topology-resize {
  position: absolute; inset: 0 auto auto 0; z-index: 2; width: 14px; height: 14px;
  border: 2px solid #163d50; border-radius: 4px; background: #86e1d5; pointer-events: auto; cursor: nwse-resize;
}
.topology-empty {
  position: absolute; inset: 50% 10px auto; transform: translateY(-50%); margin: 0;
  color: #d2dfef; text-align: center; pointer-events: none;
}
.topology-details { min-height: 0; overflow: auto; border-left: 1px solid #d9e3ee; }
.topology-details section { padding: 13px 14px; border-bottom: 1px solid #edf1f5; }
.topology-details h3 { margin: 0 0 8px; font-size: 14px; overflow-wrap: anywhere; }
.topology-details h3 small { color: #61758c; font-weight: 500; }
.topology-details dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0 0 10px; font-size: 12px; }
.topology-details dt { color: #52677d; }
.topology-details dd { margin: 0; overflow-wrap: anywhere; }
.topology-details .field { margin-block: 9px; }
.topology-details ul { list-style: none; padding: 0; margin: 0; }
.topology-wires li { border-bottom: 1px solid #edf1f5; padding: 6px 0; font-size: 12px; overflow-wrap: anywhere; }
.topology-wires li > span, .topology-wires li > small { display: block; color: #52677d; }
.topology-wires li small:empty { display: none; }
.topology-list-button {
  border: 0; background: transparent; padding: 3px 4px; margin-inline: -4px; text-align: start; font-size: 13px;
  border-radius: 4px; color: #1c5c9f; font-weight: 650; overflow-wrap: anywhere;
}
.topology-list-button:hover { background: #ebf4ff; }
.topology-list-button small { display: block; color: #61758c; font-weight: 400; }
.topology-list-button[draggable] { cursor: grab; }
.topology-pool > button { margin-top: 6px; }
.topology-annotation-text { margin-top: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.topology-object-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.topology-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 6px; padding: 6px 12px; font-size: 11px; color: #516983; border-top: 1px solid #e6ecf4;
}
.topology-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.topology-legend i { width: 12px; height: 0; border-top: 2px solid; margin-inline-start: 6px; }
.topology-optical { color: #8261c2; }
.topology-copper { color: #1b887b; }
.topology-wire { color: #517ca9; }
.topology-legend .topology-arrow { color: #a97425; border-top-style: dashed; }

@media (max-width: 1020px) {
  .topology-work { grid-template-columns: minmax(0, 1fr) 194px; }
  .topology-mode { margin-inline-start: 0; }
}
@media (max-width: 680px) {
  .topology-work { display: flex; flex-direction: column; flex: none; }
  .topology-view { height: 55vh; min-height: 270px; }
  .topology-details { max-height: 280px; border-left: 0; border-top: 1px solid #e6ecf4; }
}
