:root {
  --ink: #102331;
  --muted: #607283;
  --panel: #ffffff;
  --panel-2: #f4f8fb;
  --line: #d7e2eb;
  --blue: #1676d2;
  --teal: #0f9f9a;
  --green: #1a9a5b;
  --amber: #e58a00;
  --red: #d74646;
  --fiber: #e45a9f;
  --copper: #c77b2e;
  --shadow: 0 18px 45px rgba(17, 42, 62, 0.14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eaf1f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.topbar, .canvas-panel, .status-screen {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: #fff;
  background: linear-gradient(135deg, #102331, #1676d2 55%, #0f9f9a);
  border-radius: 8px;
  font-weight: 900;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; }
.brand p, .panel-header p { color: var(--muted); font-size: 13px; margin-top: 4px; }

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.view-tabs button, .actions button, .street-actions button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}
.view-tabs button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 360px;
  gap: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.view { display: none; min-height: 620px; position: relative; }
.view.active { display: block; }

.house-shell {
  position: absolute;
  inset: 18px;
  background:
    linear-gradient(90deg, rgba(215, 226, 235, 0.6) 1px, transparent 1px),
    linear-gradient(rgba(215, 226, 235, 0.6) 1px, transparent 1px),
    #f8fbfd;
  background-size: 24px 24px;
  border: 7px solid #14364e;
  overflow: hidden;
}
.room-label {
  position: absolute;
  left: 18px;
  top: 14px;
  color: var(--muted);
  font-weight: 900;
}

.device {
  position: absolute;
  display: grid;
  gap: 8px;
  min-width: 148px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(17, 42, 62, 0.14);
  z-index: 3;
}
.device-client { left: 38px; top: 88px; }
.router { left: 205px; top: 58px; min-width: 286px; }
.ont { left: 276px; top: 318px; min-width: 208px; }
.splice { left: 296px; top: 480px; min-width: 230px; }
.drop { left: 606px; top: 92px; background: #eff8f5; }

.visual-device strong {
  font-size: 15px;
}

.laptop-icon {
  width: 118px;
  height: 72px;
  display: grid;
  place-items: end center;
}

.laptop-icon span {
  width: 88px;
  height: 54px;
  display: block;
  background: linear-gradient(145deg, #263847, #101f2c);
  border: 5px solid #334b5f;
  border-radius: 8px 8px 3px 3px;
}

.laptop-icon i {
  width: 116px;
  height: 12px;
  display: block;
  background: #7f95a5;
  border-radius: 2px 2px 8px 8px;
}

.router-picture {
  position: relative;
  width: 214px;
  height: 70px;
}

.router-body {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 174px;
  height: 44px;
  background: linear-gradient(145deg, #162b3b, #0b1721);
  border-radius: 10px;
  box-shadow: inset 0 -8px 0 rgba(255, 255, 255, 0.06);
}

.antenna {
  position: absolute;
  top: 0;
  width: 8px;
  height: 52px;
  background: #102331;
  border-radius: 999px;
  transform-origin: bottom center;
}

.antenna.a1 {
  left: 8px;
  transform: rotate(-20deg);
}

.antenna.a2 {
  right: 8px;
  transform: rotate(20deg);
}

.ont-picture,
.cassette-picture {
  width: 148px;
  min-height: 58px;
  display: grid;
  place-items: center;
  background: #f8fbfd;
  border: 2px solid #9fb1bf;
  border-radius: 8px;
}

.ont-picture span {
  color: #1676d2;
  font-weight: 900;
}

.cassette-picture {
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  padding: 11px;
}

.cassette-picture span {
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--fiber);
  background: rgba(228, 90, 159, 0.12);
}

.power-socket {
  position: absolute;
  right: 34px;
  top: 126px;
  display: grid;
  place-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  z-index: 6;
}

.power-socket span {
  width: 48px;
  height: 56px;
  display: block;
  background: #fff;
  border: 2px solid #aab9c5;
  border-radius: 8px;
  box-shadow: inset 0 0 0 8px #eef4f8;
}

.power-socket span::before,
.power-socket span::after {
  content: "";
  position: absolute;
  top: 24px;
  width: 5px;
  height: 14px;
  background: #6f8190;
  border-radius: 999px;
}

.power-socket span::before { margin-left: 14px; }
.power-socket span::after { margin-left: 28px; }

.port, .power {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}
.port { color: #fff; background: #73889a; border: 0; cursor: pointer; }
.port.wan { background: var(--blue); }
.port.lan, .port.eth { background: var(--copper); }
.port.fiber { background: var(--fiber); }
.port.power-port { background: #2f3f4d; }
.port.pending {
  outline: 3px solid rgba(229, 138, 0, 0.45);
  outline-offset: 3px;
}
.port-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.port.connected {
  border-color: #102331;
  box-shadow: 0 0 0 3px rgba(15, 159, 154, 0.18);
}
.lan-yellow, .lan-green, .lan-orange { background: var(--copper) !important; }
.power {
  border: 0;
  color: #fff;
  background: var(--green);
  cursor: pointer;
}
.power.off { background: var(--red); }

.toolbox {
  position: absolute;
  right: 18px;
  top: 18px;
  bottom: 18px;
  width: 280px;
  padding: 14px;
  background: var(--panel-2);
  border-left: 1px solid var(--line);
}
.toolbox h3 { font-size: 16px; margin-bottom: 12px; }
.toolbox label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
select {
  min-height: 38px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

.client-cable-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.drawn-cable {
  stroke-width: 7;
  stroke-linecap: round;
}

.copper-drawn {
  stroke: var(--copper);
}

.ethernet-drawn {
  stroke: var(--copper);
}

.fiber-drawn {
  stroke: var(--fiber);
}

.patch-drawn {
  stroke: var(--fiber);
}

.power-drawn {
  stroke: #2f3f4d;
  stroke-width: 5;
}

.faulty-cable {
  stroke: var(--red);
  stroke-dasharray: 16 12;
}

.cable-tray {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 4;
  width: 244px;
  display: grid;
  gap: 9px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(17, 42, 62, 0.14);
}

.router .port {
  min-height: 25px;
  padding: 0 7px;
  font-size: 11px;
}

.cable-tray h3 {
  font-size: 16px;
}

.tool-button,
.cable-plug,
.fault-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  cursor: grab;
}

.tool-button {
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  line-height: 1.12;
  font-size: 13px;
}

.tool-button.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 118, 210, 0.16);
}

.power-cable {
  border-left: 8px solid #2f3f4d;
}

.cable-tray p {
  color: #526879;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.small-action {
  min-height: 34px;
  font-size: 12px;
}

.cable-plug.dragging {
  position: fixed;
  z-index: 10;
  width: 190px;
  transform: translate(-50%, -50%);
  cursor: grabbing;
}

.cable-plug.plugged {
  box-shadow: inset 5px 0 0 var(--green);
}

.copper-cable {
  border-left: 8px solid var(--copper);
}

.fiber-cable {
  border-left: 8px solid var(--fiber);
}

.fault-toggle {
  cursor: pointer;
  color: #415565;
}

.fault-toggle[aria-pressed="true"] {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.router::after,
.ont::after {
  content: none;
  position: absolute;
  width: 3px;
  background: #2f3f4d;
  border-radius: 999px;
  z-index: -1;
}

.router::after {
  right: -112px;
  top: -20px;
  height: 114px;
  transform: rotate(68deg);
}

.ont::after {
  right: -74px;
  top: -198px;
  height: 244px;
  transform: rotate(21deg);
}

.street-map, .area-map, .rack {
  position: absolute;
  inset: 18px;
  background: #eef6fb;
  border: 1px solid var(--line);
  overflow: hidden;
}
.street-map {
  background:
    linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px),
    #cfe0ca;
  background-size: 42px 42px;
}
.street-road {
  position: absolute;
  background: #7f8c95;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.2);
}

.street-road::after,
.road::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #fff 0 28px, transparent 28px 58px);
  border-radius: 999px;
  opacity: .92;
}

.map-legend {
  position: absolute;
  right: 16px;
  top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 12;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #415565;
  font-size: 11px;
  font-weight: 900;
}

.legend-line {
  width: 24px;
  height: 5px;
  background: var(--fiber);
  border-radius: 999px;
}

.legend-pole {
  width: 15px;
  height: 15px;
  background: #f6fbff;
  border: 3px solid #111;
  border-radius: 999px;
}

.legend-dome {
  width: 18px;
  height: 13px;
  background: #283d4f;
  border: 3px solid #d9e6ef;
  border-radius: 999px;
}
.street-road.horizontal {
  left: 24px;
  right: 24px;
  top: 276px;
  height: 96px;
}
.pole {
  position: absolute;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  width: 104px;
  height: 86px;
  color: #fff;
  background: #6c523b;
  border-radius: 8px;
  text-align: center;
  z-index: 5;
  box-shadow: 0 14px 28px rgba(17, 42, 62, 0.2);
}
.pole span { font-size: 12px; color: rgba(255,255,255,.8); }
.pole-a { left: 328px; top: 176px; }
.pole-b { right: 92px; top: 240px; }
.fiber-line {
  position: absolute;
  height: 6px;
  background: var(--fiber);
  border-radius: 999px;
  z-index: 3;
}
.street-cable-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.street-core,
.drop-line {
  stroke: var(--fiber);
  stroke-width: 6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.street-core {
  stroke-width: 8;
}

.pole-branch {
  stroke-width: 5;
}

.map-pole {
  fill: #f6fbff;
  stroke: #111;
  stroke-width: 4;
}

.map-dome {
  fill: #283d4f;
  stroke: #d9e6ef;
  stroke-width: 5;
}

.plant-label {
  fill: #102331;
  font-size: 15px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255,255,255,.9);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.area-label {
  font-size: 13px;
}

.street-map.main-broken .main-core,
.street-map.main-broken .pole-branch,
.street-map.main-broken .drop-line,
.street-map.house-5-broken .drop-line.house5 {
  stroke: var(--red);
  stroke-dasharray: 16 12;
}
.street-map.main-broken .main-line, .house-card.offline .drop-wire { background: var(--red); }

.houses {
  position: absolute;
  inset: 0;
  z-index: 4;
}
.house-card {
  position: absolute;
  width: 118px;
  min-height: 112px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(17, 42, 62, 0.14);
  text-align: center;
}
.house-card::before {
  content: "";
  position: absolute;
  left: 19px;
  top: -14px;
  width: 78px;
  height: 28px;
  background: #d77c46;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.house-card:nth-child(1) { left: 94px; top: 72px; }
.house-card:nth-child(2) { left: 244px; top: 72px; }
.house-card:nth-child(3) { left: 474px; top: 72px; }
.house-card:nth-child(4) { left: 169px; top: 424px; }
.house-card:nth-child(5) { left: 479px; top: 424px; }
.house-card strong, .house-card span { display: block; }
.house-card span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.house-card.offline {
  border-color: var(--red);
  background: #eef1f3;
  filter: grayscale(.85);
  opacity: .78;
}

.house-card.offline::after,
.area-home.offline::before {
  content: "X";
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  color: var(--red);
  border: 4px solid var(--red);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  font-size: 46px;
  font-weight: 950;
  z-index: 8;
}

.house-card.offline span,
.house-card.offline strong {
  color: #6e7a82;
}
.drop-wire {
  display: none;
}

.street-actions {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 5;
}
.street-actions button.active { color: #fff; background: var(--red); border-color: var(--red); }

.area-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  place-items: center;
}
.street-node, .isp-node, .cloud {
  display: grid;
  place-items: center;
  width: 150px;
  height: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 42, 62, 0.12);
  text-align: center;
  font-weight: 900;
  z-index: 2;
}
.street-node span { color: var(--fiber); }
.isp-node { color: #fff; background: var(--blue); }
.area-line {
  position: absolute;
  height: 6px;
  width: 210px;
  background: var(--fiber);
  border-radius: 999px;
}
.l1 { left: 190px; top: 290px; }
.l2 { left: 392px; top: 290px; }
.l3 { left: 594px; top: 290px; }

.rack {
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  align-items: center;
  gap: 30px;
  padding: 30px;
}
.rack-title {
  position: absolute;
  top: 18px;
  left: 24px;
  font-weight: 900;
}
.rack-device {
  display: grid;
  gap: 10px;
  padding: 18px;
  min-height: 220px;
  background: #182d3d;
  color: #fff;
  border-radius: 8px;
  box-shadow: inset 0 0 0 8px #0f202d;
}
.rack-device span {
  padding: 9px;
  background: rgba(255,255,255,.1);
  border-radius: 5px;
}
.cloud {
  width: 220px;
  height: 140px;
  color: #fff;
  background: var(--teal);
  border-radius: 999px;
}

.status-screen {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.screen-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--amber);
  font-size: 12px;
  font-weight: 900;
}
.badge.ok { background: var(--green); }
.badge.bad { background: var(--red); }

.button-row {
  display: grid;
  gap: 9px;
}
.primary-action, .secondary-action {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
}
.primary-action { color: #fff; background: var(--blue); }
.secondary-action { color: var(--ink); background: #fff; border-color: var(--line); }

.status-list {
  display: grid;
  gap: 8px;
}
.status-list div, .explain-card {
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.status-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.status-list strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
}
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }
.warn-text { color: var(--amber); }

.explain-card p, .explain-card li {
  color: #526879;
  font-size: 13px;
  line-height: 1.45;
}
.explain-card p { margin-top: 8px; }
.explain-card ul { margin: 10px 0 0; padding-left: 18px; }
.explain-card li { margin: 8px 0; }
.explain-card strong { color: var(--ink); }

#clientView.view { min-height: 740px; }

.house-shell {
  background:
    linear-gradient(90deg, rgba(255,255,255,.42) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.42) 1px, transparent 1px),
    linear-gradient(#dce9ef 0 66%, #b98e63 66% 100%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

.house-shell::before {
  content: "";
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 84px;
  height: 118px;
  background: linear-gradient(#9a6f45, #7e5734);
  border-radius: 7px 7px 0 0;
  box-shadow: inset 0 10px 0 rgba(255,255,255,.12);
  z-index: 1;
}

.house-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  height: 8px;
  background: rgba(20, 54, 78, 0.2);
  z-index: 1;
}

.room-label {
  top: 128px;
  z-index: 9;
}

.table-surface {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 86px;
  height: 16px;
  background: #5e3e25;
  border-radius: 5px;
  z-index: 2;
}

.cable-tray {
  left: 18px;
  right: 18px;
  top: 14px;
  bottom: auto;
  width: auto;
  min-height: 102px;
  grid-template-columns: 150px repeat(5, minmax(96px, 1fr));
  align-items: center;
  gap: 8px;
  padding: 10px;
  z-index: 10;
}

.cable-tray h3 {
  position: static;
  width: auto;
  grid-row: 1 / span 2;
}

.cable-tray p {
  min-height: 42px;
  margin: 0;
  grid-column: 2 / -1;
}

.tool-button.installed {
  box-shadow: inset 5px 0 0 var(--green);
}

.device {
  z-index: 5;
  touch-action: none;
}

.movable {
  cursor: grab;
}

.movable:active {
  cursor: grabbing;
}

.client-cable-layer {
  z-index: 8;
}

.device-client {
  left: 50px;
  top: 494px;
}

.router {
  left: 340px;
  top: 202px;
}

.ont {
  left: 386px;
  top: 410px;
}

.splice {
  left: 34px;
  top: 238px;
}

.drop {
  left: 34px;
  top: 146px;
}

.not-installed {
  opacity: 0;
  pointer-events: none;
}

.splice::before {
  content: "Pre-installed";
  position: absolute;
  right: 10px;
  top: 10px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.fixed-drop {
  stroke-dasharray: 0;
}

.socket-face {
  position: relative;
}

.socket-port {
  min-width: 118px;
  color: var(--ink);
  background: #fff !important;
  border: 1px solid var(--line);
}

.router-led {
  position: absolute;
  right: 34px;
  top: 34px;
  width: 10px;
  height: 10px;
  background: #56d678;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(86, 214, 120, 0.16);
}

.ont-picture {
  position: relative;
  justify-items: start;
  padding-left: 22px;
}

.ont-light {
  position: absolute;
  right: 18px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.ont-light.red { top: 17px; background: #d74646; }
.ont-light.green { top: 34px; background: #1a9a5b; }

.area-map {
  display: block;
  background:
    linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px),
    #cfe0ca;
  background-size: 44px 44px;
}

.area-plant-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.area-core,
.area-drop {
  fill: none;
  stroke: var(--fiber);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-core {
  stroke-width: 7;
}

.area-drop {
  stroke-width: 4;
}

.area-pole {
  fill: #f6fbff;
  stroke: #111;
  stroke-width: 3;
}

.area-dome {
  fill: #283d4f;
  stroke: #d9e6ef;
  stroke-width: 5;
}

.area-map.backbone-broken .backbone-core,
.area-map.epon1-broken .epon1-core,
.area-map.epon1-broken .epon1-drop,
.area-map.epon2-broken .epon2-core,
.area-map.epon2-broken .epon2-drop,
.area-map.epon3-broken .epon3-core,
.area-map.epon3-broken .epon3-drop,
.area-map.drop-2-3-broken .drop-2-3 {
  stroke: var(--red);
  stroke-dasharray: 14 10;
}

.road {
  position: absolute;
  background: #7f8c95;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.2);
}

.area-road {
  left: 74px;
  right: 180px;
  height: 58px;
}

.area-road-1 { top: 72px; }
.area-road-2 { top: 260px; }
.area-road-3 { top: 448px; }

.feeder-road {
  right: 168px;
  top: 72px;
  width: 58px;
  height: 434px;
}

.feeder-road::after {
  left: 50%;
  right: auto;
  top: 22px;
  bottom: 22px;
  width: 8px;
  height: auto;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, #fff 0 28px, transparent 28px 58px);
}

.route-tag {
  position: absolute;
  z-index: 8;
  padding: 4px 8px;
  color: #102331;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-left: 5px solid var(--fiber);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(17, 42, 62, 0.08);
}

.tag-epon1 { left: 12px; top: 18px; }
.tag-epon2 { left: 12px; top: 206px; }
.tag-epon3 { left: 12px; top: 394px; }
.tag-feeder { right: 238px; top: 286px; }

.area-isp {
  position: absolute;
  right: 26px;
  top: 238px;
  width: 138px;
  height: 148px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #fff;
  background: #15384f;
  border: 6px solid #dbe7ef;
  border-radius: 8px;
  text-align: center;
  z-index: 4;
}

.area-isp span {
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 800;
}

.area-cable.backbone {
  position: absolute;
  left: 120px;
  right: 142px;
  top: 316px;
  height: 7px;
  background: var(--fiber);
  border-radius: 999px;
  z-index: 2;
  opacity: 0;
}

.area-map.backbone-broken .area-cable.backbone {
  background: var(--red);
  background-image: repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.55) 18px 28px);
}

.area-street {
  position: absolute;
  z-index: 6;
  width: 760px;
  height: 170px;
}

.street-one { left: 0; top: 24px; }
.street-two { left: 0; top: 212px; }
.street-three { left: 0; top: 368px; }

.pole-run {
  position: absolute;
  left: 16px;
  top: 126px;
  display: none;
  align-items: center;
  gap: 58px;
  z-index: 1;
}

.street-two .pole-run {
  top: auto;
  bottom: 126px;
}

.pole-run::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 22px;
  height: 6px;
  background: var(--fiber);
  border-radius: 999px;
  z-index: -1;
}

.area-street.offline .pole-run::before {
  background: var(--red);
}

.pole-run i {
  width: 28px;
  height: 46px;
  display: block;
  background: #6c523b;
  border-radius: 6px;
  box-shadow: 0 8px 15px rgba(17, 42, 62, 0.18);
}

.pole-run i.dome {
  position: relative;
}

.pole-run i.dome::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  width: 44px;
  height: 28px;
  background: #283d4f;
  border: 3px solid #d9e6ef;
  border-radius: 999px;
}

.street-pole {
  width: 92px;
  height: 132px;
  display: grid;
  place-items: center;
  padding: 10px;
  color: #fff;
  background: #6c523b;
  border-radius: 8px;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(17, 42, 62, 0.18);
  position: relative;
  z-index: 4;
  display: none;
}

.street-pole::after {
  content: "";
  position: absolute;
  left: 42px;
  top: 130px;
  width: 7px;
  height: 84px;
  background: var(--fiber);
}

.street-two .street-pole::after {
  top: auto;
  bottom: 130px;
}

.area-street.offline .street-pole::after {
  background: var(--red);
}

.street-pole span {
  color: #f6c0dc;
  font-size: 11px;
}

.street-homes {
  position: absolute;
  inset: 0;
  display: block;
}

.street-two .street-homes {
  top: 0;
}

.area-home {
  position: absolute;
  width: 70px;
  min-height: 74px;
  padding: 18px 5px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(17, 42, 62, 0.12);
}

.area-home::after {
  content: "";
  position: absolute;
  left: 33px;
  top: 100%;
  width: 4px;
  height: 28px;
  background: var(--fiber);
  display: none;
}

.street-two .area-home::after {
  top: auto;
  bottom: 100%;
}

.area-home .roof {
  position: absolute;
  left: 9px;
  top: 7px;
  width: 52px;
  height: 16px;
  background: #d77c46;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.area-home strong,
.area-home em {
  display: block;
  position: relative;
  z-index: 2;
}

.area-home strong { font-size: 10px; }
.area-home em {
  color: var(--fiber);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.area-home:nth-child(1) { left: 120px; top: 0; }
.area-home:nth-child(2) { left: 310px; top: 0; }
.area-home:nth-child(3) { left: 500px; top: 0; }
.area-home:nth-child(4) { left: 230px; top: 104px; }
.area-home:nth-child(5) { left: 610px; top: 104px; }

.street-two .area-home:nth-child(1),
.street-three .area-home:nth-child(1) { left: 120px; top: 0; }
.street-two .area-home:nth-child(2),
.street-three .area-home:nth-child(2) { left: 310px; top: 0; }
.street-two .area-home:nth-child(3),
.street-three .area-home:nth-child(3) { left: 500px; top: 0; }
.street-two .area-home:nth-child(4),
.street-three .area-home:nth-child(4) { left: 230px; top: 104px; }
.street-two .area-home:nth-child(5),
.street-three .area-home:nth-child(5) { left: 610px; top: 104px; }

.street-three .area-home:nth-child(1) { left: 120px; top: 0; }
.street-three .area-home:nth-child(2) { left: 255px; top: 0; }
.street-three .area-home:nth-child(3) { left: 390px; top: 0; }
.street-three .area-home:nth-child(4) { left: 525px; top: 0; }
.street-three .area-home:nth-child(5) { left: 660px; top: 0; }

.street-two .area-home::after {
  top: auto;
  bottom: 100%;
}

.area-home.offline {
  border-color: var(--red);
  background: #eef1f3;
  filter: grayscale(.85);
  opacity: .78;
}

.area-home.offline::before {
  inset: 5px;
  font-size: 30px;
  border-width: 3px;
}

.area-home.offline::after {
  background: var(--red);
}

.area-actions {
  align-items: center;
  padding: 8px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.isp-floor {
  display: block;
  background:
    linear-gradient(90deg, rgba(16,35,49,.06) 1px, transparent 1px),
    linear-gradient(rgba(16,35,49,.06) 1px, transparent 1px),
    #eef6fb;
  background-size: 32px 32px;
}

.outside-feeds {
  position: absolute;
  left: 26px;
  top: 170px;
  display: grid;
  gap: 14px;
  z-index: 4;
}

.outside-feeds span {
  width: 180px;
  padding: 10px;
  color: #fff;
  background: var(--fiber);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

.rack-cabinet {
  position: absolute;
  left: 282px;
  top: 82px;
  width: 330px;
  min-height: 420px;
  padding: 18px 22px;
  display: grid;
  align-content: start;
  gap: 13px;
  background: #122536;
  border: 10px solid #263f52;
  border-radius: 8px;
  box-shadow: 0 22px 40px rgba(17, 42, 62, 0.22);
}

.rack-cabinet::before,
.rack-cabinet::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 5px;
  background: repeating-linear-gradient(#8092a0 0 8px, transparent 8px 18px);
}

.rack-cabinet::before { left: 8px; }
.rack-cabinet::after { right: 8px; }

.isp-floor .rack-device {
  min-height: 0;
}

.patch-panel {
  grid-template-columns: repeat(6, 1fr);
}

.patch-panel strong,
.olt strong,
.bng strong {
  grid-column: 1 / -1;
}

.patch-panel span {
  text-align: center;
  background: rgba(228, 90, 159, 0.55);
}

.isp-cable {
  position: absolute;
  height: 7px;
  background: var(--fiber);
  border-radius: 999px;
  z-index: 2;
}

.isp-cable-a {
  left: 200px;
  top: 248px;
  width: 110px;
}

.isp-cable-b {
  left: 610px;
  top: 318px;
  width: 230px;
}

.isp-floor .cloud {
  position: absolute;
  right: 22px;
  top: 238px;
  width: 180px;
  height: 118px;
}

@media (max-width: 1120px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .status-screen { order: -1; }
  .view { min-height: 720px; }
  .house-shell { inset: 18px 18px 320px 18px; }
  .toolbox { left: 18px; right: 18px; top: auto; width: auto; height: 280px; border-left: 0; border-top: 1px solid var(--line); }
}
