.top {
  display: grid;
  grid-template-columns: minmax(380px, 460px) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "head plan" "side plan";
  height: 100%;
}
.top-head, .top-side {
  border-right: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(6, 12, 22, .96), rgba(6, 12, 22, .82));
  padding: 0 36px;
}
.top-head { grid-area: head; padding-top: 40px; }
.top-side { grid-area: side; display: flex; flex-direction: column; padding-bottom: 24px; overflow: auto; }
.plan { grid-area: plan; }
.top-kicker { font: 11px/1 var(--mono); color: var(--blue); letter-spacing: .18em; margin: 0 0 22px; }
.top-title { font-size: 26px; line-height: 1.6; font-weight: 700; letter-spacing: .04em; margin: 0 0 16px; }
.top-lead { color: var(--ink-2); font-size: 14px; margin: 0 0 30px; }

.device-list { list-style: none; margin: 0 0 30px; padding: 0; border-top: 1px solid var(--line); }
.device-list a {
  display: grid;
  grid-template-columns: 50px 1fr 14px;
  align-items: center;
  gap: 4px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .18s var(--ease), padding .18s var(--ease);
}
.device-list .mono { font-size: 11px; color: var(--ink-3); }
.device-list b { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; }
.device-list small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.device-list svg { width: 14px; height: 14px; stroke: var(--ink-3); fill: none; stroke-width: 1.5; }
.device-list a:hover, .device-list a:focus-visible, .device-list a.is-hot { background: var(--bg-3); padding-left: 12px; }
.device-list a:hover .mono, .device-list a.is-hot .mono { color: var(--blue); }
.device-list a:hover svg, .device-list a.is-hot svg { stroke: var(--blue); }

.top-news { margin-top: auto; }
.top-news h2 { font: 11px/1 var(--mono); color: var(--ink-3); letter-spacing: .18em; margin: 0 0 10px; display: flex; justify-content: space-between; }
.top-news h2 a { color: var(--ink-3); text-decoration: none; }
.top-news h2 a:hover { color: var(--blue); }
.top-news ul { list-style: none; margin: 0; padding: 0; }
.top-news li a { display: grid; grid-template-columns: 86px 1fr; gap: 8px; padding: 7px 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); text-decoration: none; border-top: 1px dashed var(--line); }
.top-news li a:hover { color: var(--ink); }
.top-news .mono { font-size: 11px; color: var(--ink-3); }

/* ===== blueprint ===== */
.plan { position: relative; overflow: hidden; }
.plan > svg { position: absolute; top: 64px; left: 24px; width: calc(100% - 48px); height: calc(100% - 128px); display: block; user-select: none; touch-action: none; }
.plan-readout {
  position: absolute;
  top: 18px;
  right: 22px;
  font: 11px/1.7 var(--mono);
  color: var(--ink-3);
  text-align: right;
  letter-spacing: .08em;
  pointer-events: none;
}
.plan-readout b { color: var(--ink-2); font-weight: 500; }
.plan-hint { position: absolute; left: 22px; top: 18px; font: 11px/1.6 var(--mono); color: var(--ink-3); letter-spacing: .08em; pointer-events: none; }

.bp-wall { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.bp-wall-inner { fill: none; stroke: var(--line); stroke-width: 1; }
.bp-fix { fill: rgba(150, 190, 225, .03); stroke: var(--line); stroke-width: 1; }
.bp-thin { fill: none; stroke: var(--line); stroke-width: .8; }
.bp-door { fill: none; stroke: var(--line); stroke-width: .8; stroke-dasharray: 3 3; }
.bp-dim { stroke: var(--ink-3); stroke-width: .7; fill: none; }
.bp-text { fill: var(--ink-3); font: 9px var(--mono); letter-spacing: .12em; }
.bp-zone { fill: var(--ink-3); font: 10px var(--sans); letter-spacing: .2em; opacity: .75; }
.bp-title { fill: var(--ink-2); font: 10px var(--mono); letter-spacing: .1em; }
.bp-title-strong { fill: var(--ink); font: 500 12px var(--sans); letter-spacing: .08em; }

.device { cursor: pointer; outline: none; }
.device-hit { fill: transparent; }
.device-body { fill: var(--bg-2); stroke: var(--blue); stroke-width: 1.4; }
.device-tag rect { fill: var(--bg); stroke: var(--line); stroke-width: .8; }
.device-tag text { fill: var(--ink-2); font: 9.5px var(--mono); letter-spacing: .1em; }
.device-tag .tag-name { fill: var(--ink); font: 500 10.5px var(--sans); letter-spacing: .06em; }
.device-leader { stroke: var(--line-strong); stroke-width: .8; fill: none; }
.device.is-hot .device-body, .device:focus-visible .device-body { stroke: var(--ink); fill: var(--bg-3); }
.device.is-hot .device-tag rect, .device:focus-visible .device-tag rect { stroke: var(--blue); }
.device.is-hot .device-tag text:first-child, .device:focus-visible .device-tag text:first-child { fill: var(--blue); }

.cam-cone { fill: rgba(155, 201, 219, .05); stroke: rgba(155, 201, 219, .3); stroke-width: .8; }
.cam-cone.is-seeing { fill: rgba(95, 174, 118, .1); stroke: var(--green); }
.ap-range { fill: none; stroke: rgba(155, 201, 219, .14); stroke-width: .8; stroke-dasharray: 2 5; }
.ap-ring { fill: none; stroke: var(--blue); stroke-width: 1; }
.ap-link { stroke: var(--green); stroke-width: 1; stroke-dasharray: 4 4; animation: link-flow .6s linear infinite; }
.sig-screen { fill: rgba(79, 157, 196, .12); stroke: var(--blue); stroke-width: 1.4; transition: fill .25s var(--ease); }
.device.is-lit .sig-screen { fill: var(--blue-deep); }
.sig-copy { fill: var(--bg); font: 700 8px var(--sans); letter-spacing: .04em; opacity: 0; transition: opacity .25s var(--ease); }
.device.is-lit .sig-copy { opacity: 1; }
.thermal-zone { fill: rgba(95, 174, 118, .0); stroke: rgba(95, 174, 118, .35); stroke-width: .8; stroke-dasharray: 3 3; transition: fill .2s var(--ease); }
.thermal-zone.is-scanning { fill: rgba(95, 174, 118, .1); }
.thermal-scan { fill: var(--green); font: 500 10px var(--mono); letter-spacing: .2em; opacity: 0; }
.device.is-scanning .thermal-scan { opacity: 1; animation: blink .5s steps(2) infinite; }
.pc-screen { fill: rgba(79, 157, 196, .12); stroke: var(--blue); stroke-width: 1.2; }
.pc-line { stroke: var(--blue); stroke-width: 1; opacity: .7; }

.visitor-dot { fill: var(--ink); }
.visitor-halo { fill: none; stroke: var(--ink); stroke-width: .8; opacity: .5; }
.visitor-trail circle { fill: var(--ink-2); }
.detect-box { fill: none; stroke: var(--green); stroke-width: 1.2; }
.detect-text { fill: var(--green); font: 500 9px var(--mono); letter-spacing: .12em; }
.focus-lines line { stroke: var(--blue); stroke-width: 1; vector-effect: non-scaling-stroke; }

#visitor, #bp-detect, #bp-focus, .cam-cone, .ap-range, .thermal-zone, #bp-rings, #bp-links { pointer-events: none; }
.bp-seat { fill: none; stroke: var(--line); stroke-width: .6; }
.device-mark { fill: none; stroke: var(--blue); stroke-width: 1; }
.sig-copy.is-vertical { writing-mode: vertical-rl; font-size: 7px; }
.device.is-linked .device-body, .device.is-seeing .device-body, .device.is-scanning .device-body { stroke: var(--green); }

.plan-title {
  position: absolute;
  right: 24px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  border: 1px solid var(--line-strong);
  background: rgba(6, 12, 22, .88);
  pointer-events: none;
}
.plan-title > div { padding: 6px 14px; border-left: 1px solid var(--line); }
.plan-title > div:first-child { border-left: 0; }
.plan-title span { display: block; font: 9px/1.4 var(--sans); color: var(--ink-3); letter-spacing: .12em; }
.plan-title b { display: block; font: 500 11px/1.5 var(--mono); color: var(--ink-2); }

@keyframes link-flow { to { stroke-dashoffset: -8; } }
@keyframes blink { 50% { opacity: .35; } }

@media (max-width: 900px) {
  .top { display: block; overflow: auto; height: 100%; }
  .top-head, .top-side { border-right: 0; padding: 0 16px; overflow: visible; }
  .top-head { padding-top: 26px; }
  .top-side { padding-top: 24px; padding-bottom: 32px; }
  .top-title { font-size: 21px; }
  .plan { height: 72vw; min-height: 300px; border-bottom: 1px solid var(--line); }
  .plan-hint, .plan-title, .device-tag, .device-leader, [data-readout-state] { display: none; }
  .plan-readout { top: 8px; right: 10px; left: 10px; display: flex; justify-content: space-between; font-size: 9.5px; }
  .plan > svg { top: 30px; left: 8px; width: calc(100% - 16px); height: calc(100% - 38px); }
  .top-news { margin-top: 8px; }
}
