/* V2 unified editor: window layout, project + docs sidebar, tabs, Monaco host, error line, special links, call graph. */

/* UNIFIED EDITOR LAYOUT */

/* Override window content defaults for unified editor */
.sl-window-content:has(.v2-unified-editor) {
    padding: var(--content-padding, 0px);
    overflow: hidden;
}

/* Override window content defaults for unified browser */
.sl-window-content:has(.v2-unified-browser) {
    padding: var(--content-padding, 0px);
    overflow: hidden;
}

.v2-unified-browser {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg-panel, #161b22);
}

/* Browser sidebar reuses project-sidebar styles */
.v2-browser-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--bg-secondary, #161b22);
    border-right: 1px solid var(--border, rgba(255,255,255,0.1));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease;
    user-select: none;
}

.v2-browser-sidebar.collapsed {
    width: 32px;
    min-width: 32px;
}

.v2-browser-sidebar.collapsed .v2-sidebar-title,
.v2-browser-sidebar.collapsed .v2-sidebar-section,
.v2-browser-sidebar.collapsed .v2-sidebar-content {
    display: none;
}

.v2-browser-sidebar.collapsed .v2-sidebar-console-toggle span:not(.v2-browser-chat-arrow) {
    display: none;
}

.v2-browser-sidebar.collapsed .v2-sidebar-console-toggle {
    padding: 5px 0;
    justify-content: center;
}

/* Override window content defaults for preview panel */
.sl-window-content:has(.v2-preview) {
    padding: var(--content-padding, 0px);
    overflow: hidden;
}

/* Ensure preview container doesn't scroll - only uniforms section scrolls */
.v2-preview {
    overflow: hidden;
}

/* Embedded uniforms section - constrain width */
.v2-uniforms-section-embedded {
    max-width: 100%;
    overflow: hidden;
}

/* Color row should wrap and not expand parent */
.v2-uniforms-color-row {
    max-width: 100%;
}

/* Compact color uniform in embedded mode */
.v2-uniforms-section-embedded .sl-color-uniform {
    flex-shrink: 1;
    min-width: 0;
}

.v2-unified-editor {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg-panel, #161b22);
}

.v2-unified-main,
.v2-unified-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.v2-tab-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.v2-tab-area .sl-tabpane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.v2-tab-area .sl-tabpane-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.v2-tab-area .sl-tabpane-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.v2-no-tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #6e7681);
    font-size: 14px;
    gap: 12px;
}

/* PROJECT SIDEBAR */

.v2-project-sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--bg-secondary, #161b22);
    border-right: 1px solid var(--border, rgba(255,255,255,0.1));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease;
    user-select: none;
}

.v2-project-sidebar.collapsed {
    width: 32px;
    min-width: 32px;
}

.v2-project-sidebar.collapsed .v2-sidebar-title,
.v2-project-sidebar.collapsed .v2-sidebar-section,
.v2-project-sidebar.collapsed .v2-sidebar-content {
    display: none;
}

.v2-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    min-height: 36px;
    box-sizing: border-box;
    background: var(--bg-tertiary, #21262d);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    flex-shrink: 0;
    user-select: none;
}

.v2-sidebar-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #8b949e);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.v2-new-shader-btn {
    background: var(--accent, #58a6ff);
    color: var(--bg-primary, #0d1117);
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.v2-new-shader-btn:hover {
    filter: brightness(1.15);
}

.v2-shader-type-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    box-sizing: border-box;
    padding: 4px 12px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted, #8b949e);
    background: var(--bg-tertiary, #21262d);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.v2-project-sidebar.collapsed .v2-new-shader-btn,
.v2-project-sidebar.collapsed .v2-shader-type-badge {
    display: none;
}

.v2-dropdown-hint {
    font-size: 9px;
    color: var(--text-muted, #6e7681);
    margin-left: 8px;
    font-style: italic;
}

.v2-sidebar-collapse {
    background: none;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 10px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.v2-sidebar-collapse:hover {
    background: var(--bg-hover, rgba(255,255,255,0.1));
    color: var(--text-primary, #c9d1d9);
}

.v2-sidebar-sections {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Project sidebar scroll area (also reused by the browser sidebar) */
.v2-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Shader-info "needs attention" badge in the sidebar link */
.v2-info-warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
}

.v2-info-warn.is-error {
    background: var(--console-error);
}

.v2-info-warn.is-warning {
    background: var(--console-warn);
}

/* Empty "no tabs" icon (editor + browser placeholders) */
.v2-no-tabs-icon {
    font-size: 48px;
    opacity: 0.3;
}

/* SIDEBAR SECTIONS */

.v2-sidebar-section {
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
}

.v2-sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary, #161b22);
    cursor: pointer;
    user-select: none;
}

.v2-sidebar-section-header:hover {
    background: var(--bg-tertiary, #21262d);
}

.v2-section-expand {
    background: none;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    text-align: center;
}

.v2-section-icon {
    width: 16px;
    text-align: center;
    margin-right: 4px;
}

.v2-section-title {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #8b949e);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v2-sidebar-items {
    padding: 4px 0;
}

/* ADD BUTTON & DROPDOWN */

.v2-add-button-container {
    position: relative;
    margin-left: auto;
}

.v2-add-button {
    background: none;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.v2-add-button:hover {
    background: var(--accent, #58a6ff);
    color: white;
}

.v2-add-dropdown {
    position: fixed;
    background: var(--bg-secondary, #161b22);
    border: 1px solid var(--border, rgba(255,255,255,0.15));
    border-radius: 6px;
    padding: 4px 0;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    user-select: none;
}

.v2-add-dropdown.visible {
    display: block;
}

.v2-add-dropdown .v2-dropdown-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.v2-add-dropdown .v2-dropdown-item:hover:not(:disabled) {
    background: var(--bg-tertiary, #21262d);
}

.v2-add-dropdown .v2-dropdown-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.v2-dropdown-icon {
    font-size: 14px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.v2-dropdown-icon img {
    display: block;
}

/* SVG code-type icons — uniform height, auto width, thin dark glow for light bg */
.v2-svg-icon {
    height: 22px;
    width: auto;
    vertical-align: middle;
    filter: drop-shadow(0 0 0.5px rgba(0,0,0,0.5)) drop-shadow(0 0 1px rgba(0,0,0,0.25));
}

.v2-dropdown-label {
    font-size: 12px;
    color: var(--text-primary, #c9d1d9);
}

/* SIDEBAR ITEMS */

.v2-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 24px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.v2-sidebar-item:hover {
    background: var(--bg-tertiary, #21262d);
}

.v2-sidebar-item.has-tab {
    background: rgba(88, 166, 255, 0.05);
}

.v2-sidebar-item.has-tab::before {
    content: '●';
    position: absolute;
    left: 8px;
    font-size: 6px;
    color: var(--accent, #58a6ff);
}

.v2-sidebar-item.active {
    background: rgba(88, 166, 255, 0.15);
    border-left: 2px solid var(--accent, #58a6ff);
    padding-left: 22px;
}

.v2-item-icon {
    font-size: 14px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.v2-item-icon img {
    display: block;
}

.v2-item-label {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary, #c9d1d9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-item-channel {
    font-size: 9px;
    color: var(--text-muted, #6e7681);
    font-family: var(--font-code, 'JetBrains Mono', monospace);
    background: var(--bg-tertiary, #21262d);
    padding: 2px 4px;
    border-radius: 3px;
}

.v2-item-lock {
    font-size: 10px;
    opacity: 0.5;
}

/* DOCS SIDEBAR (Browser Panel) */

.v2-docs-guide-header {
    position: relative;
}

.v2-docs-guide-header .v2-item-label {
    font-weight: 600;
    color: var(--text-secondary, #8b949e);
}

.v2-docs-guide-header.active .v2-item-label {
    color: var(--text-primary, #c9d1d9);
}

.v2-docs-section-item {
    position: relative;
}

.v2-docs-section-item .v2-item-label {
    color: var(--text-secondary, #8b949e);
}

.v2-docs-section-item:hover .v2-item-label {
    color: var(--text-primary, #c9d1d9);
}

.v2-docs-section-item.active {
    background: rgba(88, 166, 255, 0.12);
    border-left: 2px solid var(--accent, #58a6ff);
}

.v2-docs-section-item.active .v2-item-label {
    color: var(--text-primary, #c9d1d9);
}

/* CONTEXT MENU */

.v2-context-menu {
    position: fixed;
    background: var(--bg-secondary, #161b22);
    border: 1px solid var(--border, rgba(255,255,255,0.15));
    border-radius: 6px;
    padding: 4px 0;
    min-width: 120px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 10000;
}

.v2-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    font-size: 12px;
    color: var(--text-primary, #c9d1d9);
    cursor: pointer;
    transition: background 0.15s;
}

.v2-context-menu button:hover {
    background: var(--bg-tertiary, #21262d);
}

.v2-context-menu button.danger {
    color: var(--console-error, #f85149);
}

.v2-context-menu button.danger:hover {
    background: rgba(248, 81, 73, 0.1);
}

/* UNIFIED TAB AREA (uses SLUI TabPane) */

.v2-unified-tab-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.v2-unified-tab-area .sl-tabpane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.v2-unified-tab-area .sl-tabpane-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.v2-no-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #6e7681);
    font-size: 14px;
}

/* CODE CONTENT (MONACO) */

.v2-code-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.v2-editor-host {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.v2-editor-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-tertiary, #21262d);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    flex-shrink: 0;
    user-select: none;
}

.v2-auto-compile {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted, #8b949e);
    cursor: pointer;
}

.v2-compile-status {
    font-size: 11px;
    color: var(--text-muted, #8b949e);
}

.v2-compile-status.is-ok {
    color: var(--console-success);
}

.v2-compile-status.is-error {
    color: var(--console-error);
}

/* Flexible spacer used in editor controls / status bar */
.v2-editor-spacer {
    flex: 1;
}

/* Save button dimmed when there are no unsaved changes */
.v2-save-clean {
    opacity: 0.5;
}

.v2-editor-wrapper {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

/* Mobile toolbar buttons: keyboard toggle, undo, redo — hidden on desktop */
.v2-mobile-kb-btn,
.v2-mobile-undo-btn,
.v2-mobile-redo-btn {
    display: none !important;
}

.sl-app[data-mode="mobile"] .v2-mobile-kb-btn,
.sl-app[data-mode="mobile"] .v2-mobile-undo-btn,
.sl-app[data-mode="mobile"] .v2-mobile-redo-btn {
    display: flex !important;
}

.v2-mobile-kb-btn.active {
    color: var(--accent);
    background: var(--bg-secondary);
}

/* Hide desktop-only controls on mobile */
.sl-app[data-mode="mobile"] .v2-desktop-only {
    display: none !important;
}

.v2-editor-statusbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    height: 24px;
    box-sizing: border-box;
    background: var(--bg-tertiary, #21262d);
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    font-size: 11px;
    color: var(--text-muted, #8b949e);
    font-family: var(--font-code, 'JetBrains Mono', monospace);
    flex-shrink: 0;
    user-select: none;
}

.v2-line-info {
    min-width: 100px;
}

.v2-font-size-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.v2-font-small {
    font-size: 9px;
    opacity: 0.7;
}

.v2-font-large {
    font-size: 13px;
    opacity: 0.7;
}

.v2-font-size-control input[type="range"] {
    width: 75px;
    height: 4px;
    cursor: pointer;
    accent-color: var(--accent, #58a6ff);
}

.v2-char-count-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.v2-char-toggle {
    width: 12px;
    height: 12px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent, #58a6ff);
}

.v2-separator {
    color: var(--border, rgba(255,255,255,0.1));
    margin: 0 4px;
}

/* Keybinding mode dropdown on status bar */
.v2-keybinding-select {
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.15));
    border-radius: 3px;
    color: var(--text-muted, #8b949e);
    font-size: 10px;
    font-family: var(--font-code, 'JetBrains Mono', monospace);
    padding: 1px 4px;
    cursor: pointer;
    outline: none;
    height: 18px;
    line-height: 16px;
}

.v2-keybinding-select:hover {
    color: var(--text-primary, #e6edf3);
    border-color: var(--accent, #58a6ff);
}

.v2-keybinding-select:focus {
    border-color: var(--accent, #58a6ff);
}

.v2-keybinding-select option {
    background: var(--bg-secondary, #161b22);
    color: var(--text-primary, #e6edf3);
}

/* Vim/Emacs command status bar — between editor and bottom bar */
.v2-keybinding-statusbar {
    height: 22px;
    padding: 0 10px;
    background: var(--bg-primary, #0d1117);
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    font-size: 12px;
    font-family: var(--font-code, 'JetBrains Mono', monospace);
    color: var(--accent, #58a6ff);
    line-height: 22px;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.v2-error {
    padding: 20px;
    color: var(--console-error, #f85149);
}
/* ERROR LINE DECORATION */

.v2-error-line {
    background: rgba(248, 81, 73, 0.15) !important;
}

/* SIDEBAR SPECIAL LINKS */

.v2-sidebar-special-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 8px;
    cursor: pointer;
    background: var(--bg-tertiary, #21262d);
    border: 1px solid var(--border-primary, #30363d);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary, #8b949e);
    transition: all 0.15s ease;
}

.v2-sidebar-special-link:hover {
    background: var(--bg-hover, #30363d);
    color: var(--text-primary, #c9d1d9);
    border-color: var(--accent-color, #58a6ff);
}

.v2-special-link-icon {
    font-size: 14px;
}

.v2-special-link-label {
    font-weight: 500;
}
/* CALL GRAPH (editor tab) */

.v2-call-graph-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary, #1e1e1e);
    color: var(--text-primary, #c9d1d9);
    user-select: none;
    font-family: var(--font-ui, sans-serif);
}

.v2-call-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    background: var(--bg-secondary, #252526);
    flex-shrink: 0;
}

.v2-call-graph-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.v2-call-graph-icon {
    font-size: 16px;
}

.v2-call-graph-subject {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted, #6e7681);
    margin-left: 6px;
}

.v2-call-graph-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.v2-cg-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    color: var(--text-muted, #6e7681);
    background: var(--bg-primary, #1e1e1e);
}

.v2-cg-chip.cg-entry     { color: var(--console-success, #3fb950); border-color: rgba(63, 185, 80, 0.5); }
.v2-cg-chip.cg-cycle     { color: var(--console-error, #f85149); border-color: rgba(248, 81, 73, 0.5); }
.v2-cg-chip.cg-undefined { color: var(--console-error, #f85149); border-color: rgba(248, 81, 73, 0.5); border-style: dashed; }
.v2-cg-chip.cg-forward   { color: var(--console-warning, #d29922); border-color: rgba(210, 153, 34, 0.5); }
.v2-cg-chip.cg-dead      { color: var(--text-muted, #6e7681); opacity: 0.6; }
.v2-cg-chip.cg-library   { color: var(--accent, #58a6ff); border-color: rgba(88, 166, 255, 0.5); }
.v2-cg-chip.cg-common    { color: var(--accent, #58a6ff); border-color: rgba(88, 166, 255, 0.5); border-style: dashed; }
.v2-cg-chip.cg-ambiguous { color: var(--accent, #58a6ff); border-color: rgba(88, 166, 255, 0.5); border-style: dotted; }

.v2-call-graph-subject-select {
    max-width: 160px;
}

.v2-call-graph-main {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: auto;
}

.v2-call-graph-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #6e7681);
    font-style: italic;
    text-align: center;
    padding: 16px;
}

.v2-call-graph-canvas {
    padding: 12px;
}

.v2-call-graph-svg {
    display: block;
    margin: 0 auto;
    /* Allow horizontal scrolling for wide graphs while keeping it tidy. */
    max-width: none;
}

/* Edges */
.cg-edge {
    stroke-width: 1.4;
    transition: stroke-width 0.08s, opacity 0.08s;
}
.cg-edge-normal {
    stroke: var(--text-muted, #6e7681);
    opacity: 0.55;
}
.cg-edge-cycle {
    stroke: var(--console-error, #f85149);
    opacity: 0.85;
    stroke-dasharray: 4 3;
}
.cg-edge-undefined {
    stroke: var(--console-error, #f85149);
    opacity: 0.85;
}
.cg-edge-forward {
    stroke: var(--console-warning, #d29922);
    opacity: 0.85;
}
/* Ambiguous overload call — connected to every candidate overload. */
.cg-edge-ambiguous {
    stroke: var(--accent, #58a6ff);
    opacity: 0.7;
    stroke-dasharray: 2 3;
}
.cg-edge.cg-edge-hover {
    stroke-width: 2.4;
    opacity: 1;
}

/* Nodes */
.cg-node-rect {
    fill: var(--bg-secondary, #252526);
    stroke: var(--border, rgba(255,255,255,0.18));
    stroke-width: 1;
    transition: stroke 0.08s, fill 0.08s;
}
.cg-node {
    cursor: pointer;
}

.cg-node:hover .cg-node-rect {
    stroke: var(--accent, #58a6ff);
}

.cg-node-name {
    fill: var(--text-primary, #c9d1d9);
    font-family: var(--mono-font, ui-monospace, SFMono-Regular, monospace);
    font-size: 11px;
    font-weight: 600;
}
.cg-node-sub {
    fill: var(--text-muted, #6e7681);
    font-family: var(--mono-font, ui-monospace, SFMono-Regular, monospace);
    font-size: 9px;
}

.cg-node-entry .cg-node-rect {
    stroke: var(--console-success, #3fb950);
    stroke-width: 1.5;
    fill: rgba(63, 185, 80, 0.05);
}
.cg-node-cycle .cg-node-rect {
    stroke: var(--console-error, #f85149);
    stroke-width: 1.5;
    fill: rgba(248, 81, 73, 0.07);
}
.cg-node-cycle .cg-node-name {
    fill: var(--console-error, #f85149);
}

/* Forward-reference target — function exists, but at least one caller
   reaches it from above its definition (illegal in GLSL). Orange to match
   the inline forward-ref warning. */
.cg-node-uncallable .cg-node-rect {
    stroke: var(--console-warning, #d29922);
    stroke-width: 1.5;
    fill: rgba(210, 153, 34, 0.07);
}
.cg-node-uncallable .cg-node-name {
    fill: var(--console-warning, #d29922);
}

/* Undefined call target — appears as a "ghost" node so the user can see
   what's referencing a missing function. Greyed body, red dashed outline. */
.cg-node-undefined .cg-node-rect {
    stroke: var(--console-error, #f85149);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
    fill: rgba(110, 118, 129, 0.18);
}
.cg-node-undefined .cg-node-name {
    fill: var(--console-error, #f85149);
    text-decoration: line-through;
    text-decoration-color: rgba(248, 81, 73, 0.6);
}
.cg-node-undefined .cg-node-sub {
    fill: var(--console-error, #f85149);
    opacity: 0.8;
}

.cg-node-dead {
    opacity: 0.45;
}
.cg-node-dead .cg-node-name {
    font-style: italic;
}
.cg-node-library .cg-node-rect {
    stroke: var(--accent, #58a6ff);
    stroke-dasharray: 3 2;
}

/* Function sourced from the shared Common tab (folded into a pass's graph). */
.cg-node-common .cg-node-rect {
    stroke: var(--accent, #58a6ff);
    stroke-dasharray: 3 2;
    fill: rgba(88, 166, 255, 0.05);
}

/* Editor highlight for hovered call sites (driven from the graph). */
.v2-call-graph-call-highlight {
    background: rgba(88, 166, 255, 0.18);
    outline: 1px solid rgba(88, 166, 255, 0.55);
    border-radius: 2px;
}
