/* ── SVG-дерево задач ─────────────────────────────────────────────────────── */

.task-tree-panel {
    display: flex;
    flex-direction: column;
    min-height: 560px;
}

/* Встроенная панель инструментов в хедере */
.tt-toolbar-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    margin-right: 12px;
}

/* Легенда */
.tt-legend {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 4px 10px;
    font-size: 12px;
    color: #555;
}
body.dark-theme .tt-legend { color: #aaa; }

.tt-leg-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-leg-dot {
    display: inline-block;
    width: 20px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.tt-leg-line-dash {
    display: inline-block;
    width: 28px;
    height: 0;
    border-top: 2px dashed #00c2f1;
}

/* Обёртка SVG */
.tt-svg-wrap {
    flex: 1 1 0;
    /* Явная высота — SVG height:100% работает только если у родителя есть computed height */
    height: calc(100vh - 260px);
    min-height: 400px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #f4f6f8;
    cursor: grab;
}
body.dark-theme .tt-svg-wrap {
    background: #1a1e24;
    border-color: #383e47;
}
.tt-svg-wrap:active { cursor: grabbing; }

/* SVG заполняет обёртку через абсолютное позиционирование */
#ttSvg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Узел дерева — hover */
.tt-node rect {
    transition: filter 0.15s;
}
.tt-node:hover rect {
    filter: brightness(1.12) drop-shadow(0 3px 8px rgba(0,0,0,0.25));
}
.tt-node.tt-selected rect {
    filter: brightness(1.05) drop-shadow(0 0 0 2.5px rgba(0,194,241,0.8));
}

/* Полноэкранный режим */
.task-tree-panel:fullscreen {
    border-radius: 0;
    margin: 0;
    padding: 24px;
    height: 100vh;
    box-sizing: border-box;
    background: white;
}
body.dark-theme .task-tree-panel:fullscreen {
    background: var(--light-color);
}
.task-tree-panel:fullscreen .tt-svg-wrap {
    height: calc(100vh - 160px);
    min-height: 0;
}
