/* Оптика — стили. Жёлтый — цвет оболочки одномодового кабеля, им обозначены кабели. */
:root {
    --paper: #F3F5F6;
    --panel: #FFFFFF;
    --ink: #17232D;
    --ink-2: #24384A;
    --muted: #5A6A77;
    --line: #D6DDE2;
    --line-soft: #E8ECEF;
    --hover: #F1F4F6;
    --fiber: #F2B705;
    --fiber-dark: #8A6400;
    --cable: #2563EB;
    --cable-dark: #1E3A8A;
    --node: #1B4F8A;
    --accent: #1B4F8A;
    --pole: #3A4752;
    --danger: #B42318;
    --ok: #14532D;
    --radius: 6px;
    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --topbar: 52px;
    --layers-w: 284px;
    --rail-w: 80px;
    --inspector-w: 480px;
    --inspector-wide: min(980px, calc(100vw - 360px));
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--paper); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* Знак: сечение кабеля — жёлтая оболочка вокруг сердцевины */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .01em; }
.brand-mark {
    width: 20px; height: 20px; border-radius: 50%;
    background: radial-gradient(circle, var(--ink) 0 3px, var(--panel) 3.5px 5px, var(--fiber) 5.5px);
    box-shadow: inset 0 0 0 1px var(--fiber-dark);
    flex: none;
}
.brand--large { font-size: 26px; gap: 14px; }
.brand--large .brand-mark { width: 34px; height: 34px; background: radial-gradient(circle, var(--ink) 0 5px, var(--panel) 5.5px 9px, var(--fiber) 9.5px); }

/* Формы */
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.input, .select, .login-form input {
    width: 100%; padding: 7px 10px; font: inherit; font-size: 14px; color: var(--ink);
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
textarea.input { resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .login-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(27, 79, 138, .15); }
.input[readonly] { background: var(--paper); }
.btn { font: inherit; font-size: 14px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ink-2); }
.btn-small { font-size: 13px; padding: 4px 10px; background: var(--panel); border-color: var(--line); color: var(--ink); }
.btn-small:hover:not(:disabled) { border-color: var(--muted); background: var(--hover); }
.btn-danger { color: var(--danger); }
.btn-link { background: none; color: var(--muted); }
.btn-accent { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-accent:hover { background: var(--ink-2); }
.link { font: inherit; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.select--small { width: auto; padding: 3px 6px; font-size: 13px; }
.input--small { padding: 3px 6px; font-size: 13px; min-width: 140px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.form-error { color: var(--danger); background: #FEF3F2; border: 1px solid #FECDCA; padding: 8px 10px; border-radius: var(--radius); margin: 0 0 8px; font-size: 14px; }

/* Вход и пустое состояние */
.page-login { display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 360px; }
.login-lead { margin: 6px 0 24px; color: var(--muted); }
.login-form { display: grid; gap: 2px; }
.login-form label { font-size: 13px; color: var(--muted); margin-top: 10px; }
.login-form .btn { margin-top: 18px; justify-content: center; }
.hint { margin: 16px 0 6px; }
.code { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; overflow-x: auto; font-size: 13px; }

/* ================================================================ каркас */
.page-map { overflow: hidden; }

.topbar {
    grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 8px;
    background: var(--ink); color: #fff; z-index: 1010; box-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}
.topbar .brand { color: #fff; }
.topbar .brand-mark { box-shadow: inset 0 0 0 1px var(--fiber); }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: var(--radius); background: transparent; color: #C9D3DB; cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .1); color: #fff; }
.select--bar { width: auto; max-width: 220px; background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); padding: 5px 8px; }
.select--bar option { color: var(--ink); }
.search { position: relative; flex: 1 1 420px; max-width: 620px; }
.search-icon { position: absolute; left: 10px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; fill: #8A99A6; pointer-events: none; }
.input--search { padding-left: 34px; background: rgba(255, 255, 255, .95); border-color: transparent; }
.search-results {
    list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 1020;
    background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(23, 35, 45, .18); max-height: 60vh; overflow-y: auto;
}
.search-results button {
    display: grid; grid-template-columns: 14px 1fr; gap: 2px 10px; align-items: center;
    width: 100%; padding: 7px 8px; border: 0; background: none; text-align: left; font: inherit; font-size: 14px; cursor: pointer; border-radius: 4px; color: var(--ink);
}
.search-results button:hover, .search-results button:focus-visible { background: var(--hover); }
.search-results .sub { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.search-results .none { padding: 8px; color: var(--muted); }
.search-results button:disabled { cursor: default; opacity: .7; }
.search-results .swatch { justify-self: center; }
.topbar-nav { display: flex; gap: 4px; }
.bar-btn { white-space: nowrap; font: inherit; font-size: 14px; color: #DCE3E9; background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: 6px 10px; cursor: pointer; }
.bar-btn:hover, .bar-btn.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.user { margin-left: auto; font-size: 13px; color: #C9D3DB; text-decoration: none; white-space: nowrap; display: flex; gap: 8px; align-items: baseline; }
.user-exit { color: #8A99A6; }
.user:hover .user-exit { color: #fff; }

.swatch { display: inline-block; justify-self: center; flex: none; }
.swatch--span { width: 22px; height: 4px; background: var(--cable); border-radius: 2px; box-shadow: 0 0 0 1px var(--cable-dark); }
.swatch--pole { width: 7px; height: 7px; border-radius: 50%; background: var(--pole); }
.swatch--trunk { width: 22px; height: 5px; background: #7C3AED; border-radius: 2px; }
.swatch--full { width: 22px; height: 4px; background: #C62828; border-radius: 2px; }
.swatch--text { font-size: 12px; font-weight: 700; line-height: 1; }
.swatch--node-node, .swatch--node-cabinet, .swatch--node-cross, .swatch--node-splice, .swatch--node-cassette, .swatch--planned, .swatch--faulty {
    width: 11px; height: 11px; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(23, 35, 45, .35);
}
.swatch--node-node { background: #2E9E44; }
.swatch--node-cabinet { background: #5B6B7A; }
.swatch--node-cross { background: #7B3FA0; }
.swatch--node-splice { background: #1F2937; border-radius: 50%; }
.swatch--node-cassette { background: #E07B00; border-radius: 50%; }
.swatch--planned { background: #fff; border: 2px dashed #5A6A77; box-shadow: none; }
.swatch--faulty { background: #fff; border: 2.5px solid #D92D20; box-shadow: none; border-radius: 50%; }

/* Карта */
.map { grid-area: map; position: relative; min-width: 0; background: #E9ECEE; }
.leaflet-container { font: inherit; }
.leaflet-tooltip.obj-tip { font-size: 13px; padding: 3px 7px; border-radius: 4px; }
.map.is-picking, .map.is-picking .leaflet-interactive { cursor: crosshair; }
.map.is-dragging-node, .map.is-dragging-node .leaflet-interactive { cursor: grabbing; }
.trace-chip { display: flex; align-items: center; gap: 8px; max-width: 520px; margin-bottom: 4px !important; padding: 6px 8px 6px 10px; background: #fff; border: 1px solid #F0C3D5; border-left: 4px solid #C2185B; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(23, 35, 45, .15); font-size: 13px; }
.trace-chip-dot { width: 10px; height: 10px; border-radius: 50%; border: 3px solid #C2185B; flex: none; }
.trace-chip button { font: inherit; font-size: 12.5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; white-space: nowrap; }
.trace-chip button[data-clear] { font-size: 16px; line-height: 1; padding: 2px 7px; }
.coords { background: rgba(255, 255, 255, .85); padding: 1px 6px; border-radius: 3px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink); }

.toast {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1006; max-width: min(620px, calc(100% - 24px));
    padding: 8px 14px; border-radius: var(--radius); background: #E7F4EC; color: var(--ok); border: 1px solid #A7D7B8;
    font-size: 14px; box-shadow: 0 4px 16px rgba(23, 35, 45, .15); white-space: pre-line; display: flex; gap: 12px; align-items: center;
}
.toast--warn { background: #FEF3F2; color: var(--danger); border-color: #FECDCA; }
.toast button { font: inherit; font-size: 13px; font-weight: 600; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* Инструменты: вертикальная панель слева на карте */
.tools { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 5px rgba(23, 35, 45, .16); }
.tool { width: 38px; height: 36px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--panel); color: var(--ink); cursor: pointer; display: grid; place-items: center; position: relative; }
.tool:last-child { border-bottom: 0; }
.tool svg { width: 20px; height: 20px; }
.tool:hover { background: var(--hover); }
.tool.is-active { background: var(--ink); color: #fff; }
.tool-sep { height: 6px; background: var(--paper); }
.tool-hint {
    position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000; max-width: min(760px, calc(100% - 24px));
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 9px 12px;
    background: var(--ink); color: #fff; border-radius: var(--radius); font-size: 14px; box-shadow: 0 4px 16px rgba(23, 35, 45, .25);
}
.tool-hint span { flex: 1 1 260px; }
.tool-hint button { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; cursor: pointer; }
.tool-hint button.primary { background: var(--fiber); border-color: var(--fiber); color: var(--ink); font-weight: 600; }
.tool-hint button:disabled { opacity: .5; cursor: default; }

/* Подписи узлов на карте */
.map-label {
    position: absolute; left: 0; top: 0; white-space: nowrap; padding: 0 3px; line-height: 16px;
    font-size: 12px; color: var(--ink);
    text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff;
}
.map-label--square { font-weight: 600; }
.map-label.is-selected { background: var(--ink); color: #fff; text-shadow: none; border-radius: 3px; }

/* Правка трассы и перетаскивание: ручки */
.vh { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); cursor: grab; }
.vh:active { cursor: grabbing; }
.vh--fixed { background: var(--ink); border-color: #fff; cursor: not-allowed; width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.vh--mid { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: rgba(255, 255, 255, .75); border: 1.5px dashed var(--ink); box-shadow: none; }
.vh--mid:hover { background: var(--fiber); border-style: solid; }
.drag-handle { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid var(--ink); background: rgba(242, 183, 5, .85); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); cursor: grab; }
.drag-handle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); }

/* Контекстное меню и выбор из нескольких объектов */
.ctx {
    position: fixed; z-index: 2000; min-width: 230px; max-width: 320px; padding: 4px 0; margin: 0; list-style: none;
    background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 36px rgba(23, 35, 45, .22); font-size: 14px;
}
.ctx-head { padding: 6px 12px 6px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-head strong { color: var(--ink); font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.ctx button:hover:not(:disabled), .ctx button:focus-visible { background: var(--hover); outline: none; }
.ctx button:disabled { color: #A3AEB7; cursor: default; }
.ctx .kbd { margin-left: auto; color: var(--muted); font-size: 12px; }
.ctx .danger { color: var(--danger); }
.ctx hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.ctx .sub { display: block; font-size: 12px; color: var(--muted); }

/* ================================================================ панель объекта */
.inspector {
    grid-area: inspector; width: var(--inspector-w); min-width: 0; display: flex; flex-direction: column; min-height: 0;
    background: var(--panel); border-left: 1px solid var(--line); font-size: 14px; position: relative; z-index: 1005;
    transition: width .15s ease;
}
.inspector.is-wide { width: var(--inspector-wide); }
.insp-head { padding: 10px 14px 0; border-bottom: 1px solid var(--line); flex: none; }
.insp-top { display: flex; align-items: flex-start; gap: 10px; }
.insp-icon { margin-top: 5px; }
.insp-titles { flex: 1; min-width: 0; }
.insp-kind { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.insp-title { font-size: 18px; font-weight: 650; line-height: 1.25; margin: 1px 0 2px; overflow-wrap: anywhere; }
.insp-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.insp-btns { display: flex; gap: 2px; flex: none; }
.insp-btn { width: 30px; height: 30px; border: 1px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; display: grid; place-items: center; }
.insp-btn svg { width: 17px; height: 17px; fill: currentColor; }
.insp-btn:hover { background: var(--hover); color: var(--ink); }
.insp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.insp-tabs { display: flex; gap: 0; margin: 10px -14px 0; padding: 0 8px; overflow-x: auto; }
.insp-tab { font: inherit; font-size: 14px; padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.insp-tab:hover { color: var(--ink); }
.insp-tab.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.insp-tab .count { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.insp-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; }
.insp-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: #FFFBEB; }
.insp-foot .kbd-hint { color: #9FB0BD; font-size: 12px; }
.insp-foot .msg { flex: 1; font-size: 13px; color: var(--fiber-dark); }
.insp-back { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.insp-empty { padding: 30px 18px; color: var(--muted); text-align: center; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.badge--active { background: #E7F4EC; color: var(--ok); }
.badge--planned { background: #EEF2F6; color: #334155; }
.badge--faulty { background: #FEF3F2; color: var(--danger); }
.badge--dismantled { background: #F2F4F7; color: #667085; text-decoration: line-through; }
.badge--src { background: #F5F0FF; color: #5B21B6; }

/* Паспорт: секции и поля */
.pp-section { margin: 0 0 16px; }
.pp-section > h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.pp-field { display: grid; gap: 3px; min-width: 0; }
.pp-field--wide { grid-column: 1 / -1; }
.pp-field > label, .pp-field > .lbl { font-size: 12.5px; color: var(--muted); }
.pp-field .val { min-height: 22px; overflow-wrap: anywhere; white-space: pre-line; }
.pp-field .val.empty { color: #A3AEB7; }
.pp-field.is-dirty .input, .pp-field.is-dirty .select { border-color: #E3A008; background: #FFFDF5; }
.pp-inline { display: flex; gap: 6px; align-items: center; }
.pp-inline .input { flex: 1; }
.contacts { display: grid; gap: 8px; }
.contact { display: grid; grid-template-columns: 150px 1fr 140px 28px; gap: 6px; align-items: start; }
.contact .input, .contact .select { font-size: 13.5px; padding: 5px 8px; }
.contact-note { grid-column: 2 / 4; }
.contact-view { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.contact-view .role { font-size: 12px; color: var(--muted); }
.contact-view .name { font-weight: 600; }
.contact-view .phone { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; font-weight: 600; text-decoration: none; white-space: nowrap; }
.contact-view .note { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13.5px; }
.stat-row b { font-variant-numeric: tabular-nums; }

/* Списки в панели: кабели узла, трасса кабеля, журнал */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.list > li .grow { flex: 1; min-width: 0; }
.list .sub { display: block; font-size: 12.5px; color: var(--muted); }
.route { list-style: none; margin: 0 0 14px; padding: 0 0 0 14px; border-left: 3px solid var(--cable); }
.route li { position: relative; padding: 4px 0 4px 10px; }
.route .stop::before { content: ''; position: absolute; left: -22px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.route .stop--node::before { background: var(--cable-dark); border-color: #fff; box-shadow: 0 0 0 1.5px var(--cable-dark); }
.route .seg { color: var(--muted); font-size: 12.5px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.history .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history .what { font-weight: 600; }
.history .det { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* Формы в панели (создание, разрыв) */
.edit-form { display: grid; gap: 2px; }
.edit-form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.edit-form label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; margin-top: 12px; }
.edit-form .form-error { margin-top: 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; }

/* Волокна, сварки, трасса */
.drawer-summary { margin: 0 0 10px; }
.h3 { font-size: 14px; font-weight: 600; margin: 16px 0 4px; }
.fdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(23, 35, 45, .45); }
.fstatus { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.fstatus--free { background: #E7F4EC; color: var(--ok); }
.fstatus--service { background: #EEF2F6; color: #334155; }
.fstatus--client { background: #FDF0D5; color: #7A4D00; }
.fnote { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-line; }
.fbar { display: inline-block; width: 40px; height: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(23, 35, 45, .4); vertical-align: middle; }
.ftable { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.ftable th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px; border-bottom: 1px solid var(--line); position: sticky; top: -12px; background: var(--panel); z-index: 1; }
.ftable td { padding: 5px 6px; border-bottom: 1px solid #EEF1F3; vertical-align: top; }
.ftable tr.module-start td { border-top: 2px solid var(--line); }
.ftable .num { text-align: right; font-variant-numeric: tabular-nums; }
.ftable th.num { text-align: right; }
.ftable--fibers td { vertical-align: middle; }
.ftable--fibers tr.fs--client td { background: #FFF8E8; }
.ftable--fibers tr.fs--service td { background: #F4F6F9; }
.ftable--fibers .fsplices { font-size: 12.5px; line-height: 1.45; min-width: 200px; }
.flease { width: 26%; }
.flease .input--small { width: 100%; }
.fsplices { font-size: 13px; line-height: 1.6; }
.splice-mid { color: var(--muted); text-align: center; }
.splice-group h3 { font-size: 14px; font-weight: 600; margin: 18px 0 2px; }
.node-cables { margin: 0 0 12px; padding-left: 18px; }
.tool-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 10px 0; }
.tool-box summary { cursor: pointer; font-weight: 600; }
.tool-box[open] summary { margin-bottom: 8px; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 8px; }
.tool-grid label { font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.tool-box .btn { margin-top: 6px; }
.trace { list-style: none; margin: 0 0 12px; padding: 0 0 0 14px; border-left: 3px solid #C2185B; }
.trace li { padding: 4px 0 4px 10px; position: relative; }
.trace-node::before { content: ''; position: absolute; left: -22px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid #C2185B; }
.trace-node--end::before { background: #C2185B; }
.trace-node--open { color: var(--muted); font-style: italic; }
.trace-fiber--start { background: #FBEAF0; border-radius: 4px; }
.info-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 8px; }
.info-grid dt { color: var(--muted); }
.info-grid dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }

/* Схема узла — «Кроссировка» */
.sch-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.sch-toolbar .check { margin: 0; }
.sch-zoom { margin-left: auto; display: flex; gap: 4px; }
.sch-hint { margin: 6px 0; }
.sch-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #FBFCFC; max-height: calc(100vh - 330px); min-height: 220px; }
.sch { display: block; font-family: var(--font); user-select: none; }
.sch-box { fill: #fff; stroke: #9AA7B2; stroke-width: 1.5; }
.sch-node-name { font-size: 14px; fill: #C3CBD2; font-weight: 600; }
.sch-bar { fill: #3A4752; }
.sch-cable-name { font-size: 13px; font-weight: 600; fill: var(--ink); }
.sch-module { font-size: 11px; fill: var(--muted); }
.sch-num { font-size: 9px; fill: #5A6A77; }
.sch-tail { stroke: #9AA7B2; stroke-width: 1; }
.sch-fiber { cursor: pointer; outline: none; }
.sch-fiber .sch-hit, .sch-splice .sch-hit { fill: transparent; stroke: transparent; }
.sch-splice .sch-hit { fill: none; stroke-width: 9; }
.sch-dot { stroke: #17232D; stroke-width: 1; }
.sch-fiber.fs--service .sch-dot, .sch-fiber.fs--client .sch-dot { stroke-width: 2.6; }
.sch-fiber:hover .sch-dot, .sch-fiber:focus .sch-dot { stroke: #C2185B; stroke-width: 2.6; }
.sch-fiber.is-picked .sch-dot { stroke: #C2185B; stroke-width: 3.5; }
.sch-fiber.is-picked .sch-tail { stroke: #C2185B; stroke-width: 2; }
.sch-line { fill: none; stroke: #1E66D0; stroke-width: 1.6; }
.sch-splice.is-busy .sch-line { stroke: #111; }
.sch-splice { cursor: pointer; }
.sch-splice:hover .sch-line, .sch-splice.is-hover .sch-line { stroke-width: 3; }
.sch-splice.is-picked .sch-line { stroke: #C2185B; stroke-width: 3.2; }
.sch-fiber.is-traced .sch-dot { stroke: #C2185B; stroke-width: 3.5; r: 6.5; }
.sch-fiber.is-traced .sch-tail { stroke: #C2185B; stroke-width: 2.5; }
.sch-fiber.is-traced .sch-num { fill: #C2185B; font-weight: 700; }
.sch-splice.is-traced .sch-line { stroke: #C2185B; stroke-width: 4; }
.sch-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 6px 0 8px; padding: 8px 10px; border: 1px solid #F0C3D5; background: #FCF1F5; border-radius: var(--radius); }
.sch-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sch-legend { color: var(--muted); margin: 6px 0; }
.sch-key { display: inline-block; width: 22px; height: 0; border-top: 2px solid; vertical-align: middle; margin: 0 6px 0 2px; }
.sch-key--free { border-color: #1E66D0; }
.sch-key--busy { border-color: #111; margin-left: 12px; }
.sch-sides { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sch-sides li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Справочники — лист поверх карты слева */
.sheet {
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 1004; width: min(780px, 72%);
    display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line);
    box-shadow: 12px 0 32px rgba(23, 35, 45, .16); font-size: 14px; cursor: auto;
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sheet-title { flex: 1; margin: 0; font-size: 16px; font-weight: 600; }
.sheet-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; }
.dir-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.dir-tools .input { flex: 1 1 260px; width: auto; }
.dir-tools .select { width: auto; }
.dir-tools .check { margin: 0; }
.th-sort { font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.th-sort.is-active, .th-sort:hover { color: var(--ink); }
.dir td { vertical-align: middle; }
.dir tbody tr { cursor: pointer; }
.dir tbody tr:hover td { background: var(--hover); }
.dir tbody tr.is-current td { background: #EAF1FA; }
.dir .link { text-decoration: none; }
.dir .swatch { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.dir-zero { color: var(--danger); font-weight: 600; }
.dir-pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.dir-pager span { flex: 1; }

@media (max-width: 900px) {
    :root { --layers-w: 264px; --rail-w: 80px; --inspector-w: 380px; }
}
@media (max-width: 760px) {
    .app { grid-template-columns: 1fr; grid-template-rows: var(--topbar) 1fr; grid-template-areas: "top" "map"; }
    .inspector, .inspector.is-wide { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: 60dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; box-shadow: 0 -8px 24px rgba(23, 35, 45, .2); }
    .brand-name { display: none; }
    .topbar .admin-link { display: none; }
    .select--bar { max-width: 110px; }
    .contact { grid-template-columns: 1fr 1fr 28px; }
    .contact-note { grid-column: 1 / 3; }
    .pp-grid, .tool-grid { grid-template-columns: 1fr; }
    .sheet { width: 100%; }
}

/* ---------- этап 6: оборудование в узлах ---------- */
.swatch--device { width: 18px; height: 11px; border-radius: 2px; background: #334155; position: relative; display: inline-block; vertical-align: middle;
    box-shadow: inset 0 -3px 0 #0F172A; }
.swatch--device::after { content: ''; position: absolute; left: 3px; right: 3px; top: 3px; height: 2px;
    background: repeating-linear-gradient(90deg, #A7F3D0 0 2px, transparent 2px 4px); }
.dev-list .sub + .sub { margin-top: 0; }
.ftable--ports td { vertical-align: middle; }
.ftable--ports tr.ps--client td { background: #F0FAF3; }
.ftable--ports tr.ps--service td { background: #FFF9E6; }
.ftable--ports .fsplices { font-size: 12.5px; min-width: 170px; }
.ftable--ports .flease .input { min-width: 150px; }
.trace-port { font-size: 12.5px; margin-top: 3px; color: var(--ink); }
.trace-port .swatch--device { margin-right: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
/* схема: блок оборудования и порты */
.sch-dev-body { fill: #334155; }
.sch-dev-name { fill: #0F172A; }
.sch-device .sch-cable-name[data-device] { cursor: pointer; text-decoration: underline; text-decoration-color: #94A3B8; }
.sch-port .sch-dot { stroke: #0F172A; stroke-width: 1.2; }
.sch-port.ps--client .sch-dot, .sch-port.ps--service .sch-dot { stroke-width: 2; }
.sch-port:hover .sch-dot, .sch-port:focus .sch-dot, .sch-port.is-picked .sch-dot { stroke: #C2185B; stroke-width: 3; }
.sch-port.is-traced .sch-dot { stroke: #C2185B; stroke-width: 3.5; }
.sch-patch .sch-line { stroke: #0F766E; stroke-dasharray: 5 3; stroke-width: 1.8; }
.sch-patch.is-busy .sch-line { stroke: #0F766E; }
.sch-patch.is-traced .sch-line { stroke: #C2185B; stroke-dasharray: none; stroke-width: 4; }
.sch-key--patch { border-top: 2px dashed #0F766E; margin-left: 12px; }

/* ---------- этап 7: админка и своя учётная запись ---------- */
.page-admin { min-height: 100%; }
.admin-top { position: sticky; top: 0; z-index: 10; height: var(--topbar); }
.admin-brand { text-decoration: none; }
.admin-nav { display: flex; gap: 4px; margin-left: 12px; }
.admin-nav .bar-btn { text-decoration: none; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 20px 20px 48px; }
.admin-main h1 { font-size: 24px; margin: 4px 0 6px; }
.admin-main h2 { font-size: 16px; margin: 0 0 10px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head .btn { text-decoration: none; }
.admin-table { width: 100%; background: var(--panel); margin-top: 10px; }
.admin-table tr.is-off td { color: var(--muted); }
.admin-table td a { font-weight: 600; text-decoration: none; }
.role { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 10px; background: var(--hover); }
.role--admin { background: #FDECEC; color: #8A1C1C; }
.role--editor { background: #E8F0FB; color: #1B4F8A; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.admin-card--narrow { max-width: 440px; margin-top: 14px; }
.admin-form { display: grid; gap: 4px; max-width: 520px; }
.admin-form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.admin-form .check { color: var(--ink); font-size: 14px; }
.admin-form .hint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.admin-form .form-actions { margin-top: 12px; display: flex; gap: 8px; }
.pw-row { display: flex; gap: 6px; align-items: center; }
.pw-row .input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; }
.danger-title { margin-top: 22px !important; color: var(--danger); }
.flash { padding: 10px 12px; border-radius: var(--radius); margin: 0 0 12px; font-size: 14px; }
.flash--success { background: #ECFDF3; border: 1px solid #ABEFC6; color: #054F31; }
.flash--error { background: #FEF3F2; border: 1px solid #FECDCA; color: var(--danger); }
.topbar .admin-link { color: #C9D3DB; text-decoration: none; font-size: 13px; margin-left: auto; white-space: nowrap; }
.topbar .admin-link:hover { color: #fff; }
.topbar .admin-link + .user { margin-left: 12px; }
@media (max-width: 760px) {
    .admin-cols { grid-template-columns: 1fr; }
    .admin-nav .bar-btn { padding: 6px 6px; }
}
.user a { color: inherit; text-decoration: none; }
.user .user-name:hover { color: #fff; text-decoration: underline; }
.user a.user-exit { color: #8A99A6; }
.user a.user-exit:hover { color: #fff; }

/* ================================================================ этап 9: боковая панель
   Слева — тёмная полоса разделов, продолжение верхней строки: вместе они образуют рамку вокруг карты.
   Открытый раздел отмечен жёлтой чертой — цветом оболочки оптического кабеля, как и знак «Оптики». */
.app {
    display: grid; height: 100vh; height: 100dvh;
    grid-template-rows: var(--topbar) 1fr;
    grid-template-columns: var(--rail-w) var(--layers-w) 1fr auto;
    grid-template-areas: "top top top top" "rail layers map inspector";
}
.app.layers-collapsed { grid-template-columns: var(--rail-w) 0 1fr auto; }
.app.layers-collapsed .layers-panel { visibility: hidden; }

svg.i, .icon-btn svg.i { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topbar { padding-left: calc((var(--rail-w) - 36px) / 2); }
.topbar #layers-toggle svg { width: 22px; height: 22px; }

.rail {
    grid-area: rail; display: flex; flex-direction: column; padding: 8px 0 10px; min-height: 0; overflow-y: auto;
    background: var(--ink); border-top: 1px solid rgba(255, 255, 255, .07); z-index: 1009;
}
.rail-btn {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; flex: none;
    width: 100%; padding: 11px 4px 9px; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 10.5px; line-height: 1.2; color: #93A3B1; text-align: center;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rail-btn:hover { color: #E4EAEF; background: rgba(255, 255, 255, .04); }
.rail-btn.is-active { color: #fff; background: rgba(255, 255, 255, .08); }
.rail-btn.is-active::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--fiber); }
.rail-btn:focus-visible { outline: 2px solid var(--fiber); outline-offset: -4px; }
.rail-btn--end { margin-top: auto; }
.rail-badge {
    position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--fiber); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px var(--ink); font-variant-numeric: tabular-nums;
}

.layers-panel {
    grid-area: layers; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
    background: var(--panel); border-right: 1px solid var(--line); font-size: 14px;
}
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pane-head { display: flex; align-items: center; gap: 8px; height: 50px; flex: none; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line-soft); }
.pane-title { flex: 1; margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; }
.pane-close svg { width: 18px; height: 18px; }
.pane-close:hover { background: var(--hover); color: var(--ink); }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 18px; }
.pane-lead { margin: 4px 8px 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.group-title { margin: 20px 8px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.group-title--first { margin-top: 6px; }

/* слой: знак на карте, название с числом, переключатель */
.layer { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; cursor: pointer; }
.layer:hover { background: var(--hover); }
.layer-sym { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--paper); transition: opacity .15s; }
.layer-text { min-width: 0; display: grid; }
.layer-name { line-height: 1.3; }
.layer-sub, .layer-zoom { font-size: 12.5px; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; }
.layer-zoom { display: none; color: var(--fiber-dark); }
.layer.is-out-of-zoom .layer-sub { display: none; }
.layer.is-out-of-zoom .layer-zoom { display: block; }
.layer:has(.switch:not(:checked)) .layer-sym { opacity: .4; }
.layer:has(.switch:not(:checked)) .layer-name { color: var(--muted); }
.layer:has(.switch:not(:checked)) .layer-zoom { display: none; }
.layer:has(.switch:not(:checked)) .layer-sub { display: block; }

.switch {
    appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0;
    border-radius: 10px; background: #C3CCD4; cursor: pointer; transition: background .15s;
}
.switch::before {
    content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(23, 35, 45, .3); transition: transform .15s;
}
.switch:checked { background: var(--ink); }
.switch:checked::before { transform: translateX(14px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* обозначения узлов — под слоем «Узлы», по колонке названий */
.key { list-style: none; margin: 0 8px 6px 50px; padding: 2px 0 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; font-size: 12.5px; color: var(--muted); }
.key li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.layer:has(.switch:not(:checked)) + .key { opacity: .45; }
.key--cables { grid-template-columns: 1fr; gap: 3px; }
.cable-w { display: inline-block; width: 26px; border-radius: 2px; background: var(--cable); flex: none; }
.cable-w--thick { height: 5px; }
.cable-w--medium { height: 3px; }
.cable-w--thin { height: 2px; }

/* справочники: значок, название, что внутри */
.side-dir {
    display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 12px; width: 100%; padding: 8px;
    border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.side-dir svg { width: 30px; height: 30px; padding: 5px; border-radius: 7px; background: var(--paper); color: var(--ink-2); }
.side-dir-text { display: grid; min-width: 0; }
.side-dir-name { font-size: 14px; line-height: 1.3; }
.side-dir-sub { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.side-dir:hover { background: var(--hover); }
.side-dir:hover svg { background: #E6EBEF; }
.side-dir.is-active { background: #EAF1FA; }
.side-dir.is-active svg { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 1px #C9DAEE; }
.side-dir.is-active .side-dir-name { font-weight: 600; color: var(--accent); }

/* не нанесены на карту */
.unplaced-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.unplaced-list li { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 0; border-radius: 8px; }
.unplaced-list li:hover { background: var(--hover); }
.unplaced-open { flex: 1; min-width: 0; display: grid; padding: 4px 8px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.unplaced-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unplaced-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unplaced-open:hover .unplaced-name { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* клавиши */
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 12px 14px; align-items: baseline; margin: 8px; font-size: 13.5px; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }
.keys--mouse { grid-template-columns: 1fr; gap: 2px; }
.keys--mouse dt { font-weight: 600; font-size: 13px; }
.keys--mouse dd { margin-bottom: 10px; }
kbd {
    display: inline-block; padding: 3px 7px; font: 12px/1.2 var(--font); color: var(--ink);
    background: var(--panel); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
}

/* строка состояния */
.panel-foot { display: flex; align-items: center; gap: 9px; flex: none; padding: 10px 18px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2E9E44; flex: none; }
.panel-foot[data-state="busy"] .status-dot { background: var(--fiber); animation: optika-pulse 1s ease-in-out infinite; }
.panel-foot[data-state="warn"] .status-dot { background: var(--fiber-dark); }
.panel-foot .warn { color: var(--fiber-dark); }
@keyframes optika-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .panel-foot[data-state="busy"] .status-dot { animation: none; } .switch, .switch::before { transition: none; } }

@media (max-width: 760px) {
    .app, .app.layers-collapsed { grid-template-columns: 1fr; grid-template-areas: "top" "map"; }
    .topbar { padding-left: 8px; gap: 10px; }
    .user .user-name { display: none; }
    .rail { position: fixed; top: var(--topbar); left: 0; bottom: 0; width: var(--rail-w); }
    .layers-panel { position: fixed; top: var(--topbar); left: var(--rail-w); bottom: 0; width: min(296px, calc(100vw - var(--rail-w) - 12px)); z-index: 1008; box-shadow: 12px 0 28px rgba(23, 35, 45, .22); }
    .app.layers-collapsed .rail, .app.layers-collapsed .layers-panel { display: none; }
}

/* ================================================================ этап 10: панель объекта справа
   Тот же язык, что у левой панели: значок на плитке, контурные иконки, спокойные заголовки разделов.
   Ширина меняется перетаскиванием левого края; кроссировка — холст в клетку (колесо — масштаб, тянуть — сдвиг). */
.inspector { box-shadow: -1px 0 0 var(--line); border-left: 0; }
.inspector.is-resizing { transition: none; }
.inspector, .inspector.is-wide { max-width: calc(100vw - var(--rail-w) - 120px); }
body.is-col-resizing, body.is-col-resizing * { cursor: col-resize !important; user-select: none; }
.insp-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 9px; z-index: 5; cursor: col-resize; touch-action: none; }
.insp-resize::after { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 3px; background: transparent; transition: background .15s; }
.insp-resize:hover::after, .inspector.is-resizing .insp-resize::after { background: var(--accent); }

.insp-head { padding: 14px 16px 0 18px; border-bottom: 1px solid var(--line); }
.insp-back {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin: -4px 0 8px -6px; padding: 3px 8px 3px 4px;
    border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.insp-back svg { width: 16px; height: 16px; flex: none; }
.insp-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-back:hover { background: var(--hover); color: var(--ink); }
.insp-top { gap: 12px; align-items: flex-start; }
.insp-icon { width: 40px; height: 40px; margin: 2px 0 0; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-soft); }
.insp-icon .swatch { transform: scale(1.35); }
.insp-icon .swatch--span, .insp-icon .swatch--trunk { transform: none; }
.insp-kind { font-size: 12.5px; gap: 4px 8px; }
.insp-title { font-size: 19px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; margin: 2px 0 3px; }
.insp-sub { font-size: 13px; line-height: 1.4; }
.insp-btns { gap: 0; margin: -2px -4px 0 0; }
.insp-btn { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.insp-btn svg.i { width: 18px; height: 18px; fill: none; }

.insp-actions { gap: 6px; margin: 14px 0 2px; }
.insp-act {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px 0 9px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink);
    font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.insp-act svg { width: 17px; height: 17px; color: var(--ink-2); flex: none; }
.insp-act:hover { background: var(--hover); border-color: #C3CCD4; }
.insp-act:active { background: #E6EBEF; }
.insp-act--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.insp-act--primary svg { color: #fff; }
.insp-act--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.insp-act--danger { color: var(--danger); }
.insp-act--danger svg { color: var(--danger); }

.insp-tabs { margin: 12px -16px 0 -18px; padding: 0 10px; gap: 2px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.insp-tabs::-webkit-scrollbar { display: none; }
.insp-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 10px 10px 11px; border-bottom: 0; font-size: 14px; }
.insp-tab::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.insp-tab.is-active { font-weight: 600; }
.insp-tab.is-active::after { background: var(--ink); }
.insp-tab .count {
    margin: 0; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--paper);
    font-size: 11.5px; font-weight: 600; line-height: 19px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.insp-tab .count--zero { color: #9AA7B2; font-weight: 500; }
.insp-tab.is-active .count { background: var(--ink); color: #fff; }

.insp-body { padding: 16px 18px 24px; }
.insp-foot { padding: 10px 18px; background: #FFFBEB; border-top-color: #F3E3A6; }

/* паспорт: разделы с тонкой чертой, без заглавных букв */
.pp-section { margin: 0; padding: 16px 0 18px; border-top: 1px solid var(--line-soft); }
.pp-section:first-child { padding-top: 2px; border-top: 0; }
.pp-section > h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--ink); }
.pp-grid { gap: 10px 14px; }
.pp-field > label, .pp-field > .lbl { font-size: 12.5px; }
.inspector .input, .inspector .select { border-radius: 7px; }
.inspector .input:hover:not(:focus):not([readonly]), .inspector .select:hover:not(:focus) { border-color: #B9C3CB; }

/* списки: кабели узла, оборудование, журнал */
.inspector .list > li { gap: 12px; padding: 10px 2px; }
.inspector .list .link { color: var(--ink); font-weight: 600; text-decoration: none; }
.inspector .list .link:hover { color: var(--accent); text-decoration: underline; }
.inspector .list .btn-small { border-radius: 7px; padding: 5px 12px; }

/* кроссировка: панель инструментов, сегментный масштаб, холст в клетку */
.sch-toolbar { gap: 8px 14px; }
.sch-zoom { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); gap: 0; }
.seg-btn { min-width: 32px; padding: 0 9px; border: 0; border-right: 1px solid var(--line-soft); background: none; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; }
.seg-btn--text { font-size: 13px; border-right: 0; border-left: 1px solid var(--line-soft); }
.seg-btn:hover { background: var(--hover); }
.seg-val { min-width: 54px; display: grid; place-items: center; border-right: 1px solid var(--line-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.sch-wrap {
    height: calc(100vh - 330px); height: calc(100dvh - 330px); max-height: none; min-height: 300px;
    border-radius: 10px; cursor: grab;
    background-color: #FBFCFD;
    background-image: radial-gradient(circle, #D5DCE2 1px, transparent 1.2px);
    background-size: 18px 18px;
}
.sch-wrap.is-panning { cursor: grabbing; user-select: none; }
.sch-wrap .sch-fiber, .sch-wrap .sch-splice, .sch-wrap .sch-port { cursor: pointer; }
.sch-wrap.is-panning .sch-fiber, .sch-wrap.is-panning .sch-splice { cursor: grabbing; }
.sch-box { fill: #fff; stroke: #AEB9C3; filter: drop-shadow(0 1px 2px rgba(23, 35, 45, .08)); }

@media (max-width: 760px) {
    .insp-resize { display: none; }
    .inspector, .inspector.is-wide { max-width: none; }
    .sch-wrap { height: 50dvh; }
}
