/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000080;      /* оригинальный синий из инфо-боксов */
    --secondary-color: #f5f5f5;
    --border-color: #848484;       /* серый из оригинала */
    --text-color: #333;
    --hover-color: #e8f4f8;
    --selected-color: #3399ff;     /* оригинальный цвет выделения */
    --header-height: 50px;
    --toolbar-height: 44px;
    --status-height: 25px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: var(--text-color);
    background: #fff;
}

/* ==================== Header ==================== */
.app-header {
    height: var(--header-height);
    background: linear-gradient(to bottom, #2c3e50, #1a252f);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-left .version {
    font-size: 12px;
    opacity: 0.85;
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 3px;
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 17px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ==================== Main Container ==================== */
.main-container {
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* ==================== Navigation Panel ==================== */
.nav-panel {
    width: 320px;
    min-width: 200px;
    max-width: 600px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none;
    transition: width 0.25s ease, min-width 0.25s ease;
}

.nav-header {
    padding: 12px 15px;
    background: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.nav-header h2 {
    font-size: 15px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}

.nav-header .icon-btn {
    background: #fff;
    color: #333;
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.nav-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 8px 2px;
}

/* ==================== Ручка изменения ширины ==================== */
.nav-resizer {
    width: 5px;
    cursor: col-resize;
    background: var(--border-color);
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s;
    z-index: 50;
}

.nav-resizer:hover,
.nav-resizer.active {
    background: var(--primary-color);
}

.nav-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    right: -3px;
    /* Расширяем зону захвата, чтобы было удобнее ловить мышью */
}

/* При свёрнутой панели — скрываем ручку */
.nav-panel.collapsed + .nav-resizer {
    display: none;
}

/* ==================== Tree View ==================== */
.tree-item {
    user-select: none;
    white-space: nowrap;
}

.tree-label {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.12s;
    font-size: 14px;
}

.tree-label:hover {
    background: var(--hover-color);
}

.tree-label.selected {
    background: var(--selected-color);
    color: #ffffff;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
    flex-shrink: 0;
    cursor: pointer;
}

.tree-label.selected .tree-toggle {
    color: #fff;
}

.tree-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.tree-icon.folder {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8a33d'%3E%3Cpath d='M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E");
}

.tree-icon.folder-open {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0b429'%3E%3Cpath d='M19 20H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h6l2 2h7c1.1 0 2 .9 2 2H4v10l2.14-8h17.07l-2.28 8.5c-.23.87-1.01 1.5-1.93 1.5z'/%3E%3C/svg%3E");
}

.tree-icon.sheet {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234caf50'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

.tree-text {
    font-size: 14px;
    line-height: 1.4;
}

.tree-children {
    margin-left: 22px;
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* ==================== Viewer Panel ==================== */
.viewer-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e8e8e8;
    position: relative;
    min-width: 0;
}

.viewer-toolbar {
    height: var(--toolbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 4px;
    flex-shrink: 0;
}

.tool-btn {
    background: white;
    border: 1px solid var(--border-color);
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.tool-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.zoom-level {
    font-size: 12px;
    padding: 0 8px;
    color: #555;
    min-width: 48px;
    text-align: center;
}

.separator {
    width: 1px;
    height: 26px;
    background: #ccc;
    margin: 0 6px;
    flex-shrink: 0;
}

/* ==================== SVG Container ==================== */
.svg-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: white;
    cursor: grab;
}

.svg-container.panning {
    cursor: grabbing;
}

.svg-viewer {
    width: 100%;
    height: 100%;
    display: block;
}

.svg-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 18px;
}

.svg-placeholder p {
    padding: 20px 40px;
    border: 2px dashed #ccc;
    border-radius: 8px;
}

/* ==================== Overview Panel ==================== */
.overview-panel {
    position: absolute;
    right: 15px;
    bottom: 40px;
    width: 160px;
    height: 120px;
    background: white;
    border: 2px solid #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    z-index: 50;
    overflow: hidden;
}

.svg-overview {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

.overview-rect {
    position: absolute;
    border: 2px solid red;
    background: rgba(255, 0, 0, 0.08);
    pointer-events: none;
    display: none;
}

/* ==================== Status Bar ==================== */
.status-bar {
    height: var(--status-height);
    background: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    color: #555;
    flex-shrink: 0;
}

.status-bar .status-error { color: #c0392b; font-weight: bold; }
.status-bar .status-success { color: #27ae60; }
.status-bar .status-warning { color: #e67e22; }
.status-bar .status-info { color: #555; }

/* ==================== Info Box ==================== */
.info-box {
    position: fixed; 
    top: 90px;
    left: 340px;
    width: 360px;
    max-width: 90vw;
    background: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    z-index: 1000;
    border-radius: 2px;
    overflow: hidden;
}

/* ==================== Info Box ==================== */
.info-box-header {
    background: var(--primary-color);
    color: white;
    padding: 7px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.info-box-title {
    font-weight: bold;
    font-size: 13px;
    font-family: Verdana, Arial, sans-serif;
    flex: 1;               /* ← ДОБАВЛЕНО: заголовок занимает всё свободное место */
    margin-right: 8px;     /* ← ДОБАВЛЕНО: отступ до кнопок */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-box-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.info-box-close:hover {
    color: #ff8080;
}

.info-box-content {
    padding: 12px;
    max-height: 420px;
    overflow-y: auto;
}

/* Таблица атрибутов (как в оригинале: .attrName / .attrVal) */
.attr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.attr-table th {
    text-align: left;
    padding: 5px 8px;
    border-bottom: 2px solid var(--primary-color);
    font-size: 12px;
}

.attr-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.attr-name {
    font-weight: bold;
    color: #444;
    width: 45%;
}

.attr-val {
    color: #111;
    word-break: break-word;
}

.attr-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 8px;
    display: inline-block;
}

.attr-link:hover {
    color: #0055cc;
}

/* ==================== Search Dialog ==================== */
.search-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-width: 92vw;
    background: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    z-index: 1100;
    border-radius: 2px;
    overflow: hidden;
}

.search-header {
    background: var(--primary-color);
    color: white;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-header h3 {
    font-size: 15px;
    font-family: Tahoma, Arial, sans-serif;
}

.search-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.search-content {
    padding: 16px;
}

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-content input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--primary-color);
    border-radius: 3px;
    font-size: 14px;
    outline: none;
}

.search-content input:focus {
    box-shadow: 0 0 0 2px rgba(0, 0, 128, 0.2);
}

.search-content button {
    padding: 8px 22px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-family: Tahoma, Arial, sans-serif;
}

.search-content button:hover {
    background: #0000a8;
}

.search-results {
    max-height: 320px;
    overflow-y: auto;
    border-top: 1px solid #ddd;
}

.search-result-item {
    padding: 9px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.12s;
}

.search-result-item:hover {
    background: var(--hover-color);
}

.search-result-id {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 13px;
}

.search-result-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.search-empty {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* ==================== Overlay для модальных окон ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1050;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 5px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* ==================== Loading ==================== */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border: 4px solid rgba(0, 0, 128, 0.15);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.9s linear infinite;
    z-index: 200;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==================== Печать ==================== */
@media print {
    .app-header,
    .nav-panel,
    .viewer-toolbar,
    .overview-panel,
    .status-bar,
    .info-box,
    .search-dialog {
        display: none !important;
    }

    .main-container {
        height: auto;
    }

    .svg-container {
        overflow: visible;
    }
}

/* ==================== Запрет выделения текста ==================== */
.svg-container,
.svg-container *,
.overview-panel,
.overview-panel * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* Курсор-«рука» не должен меняться на текстовый (I-beam) над подписями */
.svg-container text,
.svg-container tspan {
    cursor: inherit;
}

/* ==================== Интерактивность проводов ==================== */

/* Базовый hover — при наведении */
svg path.net.wire-hover {
    stroke: #ff4444 !important;
    stroke-width: 1.5 !important;
    cursor: pointer;
}

/* Выделение кликом — «залипает» */
svg path.net.wire-selected {
    stroke: #ff0000 !important;
    stroke-width: 1.5 !important;
    filter: drop-shadow(0 0 2px rgba(255,0,0,0.6));
    cursor: pointer;
}

/* Подсветка подписей выделенного провода */
svg g.wire-group-selected text {
    fill: #c00000 !important;
    font-weight: bold;
}

/* Курсор над любым проводом */
svg path.net {
    cursor: pointer;
}

/* Инфо-окно атрибутов: стили таблицы */
.attr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.attr-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid var(--primary-color);
    font-weight: bold;
    background: #f5f5f5;
    font-size: 12px;
}

.attr-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.attr-table td.attr-name {
    font-weight: 600;
    color: #444;
    width: 45%;
    font-family: Tahoma, Arial, sans-serif;
}

.attr-table td.attr-val {
    color: #111;
    word-break: break-word;
    font-family: Consolas, Monaco, monospace;
}

/* ==================== Подсветка splice points (соединений проводов) ==================== */

svg .splice-highlighted {
    stroke: #ff0000 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 3px rgba(255,0,0,0.8));
}

/* ==================== Анимация мигающего провода ==================== */

svg .wire-animated {
    stroke: #ff0000 !important;
    filter: drop-shadow(0 0 3px rgba(255,0,0,0.9));
    cursor: pointer;
}

/* Курсор над портами (переход на другую схему) */
svg .port {
    cursor: pointer;
}

svg .port:hover {
    fill: #ffcc00 !important;
    stroke: #ff6600 !important;
    stroke-width: 1.5 !important;
}

/* ==================== Компоненты и разъёмы ==================== */

/* Курсоры */
svg .comp, svg .conn, svg .inFrame { cursor: pointer; }

/* Hover: тёмно-красный для блоков (компонентов) */
svg .comp-hover {
    stroke: #a00000 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 2px rgba(160,0,0,0.6));
}

/* Hover: тёплый оранжевый для контактов/разъёмов */
svg .conn-hover {
    stroke: #d96400 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 2px rgba(217,100,0,0.6));
}

.infolinks { margin-top: 8px; border-top: 1px solid #ddd; padding-top: 6px; }
.infolinks-header { font-weight: bold; font-size: 12px; margin: 6px 0 2px; color: #444; }
.infolinks .attr-link { display: block; margin: 3px 0; cursor: pointer; color: #0066cc; }
.infolinks .attr-link:hover { color: #0033aa; text-decoration: underline; }

/* ==================== Модальное окно графики (единый стиль с info-box) ==================== */
.graphic-modal-window {
    position: fixed;
    z-index: 1200;
    background: white;
    border: 2px solid var(--primary-color);
    width: 560px;
    max-width: 92vw;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    border-radius: 2px;
    overflow: hidden;
}

.graphic-modal-header {
    background: var(--primary-color);
    color: white;
    padding: 7px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.graphic-modal-title {
    font-weight: bold;
    font-size: 13px;
    font-family: Verdana, Arial, sans-serif;
    flex: 1;               /* ← ДОБАВЛЕНО: заголовок занимает всё свободное место */
    margin-right: 8px;     /* ← ДОБАВЛЕНО: отступ до кнопок */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graphic-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.graphic-modal-close:hover {
    color: #ff8080;
}

.graphic-modal-content {
    padding: 12px;
    background: #fff;
    max-height: 70vh;
    overflow: auto;
}
.graphic-modal-content svg {
    max-width: 100%;
    height: auto;
}

/* ==================== Адаптация под мобильные устройства ==================== */
@media (max-width: 768px), (pointer: coarse) {
    /* Прячем разделитель */
    .nav-resizer {
        display: none !important;
    }
    
    /* Хедер выше панели, чтобы кнопка ☰ была доступна */
    .app-header {
        z-index: 200;
        position: relative;
    }
    
    /* Панель навигации на мобильных */
    .nav-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 90vw !important;
        max-width: 90vw !important;
        height: 100vh;
        z-index: 150;
        box-shadow: 4px 0 20px rgba(0,0,0,0.4);
        transition: transform 0.3s ease;
        transform: translateX(0);
    }
    
    /* Скрытое состояние — уезжает за левый край */
    .nav-panel.collapsed {
        transform: translateX(-100%) !important;
        width: 90vw !important;
        max-width: 90vw !important;
    }
    
    /* ==================== Overlay для навигации (мобильный) ==================== */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 140;
        opacity: 0;
        pointer-events: none; /* КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ: по умолчанию НЕ блокирует клики */
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto; /* Блокирует клики по схеме только когда это действительно нужно */
    }
    
    .nav-overlay.hidden {
        opacity: 0;
        pointer-events: none;
    }
    
    
    .nav-header {
        position: relative;
    }
    
    /* Тулбар */
    .viewer-toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 6px;
        gap: 4px;
    }
    
    .tool-btn {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .separator {
        display: none;
    }
    
    /* Модальные окна */
    .info-box, .search-dialog, .graphic-modal-window {
        position: fixed !important;
        width: 95vw !important;
        max-width: 95vw !important;
        left: 2.5vw !important;
        top: 60px !important;
        max-height: 85vh;
    }
    
    .info-box-content, .graphic-modal-content {
        max-height: 70vh;
    }
    
    /* Миниатюра */
    .overview-panel {
        width: 100px;
        height: 75px;
        right: 8px;
        bottom: 30px;
    }
    
    /* Прячем версию и подпись на мобильных */
    .header-left h4, 
    .header-left .version {
        display: none;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
}

/* Кнопка копирования ссылки в инфо-боксе */
.copy-element-link-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0f4f8;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.copy-element-link-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Кнопка копирования в заголовке модального окна графики */
.graphic-modal-copy {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    transition: background 0.2s;
}

.graphic-modal-copy:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Компактная кнопка ссылки в шапке модальных окон */
.header-link-btn {
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px; /* Отступ от крестика закрытия */
    transition: background 0.2s;
    flex-shrink: 0;
}

.header-link-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Жёсткое, заметное выделение целевого элемента из ссылки */
.target-highlighted {
    stroke: #ff00ff !important; /* Яркая маджента, контрастирует с любыми проводами */
    stroke-width: 2 !important;
    animation: target-pulse 1.2s infinite alternate;
}

.target-highlighted-fill {
    fill: #ff00ff !important;
    animation: target-pulse-fill 1.2s infinite alternate;
}

@keyframes target-pulse {
    from { stroke-width: 3; filter: drop-shadow(0 0 4px rgba(255, 0, 255, 0.1)); }
    to { stroke-width: 5; filter: drop-shadow(0 0 4px rgba(255, 0, 255, 1)); }
}

@keyframes target-pulse-fill {
    from { filter: drop-shadow(0 0 4px rgba(255, 0, 255, 0.1)); }
    to { filter: drop-shadow(0 0 4px rgba(255, 0, 255, 1)); }
}

.svg-container {
    /* ... существующие стили ... */
    touch-action: none;          /* ← КЛЮЧЕВОЕ: отключаем системные жесты */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overscroll-behavior: none;   /* ← Чтобы свайп не "выдёргивал" страницу */
}

/* Выбранный компонент (блок) — яркая красная обводка со свечением */
svg .comp-selected {
    stroke: #ff0000 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.85)) !important;
    cursor: pointer;
}

/* Выбранный разъём / контакт — яркая оранжевая обводка со свечением */
svg .conn-selected {
    stroke: #ff6600 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 3px rgba(255, 102, 0, 0.85)) !important;
    cursor: pointer;
}

/* Для inliner используем стиль разъёма */
svg .inFrame.conn-selected {
    stroke: #ff6600 !important;
    stroke-width: 2 !important;
    filter: drop-shadow(0 0 3px rgba(255, 102, 0, 0.85)) !important;
}
