/* SiteBuilder reference-led engineering workspace. */
:root {
  color-scheme: dark;
  --bg: #040d1d; --bg2: #09162c; --card: #0b1930; --card2: #10233e;
  --line: #203958; --line2: #2d4c70; --text: #edf3ff; --muted: #a4b6d2;
  --violet: #8d72f7; --cyan: #24c7ef; --pink: #ee5ca4; --amber: #f5c34c;
  --green: #23cca0; --red: #f35e77; --r: 13px;
  --grad: linear-gradient(115deg, #6e5cf6, #1684ff 70%, #00bce9);
  --grad2: linear-gradient(115deg, #8755ed, #3d66ef);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-top: 100px; }
body {
  margin: 0; min-width: 320px; color: var(--text);
  font: 13px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #040d1d;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 10, 24, .55), rgba(3, 10, 24, .4) 70%),
    url("/static/assets/page-telecom-night-v2.webp") center bottom / cover no-repeat;
}
button, input, select { font: inherit; }
button, .btn { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, label.btn:focus-within, [tabindex]:focus-visible {
  outline: 2px solid #61d9ff; outline-offset: 3px;
}
button, input, select { transition: border-color .16s, background-color .16s, box-shadow .16s; }
input, select { width: 100%; min-width: 0; }
input:disabled, select:disabled { opacity: .55; }
code { background: #202044; color: #cec3ff; padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.xs { font-size: 11px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; }
.gap { gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.ui-icon { width: 21px; height: 21px; display: inline-block; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Navigation: the active step carries the only persistent navigation glow. */
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 72px;
  display: flex; align-items: center; gap: 18px; padding: 12px 24px;
  border-bottom: 1px solid #1b4770; background: rgba(3, 12, 28, .93);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 242px; }
.brand .logo { width: 34px; height: 42px; }
.brand b { display: block; font-size: 21px; letter-spacing: -.6px; }
.brand span { display: block; font-size: 11px; color: #9fb9db; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 5px; flex: 1; min-width: 0; }
.stepper button {
  display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: 6px 11px 6px 6px; border: 1px solid transparent; border-radius: 24px;
  background: transparent; color: #a9bedc; font-size: 12px;
}
.stepper button i {
  display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #34547c;
  background: #10294c; border-radius: 50%; color: #d5e6ff; font-style: normal; font-weight: 600;
}
.stepper button.done i { color: #9fe8d5; background: #06372f; border-color: #237b68; }
.stepper button.on { color: white; border-color: #7164d8; background: linear-gradient(100deg, #153878, #292557); box-shadow: 0 0 12px #4856de30; }
.stepper button.on i { background: #168bfd; border-color: #54d9ff; color: white; box-shadow: 0 0 9px #118aff60; }
.stepper button:disabled { opacity: .5; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.top-actions label.btn { flex-direction: row; font-size: 12px; }
.pill { padding: 8px 14px; border: 1px solid #147399; background: #06283d; border-radius: 11px; color: #6ceaff; font-weight: 700; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* Main workspace: stable columns with no nested pane scrolling. */
.layout, .layout.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: start; gap: 20px; padding: 20px 24px 28px; max-width: 1920px; margin: auto; }
.layout[data-step="3"] { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.layout[data-step="4"] { grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); }
.pane { min-width: 0; }
.view-pane { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 12px; }
.step { display: none; }
.step.on { display: block; }
.step-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; font-size: 23px; line-height: 1.3; font-weight: 750; letter-spacing: -.6px; margin: 0 0 7px; }
.step-title small { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.grad { color: #29cefb; white-space: nowrap; }
.hint, .step-description { color: #a9bedc; font-size: 11.5px; line-height: 1.65; margin: 0 0 17px; }
.step-description { max-width: 76ch; }
.card { position: relative; border: 1px solid #234e78; border-radius: var(--r); padding: 14px; margin-bottom: 13px; background: linear-gradient(135deg, rgba(13, 30, 54, .97), rgba(6, 18, 38, .95)); box-shadow: 0 5px 18px #00000020; }
.card h3 { display: flex; align-items: center; gap: 9px; margin: -14px -14px 13px; padding: 13px 14px 11px; min-height: 54px; font-size: 14px; font-weight: 650; border-bottom: 1px solid #254466; border-radius: 12px 12px 0 0; background: linear-gradient(105deg, #10263e, #0b1e38); }
.card h3 small { font-size: 11px; color: var(--muted); font-weight: 400; }
.heading-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.heading-copy .heading-note { font-size: 10.5px; font-weight: 400; color: #95afd2; }
.heading-icon { display: grid; place-items: center; width: 29px; height: 29px; flex: none; color: var(--cyan); border: 1px solid #20496c; background: #092a43; border-radius: 8px; }
.heading-icon.violet { color: #ad94ff; background: #232044; border-color: #4c3c72; }
.heading-icon.amber { color: #f5ca63; background: #2d291d; border-color: #66522b; }
.heading-icon.green { color: #4fe0b7; background: #0b302f; border-color: #215d50; }
.card h4 { display: flex; align-items: center; gap: 10px; font-size: 12px; margin: 14px 0 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--cyan); }
.dot.violet { background: var(--violet); } .dot.pink { background: var(--pink); }
.dot.amber { background: var(--amber); } .dot.green { background: var(--green); }
#famBadge { padding: 2px 8px; background: #302960; border-radius: 5px; color: #d6cbff; }
.grid { display: grid; gap: 11px 14px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 5px; color: #b6c9e5; font-size: 11px; font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
input, select { color: #edf3ff; background: #061327; border: 1px solid #2b4b70; border-radius: 6px; padding: 7px 9px; font-size: 12px; min-height: 33px; outline: none; }
input:hover, select:hover { border-color: #466f98; }
input:focus, select:focus { border-color: #35bde8; box-shadow: 0 0 0 2px #25c0e51a; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: #149bf2; flex: none; }
input::placeholder { color: #738aab; }
.type-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.type-tile { position: relative; background: #08172d; color: #d7e6ff; border: 1px solid #284567; border-radius: 8px; padding: 11px 6px 9px; text-align: center; }
.type-tile svg { display: block; width: 28px; height: 34px; margin: 0 auto 5px; }
.type-tile b { display: block; font-size: 12px; }
.type-tile span { display: block; font-size: 9px; color: #99b0d0; line-height: 1.3; margin-top: 2px; }
.type-tile:hover { border-color: #4f80ad; background: #102440; }
.type-tile.on { border-color: #8474e6; background: #1a2547; box-shadow: inset 0 0 0 1px #8474e640; }
.type-tile .tag { position: absolute; top: 4px; right: 5px; font-size: 8px; font-style: normal; color: #e3c277; }
.fam-lattice { --fc: #987fff; } .fam-pole { --fc: #31c9f1; } .fam-guyed { --fc: #eb75b4; }

/* Motion is limited to the main call to action. */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; position: relative; padding: 9px 15px; border: 1px solid #31567c; border-radius: 8px; background: #0b1c34; color: #eef4ff; font-weight: 600; font-size: 12px; overflow: hidden; }
.btn:hover { background: #15304c; border-color: #578bb8; }
.btn.primary { min-width: 100px; background: var(--grad); border-color: #499aff; box-shadow: 0 3px 12px #146cf333; }
.btn.primary::after { content: ""; position: absolute; inset: 0; transform: translateX(-130%); background: linear-gradient(110deg, transparent 25%, #ffffff24 50%, transparent 75%); pointer-events: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn.primary:hover::after { transform: translateX(130%); transition: transform .6s ease; }
}
.btn.create { background: var(--grad2); border-color: #8879ff; }
.btn.ghost { background: #07172cb3; }
.btn.xs { padding: 5px 9px; font-size: 11px; border-radius: 6px; }
.btn.danger { color: #ff9eae; }
.icon-btn { display: inline-grid; place-items: center; background: transparent; border: 0; color: #93a9cc; padding: 5px; border-radius: 5px; min-width: 25px; min-height: 27px; }
.icon-btn .ui-icon { width: 15px; height: 15px; }
.icon-btn:hover { color: #ffa5b1; background: #ef44441a; }
.wizard-nav { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
.chip { border: 1px solid #284b70; border-radius: 7px; background: #07172ce6; color: #b8cbe7; padding: 5px 10px; font-size: 11px; min-height: 30px; white-space: nowrap; }
.chip:hover { border-color: #4483b4; color: white; }
.chip.on { background: #093969; border-color: #24c7ef; color: #7ae9ff; box-shadow: 0 0 9px #1cbbff25; }

/* Tables retain engineering density and scroll within their own boundary. */
.tbl-wrap { overflow: auto; max-height: 360px; border: 1px solid #223c60; border-radius: 8px; scrollbar-color: #3a6599 #08172a; scrollbar-width: thin; overscroll-behavior-x: contain; }
.tbl-wrap.tall { max-height: 390px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; padding: 9px 8px; background: #122944; color: #b4c9eb; text-align: left; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .15px; white-space: nowrap; border-bottom: 1px solid #2b5079; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid #1c314d; white-space: nowrap; }
.tbl tbody tr:nth-child(even) { background: #10213b80; }
.tbl tbody tr[data-p], .tbl tbody tr[data-mid], .tbl tbody tr[data-ant], .tbl tbody tr[data-sector] { cursor: pointer; }
.tbl tbody tr:hover td { background: #15365a60; }
.tbl tr.sel td { background: #45368b65; border-bottom-color: #6758aa; border-top: 1px solid #6758aa; }
.tbl tr.sel td:first-child { box-shadow: inset 3px 0 #a590ff; }
.tbl.compact td { padding: 6px 7px; }
.tbl select, .tbl input { padding: 4px 6px; font-size: 11px; min-height: 27px; border-radius: 5px; width: 100%; }
.tbl input[type=number] { max-width: 86px; min-width: 50px; }
#panelTable select { min-width: 105px; }
#panelTable select.pat { min-width: 155px; }
#boltTable select { min-width: 64px; }
#boltTable td.xs { white-space: normal; min-width: 110px; color: #c4d5ef; }
.xs-select { width: auto; font-size: 11px; padding: 4px 7px; min-height: 28px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.b-pass { color: #75e6bb; background: #084236; } .b-fail { color: #ffa3b2; background: #502133; }
.b-grp { color: #d0c3ff; background: #352965; } .b-sec { color: #7ae3f4; background: #103b50; }
.sector-tag { display: inline-grid; place-items: center; width: 23px; height: 24px; border-radius: 6px; color: white; font-size: 12px; font-weight: 700; flex: none; }
.sector { border: 1px solid #2b3d5d; border-left: 4px solid var(--sc, #8d72f7); padding: 12px; background: linear-gradient(105deg, color-mix(in srgb, var(--sc) 8%, #0b1428), #0a152b 45%); }
.sector .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.sector .head b { font-size: 13px; }
.sector .head label { display: flex; flex-direction: row; align-items: center; gap: 5px; font-size: 9px; }
.sector .head input { width: 62px; min-height: 29px; }
.sector .head .compass { width: 32px; height: 32px; }
.bearing-label { color: color-mix(in srgb, var(--sc) 60%, #dce8ff); font-size: 9px; border: 1px solid #354464; border-radius: 4px; padding: 2px 5px; }
.sector .foot { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.sector .foot label { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.sector .foot select { max-width: 168px; }
.compass { width: 40px; height: 40px; flex: none; }

/* A separate image lives inside the viewer, not on the page or its headers. */
.viewer-card { position: relative; border: 1px solid #2875a6; border-radius: var(--r); overflow: hidden; background: #06162d; }
.viewer-head { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px; background: linear-gradient(100deg, #0d223c, #09192f); border-bottom: 1px solid #244767; }
.viewer-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.viewer-heading > div { min-width: 0; }
.viewer-head b { display: block; font-size: 14px; }
.viewer-head #viewSub { display: block; margin-top: 2px; font-size: 10px; }
.view-tools { display: flex; align-items: center; gap: 5px; }
.viewer { height: clamp(420px, 53vh, 650px); position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 52% 40%, #1e3546 0%, #101f2d 55%, #0a1723 100%); }
.layout[data-step="3"] .viewer { height: clamp(370px, 48vh, 590px); }
.layout[data-step="4"] .viewer { height: clamp(360px, 46vh, 570px); }
.viewer canvas { display: block; outline: none; }
.viewer canvas:focus-visible { outline: 2px solid #63c7e8; outline-offset: -3px; }
.viewer-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: #0b1b2a; border-top: 1px solid #284051; font-size: 9px; letter-spacing: 1.1px; color: #abc2d1; }
.viewer-caption > span { display: flex; align-items: center; gap: 8px; }
.viewer-caption i { width: 5px; height: 5px; border-radius: 50%; background: #86b7c9; }
.viewer-caption small { color: #7796a9; letter-spacing: 0; margin-left: 5px; }
.viewer-caption label { display: flex; flex-direction: row; align-items: center; gap: 8px; letter-spacing: 0; }
.viewer-caption select { width: auto; min-height: 28px; padding: 4px 22px 4px 8px; font-size: 10px; background: #142b3b; border-color: #375264; }
@media (max-width: 540px) { .viewer-caption small { display: none; } .viewer-caption { letter-spacing: .6px; padding: 9px; } }
.viewer-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.viewer-hud { position: absolute; top: 20px; left: 16px; padding: 12px; border: 1px solid #2c5b86; border-radius: 9px; background: #06162de0; min-width: 112px; }
.viewer-hud .hud-row { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.viewer-hud .hud-row:last-child { margin-bottom: 0; }
.viewer-hud .ui-icon { color: #55c8f4; width: 20px; }
.viewer-hud b { display: block; font-size: 11px; font-weight: 600; }
.viewer-hud small { display: block; color: #91acd0; font-size: 9px; }
.viewer-sector-key { position: absolute; top: 17px; left: 14px; background: #06162ddd; border: 1px solid #24476a; border-radius: 8px; padding: 9px 10px; font-size: 10px; }
.viewer-sector-key div { display: flex; gap: 7px; align-items: center; margin: 7px 0; }
.viewer-sector-key i { width: 8px; height: 8px; border-radius: 3px; }
.viewer-sector-key em { font-style: normal; color: #adc1dd; margin-left: 8px; }
.viewer-compass { position: absolute; right: 15px; top: 20px; width: 76px; height: 76px; }
.viewer-compass svg { width: 100%; height: 100%; }
.viewer-instruction { position: absolute; bottom: 9px; right: 12px; z-index: 2; color: #b5c8e0; font-size: 9px; background: #041024a6; padding: 3px 7px; border-radius: 5px; pointer-events: none; }
.legend { position: absolute; left: 10px; bottom: 10px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 5px 8px; background: #06162de8; border: 1px solid #285171; border-radius: 7px; color: #c2d1e8; font-size: 9px; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 3px; }
.sel-info { position: absolute; z-index: 4; right: 10px; bottom: 39px; max-width: calc(100% - 20px); background: #151b3af2; border: 1px solid #7463b3; border-radius: 7px; padding: 7px 10px; color: #dcd7ff; font-size: 11px; }
.busy { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: #05122780; }
.spinner { width: 32px; height: 32px; border: 2px solid #264665; border-top-color: #30c9f2; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tip { position: absolute; z-index: 7; pointer-events: none; background: #07172ff2; border: 1px solid #497096; color: #e0eaff; padding: 5px 8px; border-radius: 6px; font-size: 10px; max-width: 230px; }
.lbl3d { position: absolute; pointer-events: none; font-size: 10px; font-weight: 650; color: white; padding: 2px 6px; border-radius: 5px; transform: translate(-50%, -130%); white-space: nowrap; border: 1px solid #ffffff35; }
.lbl-leader { position: absolute; height: 1px; transform-origin: left center; background: #b5cde880; pointer-events: none; }
.viewer-card:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; background: #051125; }
.viewer-card:fullscreen .viewer { height: calc(100% - 115px); }

/* Metrics use colored edges and icons, without outer colored shadows. */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.fact { position: relative; display: flex; align-items: flex-start; gap: 9px; min-width: 0; min-height: 88px; padding: 12px 11px; border: 1px solid #2b4c70; border-left: 3px solid var(--fc); border-radius: 10px; background: linear-gradient(120deg, #112642, #09172f); }
.fact-icon { color: var(--fc); margin-top: 3px; flex: none; }
.fact-icon .ui-icon { width: 23px; height: 26px; }
.fact-copy { min-width: 0; }
.fact-copy > span { display: block; font-size: 9px; color: #a9c2e4; text-transform: uppercase; letter-spacing: .3px; }
.fact b { display: block; font-size: clamp(14px, 1.3vw, 20px); letter-spacing: -.3px; margin: 3px 0 1px; overflow-wrap: anywhere; line-height: 1.35; }
.fact small { display: block; color: #9fb5d5; font-size: 9px; line-height: 1.4; }
.side-table { margin-bottom: 0; }
.side-table .tbl-wrap { max-height: 290px; }
.side-table h3 { min-height: 48px; }
.antenna-tools { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; }
.antenna-tools input { flex: 1; } .antenna-tools select { width: 120px; }
.warn-box { border: 1px solid #806731; border-radius: 9px; background: #282414ed; color: #ead398; padding: 11px 13px; font-size: 10.5px; line-height: 1.6; }
.warn-box b { color: #f2d16a; }
.warn-box ul { padding-left: 17px; margin: 6px 0; }
.warn-box li { margin: 3px 0; }
.err-box { border-color: #a14e5b; background: #301924ed; color: #ffb5c1; }
.err-box b { color: #ffb5c1; }

/* Workflow and results follow the fourth reference screen. */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.flow-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 1px solid #355778; border-radius: 8px; background: #0a1b32; color: #edf4ff; text-align: left; min-height: 101px; }
.flow-btn i { color: #59b8ff; font-style: normal; margin-bottom: 5px; }
.flow-btn b { font-size: 11px; font-weight: 600; }
.flow-btn span { font-size: 10px; color: #aec1de; }
.flow-btn .flow-index { position: absolute; top: 9px; right: 10px; color: #a3bad9; font-size: 10px; }
.flow-btn:disabled { opacity: .45; }
.flow-btn.done:disabled { opacity: 1; }
.flow-btn.next { border-color: #39acd4; background: #102e46; }
.flow-btn:not(:disabled):hover { background: #17344f; border-color: #65b6e3; }
.flow-btn.done { border-color: #337c70; background: #0d302f; }
.flow-btn.done .flow-index { color: #76e4c2; }
.flow-btn.running::after { content: ""; position: absolute; right: 9px; top: 9px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #2d677f; border-top-color: #69e2ff; animation: spin .8s linear infinite; }
.flow-btn.running .flow-index { visibility: hidden; }
.progress-row { display: flex; align-items: center; gap: 9px; margin: 12px 0 5px; }
.progress { height: 5px; border-radius: 8px; overflow: hidden; background: #1a304b; flex: 1; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, #5967f0, #18bbf1, #30dcbd); transition: width .4s; border-radius: 8px; }
#progressValue { font-size: 10px; color: #78dfed; font-variant-numeric: tabular-nums; }
#flowMsg { min-height: 15px; font-size: 10px; }
.dl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dl { display: flex; align-items: center; gap: 9px; text-align: left; color: #edf4ff; background: linear-gradient(120deg, #142e49, #0a1a30); border: 1px solid #335375; border-radius: 8px; padding: 10px; min-height: 67px; }
.dl .download-icon { width: 28px; height: 31px; display: grid; place-items: center; color: #63b1ff; background: #123456; border-radius: 5px; flex: none; }
.dl[data-dl="report.pdf"] .download-icon { color: #ffa8bb; background: #532d42; }
.dl[data-dl="members.csv"] .download-icon { color: #86e0c2; background: #14483e; }
.dl[data-dl="results.zip"] .download-icon { color: #efcf89; background: #413922; }
.dl .download-copy { flex: 1; min-width: 0; }
.dl b { display: block; font-size: 10.5px; font-weight: 600; }
.dl .download-copy > span { display: block; color: #a7bcda; font-size: 9px; }
.dl > .ui-icon { width: 14px; height: 16px; color: #a7c8ed; flex: none; }
.dl:disabled { opacity: .45; }
.dl:not(:disabled):hover { background: #183651; border-color: #588bb4; }
.tabs { display: flex; gap: 3px; margin: -5px -5px 12px; border-bottom: 1px solid #2c456a; overflow-x: auto; }
.tabs button { flex: 1 0 auto; background: transparent; color: #b2c6e7; padding: 11px 10px; border: 1px solid transparent; border-bottom: 2px solid transparent; font-size: 11px; }
.tabs button.on { color: white; border-color: #355b9c; border-bottom-color: #3abaff; border-radius: 7px 7px 0 0; background: #173466; }
.res-body .tbl-wrap { max-height: 370px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.kpi { background: #08182d; border: 1px solid #294564; border-radius: 8px; padding: 10px; }
.kpi span { font-size: 9px; color: #a9c0df; text-transform: uppercase; letter-spacing: .25px; }
.kpi b { display: block; font-size: 17px; margin-top: 2px; }
.kpi.pass b { color: #5ed5aa; } .kpi.fail b { color: #ff718d; }
.bar { height: 5px; border-radius: 9px; min-width: 53px; overflow: hidden; background: #25374e; }
.bar i { display: block; height: 100%; border-radius: 9px; }
.toast { white-space: pre-line; position: fixed; z-index: 50; bottom: 24px; left: 50%; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: #10233f; border: 1px solid #356791; color: #eff6ff; border-radius: 9px; padding: 10px 15px; max-width: min(90vw, 600px); transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: #b15b70; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #31557c; border-radius: 7px; }
::-webkit-scrollbar-track { background: #08142970; }

@media (min-width: 1600px) {
  .layout, .layout.wide { padding: 24px 30px 32px; gap: 24px; }
  .card { padding: 17px; }
  .card h3 { margin: -17px -17px 15px; padding: 14px 17px; }
  .sector { padding: 14px; }
}
@media (max-width: 1250px) {
  .topbar { gap: 10px; padding-inline: 18px; }
  .brand { min-width: 190px; } .brand b { font-size: 18px; } .brand span { font-size: 9px; }
  .stepper button { padding-right: 7px; gap: 5px; font-size: 10px; }
  .layout, .layout.wide { padding: 16px 18px 24px; gap: 15px; }
  .viewer-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .view-tools { align-self: flex-end; }
  .fact { gap: 6px; padding: 10px 8px; }
  .fact-icon .ui-icon { width: 17px; }
  .dl { padding: 8px; gap: 6px; } .dl > .ui-icon { display: none; }
  .sector .head .compass { display: none; }
  .flow { gap: 6px; } .flow-btn { padding: 9px; }
}
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; }
  .brand { flex: 1; }
  .stepper { order: 3; flex-basis: 100%; justify-content: space-between; }
  .stepper button { flex: 1; font-size: 11px; }
  .layout, .layout.wide, .layout[data-step="3"], .layout[data-step="4"] { grid-template-columns: minmax(0, 1fr); }
  .view-pane { position: static; }
  .viewer-head { flex-direction: row; align-items: center; }
  .view-tools { align-self: auto; }
  .viewer, .layout[data-step="3"] .viewer, .layout[data-step="4"] .viewer { height: 440px; }
  .fact b { font-size: 19px; }
  .fact-icon .ui-icon { width: 24px; }
  .fact { padding: 14px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-nav { padding: 12px; background: #061328ed; border: 1px solid #28496c; border-radius: 9px; margin-bottom: 4px; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 130px; }
  .topbar { padding: 9px 12px; gap: 9px; }
  .brand { min-width: 0; gap: 7px; } .brand .logo { width: 26px; height: 34px; }
  .brand b { font-size: 17px; } .brand span { display: none; }
  .top-actions { gap: 7px; } .top-actions .btn { font-size: 10px; padding: 7px 9px; min-height: 36px; }
  .pill { padding: 7px 8px; font-size: 10px; max-width: 95px; }
  .stepper { gap: 3px; }
  .stepper button { padding: 5px; gap: 5px; font-size: 9px; border-radius: 8px; flex-direction: column; }
  .stepper button i { width: 23px; height: 23px; font-size: 10px; }
  .stepper button span { display: block; white-space: normal; text-align: center; line-height: 1.2; }
  .layout, .layout.wide { padding: 14px 12px 18px; gap: 14px; }
  .step-title { font-size: 20px; gap: 7px; }
  .hint, .step-description { font-size: 11px; }
  .card { padding: 12px; }
  .card h3 { margin: -12px -12px 12px; padding: 11px 12px; font-size: 13px; flex-wrap: wrap; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  input, select { min-height: 40px; font-size: 16px; }
  .tbl input, .tbl select { min-height: 36px; font-size: 12px; }
  .btn, .icon-btn, .chip { min-height: 40px; }
  .btn { padding: 9px 11px; }
  .sector .head { gap: 7px; }
  .sector .head .spacer { display: none; }
  .sector .head label { flex: 1; min-width: 110px; }
  .sector .head input { width: 100%; min-height: 37px; font-size: 14px; }
  .sector .head .bearing-label { margin-right: auto; }
  .sector .foot { gap: 8px; }
  .sector .foot .spacer { display: none; }
  .sector .foot label { flex: 1; min-width: 115px; }
  .sector .foot select { max-width: none; font-size: 12px; }
  .sector .tbl { min-width: 490px; }
  .viewer-head { flex-direction: column; align-items: stretch; padding: 11px; }
  .view-tools { width: 100%; display: flex; gap: 5px; }
  .chip { flex: 1; padding-inline: 6px; font-size: 10px; min-width: 0; }
  .viewer, .layout[data-step="3"] .viewer, .layout[data-step="4"] .viewer { height: 370px; }
  .viewer-hud { left: 9px; top: 12px; min-width: 93px; padding: 9px; }
  .viewer-hud .hud-row { gap: 6px; margin-bottom: 10px; }
  .viewer-hud .ui-icon { width: 15px; }
  .viewer-compass { width: 57px; height: 57px; right: 8px; top: 12px; }
  .viewer-sector-key { left: 9px; top: 12px; font-size: 9px; padding: 6px 8px; }
  .viewer-instruction { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { min-height: 84px; padding: 11px; }
  .fact b { font-size: 17px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .flow-btn { min-height: 100px; padding: 12px; }
  .flow-btn b { font-size: 12px; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl { padding: 9px; min-height: 72px; }
  .dl b { font-size: 10px; }
  .tabs button { min-height: 42px; }
  .xs-select { min-height: 36px; font-size: 12px; }
  .kpis { gap: 5px; } .kpi { padding: 8px; } .kpi b { font-size: 14px; }
  .wizard-nav { padding: 9px; flex-wrap: wrap; bottom: max(6px, env(safe-area-inset-bottom)); }
  .legend { gap: 7px; font-size: 8px; }
  .antenna-tools { flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .pill { display: none; }
  .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .step-title { font-size: 18px; }
  .heading-copy .heading-note { font-size: 9px; }
  .viewer-sector-key em { display: none; }
  #packBtn { font-size: 10px; padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- loaders (loader.js): tower build + robot */
.preloader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 10%, #0d2246 0%, var(--bg) 60%); transition: opacity .6s ease, visibility .6s; }
.preloader.out { opacity: 0; visibility: hidden; }
.pl-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, #6e5cf633 0%, #00bce91a 40%, transparent 70%); filter: blur(10px); animation: plGlow 5s ease-in-out infinite; }
.pl-card { position: relative; display: grid; justify-items: center; gap: 10px; padding: 26px 34px 24px; width: min(92vw, 440px); border: 1px solid #2d4c7099; border-radius: 22px; background: linear-gradient(160deg, #0f2443e6, #08162ce6); box-shadow: 0 30px 80px #0009, inset 0 1px 0 #ffffff12; backdrop-filter: blur(6px); }
.pl-stage { width: 100%; aspect-ratio: 260 / 220; }
.pl-title { display: grid; justify-items: center; line-height: 1.15; }
.pl-title b { font-size: 22px; font-weight: 800; letter-spacing: .3px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-title span { color: var(--muted); font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
.pl-msg { min-height: 1.3em; color: var(--text); font-size: 13.5px; text-align: center; }
.preloader.failed .pl-msg { color: var(--red); }
.pl-bar { position: relative; width: 100%; height: 4px; border-radius: 4px; background: #1b3352; overflow: hidden; }
.pl-bar i { position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: 4px; background: var(--grad); animation: plBar 1.4s cubic-bezier(.6,.1,.3,.9) infinite; }
.preloader.failed .pl-bar i { animation: none; width: 100%; background: var(--red); }
@keyframes plBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(270%); } }
@keyframes plGlow { 50% { transform: scale(1.12); opacity: .75; } }

.tb-svg { width: 100%; height: 100%; overflow: visible; }
.tb-grid line { stroke: #24c7ef; stroke-width: .3; opacity: .07; }
.tb-ground { stroke: #3d6a99; stroke-width: 1.2; stroke-dasharray: 6 4; animation: tbGround 1.6s linear infinite; }
.tb-footing { fill: #1d3557; }
.tb-ghost path { fill: none; stroke: #8d72f7; stroke-width: .7; stroke-dasharray: 2 2.5; opacity: .35; }
.tb-part { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .35s ease-out, opacity .2s; }
.tb-part.on { stroke-dashoffset: 0; opacity: 1; }
.tb-leg { stroke-width: 3.2; }
.tb-brace { stroke-width: 1.6; }
.tb-horiz { stroke-width: 2; }
.tb-mast { stroke-width: 2.4; }
.tb-ant, .tb-dish { stroke-width: 1; stroke-dasharray: none; fill: #ee5ca4; stroke: #ff9ccc !important; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .2s; }
.tb-dish { fill: #f5c34c; stroke: #ffe39a !important; }
.tb-ant.on, .tb-dish.on { transform: scale(1); }
.tb-part.on.tb-horiz, .tb-part.on.tb-brace { filter: drop-shadow(0 0 2px #24c7ef99); }
.tb-top { opacity: 0; transition: opacity .3s; }
.tb-top.on { opacity: 1; }
.tb-beacon { fill: #ff5c7a; animation: tbBlink 1s ease-in-out infinite; filter: drop-shadow(0 0 4px #ff5c7a); }
.tb-wave { fill: none; stroke: #24c7ef; stroke-width: 1.2; stroke-linecap: round; opacity: 0; animation: tbWave 1.4s ease-out infinite; }
.tb-svg.reset .tb-part, .tb-svg.reset .tb-top { transition: opacity .3s; opacity: 0; }
.tb-carry { stroke: #f5c34c; stroke-width: 2.4; stroke-linecap: round; opacity: 0; transition: transform .22s cubic-bezier(.4,0,.2,1); filter: drop-shadow(0 0 3px #f5c34c); }
.tb-carry.on { opacity: 1; }
@keyframes tbGround { to { stroke-dashoffset: -20; } }
@keyframes tbBlink { 50% { opacity: .25; } }
@keyframes tbWave { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.15); } }
.tb-wave { transform-box: view-box; transform-origin: 110px 18px; }

.rb-track { fill: #1b3352; stroke: #3d6a99; }
.rb-wheel { fill: #24c7ef; animation: tbBlink 1.2s infinite; }
.rb-wheel:nth-child(odd) { animation-delay: .6s; }
.rb-body { fill: #3b4f9e; stroke: #8d72f7; stroke-width: 1; }
.rb-panel { fill: #0b1930; stroke: #24c7ef; stroke-width: .6; }
.rb-led { fill: #23cca0; animation: tbBlink 1.6s infinite; }
.rb-led2 { fill: #f5c34c; animation-delay: .8s; }
.rb-headbox { fill: #4a5fb8; stroke: #a99bff; stroke-width: 1; }
.rb-visor { fill: #061226; }
.rb-eye { fill: #24c7ef; filter: drop-shadow(0 0 2px #24c7ef); animation: rbEye 4s infinite; transform-box: fill-box; transform-origin: center; }
.rb-ant { stroke: #a99bff; stroke-width: 1.4; }
.rb-antball { fill: #ee5ca4; animation: tbBlink .9s infinite; }
.rb-limb { stroke: #a99bff; stroke-width: 3; stroke-linecap: round; }
.rb-hand { fill: #f5c34c; }
.rb-head { transform-box: fill-box; transform-origin: 50% 100%; animation: rbLook 3.2s ease-in-out infinite; }
.rb-arm { transform-box: view-box; transform-origin: 178px 166px; transition: transform .2s ease-out; }
.tb-robot.lift .rb-arm { transform: rotate(38deg); }
.rb-map { transform-box: view-box; transform-origin: 206px 166px; animation: rbMap 3.2s ease-in-out infinite; }
.rb-paper { fill: #1684ff22; stroke: #24c7ef; stroke-width: .8; }
.rb-plan { fill: none; stroke: #8fe3ff; stroke-width: .7; }
.rb-pin { fill: #ff5c7a; animation: tbBlink 1s infinite; }
.tb-robot { animation: rbBob 1.1s ease-in-out infinite; }
@keyframes rbLook { 0%, 40% { transform: rotate(-9deg); } 55%, 90% { transform: rotate(7deg); } 100% { transform: rotate(-9deg); } }
@keyframes rbMap { 0%, 40% { transform: rotate(-6deg); } 55%, 90% { transform: rotate(4deg) translateY(2px); } 100% { transform: rotate(-6deg); } }
@keyframes rbEye { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
@keyframes rbBob { 50% { transform: translateY(-1.2px); } }

/* in-app busy overlay: the same tower, no robot; shown only for waits longer than a moment */
.busy { backdrop-filter: blur(2px); transition: opacity .25s .25s; }
.busy.hidden { display: grid !important; opacity: 0; pointer-events: none; transition: opacity .15s 0s; }
.busy-card { display: grid; justify-items: center; gap: 6px; padding: 14px 18px 12px; border: 1px solid #2d4c70aa; border-radius: 16px; background: #0b1930e6; box-shadow: 0 16px 40px #0008; }
.busy-scene { width: 96px; height: 150px; }
.busy-label { font-size: 12.5px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .pl-glow, .pl-bar i, .tb-ground, .tb-wave, .tb-beacon, .rb-head, .rb-map, .tb-robot, .rb-eye, .rb-led, .rb-wheel, .rb-antball, .rb-pin { animation: none; }
  .tb-wave { opacity: .6; }
}
