body.global-graph-body {
    background: #0a0a0a;
    color: #f0eee9;
}

.global-graph {
    --header-height: 60px;
    position: relative;
    display: flex;
    width: 100%;
    height: calc(100dvh - var(--header-height));
    min-height: 0;
    overflow: hidden;
    background: #080808;
}

.global-graph__sidebar {
    position: relative;
    flex: 0 0 280px;
    width: 280px;
    min-height: 0;
    background: rgba(0, 0, 0, 0.85);
    border-right: 1px solid #2a2722;
    padding: 24px 20px;
    overflow-y: auto;
    font-size: 14px;
    z-index: 2;
}

.global-graph__sidebar h1 {
    font-size: 18px;
    margin: 0 0 12px;
    color: #e7e1d3;
}

.global-graph__sidebar .global-graph__hint {
    font-size: 12px;
    color: #807a6e;
    line-height: 1.5;
}

.global-graph__legend {
    margin-top: 20px;
}

.global-graph__legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.global-graph__legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.global-graph__filter {
    margin-top: 20px;
}

.global-graph__filter label {
    display: block;
    padding: 4px 0;
    cursor: pointer;
}

.global-graph__search {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2a2722;
    color: #e7e1d3;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 4px;
    margin-top: 12px;
}

.global-graph__search:focus {
    outline: 1px solid #d91515;
}

.global-graph__toggle {
    display: flex;
    gap: 0;
    margin-top: 16px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #2a2722;
}

.global-graph__toggle button {
    flex: 1;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: #807a6e;
    font-size: 12px;
    cursor: pointer;
    transition: 0.15s;
}

.global-graph__toggle button.active {
    background: #d91515;
    color: #fff;
}

.global-graph__toggle button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: #e7e1d3;
}

.global-graph__area {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    z-index: 1;
}

.global-graph__canvas {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.global-graph__canvas canvas,
.global-graph__canvas > .view-2d,
.global-graph__canvas > .view-3d {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.global-graph__canvas canvas {
    z-index: 1;
}

.global-graph__canvas .view-2d {
    display: block;
}

.global-graph__canvas .view-3d {
    display: none;
}

.global-graph__canvas.mode-2d .view-2d {
    display: block;
}

.global-graph__canvas.mode-2d .view-3d {
    display: none;
}

.global-graph__canvas.mode-3d .view-2d {
    display: none;
}

.global-graph__canvas.mode-3d .view-3d {
    display: block;
}

.global-graph__canvas.mode-3d .view-3d > canvas,
.global-graph__canvas.mode-3d .view-3d > div {
    max-width: 100%;
    max-height: 100%;
}

.global-graph__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6a665d;
    flex-direction: column;
    gap: 12px;
    padding: 40px;
    text-align: center;
}

.global-graph__empty h2 {
    font-size: 18px;
    margin: 0;
    color: #d4cfc1;
}

.global-graph__empty p {
    max-width: 400px;
    line-height: 1.5;
    font-size: 13px;
}

.graph-info-panel {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.92);
    border: 1px solid #3a3630;
    border-radius: 8px;
    padding: 20px 24px;
    min-width: 340px;
    max-width: 440px;
    display: none;
    z-index: 20;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.graph-info-panel.visible {
    display: block;
}

.graph-info-panel__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #807a6e;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.graph-info-panel__close:hover {
    color: #e7e1d3;
}

.graph-info-panel__name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #e7e1d3;
    padding-right: 24px;
}

.graph-info-panel__meta {
    font-size: 12px;
    color: #807a6e;
    margin-bottom: 10px;
}

.graph-info-panel__desc {
    font-size: 13px;
    color: #b0aaa0;
    line-height: 1.5;
    margin-bottom: 14px;
}

.graph-info-panel__neighbors {
    font-size: 12px;
    color: #807a6e;
    margin-bottom: 6px;
}

.graph-info-panel__neighbor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.graph-info-panel__neighbor-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    color: #c0b8a8;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: 0.15s;
}

.graph-info-panel__neighbor-tag:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.graph-info-panel__actions {
    display: flex;
    gap: 8px;
}

.graph-info-panel__btn {
    flex: 1;
    padding: 8px 0;
    text-align: center;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.15s;
}

.graph-info-panel__btn--primary {
    background: #d91515;
    color: #fff;
    border: none;
}

.graph-info-panel__btn--primary:hover {
    background: #e63030;
}

.graph-info-panel__btn--ghost {
    background: transparent;
    color: #a09888;
    border: 1px solid #3a3630;
}

.graph-info-panel__btn--ghost:hover {
    border-color: #807a6e;
    color: #e7e1d3;
}

.view-3d-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #807a6e;
    font-size: 13px;
    pointer-events: none;
    z-index: 5;
}

@media (max-width: 760px) {
    .global-graph {
        height: calc(100dvh - var(--header-height));
        flex-direction: column;
        overflow: hidden;
    }

    .global-graph__sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid #2a2722;
    }

    .global-graph__area {
        flex: 1 1 auto;
        min-height: 0;
    }
}
