:root {
  --bg: #eef5fb;
  --panel: #ffffff;
  --line: #c9dcea;
  --text: #163044;
  --muted: #5d7a90;
  --acc: #156082;
  --acc2: #3d9ad1;
  --ok: #2a8f62;
  --warn: #b5811c;
  --bad: #c45c5c;
  --chip: #d7eaf6;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "Segoe UI", Arial, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100%; }
.top {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 22px; color: var(--acc); }
h2 { margin: 0 0 8px; font-size: 18px; }
h3 { margin: 10px 0 6px; font-size: 15px; color: var(--acc); }
.sub, .hint, .lead { color: var(--muted); margin: 4px 0 0; }
.steps {
  display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; max-width: 70%;
  justify-content: flex-end;
}
.steps li {
  font-size: 11px; color: var(--muted); background: var(--chip); border-radius: 999px;
  padding: 3px 8px; cursor: pointer;
}
.steps li.on { background: var(--acc); color: #fff; }
.steps li.done { background: #b7d7ea; color: var(--acc); }
.steps li.home {
  background: #fff; border: 1px solid var(--line); color: var(--acc); font-weight: 600;
}
.steps li.home.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.wrap { display: grid; grid-template-columns: 280px 1fr; flex: 1 1 auto; min-height: 0; }
body.spec-mode .wrap { grid-template-columns: 1fr; }
body.spec-mode .girl { display: none; }
body.spec-mode main { padding: 16px 24px 32px; }
body.spec-mode .panel { max-width: none; }
.girl { padding: 16px; border-right: 1px solid var(--line); background: #f7fbfe; min-height: 0; overflow: auto; }
.girl-frame {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(21, 96, 130, 0.12); background: #fff;
}
.girl-frame img { display: block; width: 100%; height: auto; }
.bubble {
  margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; position: relative; color: var(--text);
}
.bubble:before {
  content: ""; position: absolute; top: -8px; left: 24px;
  border: 8px solid transparent; border-bottom-color: var(--line); border-top-width: 0;
}
.bubble:after {
  content: ""; position: absolute; top: -7px; left: 25px;
  border: 7px solid transparent; border-bottom-color: #fff; border-top-width: 0;
}
main { padding: 16px 18px 28px; overflow: auto; min-height: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); }
.field .why { font-size: 12px; color: var(--muted); }
input, select, textarea, button {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  max-width: 100%;
}
.field select {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
textarea { min-height: 64px; resize: vertical; }
button { cursor: pointer; background: var(--acc); color: #fff; border-color: var(--acc); }
button.ghost { background: #fff; color: var(--acc); }
button.btn-export {
  background: var(--acc2);
  border-color: #2f86b8;
  color: #fff;
}
button:disabled { opacity: 0.45; cursor: default; }
.nav { display: flex; justify-content: space-between; gap: 8px; }
.choice {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.choice label {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; cursor: pointer;
}
.choice label.on { border-color: var(--acc); background: #e7f3fa; }
.choice label.locked { opacity: 0.45; cursor: not-allowed; }
.choice input { display: none; }
.choice.stack { flex-direction: column; }
.choice.stack label { width: 100%; }
.choice label .use { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.kit-rows { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.kit-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px; align-items: center;
  padding: 8px 12px; background: #f7fbfe; border: 1px solid var(--line); border-radius: 10px;
}
.kit-row .kit-name { font-size: 14px; color: var(--text); }
.kit-row input { text-align: center; }
.kit-sum { margin: 4px 0 8px; }
.pass-wrap { overflow: auto; margin: 12px 0 8px; }
.pass-table { min-width: 480px; width: 100%; border-collapse: collapse; }
.pass-table th, .pass-table td { padding: 6px 8px; text-align: left; font-size: 13px; vertical-align: middle; }
.pass-table th { color: var(--muted); font-weight: 600; }
.pass-table td { border-top: 1px solid var(--line); }
.pass-table input.pass-qty { width: 80px; text-align: center; }
.pass-table select { width: 100%; }
.cards { display: grid; gap: 8px; }
.sys-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  max-height: 54vh; overflow: auto; padding-right: 4px;
}
.sys-grid button {
  text-align: left; background: #fff; color: var(--text);
  border: 1px solid var(--line); padding: 10px 12px;
}
.sys-grid button.on { border-color: var(--acc); background: #e7f3fa; }
.sys-grid small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #f8fcff; cursor: pointer;
}
.card.on { border-color: var(--acc); background: #e7f3fa; }
.card small { display: block; color: var(--muted); }
.norms { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.norms span {
  background: var(--chip); border-radius: 999px; padding: 3px 8px; font-size: 12px; color: var(--acc);
}
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th {
  background: #156082; color: #fff; font-weight: 600; padding: 8px 6px; text-align: center;
}
.spec-table td {
  border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; vertical-align: middle;
}
.spec-table td.name { text-align: left; }
.spec-table td.note { text-align: left; font-size: 11px; color: var(--muted); max-width: 320px; line-height: 1.35; }
.spec-table td.note a { color: var(--acc); }
.spec-table .why { display: block; color: var(--muted); font-size: 12px; }
.spec-table tr.spec-odd td { background: #fff; }
.spec-table tr.spec-even td { background: #f3f8fb; }
.spec-table tr.spec-sec td {
  background: #156082; color: #fff; font-weight: 600; text-align: left;
  padding: 8px 10px; letter-spacing: 0.02em;
}
.spec-table tr.spec-sec-psu td {
  background: #f3c96b; color: #163044; font-weight: 700;
}
.spec-table tr.spec-sec-kns td {
  background: #2a7a62; color: #fff; font-weight: 700;
  letter-spacing: 0.03em;
}
.qty-edit { display: inline-flex; align-items: center; gap: 4px; }
.qty-edit button { padding: 4px 10px; min-width: 32px; }
.qty-edit input { width: 72px; text-align: center; padding: 4px 6px; }
.spec-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.warn { background: #fff6e5; color: var(--warn); padding: 8px; border-radius: 8px; margin: 8px 0; font-size: 13px; }
.note { background: #f3f8fb; border-left: 3px solid var(--acc); padding: 8px 10px; margin: 8px 0 12px; font-size: 13px; }
.note div { margin: 2px 0; }
.note small { display: block; color: var(--muted); margin-top: 6px; }
.model-hint {
  background: #f3f8fb; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; color: var(--muted); font-size: 13px; margin: 4px 0 14px;
}
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.seg label {
  display: flex; gap: 6px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.seg label.on { border-color: #156082; background: #e8f4fb; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.check input { width: auto; margin-top: 3px; }
.num { width: 100%; }
input[readonly] { background: #f3f8fb; color: var(--muted); }
.plans { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.plan-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #f8fcff;
}
.plan-card img {
  display: block;
  width: auto; height: auto;
  max-width: 100%; max-height: min(68vh, 720px);
  object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  margin: 0 auto;
}
.plan-ph {
  width: 100%; min-height: 120px; max-height: min(68vh, 720px);
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font-size: 12px;
}
.plan-stage {
  position: relative; cursor: crosshair;
  display: flex; justify-content: center; align-items: center;
}
.plan-stage.idle { cursor: default; }
.plan-stage.place { cursor: crosshair; }
.plan-stage.over-panel { cursor: grab; }
.plan-stage.over-handle { cursor: grab; }
.plan-stage.grabbing { cursor: grabbing; }
.plan-stage.kns-hand { cursor: grab; }
.plan-stage.kns-hand.grabbing { cursor: grabbing; }
.kns-qty-box {
  position: absolute;
  z-index: 4;
  background: #fff;
  border: 1px solid #163044;
  border-radius: 6px;
  padding: 2px 5px 3px;
  font-size: 11px;
  color: #163044;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  white-space: nowrap;
}
.kns-qty-box span { display: block; font-size: 10px; color: #5a6b78; }
.kns-qty-box input {
  width: 36px;
  border: 1px solid #c9dcea;
  border-radius: 4px;
  text-align: center;
  font: inherit;
  padding: 1px 2px;
}
.plan-edit-bar { margin: 6px 0 0; }
.kns-editor {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: #fff; margin: 10px 0 14px;
}
.kns-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.kns-tools button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font: inherit; color: #163044;
}
.kns-tools button.on { border-color: #156082; background: #e8f4fb; }
.kns-tools button.kns-merge.on { border-color: #ef6c00; background: #fff3e0; }
.kns-tools button.kns-auto { border-color: #2a8f62; }
.kns-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle; border: 1px solid rgba(0,0,0,.2);
}
.kns-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 6px 0 8px; font-size: 13px; color: #163044; }
.kns-pal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.kns-pal-item {
  width: 108px;
  cursor: grab;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 2px 6px;
  text-align: center;
  user-select: none;
  font-size: 12px;
  color: #163044;
}
.kns-pal-item:active { cursor: grabbing; }
.kns-pal-item.on {
  border-color: #156082;
  box-shadow: 0 0 0 2px #156082;
}
.kns-pal-ico {
  display: block;
  width: 28px;
  height: 28px;
  margin: 4px auto 4px;
}
.pick {
  background: #eef7f1; border: 1px solid #9ec9a8; border-radius: 8px;
  padding: 10px 12px; margin: 8px 0 14px; color: #163044;
  max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
.pick .why { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.pick.net-spec b { display: block; margin-bottom: 4px; }
.pick.net-spec ul { margin: 4px 0 0; padding-left: 18px; }
.pick.net-spec li { margin: 2px 0; line-height: 1.35; }
.acc-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 12px; }
.plan-scale {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end;
  margin-top: 10px;
  padding: 12px 14px;
  background: #fff8e8;
  border: 2px solid var(--warn);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(181, 129, 28, 0.18);
}
.plan-scale label { font-weight: 600; color: var(--text); }
.plan-scale input.num {
  background: #fff;
  border: 2px solid var(--warn);
  font-size: 16px;
  min-height: 36px;
}
.sot-ana { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.sot-ana > h4 { margin: 0 0 6px; font-size: 14px; color: var(--acc); }
.sot-ana-list { max-height: 340px; overflow: auto; padding-right: 4px; }
.sot-ana-row {
  display: grid;
  grid-template-columns: 1fr 88px 28px;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
  padding: 4px 6px;
  border-radius: 8px;
}
.sot-ana-row:nth-child(odd) { background: #f7fbfe; }
.sot-ana-row .check { margin: 0; }
.sot-ana-row input.ana-qty { width: 88px; text-align: center; }
.sot-ana-row input.ana-qty:disabled { background: #eef3f7; color: var(--muted); border-color: var(--line); }
.sot-ana-unit { font-size: 12px; color: var(--muted); }
.net-q-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
  padding: 4px 6px;
  border-radius: 8px;
}
.net-q-row:nth-child(odd) { background: #f7fbfe; }
.net-q-row input.net-q-n { width: 88px; text-align: center; }
.net-qual { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.net-qual span {
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
}
.net-map-svg { overflow: auto; margin: 8px 0 12px; background: #f7fafc; border-radius: 10px; }
.net-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin: 8px 0 12px;
  align-items: flex-start;
}
.net-legend-ico {
  flex: 0 0 auto;
  overflow: visible;
}
.sks-topo-body.net-map-body { grid-template-columns: 300px 1fr; }
.net-pal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.net-pal-item {
  width: 108px;
  cursor: grab;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 2px 2px;
  text-align: center;
  user-select: none;
}
.net-pal-item:active { cursor: grabbing; }
.net-pal-item.on {
  border-color: #2f6a38;
  box-shadow: 0 0 0 2px #2f6a38;
}
.net-node { cursor: grab; }
.net-node:active { cursor: grabbing; }
.net-node.on { filter: drop-shadow(0 0 6px #2f6a38); }
.net-map-svg { min-width: 1200px; overflow: hidden; }
.sks-topo-canvas svg { overflow: hidden; }
.plan-meta { font-size: 13px; color: var(--muted); margin: 6px 0; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) {
  .plan-card { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
}
@media (max-height: 800px) {
  .plan-card img, .plan-ph { max-height: 52vh; }
}
@media (max-width: 1100px) {
  .wrap { grid-template-columns: 1fr; }
  .girl { display: grid; grid-template-columns: 160px 1fr; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .steps { max-width: none; }
  body.spec-mode .girl { display: none; }
}
body.topo-mode .wrap, body.topo-mode .top { display: none; }
.sks-topo-ov {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: #eef3f7; color: var(--text);
}
.sks-topo-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sks-topo-bar h2 { margin: 0 8px 0 0; font-size: 18px; color: var(--acc); }
.sks-topo-bar .grow { flex: 1 1 auto; }
.sks-topo-body {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 300px 1fr;
}
.sks-topo-side {
  overflow: auto; padding: 12px 14px; background: #f7fbfe;
  border-right: 1px solid var(--line);
}
.sks-topo-canvas { overflow: auto; padding: 12px 16px; background: #f7fafc; position: relative; }
.sks-node-box { cursor: pointer; }
.pass-table.sks-sum { width: 100%; }
.pass-table.sks-sum td:last-child { white-space: nowrap; }
.pass-table.sks-sum input { width: 88px; margin-right: 4px; }
.sks-floor-svg { width: 100%; min-width: 760px; display: block; }
.sks-type-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  margin: 0 0 10px; background: #fff;
}
.sks-type-card .dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  margin-right: 6px; vertical-align: middle;
}
.sks-dlg {
  position: absolute; right: 20px; bottom: 20px; width: 340px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; box-shadow: 0 12px 32px rgba(21, 96, 130, 0.18);
}
.sks-wp-btns { margin: 8px 0 4px; }
.sks-wp-btns button { margin-right: 6px; }
.sot-block {
  margin: 14px 0 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sot-block > h3 { margin: 0 0 8px; font-size: 16px; }
.sot-cam-type {
  margin: 12px 0 8px;
  padding: 10px 12px;
  background: #f7fbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sot-cam-type .lead { margin: 0 0 8px; }
.sot-cam-type .lead b { color: var(--acc); }
.sot-type-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(22, 48, 68, 0.22);
}
.sot-cam-type .check { display: inline-block; margin: 4px 16px 4px 0; }
.pass-table.wp-kit select { min-width: 0; }
.sks-pc-list { margin: 4px 0 12px 8px; }
.sks-pc-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.sks-pc-row .sks-pc-name { flex: 1 1 auto; font-size: 13px; line-height: 1.3; }
.sks-pc-row input { width: 72px; text-align: center; flex: 0 0 auto; }
.sks-route-block { margin: 10px 0 14px; padding: 8px 0 4px; border-top: 1px solid var(--line); }
.sks-route-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.sks-route-row span { flex: 1 1 auto; }
.sks-route-row input { width: 88px; text-align: center; }

/* оговорка о сведениях производителей под спецификацией */
.ang-disc { margin: 10px 2px 4px; font-size: 11.5px; line-height: 1.45; color: #5a6b7d; max-width: 1100px; }
.ang-disc .ang-warn { display: block; margin-bottom: 6px; padding: 8px 10px; font-size: 12.5px; color: #9a3412; background: #fff7ed; border-left: 3px solid #f97316; border-radius: 6px; }
