.graph-viewport,
#view-workspace {
    position: relative;
}

.graph-viewport {
    height: calc(100vh - 64px);
    overflow: hidden;
    background: radial-gradient(circle at top left, #f8fafc 0%, #eef2ff 45%, #f1f5f9 100%);
}

.graph-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.graph-edges {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

.graph-edges line.is-highlighted {
    stroke: #0ea5e9;
    stroke-width: 2.5;
    stroke-dasharray: none;
}

.graph-world {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
}

.graph-marquee {
    position: absolute;
    border: 1px dashed rgba(14, 165, 233, 0.9);
    background: rgba(14, 165, 233, 0.1);
    pointer-events: none;
    z-index: 5;
}

.graph-node {
    position: absolute;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.graph-node.is-active {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2), 0 20px 40px rgba(14, 116, 144, 0.15);
}

.graph-node.is-selected .node-header {
    background: #0ea5e9;
}

.graph-node.is-selected {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.4), 0 22px 44px rgba(14, 116, 144, 0.18);
}

.node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #0f172a;
    color: #ffffff;
    cursor: grab;
}

.node-header:active {
    cursor: grabbing;
}

.node-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
}

.node-title {
    font-size: 13px;
    font-weight: 700;
}

.node-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-link-handle {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #38bdf8;
    border: 2px solid #0f172a;
    cursor: crosshair;
}

.node-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow: auto;
}

.node-question {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
}

.node-tip {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.node-links {
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 10px;
    color: #475569;
}

.node-links button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #0ea5e9;
    margin-right: 0;
}

.node-resize-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    cursor: nwse-resize;
    width: 16px;
    height: 16px;
    pointer-events: auto;
}

.node-resize-handle::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-top: 12px solid transparent;
    border-right: 0 solid transparent;
    border-bottom: 12px solid rgba(15, 23, 42, 0.45);
}

.link-prompt {
    position: absolute;
    min-width: 200px;
    padding: 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 30;
}

.link-prompt-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
}

.link-prompt-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: #0f172a;
    text-align: left;
}

.link-prompt-btn:hover {
    border-color: #38bdf8;
    color: #0284c7;
}

.link-prompt-row {
    display: flex;
    gap: 6px;
}

.link-prompt-select {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 11px;
}

