:root {
  --bg: #0f1219;
  --bg-elevated: #171c28;
  --bg-panel: #1c2233;
  --border: #2a3348;
  --border-focus: #4a6cf7;
  --text: #e8ecf4;
  --text-muted: #8b95ab;
  --accent: #4a6cf7;
  --accent-hover: #5d7dff;
  --danger: #e85d6c;
  --success: #3dd68c;
  --port-face-max: 3.15rem;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

#app {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto 1fr;
  height: 100vh;
  overflow: hidden;
}

.toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ingor-brand-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

.ingor-brand-link:hover {
  opacity: 1;
}

.ingor-logo {
  display: block;
  width: auto;
  object-fit: contain;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ingor-logo-toolbar {
  height: 1.35rem;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.toolbar-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  margin: 0 0.25rem;
}

.btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: #252d42; border-color: #3a4560; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-accent { background: #2a3f6e; border-color: #3d5a9e; }
.btn-accent:hover { background: #354d85; }
.btn-danger { color: var(--danger); border-color: #5a3040; }
.btn-danger:hover { background: #2a1820; }
.btn-small { font-size: 0.78rem; padding: 0.35rem 0.65rem; }
.btn-file { display: inline-flex; align-items: center; cursor: pointer; }

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.panel h2 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.panel h3 {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.field span { font-size: 0.78rem; color: var(--text-muted); }

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-field input { width: auto; }

.hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.port-edit-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.range-row input {
  width: 4rem;
  font-family: var(--mono);
  padding: 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.vlan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vlan-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid transparent;
  font-size: 0.82rem;
}

.vlan-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}

.vlan-item-id {
  font-family: var(--mono);
  font-weight: 600;
  min-width: 2.5rem;
}

.vlan-item-label { flex: 1; color: var(--text-muted); }

.vlan-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
}

.vlan-item-delete:hover { color: var(--danger); background: rgba(232,93,108,0.1); }

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.panel-heading-row h2 {
  margin: 0;
}

.field-compact {
  margin-bottom: 0.65rem;
}

.field-compact span {
  font-size: 0.72rem;
}

.wireless-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wireless-item {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.wireless-item-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.5rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.wireless-item-main:hover {
  background: rgba(255, 255, 255, 0.04);
}

.wireless-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wireless-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.wireless-item-name {
  font-weight: 600;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wireless-item-meta {
  font-size: 0.7rem;
  color: #b8c4d8;
  line-height: 1.35;
}

.ap-list-block {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.ap-list-heading {
  margin-bottom: 0.4rem;
}

.ap-list-heading h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ap-item {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.ap-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.ap-item-main:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ap-item-name {
  font-weight: 600;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-item-meta {
  font-size: 0.68rem;
  color: #b8c4d8;
  line-height: 1.3;
}

.ap-item-delete {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.45rem;
}

.ap-item-delete:hover {
  color: var(--danger);
}

.ap-list-hint {
  margin-top: 0.35rem;
}

.wireless-ap-fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.wireless-ap-fieldset legend {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.wireless-ap-total-label {
  font-weight: 400;
  opacity: 0.85;
}

.ap-pick-list {
  margin: 0.35rem 0 0 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 10rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.ap-pick-item {
  align-items: flex-start;
}

.ap-pick-label {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.ap-pick-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.ap-pick-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ap-pick-empty {
  margin: 0;
  font-size: 0.72rem;
}

.wireless-item-delete {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.45rem;
  align-self: stretch;
}

.wireless-item-delete:hover {
  color: var(--danger);
  background: rgba(232, 93, 108, 0.1);
}

.workspace-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.workspace-header {
  display: flex;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  margin: 0;
  gap: 0.5rem;
}

.field.inline input {
  min-width: 220px;
}

.workspace {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem 2rem;
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, #2a3348 1px, transparent 0) 0 0 / 24px 24px;
  background-color: #12161f;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

.workspace-empty {
  margin: auto;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.cable-scroll-anchor {
  align-self: flex-start;
  width: 0;
  min-width: 0;
  height: 0;
  flex-shrink: 0;
  pointer-events: none;
  visibility: hidden;
}

.cable-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 30;
  overflow: visible;
}

.cable-path-shadow {
  fill: none;
  stroke: rgba(15, 18, 25, 0.75);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cable-path {
  fill: none;
  stroke: #7eb8f0;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cable-end-shadow {
  fill: rgba(15, 18, 25, 0.7);
  stroke: none;
}

.cable-end {
  fill: #8ec5ff;
  stroke: #1a2a3d;
  stroke-width: 1.5;
}

.cable-label {
  fill: #c8daf0;
  font-family: var(--mono);
  font-size: 10px;
  paint-order: stroke;
  stroke: rgba(15, 18, 25, 0.85);
  stroke-width: 3px;
}

.cable-draft {
  fill: none;
  stroke: #ffd666;
  stroke-width: 2;
  stroke-dasharray: 4 3;
  animation: cable-pulse 1s ease-in-out infinite;
}

@keyframes cable-pulse {
  50% { opacity: 0.45; }
}

.cable-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cable-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
}

.cable-list-label {
  flex: 1;
  line-height: 1.35;
  color: var(--text-muted);
}

.cable-list-delete {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.15rem;
  border-radius: 4px;
}

.cable-list-delete:hover {
  color: var(--danger);
  background: rgba(232, 93, 108, 0.1);
}

.btn.active {
  background: rgba(74, 108, 247, 0.22);
  border-color: var(--accent);
  color: #b8c8ff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.port-jack.cable-draft-source {
  outline: 2px solid #ffd666;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 214, 102, 0.25);
}

.switch-card.cable-mode .port-jack:hover .port-jack-face {
  outline: 1px dashed rgba(107, 159, 212, 0.8);
  outline-offset: 1px;
}

/* ── Full-width switch rack unit ── */
.switch-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: linear-gradient(180deg, #161b26 0%, #12161f 100%);
  border: 1px solid #2f3a52;
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  user-select: none;
}

.switch-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.switch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(180deg, #1e2638 0%, #1a2030 100%);
  border-bottom: 1px solid #2f3a52;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
}

.switch-header:hover .switch-drag-hint { opacity: 0.7; }

.switch-drag-hint {
  opacity: 0.35;
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
  line-height: 1;
}

.switch-card.switch-dragging {
  opacity: 0.55;
  outline: 2px dashed var(--accent);
}

.switch-card.switch-drop-target {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.switch-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.switch-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.switch-body {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.switch-notes {
  width: 100%;
  align-self: stretch;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
  font-style: italic;
}

.switch-faceplate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* ── Rack faceplate (flat manufacturer style) ── */
.switch-chassis {
  display: flex;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  background: #c9ced6;
  border: 1px solid #9aa3b0;
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 3px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.switch-chassis.unifi-style .rack-ear { display: none; }

.chassis-inner {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  min-width: 0;
  --port-w: 1.85rem;
  --port-face-h: 2.2rem;
}

.chassis-brand-col.slim {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 0;
  width: 0.55rem;
  padding: 0 0.2rem 0 0;
  border-right: 1px solid #b0b8c4;
  justify-content: center;
}

.chassis-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-led {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c0c8d4;
}

.status-led.sys { background: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.55); }
.status-led.pwr { background: #eab308; box-shadow: 0 0 4px rgba(234, 179, 8, 0.5); }
.status-led.act { background: #22c55e; box-shadow: 0 0 4px rgba(34, 197, 94, 0.45); animation: blink 2.5s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chassis-brand-col .chassis-status {
  margin: 0;
}

.chassis-model.slim {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 1.1rem;
  padding: 0 0 0 0.2rem;
  border-left: 1px solid #b0b8c4;
  align-items: center;
  justify-content: center;
}

.chassis-model.slim .chassis-sku {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.42rem;
  letter-spacing: 0.04em;
}

.chassis-main {
  flex: 0 1 auto;
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
}

.chassis-rj45-zone {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

/* Manufacturer layout: banks of pair-columns (odd↑ even↓) */
.port-field {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.port-bank {
  display: flex;
  gap: 3px;
  padding: 0.35rem 0.45rem;
  background: #b4bac4;
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}

.port-pair-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--port-w);
  flex-shrink: 0;
}

.port-idx {
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  color: #4b5563;
  height: 0.52rem;
  line-height: 0.52rem;
  text-align: center;
  width: 100%;
}

.port-idx.empty {
  visibility: hidden;
}

.port-pair-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.port-slot {
  width: 100%;
  display: flex;
  justify-content: center;
}

.port-jack-wrap {
  position: relative;
  width: 100%;
}

.port-jack {
  width: 100%;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.port-jack-face {
  position: relative;
  display: block;
  width: 100%;
  height: var(--port-face-h);
  background: #2a3038;
  border-radius: 3px 3px 4px 4px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.06),
    inset 0 -3px 6px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.port-rj45-cavity {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: 58%;
  height: 38%;
  background: #080a0e;
  border-radius: 2px 2px 1px 1px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.95);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 78% 72%, 72% 100%, 28% 100%, 22% 72%, 0 72%);
}

.port-vlan-glow {
  position: absolute;
  inset: 0;
  background: var(--vlan-tint);
  opacity: 0.38;
  pointer-events: none;
}

.port-jack.has-vlan .port-vlan-glow { opacity: 0.5; }

.port-jack.has-lag .port-jack-face {
  box-shadow:
    inset 0 0 0 2px var(--lag-color, #f59f00),
    inset 0 2px 0 rgba(255, 255, 255, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.port-lag-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 5;
  min-width: 0.95rem;
  padding: 0 0.15rem;
  border-radius: 2px;
  background: var(--lag-color, #f59f00);
  color: #111;
  font-family: var(--mono);
  font-size: 0.46rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.port-poe-toggle {
  position: absolute;
  right: -3px;
  bottom: -3px;
  z-index: 4;
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1px solid #9ca3af;
  border-radius: 2px;
  background: #e5e7eb;
  color: #9ca3af;
  font-family: var(--mono);
  font-size: 0.36rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}

.port-jack-wrap:hover .port-poe-toggle,
.port-poe-toggle.on {
  opacity: 1;
}

.port-poe-toggle:hover { border-color: #d97706; color: #d97706; background: #fff; }
.port-poe-toggle.on {
  background: #fef3c7;
  border-color: #d97706;
  color: #d97706;
  box-shadow: 0 0 4px rgba(217, 119, 6, 0.35);
}

.port-jack:hover .port-jack-face {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.port-jack.selected-port .port-jack-face {
  box-shadow:
    0 0 0 2px #2563eb,
    0 0 10px rgba(37, 99, 235, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.08);
}

.port-jack.has-poe .port-jack-face::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 4px #fbbf24;
  z-index: 2;
}

/* SFP uplink — same port width as RJ45, yellow panel */
.chassis-uplink {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  padding: 0.35rem 0.4rem;
  min-width: calc(var(--port-w) * var(--sfp-cols, 2) + 0.65rem);
  background: #facc15;
  border: 1px solid #ca8a04;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.sfp-panel-label {
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  font-family: var(--mono);
  font-size: 0.38rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #92400e;
  text-align: center;
  line-height: 1;
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
}

.sfp-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-height: 0;
  padding-top: 0.35rem;
}

.sfp-field.sfp-single-row {
  justify-content: center;
}

.sfp-field.sfp-single-row .port-jack-face.sfp-face {
  height: calc(var(--port-face-h) * 2 + 3px);
}

.sfp-uplink-duo {
  min-width: calc(var(--port-w) + 0.7rem);
  justify-content: center;
}

.sfp-duo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--port-w);
  flex: 1;
  padding-top: 0.4rem;
}

.sfp-pair-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.marquee-box {
  position: absolute;
  border: 2px dashed rgba(74, 108, 247, 0.85);
  background: rgba(74, 108, 247, 0.12);
  border-radius: 3px;
  pointer-events: none;
  z-index: 25;
  display: none;
}

.marquee-box.active {
  display: block;
}

.vlan-color-input {
  width: 1.65rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.vlan-item {
  gap: 0.4rem;
}

.sfp-port-row {
  display: flex;
  gap: 2px;
  justify-content: center;
  align-items: stretch;
}

.port-jack-wrap.sfp-wrap {
  width: var(--port-w);
  flex-shrink: 0;
}

.port-jack.port-sfp {
  width: 100%;
}

.port-jack-face.sfp-face {
  height: var(--port-face-h);
  background: #2a3038;
}

.port-sfp-cavity {
  position: absolute;
  inset: 6px 7px;
  background: #080a0e;
  border-radius: 2px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.95);
}

.port-jack.port-sfp .port-silk-num {
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  z-index: 3;
  font-size: 0.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  pointer-events: none;
}

.switch-card.cable-mode .port-jack:hover .port-jack-face {
  outline: 1px dashed #3b82f6;
  outline-offset: 1px;
}

.chassis-model {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-left: 0.5rem;
  border-left: 1px solid #b0b8c4;
  min-width: 3.5rem;
}

.chassis-sku {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 600;
  color: #4b5563;
}

.chassis-series {
  font-size: 0.42rem;
  letter-spacing: 0.08em;
  color: #9ca3af;
  text-transform: uppercase;
}

.switch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  padding: 0.35rem 0.15rem 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 100%;
  align-self: stretch;
}

.switch-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.switch-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.12);
}

.switch-legend-vid {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.port-hint {
  margin: -0.35rem 0 0.5rem;
}

.lag-assign {
  margin-top: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.lag-assign h3 {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.lag-assign .hint {
  margin-bottom: 0.5rem;
}

.switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Modals */
.modal {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow);
  max-width: 380px;
  width: calc(100% - 2rem);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.modal form { padding: 1.25rem; }

.modal h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Export / print */
.export-mount {
  position: fixed;
  left: -9999px;
  top: 0;
  pointer-events: none;
}

.export-mount.export-capturing {
  left: 0;
  top: 0;
  right: 0;
  width: 100%;
  z-index: 99999;
}

.export-root {
  font-family: var(--font);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.export-root .port-jack-face.export-colored-face {
  /* inline background-color set per VLAN — do not override */
}

.export-root .port-jack.unassigned .port-jack-face.export-colored-face,
.export-root .port-jack.has-vlan .port-jack-face.export-colored-face {
  background-image: none;
}

.export-faceplate-fit {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: visible;
}

.export-faceplate-scale {
  display: flex;
  justify-content: center;
}

.export-faceplate-scale .switch-faceplate {
  width: fit-content;
}

/* Strong VLAN fills — background-color is inline on .export-colored-face */
.export-root .port-jack-face.export-colored-face .port-rj45-cavity,
.export-root .port-jack-face.export-colored-face .port-sfp-cavity {
  opacity: 0.85;
}

.export-root.export-visual {
  width: auto;
  max-width: none;
}

.export-root.export-document {
  background: #fff;
  color: #111;
  padding: 20px 24px 28px;
  width: 1123px;
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1.45;
}

.export-root.export-document.export-landscape {
  width: 1123px;
}

/* Screen prep for Print / Save PDF — mirror @media print so cables stay aligned */
.export-root.export-printing.export-document {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.export-root.export-printing .export-cover-page {
  display: flex;
  flex-direction: column;
}

.export-root.export-printing .export-cover-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.export-mount.export-capturing:has(.export-printing) {
  position: static !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  width: auto !important;
}

.export-root .port-jack {
  cursor: default;
  pointer-events: none;
}

.export-root .port-poe-toggle {
  display: none !important;
}

.export-root .port-poe-mark {
  display: none !important;
}

.export-root .switch-chassis {
  overflow: visible;
}

.export-root .chassis-main {
  overflow: visible;
}

.export-root .port-jack-wrap {
  overflow: visible;
}

.export-root .status-led.act {
  animation: none;
}

.export-doc-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid #111;
}

.export-doc-header-main {
  min-width: 0;
  flex: 1;
}

.ingor-logo-export-header {
  height: 1.65rem;
  flex-shrink: 0;
}

.ingor-logo-export-footer {
  height: 0.85rem;
}

.export-page-footer-product {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #999;
  font-size: 0.62rem;
}

.export-page-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
  color: #111;
}

.export-page-subtitle {
  font-size: 0.82rem;
  margin: 0;
  color: #555;
}

.export-vlan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
}

.export-vlan-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.export-vlan-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.export-empty {
  text-align: center;
  opacity: 0.65;
  padding: 2rem 0;
}

/* ── PNG visual export (dark canvas) ── */
.export-root.export-visual {
  background: transparent;
  color: #e8ecf4;
}

.export-visual-canvas {
  position: relative;
  width: 1123px;
  min-width: 1123px;
  max-width: none;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 1px 1px, #2a3348 1px, transparent 0) 0 0 / 24px 24px,
    #12161f;
  padding: 40px 80px 36px 48px;
  border-radius: 12px;
}

.export-visual-canvas.export-landscape {
  width: 1123px;
  min-width: 1123px;
}

.export-root.export-visual .chassis-inner {
  --port-w: 2.25rem;
  --port-face-h: 2.65rem;
}

.export-root.export-visual .port-idx {
  font-size: 0.58rem;
  height: 0.62rem;
  line-height: 0.62rem;
}

.export-visual-canvas .export-page-subtitle {
  color: #9aa8bc;
}

.export-visual-canvas .export-vlan-legend {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #2f3a52;
  color: #c8d4e8;
}

.export-visual-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.export-layout-horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem 2rem;
}

.export-layout-horizontal .export-switch-visual {
  flex: 0 1 auto;
  max-width: 100%;
}

.export-pdf-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.export-cover-page {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.export-cover-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.export-cover-diagram {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.export-cover-page .export-diagram-area {
  flex: 0 0 auto;
  margin-bottom: 0;
  overflow: visible;
  padding: 0.35rem 0.45rem;
}

.export-cover-page .export-switch-visual-body {
  padding: 0.35rem 0.2rem 0.45rem;
}

.export-cover-page .export-faceplate-fit {
  width: 100%;
}

.export-cover-page .export-faceplate-scale {
  width: 100%;
  display: flex;
  justify-content: center;
}

.export-cover-page .export-doc-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.45rem;
}

.export-cover-page .export-vlan-legend {
  margin-bottom: 0.55rem;
  padding: 0.45rem 0.55rem;
}

.export-cover-page .export-cover-meta {
  margin-top: 0.4rem;
}

.export-cover-page .export-visual-stack {
  flex-direction: column;
  gap: 0.75rem;
}

.export-cover-page .export-switch-visual {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}

.export-cover-meta {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.export-cover-meta > :only-child {
  grid-column: 1 / -1;
}

.export-cover-content > .export-page-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 0.5rem;
}

.export-cover-notes-section,
.export-cover-cables {
  margin: 0 !important;
  padding: 0.45rem 0.6rem;
  background: #f8f9fb;
  border: 1px solid #dde1e8;
  border-radius: 8px;
}

.export-cover-notes-section .export-detail-heading,
.export-cover-cables .export-detail-heading {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
}

.export-cover-notes-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.72rem;
  line-height: 1.4;
}

.export-cover-cables .export-cable-summary {
  font-size: 0.72rem;
  padding-left: 1rem;
}

.export-cover-notes-list dt {
  margin: 0;
  font-weight: 600;
  color: #333;
}

.export-cover-notes-list dd {
  margin: 0;
  color: #444;
}

.export-cover-cables {
  margin-top: 0 !important;
}

.export-root.export-document .export-switch-visual-body {
  overflow: visible;
}

.export-wireless-page-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.export-wireless-page-body {
  margin-bottom: 0;
}

.export-overview-block {
  margin-bottom: 0.85rem;
}

.export-overview-block > .export-detail-heading {
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}

.export-switch-page {
  margin-top: 0;
  padding-top: 0;
}

.export-switch-page-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #cfd4dc;
  font-size: 0.72rem;
  color: #666;
}

.export-switch-page-banner-title {
  font-weight: 600;
  color: #333;
}

.export-switch-page-banner-switch {
  font-family: var(--mono);
  font-weight: 600;
  color: #111;
}

.export-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid #dde1e8;
  font-size: 0.65rem;
  color: #888;
}

.export-page-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #999;
}

.export-page-footer-title {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-page-footer-page {
  font-family: var(--mono);
  color: #666;
}

.export-diagram-area {
  position: relative;
  margin-bottom: 1.25rem;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.export-diagram-area.has-cables {
  padding-right: 52px;
  overflow: visible;
}

.export-diagram-area .export-visual-stack {
  position: relative;
  z-index: 1;
  overflow: visible;
  max-width: 100%;
}

.export-cable-raster {
  position: absolute;
  pointer-events: none;
  z-index: 25;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.export-cable-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 25;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.export-cable-overlay,
.export-cable-raster {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 25;
  overflow: visible;
}

.export-root.export-document .export-diagram-area {
  padding: 0.65rem 0.75rem;
  background: #f8f9fb;
  border-radius: 8px;
  border: 1px solid #dde1e8;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.export-root.export-document .export-cover-page .export-diagram-area {
  padding: 0.35rem 0.45rem;
}

/* Overview switches on print doc — light paper theme (not dark PNG style) */
.export-root.export-document .export-switch-visual {
  background: #fff;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  box-shadow: none;
}

.export-root.export-document .export-switch-visual-header {
  background: #eef0f4;
  border-bottom: 1px solid #dde1e8;
}

.export-root.export-document .export-switch-visual-title {
  color: #111;
  font-size: 0.88rem;
}

.export-root.export-document .export-switch-visual-meta {
  color: #555;
}

.export-root.export-document .export-switch-visual-body {
  padding: 0.65rem 0.75rem 0.75rem;
  background: #fafbfc;
}

.export-root.export-document .switch-legend {
  color: #555;
}

.export-root.export-document .export-diagram-area .export-faceplate-fit {
  width: 100%;
  max-width: 100%;
}

.export-root.export-document .export-diagram-area .export-faceplate-scale {
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
  display: block;
}

.export-root.export-document .export-switch-print-face .export-faceplate-fit {
  width: 100%;
  max-width: 100%;
}

.export-root.export-document .export-switch-print-face .export-faceplate-scale {
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
  display: block;
}

.export-switch-visual {
  background: linear-gradient(180deg, #161b26 0%, #12161f 100%);
  border: 1px solid #2f3a52;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  overflow: visible;
}

.export-switch-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(180deg, #1e2638 0%, #1a2030 100%);
  border-bottom: 1px solid #2f3a52;
}

.export-switch-visual-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.export-switch-visual-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #9aa8bc;
}

.export-switch-visual-body {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.export-root.export-visual .switch-legend {
  color: #9aa8bc;
}

.export-root.export-document .switch-legend {
  color: #555;
}

.export-visual-cables {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 20;
  overflow: visible;
}

/* legacy selector — cables now use .export-cable-overlay / .export-cable-raster */

.export-visual-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: #6b7a94;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.export-visual-footer-product {
  font-weight: 600;
}

.export-cables-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2f3a52;
}

.export-cables-section .export-detail-heading {
  color: #c8d4e8;
}

.export-cable-summary {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: #9aa8bc;
  line-height: 1.5;
}

/* ── Print / PDF document (light) ── */
.export-root.export-document .export-vlan-legend {
  background: #f4f5f8;
  border: 1px solid #dde1e8;
  color: #333;
}

.export-switch-print {
  margin-bottom: 0;
  break-inside: avoid-page;
  page-break-inside: avoid;
  flex: 1;
}

.export-switch-print-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.85rem;
  background: #eef0f4;
  border: 1px solid #cfd4dc;
  border-radius: 8px 8px 0 0;
}

.export-switch-print-title {
  font-weight: 700;
  font-size: 1rem;
  color: #111;
}

.export-switch-print-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #555;
}

.export-switch-print-face {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.65rem 0.5rem;
  background: #fafbfc;
  border: 1px solid #cfd4dc;
  border-top: none;
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

.export-switch-print-face .export-faceplate-fit {
  max-width: 100%;
  overflow: visible;
}

.export-switch-print-face .export-faceplate-scale {
  max-width: 100%;
  overflow: visible;
}

.export-switch-print-details {
  border: 1px solid #cfd4dc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.export-switch-print-details .export-detail-section:only-child {
  grid-column: 1 / -1;
}

.export-switch-print-details .export-notes-section {
  grid-column: 1 / -1;
}

.export-detail-section {
  padding: 0.75rem 0.85rem;
  border-top: 1px solid #e4e7ec;
}

.export-detail-section:first-child {
  border-top: none;
}

.export-detail-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

.export-notes-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #333;
  font-style: italic;
}

.export-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.export-data-table th,
.export-data-table td {
  padding: 0.35rem 0.5rem;
  border: 1px solid #dde1e8;
  text-align: left;
  vertical-align: top;
}

.export-data-table th {
  background: #f0f2f6;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
}

.export-data-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.export-vlan-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.export-table-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.export-ports-cell {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
}

.export-data-table .export-table-swatch {
  margin-right: 0.35rem;
  vertical-align: middle;
}

.export-doc-footer {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dde1e8;
  font-size: 0.68rem;
  color: #888;
  text-align: right;
}

.export-root.export-document .export-cables-section {
  margin-top: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: #f8f9fb;
  border: 1px solid #dde1e8;
  border-radius: 8px;
}

.export-root.export-document .export-cable-summary {
  color: #444;
}

.export-wireless-section {
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.85rem;
  background: #f8f9fb;
  border: 1px solid #dde1e8;
  border-radius: 8px;
}

.export-root.export-visual .export-wireless-section {
  background: rgba(255, 255, 255, 0.06);
  border-color: #3d4d68;
  color: #eef2f8;
}

.export-root.export-visual .export-wireless-section .export-detail-heading {
  color: #f0f4fa;
}

.export-root.export-visual .export-wireless-section .export-data-table th,
.export-root.export-visual .export-wireless-section .export-data-table td {
  border-color: #3d4d68;
  color: #eef2f8;
}

.export-root.export-visual .export-wireless-section .export-data-table th {
  background: rgba(255, 255, 255, 0.08);
  color: #dce6f4;
}

.export-root.export-visual .export-wireless-section .export-data-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.export-root.export-visual .export-wireless-section .export-empty-inline {
  color: #c8d4e8;
  opacity: 1;
}

.export-root.export-visual .export-cover-notes-section,
.export-root.export-visual .export-cover-cables {
  background: rgba(255, 255, 255, 0.06);
  border-color: #3d4d68;
}

.export-root.export-visual .export-cover-meta .export-detail-heading {
  color: #f0f4fa;
}

.export-root.export-visual .export-cover-notes-list dt {
  color: #dce6f4;
}

.export-root.export-visual .export-cover-notes-list dd,
.export-root.export-visual .export-cover-cables .export-cable-summary {
  color: #9aa8bc;
}

.export-ap-inline {
  margin-bottom: 0.85rem;
}

.export-ap-inline .export-detail-heading {
  font-size: 0.72rem;
  margin-bottom: 0.4rem;
}

.export-empty-inline {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.7;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm 12mm 12mm;
  }

  html, body {
    width: 100%;
    height: auto;
    background: #fff !important;
  }

  #app { display: none !important; }

  .export-mount {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    z-index: auto !important;
    pointer-events: auto !important;
  }

  .export-mount.export-capturing {
    position: static !important;
  }

  .export-root {
    display: block !important;
    position: static;
    left: auto;
    width: 100%;
    max-width: none;
    background: #fff !important;
    color: #111 !important;
  }

  .export-root.export-document {
    padding: 0;
    width: 100%;
  }

  .export-root.export-printing {
    background: #fff !important;
  }

  .export-pdf-page {
    display: flex;
    flex-direction: column;
    break-after: page;
    page-break-after: always;
    overflow: visible;
    box-sizing: border-box;
    padding: 0;
  }

  .export-pdf-page:last-child {
    break-after: avoid;
    page-break-after: avoid;
  }

  .export-switch-page {
    overflow: visible !important;
  }

  .export-cover-page {
    display: flex !important;
    flex-direction: column;
    overflow: visible;
  }

  .export-cover-content {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
  }

  .export-cover-content > .export-page-footer {
    margin-top: auto;
  }

  .export-cover-page > .export-page-footer {
    display: none;
  }

  .export-cover-page .export-diagram-area {
    overflow: visible;
    max-width: 100%;
  }

  .export-cover-page .export-switch-visual,
  .export-cover-page .export-switch-visual-body {
    overflow: visible;
    max-width: 100%;
  }

  .export-cable-overlay {
    display: none !important;
  }

  .export-cable-raster,
  .export-cable-canvas {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .export-root .port-poe-mark,
  .export-root .port-poe-toggle {
    display: none !important;
  }

  .export-switch-print-face {
    overflow: visible !important;
    max-height: none !important;
  }

  .export-root .switch-chassis,
  .export-root .chassis-main,
  .export-root .chassis-uplink,
  .export-root .export-faceplate-scale {
    overflow: visible !important;
  }

  .export-page-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding-top: 2mm;
    border-top: 0.3pt solid #bbb;
  }

  .export-switch-print,
  .export-data-table tr {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .export-root.export-document .export-diagram-area {
    background: #fafbfc !important;
    border-color: #ccc !important;
  }

  .export-root .port-jack-face.export-colored-face {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .export-table-swatch,
  .export-vlan-legend-swatch,
  .ingor-logo {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .export-switch-print-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
  .sidebar { max-height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── Internal export debugger ── */
.hidden-dev {
  display: none !important;
}

.btn-dev {
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.85;
}

.export-debug-modal {
  width: min(98vw, 1600px);
  max-width: none;
  height: min(94vh, 980px);
  max-height: none;
  padding: 0;
  border: 1px solid var(--border);
  background: #0c0f14;
  color: var(--text);
}

.export-debug-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.export-debug-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.export-debug-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #10141c;
}

.export-debug-header h2 {
  margin: 0;
  font-size: 1rem;
}

.export-debug-status {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

.export-debug-status.is-error {
  color: #f87171;
}

.export-debug-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.export-debug-header-actions .btn.active {
  background: var(--accent);
  color: #fff;
}

.export-debug-page-select {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: #151a24;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}

.export-debug-body {
  display: grid;
  grid-template-columns: 180px 1fr 280px;
  flex: 1;
  min-height: 0;
}

.export-debug-sidebar,
.export-debug-metrics {
  overflow: auto;
  padding: 0.75rem;
  border-right: 1px solid var(--border);
  background: #0e1219;
}

.export-debug-metrics {
  border-right: none;
  border-left: 1px solid var(--border);
}

.export-debug-panel + .export-debug-panel {
  margin-top: 1rem;
}

.export-debug-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.export-debug-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.export-debug-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.export-debug-zoom-row span {
  font-family: var(--mono);
  font-size: 0.78rem;
  min-width: 3rem;
  text-align: center;
}

.export-debug-legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
}

.export-debug-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.export-debug-legend .swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.swatch-frame { background: #f59e0b; }
.swatch-cable { background: #38bdf8; }
.swatch-anchor { background: #22c55e; border-radius: 50%; }
.swatch-route { background: #eab308; border-radius: 50%; }
.swatch-lane { background: #a855f7; }

.export-debug-stage-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 1px 1px, #1e2636 1px, transparent 0) 0 0 / 20px 20px,
    #080a0f;
}

.export-debug-stage-scroller {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

.export-debug-scaled {
  position: relative;
  transform-origin: top left;
  width: fit-content;
}

.export-debug-mount {
  position: relative;
}

.export-debug-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.export-debug-clone.export-debug-clone {
  position: static;
  left: auto;
}

.export-debug-clone .export-pdf-page.export-debug-inactive-page {
  display: none;
}

.export-debug-clone .export-pdf-page.export-debug-active-page {
  outline: 2px solid rgba(245, 158, 11, 0.35);
  outline-offset: 4px;
}

.export-debug-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: #0e1219;
  max-height: 220px;
  overflow: auto;
}

.export-debug-previews figure {
  margin: 0;
}

.export-debug-previews figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.export-debug-previews img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.export-debug-cap-meta {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.export-debug-metrics-block + .export-debug-metrics-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.export-debug-metrics-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.export-debug-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.65rem;
  margin: 0;
  font-size: 0.75rem;
}

.export-debug-dl dt {
  color: var(--muted);
  font-family: var(--mono);
}

.export-debug-dl dd {
  margin: 0;
  font-family: var(--mono);
}

.export-debug-json {
  margin: 0;
  padding: 0.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.45;
  background: #080b10;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: auto;
  max-height: 180px;
  white-space: pre-wrap;
  word-break: break-word;
}

.export-debug-muted {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .export-debug-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .export-debug-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .export-debug-metrics {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 200px;
  }
}
