/* =====================================================
   CLAUX - CONTRACT MAP (GRAPH VIEW)
   ===================================================== */

.graph-shell {
    display: flex;
    gap: 16px;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.graph-canvas-wrap {
    flex: 1;
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-width: 0;
}

#contractGraphCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#contractGraphCanvas:active {
    cursor: grabbing;
}

/* ── Legend overlay ───────────────────────────────── */
.graph-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(20,20,20,0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(8px);
}

.graph-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7375rem;
    color: var(--text-secondary);
}

.graph-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.graph-legend-line {
    width: 20px;
    height: 2px;
    flex-shrink: 0;
    border-radius: 2px;
}

.graph-legend-line--dashed {
    background: transparent !important;
    border-top: 2px dashed;
    height: 0;
}

/* ── Sidebar panel ────────────────────────────────── */
.graph-sidebar-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.graph-sidebar-header {
    padding: 14px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

#graphSidebar {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.graph-sidebar-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
}

.graph-sidebar-hint i {
    font-size: 2rem;
    opacity: 0.35;
}

.graph-sidebar-hint p {
    font-size: 0.8125rem;
    margin: 0;
    line-height: 1.5;
}

.graph-sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.graph-sidebar-status {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.graph-sidebar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.graph-sidebar-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.graph-sidebar-row span:first-child {
    color: var(--text-muted);
    flex-shrink: 0;
}

.graph-sidebar-row span:last-child {
    color: var(--text-primary);
    text-align: right;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-sidebar-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding-top: 4px;
}

.graph-sidebar-connection {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7875rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

.graph-sidebar-connection i {
    color: var(--text-muted);
    flex-shrink: 0;
}

.graph-sidebar-edge-type {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.graph-info {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(20,20,20,0.75);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    backdrop-filter: blur(8px);
}
