.orgchart-panel {
    --node-width: 170px;
    --node-height: 66px;
    --node-gap-x: 26px;
    --node-gap-y: 110px;
    --list-indent: 18px;
    position: relative;
    margin-top: 18px;
    min-height: 720px;
    width: 100%;
    border-radius: 18px;
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(12, 10, 8, 0.85), rgba(12, 10, 8, 0.85)),
        var(--orgchart-bg, url('https://images.unsplash.com/photo-1482192596544-9eb780fc7f66?auto=format&fit=crop&w=1600&q=80')) center/cover no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.echart-panel--legacy {
    display: none;
}

.orgchart-surface {
    position: relative;
    min-height: 100%;
}

.orgchart-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.orgchart-nodes {
    position: absolute;
    inset: 0;
}

.orgchart-node {
    position: absolute;
    width: var(--node-width);
    height: var(--node-height);
    transform: translate(-50%, -50%);
    background:
        linear-gradient(180deg, rgba(12, 10, 8, 0.72), rgba(12, 10, 8, 0.92)),
        var(--node-image, none) center/cover no-repeat;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: left;
    color: var(--text-primary);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.orgchart-node:hover,
.orgchart-node:focus {
    transform: translate(-50%, -50%) scale(1.02);
    border-color: var(--theme-accent);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.55);
    outline: none;
}

.orgchart-title {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orgchart-meta {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orgchart-capacity {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orgchart-list {
    display: none;
    padding: 24px;
    gap: 12px;
    flex-direction: column;
}

.orgchart-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(12, 10, 8, 0.7), rgba(12, 10, 8, 0.9)),
        var(--node-image, none) center/cover no-repeat;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    margin-left: calc(var(--depth) * var(--list-indent));
}

.orgchart-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(230, 220, 203, 0.15);
    opacity: 0.6;
}

.orgchart-item:hover,
.orgchart-item:focus {
    border-color: var(--theme-accent);
    outline: none;
}

.orgchart-panel[data-layout="list"] {
    min-height: auto;
}

.orgchart-panel[data-layout="list"] .orgchart-surface {
    display: none;
}

.orgchart-panel[data-layout="list"] .orgchart-list {
    display: flex;
}

@media (max-width: 900px) {
    .orgchart-panel {
        min-height: auto;
    }
}
