* { box-sizing: border-box; }

:root {
  --bg: #06111b;
  --panel: #081722;
  --node: rgba(11, 29, 42, .88);
  --node-hover: rgba(14, 38, 54, .95);
  --line: #23475d;
  --text: #eef8ff;
  --muted: #7c9aaa;
  --cyan: #23c8ff;
  --cyan-2: #178eff;
  --danger: #ff566b;
  --border: rgba(89, 188, 237, .16);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(35,200,255,.10), transparent 34%),
    #06111b;
}

.app-shell {
  width: min(1340px, calc(100vw - 36px));
  margin: auto;
  padding: 28px 0 16px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .2em;
}

h1 {
  margin: 5px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -.035em;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
}
.dot.normal { background: var(--cyan); }
.dot.blocked { background: var(--danger); }

.canvas-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px),
    var(--panel);
  background-size: 24px 24px;
  box-shadow: 0 28px 70px rgba(0,0,0,.30);
}

#network {
  display: block;
  width: 100%;
  min-height: 520px;
}

.link {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
}

.node-card {
  fill: var(--node);
  stroke: var(--border);
  stroke-width: 1.25;
}

.network-node {
  cursor: default;
}

.network-node:hover .node-card {
  fill: var(--node-hover);
  stroke: rgba(35,200,255,.36);
}

.node-type {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.node-title {
  fill: var(--text);
  font-size: 15px;
  font-weight: 680;
  text-anchor: middle;
}

.icon-wrap {
  filter: drop-shadow(0 0 8px rgba(35,200,255,.28));
}

.icon-platform {
  fill: rgba(14, 71, 105, .25);
  stroke: rgba(35,200,255,.42);
  stroke-width: 1.1;
}

.icon-top {
  fill: #155a86;
  stroke: #27caff;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.icon-face {
  fill: #0f3d5f;
  stroke: #27caff;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.icon-side {
  fill: #0a2943;
  stroke: #178eff;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.icon-line {
  fill: none;
  stroke: #71dcff;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-highlight {
  fill: none;
  stroke: #a3ecff;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.icon-led {
  fill: #73e6ff;
}

.icon-shield {
  fill: #10466b;
  stroke: #8be7ff;
  stroke-width: 1.5;
}

.icon-flame {
  fill: #7ee6ff;
  stroke: none;
}

.packet {
  fill: var(--cyan);
  filter: drop-shadow(0 0 5px rgba(35,200,255,.85));
}

.packet.blocked {
  fill: var(--danger);
  filter: drop-shadow(0 0 5px rgba(255,86,107,.85));
}

footer {
  padding-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 780px) {
  .app-shell { width: min(100% - 22px, 1340px); padding-top: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  #network { min-height: 390px; }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
}

.info-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(8, 23, 34, .92);
  min-height: 520px;
  padding: 22px;
}

.info-kicker {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
}

.info-panel h2 {
  margin: 6px 0 8px;
  font-size: 22px;
}

.info-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.info-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 18px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
}

.info-row span:first-child {
  color: var(--muted);
  text-transform: capitalize;
}

.status-normal .node-card { stroke: rgba(89,188,237,.16); }
.status-active .node-card { stroke: rgba(35,200,255,.48); }
.status-warning .node-card { stroke: rgba(255,184,77,.60); }
.status-blocked .node-card { stroke: rgba(255,86,107,.55); }
.status-offline .node-card { stroke: rgba(128,148,160,.20); opacity: .62; }

.status-active .icon-wrap {
  animation: nodePulse 2.1s ease-in-out infinite;
}

.status-warning .icon-wrap {
  filter: drop-shadow(0 0 9px rgba(255,184,77,.42));
}

.status-blocked .icon-wrap {
  filter: drop-shadow(0 0 9px rgba(255,86,107,.42));
}

.status-offline .icon-wrap {
  filter: grayscale(1) opacity(.55);
}

@keyframes nodePulse {
  0%,100% { filter: drop-shadow(0 0 5px rgba(35,200,255,.22)); }
  50% { filter: drop-shadow(0 0 12px rgba(35,200,255,.60)); }
}

.link-warning {
  stroke: rgba(255,184,77,.55);
}

.link-offline {
  stroke: rgba(128,148,160,.18);
  stroke-dasharray: 7 8;
}

.packet.warning {
  fill: #ffb84d;
  filter: drop-shadow(0 0 5px rgba(255,184,77,.85));
}

.node-state-dot {
  stroke: rgba(255,255,255,.15);
  stroke-width: 1;
}

.state-normal { fill: #6e8f9f; }
.state-active { fill: var(--cyan); }
.state-warning { fill: #ffb84d; }
.state-blocked { fill: var(--danger); }
.state-offline { fill: #536671; }

.network-node {
  cursor: pointer;
}

.network-node.selected .node-card {
  stroke: rgba(255,255,255,.72);
  stroke-width: 1.8;
}

.dot.active { background: var(--cyan); box-shadow: 0 0 8px rgba(35,200,255,.65); }
.dot.warning { background: #ffb84d; }
.dot.offline { background: #536671; }

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .info-panel {
    min-height: 0;
  }
}


.editor-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
}

.palette {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(8,23,34,.92);
  padding: 14px;
  align-self: start;
}

.panel-title {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
  margin-bottom: 10px;
}

.palette-list {
  display: grid;
  gap: 8px;
}

.palette-item {
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.palette-item:hover {
  border-color: rgba(35,200,255,.35);
  background: rgba(35,200,255,.06);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-btn {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 12px;
  cursor: pointer;
}

.tool-btn:hover {
  border-color: rgba(35,200,255,.32);
}

.tool-btn.primary {
  background: rgba(35,200,255,.12);
  border-color: rgba(35,200,255,.35);
}

.tool-btn.active {
  background: rgba(35,200,255,.16);
  border-color: var(--cyan);
}

.canvas-card {
  position: relative;
}

.mode-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  border: 1px solid rgba(35,200,255,.35);
  background: rgba(6,17,27,.92);
  color: var(--cyan);
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hidden { display: none; }

.network-node.dragging .node-card {
  stroke: var(--cyan);
  stroke-width: 2;
}

.network-node.connect-source .node-card {
  stroke: #ffffff;
  stroke-width: 2;
}

.info-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 12px;
  margin-top: 5px;
}

.info-field {
  margin-top: 12px;
}

.info-field label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.info-select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: #0b1c28;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 12px;
  margin-top: 5px;
}

@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .palette-list {
    grid-template-columns: repeat(auto-fit,minmax(110px,1fr));
  }
}

.secondary-title { margin-top: 22px; }

.shortcut-list { display: grid; gap: 4px; font-size: 10px; }
.shortcut-list span { color: var(--muted); margin-top: 7px; }
.shortcut-list strong { font-weight: 600; color: var(--text); }

.selection-count {
  margin: 8px 0 14px;
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.5;
}

.coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.connection-preview {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 7 7;
  opacity: .78;
  pointer-events: none;
}

.connection-halo {
  fill: rgba(35,200,255,.08);
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: .55;
  pointer-events: none;
}

.network-node.multi-selected .node-card {
  stroke: var(--cyan);
  stroke-width: 1.8;
}

.network-node.connect-source .node-card {
  stroke: white;
  stroke-width: 2.1;
}

.link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
}

.info-section {
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.info-section-title {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
  margin-bottom: 8px;
}

.small-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}


/* v7 --------------------------------------------------------------- */
.secondary-title { margin-top: 22px; }
.shortcut-list { display:grid; gap:4px; font-size:10px; }
.shortcut-list span { color:var(--muted); margin-top:7px; }
.shortcut-list strong { color:var(--text); font-weight:600; }

.zoom-controls { display:flex; gap:4px; }
.tool-btn.compact { min-width:36px; padding-inline:10px; }
.tool-btn.zoom-label { min-width:58px; color:var(--muted); }

.canvas-card {
  position: relative;
  min-height: 640px;
  touch-action: none;
}

#network {
  height: min(72vh, 760px);
  min-height: 640px;
  user-select: none;
}

.canvas-card.panning,
.canvas-card.panning .network-node { cursor: grabbing !important; }
.canvas-card.pan-ready { cursor: grab; }

.selection-count {
  margin:8px 0 14px;
  color:var(--cyan);
  font-size:11px;
  line-height:1.5;
}

.coord-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }

.connection-preview {
  fill:none;
  stroke:var(--cyan);
  stroke-width:2;
  stroke-dasharray:7 7;
  opacity:.82;
  pointer-events:none;
}
.connection-halo {
  fill:rgba(35,200,255,.08);
  stroke:var(--cyan);
  stroke-width:1.5;
  opacity:.58;
  pointer-events:none;
}

.network-node.multi-selected .node-card { stroke:var(--cyan); stroke-width:1.8; }
.network-node.connect-source .node-card { stroke:white; stroke-width:2.1; }

.link { transition:stroke .15s ease, opacity .15s ease; }
.link.directional { stroke-width:2.25; }
.link-selected { stroke:#dff8ff !important; stroke-width:3.2 !important; }
.link-normal { stroke:#2c5d77; }
.link-warning { stroke:#b47a2d; }
.link-blocked { stroke:#a84454; }
.link-offline { stroke:#455863; stroke-dasharray:7 8; opacity:.55; }

.link-hit {
  fill:none;
  stroke:transparent;
  stroke-width:18;
  cursor:pointer;
}
.link-hit:hover + .link-hover-proxy { opacity:1; }

.traffic-packet { pointer-events:none; }
.traffic-packet.normal { fill:#29c9ff; filter:drop-shadow(0 0 5px rgba(41,201,255,.85)); }
.traffic-packet.warning { fill:#ffb84d; filter:drop-shadow(0 0 5px rgba(255,184,77,.8)); }
.traffic-packet.blocked { fill:#ff5a70; filter:drop-shadow(0 0 5px rgba(255,90,112,.85)); }
.traffic-packet.offline { display:none; }

.direction-badge {
  fill:rgba(6,17,27,.92);
  stroke:rgba(35,200,255,.32);
  stroke-width:1;
}
.direction-text {
  fill:#b8dbea;
  font-size:9px;
  font-weight:700;
  text-anchor:middle;
  letter-spacing:.08em;
  pointer-events:none;
}

.info-section {
  padding-top:12px;
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,.06);
}
.info-section-title {
  color:var(--muted);
  font-size:9px;
  font-weight:750;
  letter-spacing:.12em;
  margin-bottom:8px;
}
.small-note { color:var(--muted); font-size:10px; line-height:1.45; }

.range-line { display:grid; grid-template-columns:1fr 50px; gap:10px; align-items:center; }
.info-range { width:100%; accent-color:#23c8ff; }
.value-chip {
  padding:6px 7px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  text-align:center;
  color:var(--text);
  background:rgba(255,255,255,.035);
  font-size:11px;
}

.link-summary {
  padding:10px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.025);
  border-radius:10px;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}
.link-summary strong { color:var(--text); }

.danger-btn {
  width:100%;
  margin-top:14px;
  border:1px solid rgba(255,90,112,.28);
  background:rgba(255,90,112,.06);
  color:#ff8c9a;
  border-radius:9px;
  padding:9px 10px;
  cursor:pointer;
}
.danger-btn:hover { background:rgba(255,90,112,.11); }

@media (max-width: 980px) {
  #network { height:64vh; min-height:540px; }
}
