:root {
    /* Horizontal offset for canvas-aligned fixed UI (logo, toolbar, status). */
    --sidebar-canvas-offset: 0px;
    --canvas-left-align: 22px;
    /* Brand defaults used during very first paint before JS applies window.BRAND. */
    --primary-color: #F05E3E;
    --secondary-color: #00B8D4;
    --accent-color: #00E5A0;
    --dark-color: #1A1F2E;
    --light-color: #F8F9FA;
    /* Light Mode Theme */
    --bg-primary: #F8F9FA;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --bg-select: #ffffff;
    --text-primary: #333;
    --text-secondary: #364153;
    --text-tertiary: #999;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0,0,0,0.05);
    --shadow-color-hover: rgba(0,0,0,0.12);
}

body.dark-mode {
    /* Dark Mode Theme */
    --bg-primary: #1a1d23;
    --bg-secondary: #23262d;
    --bg-tertiary: #2c2f38;
    --bg-select: var(--bg-primary);
    --text-primary: #e8eaed;
    --text-secondary: #b8bbc1;
    --text-tertiary: #888b92;
    --border-color: #3a3d45;
    --shadow-color: rgba(0,0,0,0.3);
    --shadow-color-hover: rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

body.app-loading {
    background: #f8f9fa;
}

html.dark-mode body.app-loading {
    background: #1a1d23;
}

/* Prevent browser text-range selection while using Shift+click interactions */
button,
img,
.toolbar,
.canvas-floating-toolbar,
.canvas-top-header,
.canvas-top-actions,
.react-flow__pane,
.react-flow__edge-text,
.react-flow__controls {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Keep editing/selecting text enabled where needed */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#root {
    width: 100vw;
    height: 100vh;
    display: flex;
}

body.app-loading #root {
    opacity: 0;
}

body.app-ready #root {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.initial-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    z-index: 20000;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.dark-mode .initial-loader {
    background: var(--bg-primary);
}

html.dark-mode .initial-loader {
    background: #1a1d23;
}

.initial-loader__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
}

.initial-loader__spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-top-color: var(--primary-color, #F05E3E);
    animation: initial-loader-spin 0.8s linear infinite;
    box-shadow: 0 8px 30px color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.initial-loader__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color, #F05E3E);
}

.initial-loader__subtitle {
    font-size: 14px;
    color: #6b7280;
}

body.dark-mode .initial-loader__subtitle {
    color: var(--text-secondary);
}

html.dark-mode .initial-loader__subtitle {
    color: #b8bbc1;
}

body.app-ready .initial-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes initial-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Canvas top-left header — outer shell (logo + blueprint/page pill), matches export toolbar */
.canvas-top-header {
    position: fixed;
    top: 20px;
    left: calc(var(--sidebar-canvas-offset, 0px) + var(--canvas-left-align, 22px));
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 8px 8px;
    box-sizing: border-box;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    pointer-events: auto;
    min-width: 650px;
    max-width: min(calc(100vw - 200px), 960px);
    overflow: visible;
}

body.dark-mode .canvas-top-header {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.canvas-top-header-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 38px;
}

.canvas-top-header-brand img {
    width: 185px;
    height: 38px;
    max-width: 185px;
    display: block;
    object-fit: contain;
    object-position: left center;
}

/* Blueprint name + ⋯ + page title — one shared pill inside the header */
.canvas-top-workspace-bar {
    --workspace-control-height: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    height: 39px;
    box-sizing: border-box;
    min-width: 320px;
    flex: 1;
    gap: 6px;
    padding: 0 4px;
    background: #FFFFFF;
    border: 1px solid #F6F6F6;
    border-radius: 8px;
    box-shadow: none;
    overflow: visible;
}

body.dark-mode .canvas-top-workspace-bar {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.canvas-top-blueprint-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    overflow: visible;
}

.canvas-top-blueprint-wrap > .blueprint-actions-dropdown {
    z-index: 10030;
}

.canvas-top-blueprint-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    height: 100%;
    padding-left: 12px;
}

.canvas-top-blueprint-name,
.canvas-top-blueprint-name-input {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: var(--workspace-control-height);
    height: var(--workspace-control-height);
}

.canvas-top-blueprint-name {
    display: block;
    color: #6B7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: text;
    user-select: none;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
}

.canvas-top-blueprint-name-input {
    color: #364153;
    margin: 0;
    padding: 0 7px;
    border: 1px solid #6B7280;
    border-radius: 6px;
    background: #ffffff;
    outline: none;
}

.canvas-top-blueprint-name-input:focus {
    border-color: #364153;
}

body.dark-mode .canvas-top-blueprint-name {
    color: var(--text-secondary);
}

body.dark-mode .canvas-top-blueprint-name-input {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .canvas-top-blueprint-name-input:focus {
    border-color: var(--text-secondary);
}

.canvas-top-pages-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    height: 100%;
}

.canvas-top-blueprint-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
}

.canvas-top-blueprint-menu-btn img {
    width: 18px;
    height: 18px;
    display: block;
}

.canvas-top-blueprint-menu-btn:hover,
.canvas-top-blueprint-menu-btn.is-open {
    background: #F6F6F6;
}

.canvas-top-blueprint-menu-btn:hover img,
.canvas-top-blueprint-menu-btn.is-open img {
    opacity: 0.72;
}

body.dark-mode .canvas-top-blueprint-menu-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

body.dark-mode .canvas-top-blueprint-menu-btn:hover,
body.dark-mode .canvas-top-blueprint-menu-btn.is-open {
    background: var(--bg-secondary);
}

body.dark-mode .canvas-top-blueprint-menu-btn:hover img,
body.dark-mode .canvas-top-blueprint-menu-btn.is-open img {
    opacity: 0.72;
}

.canvas-top-page-select {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    height: var(--workspace-control-height);
    padding: 0 5px 0 11px;
    min-width: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #F6F6F6;
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.canvas-top-page-select:hover {
    background: #EFEFEF;
}

.canvas-top-page-select.is-open {
    border-color: var(--primary-color);
    background: #FFFFFF;
}

.canvas-top-page-select.is-editing {
    background: #ffffff;
    border-color: #364153;
    cursor: default;
}

.canvas-top-page-select-input {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: var(--workspace-control-height);
    height: var(--workspace-control-height);
    color: #364153;
    outline: none;
    box-sizing: border-box;
}

.canvas-top-page-select-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 0;
}

.canvas-top-page-select-toggle:disabled {
    cursor: default;
    opacity: 0.5;
}

body.dark-mode .canvas-top-page-select {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.dark-mode .canvas-top-page-select:hover {
    background: var(--bg-secondary);
}

body.dark-mode .canvas-top-page-select.is-open {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

body.dark-mode .canvas-top-page-select.is-editing {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

body.dark-mode .canvas-top-page-select-input {
    color: var(--text-primary);
}

.canvas-top-page-select-label {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: var(--workspace-control-height);
    height: var(--workspace-control-height);
    color: #364153;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    user-select: none;
    box-sizing: border-box;
}

body.dark-mode .canvas-top-page-select-label {
    color: var(--text-primary);
}

.canvas-top-page-select-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 0;
}

.canvas-top-page-select-chevron img {
    width: 18px;
    height: 18px;
    display: block;
    transition: transform 0.25s ease;
}

.canvas-top-page-select.is-open .canvas-top-page-select-chevron img {
    transform: rotate(180deg);
}

body.dark-mode .canvas-top-page-select-chevron img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.canvas-top-pages-wrap .toolbar-pages-dropdown {
    top: calc(100% + 14px);
    right: -85px;
    left: auto;
}

/* Blueprint ⋯ menu — same UI as Load dropdown */
.canvas-top-blueprint-wrap > .load-dropdown-menu {
    top: calc(100% + 20px);
    right: -42px;
    left: auto;
    z-index: 10025;
}

/* Floating vertical toolbar — canvas left */
.canvas-floating-toolbar {
    position: fixed;
    left: calc(var(--sidebar-canvas-offset, 0px) + var(--canvas-left-align, 22px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    pointer-events: auto;
    width: max-content;
}

.canvas-floating-toolbar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 14px var(--shadow-color);
}

.canvas-floating-toolbar-group--row {
    flex-direction: row;
    align-items: stretch;
    gap: 4px;
    padding: 6px;
    box-sizing: border-box;
}

.canvas-floating-toolbar-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: #f6f6f6;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.canvas-floating-toolbar-btn:hover:not(:disabled) {
    background: #ebebeb;
}

.canvas-floating-toolbar-btn:not(:disabled) {
    cursor: pointer;
}

.canvas-floating-toolbar-btn:disabled {
    cursor: not-allowed;
}

.canvas-floating-toolbar-btn img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

.canvas-floating-toolbar-btn--small {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 24px;
    border-radius: 6px;
}

.canvas-floating-toolbar-btn--small img {
    width: 13px;
    height: 13px;
}

body.dark-mode .canvas-floating-toolbar-group {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

body.dark-mode .canvas-floating-toolbar-btn {
    background: #2c3038;
}

body.dark-mode .canvas-floating-toolbar-btn:hover {
    background: #363b45;
}

body.dark-mode .canvas-floating-toolbar-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

/* Text Note Sticky (on canvas) */
.text-note-sticky {
    overflow: visible !important;
    border-radius: 8px !important;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

/* Full card drags until edit mode; textarea stays nodrag */
.text-note-sticky:not(.text-note-sticky--editing):active {
    cursor: grabbing;
}

.text-note-sticky--editing {
    cursor: default;
}

.sticky-note-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    width: 12px;
    height: 12px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.sticky-note-delete-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.sticky-note-delete-btn img {
    display: block;
    opacity: 0.75;
}

.sticky-note-delete-btn:hover img {
    opacity: 1;
}

.sticky-note-hint {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: #5c6370;
    user-select: none;
}

/* Bottom-left folded paper corner - back side */
.text-note-sticky::before {
    content: '';
    position: absolute;
    bottom: 22px;
    left: 0px;
    width: 22px;
    height: 22px;
    background: #E8D98F;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    transform: rotate(90deg);
    transform-origin: bottom left;
    z-index: 1;
}

body.dark-mode .text-note-sticky::after {
    display: block;
    background-color: var(--bg-secondary);
    border-color: transparent transparent var(--bg-secondary) transparent;
}

/* Bottom-left folded paper corner - shadow (removed) */
.text-note-sticky::after {
    display: none;
}

.connection-types {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connection-type {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #364153;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.connection-type:hover {
    border-color: var(--hover-stroke-color, var(--primary-color));
}

.connection-type.selected {
    border-color: var(--hover-stroke-color, var(--primary-color));
}

.edge-menu .connection-type {
    width: 100%;
}

.connection-indicator {
    width: 40px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Pages */
.pages-container {
    margin: 0;
}

.pages-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.page-tab {
    position: relative;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s;
    user-select: none;
}

.page-tab:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.page-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.page-tab span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-name-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.page-tab.active .page-name-input {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

body.dark-mode .page-name-input {
    background: rgba(40, 44, 52, 0.9);
    color: var(--text-primary);
}

body.dark-mode .page-tab.active .page-name-input {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.page-copy-btn,
.page-delete-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.page-copy-btn {
    font-size: 14px;
}

.page-copy-btn:hover,
.page-delete-btn:hover {
    opacity: 1;
}

.page-tab.active .page-copy-btn,
.page-tab.active .page-delete-btn {
    color: white;
}

.copy-page-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 10000;
    min-width: 200px;
}

.copy-brand-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
    margin-bottom: 4px;
}

.copy-brand-option:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.copy-menu-cancel {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-top: 8px;
}

.copy-menu-cancel:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
}

.add-page-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.add-page-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-secondary);
}

/* Main Canvas */
.main-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    transition: background-color 0.3s ease;
    z-index: 1;
}

/* Page switch: barely-there fade + nudge */
.main-canvas.main-canvas--transitioning {
    animation: canvas-page-turn 110ms ease-out;
}

/* Load example blueprint only: same idea, slightly softer than page switch */
.main-canvas.main-canvas--transitioning-example {
    animation: canvas-example-load 100ms ease-out;
}

@keyframes canvas-example-load {
    0% {
        opacity: 0.99;
        transform: translateX(2px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes canvas-page-turn {
    0% {
        opacity: 0.98;
        transform: translateX(4px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Light mode dotted pattern */
/* Commented out - now using ReactFlow's Background component for consistent zoom scaling */
/*
.main-canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, #B7B7B7 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

 Dark mode uses ReactFlow's built-in Background component
body.dark-mode .main-canvas::before {
    display: none;
}
*/

/* Empty Canvas Message */
.empty-canvas-message {
    position: fixed;
    top: 50%;
    left: calc(var(--sidebar-canvas-offset) + (100vw - var(--sidebar-canvas-offset)) / 2);
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
    width: auto;
    max-width: calc(100vw - var(--sidebar-canvas-offset));
}

.empty-canvas-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding: 0;
    line-height: 1.4;
}

.empty-canvas-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* Canvas locked — toast above bottom controls, centered on drawable canvas */
.canvas-lock-toast {
    position: absolute;
    left: calc(var(--sidebar-canvas-offset, 0px) + (100vw - var(--sidebar-canvas-offset, 0px)) / 2);
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    z-index: 2500;
    pointer-events: none;
    max-width: min(560px, calc(100vw - var(--sidebar-canvas-offset, 0px) - 48px));
}

.canvas-lock-toast > * {
    pointer-events: auto;
}

.canvas-lock-toast__bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(15, 23, 42, 0.06);
    flex: 0 1 auto;
    min-width: 0;
}

.canvas-lock-toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.canvas-lock-toast__msg {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    color: #333f4d;
    font-weight: 400;
}

.canvas-lock-toast__msg strong {
    font-weight: 700;
    color: #333f4d;
}

.canvas-lock-toast__msg-rest {
    font-weight: 500;
    color: #333f4d;
}

.canvas-lock-toast__close {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #364153;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.canvas-lock-toast__close:hover {
    background: #f3f4f6;
    color: #111827;
}

body.dark-mode .canvas-lock-toast__bar,
body.dark-mode .canvas-lock-toast__close {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}

body.dark-mode .canvas-lock-toast__close {
    color: var(--text-primary);
}

body.dark-mode .canvas-lock-toast__msg,
body.dark-mode .canvas-lock-toast__msg strong,
body.dark-mode .canvas-lock-toast__msg-rest {
    color: var(--text-primary);
}

body.dark-mode .canvas-lock-toast__icon {
    filter: brightness(0) invert(1);
    opacity: 0.88;
}

body.dark-mode .canvas-lock-toast__close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* File loaded — success toast (bottom center of canvas) */
.file-load-success-toast {
    position: absolute;
    left: calc(var(--sidebar-canvas-offset, 0px) + (100vw - var(--sidebar-canvas-offset, 0px)) / 2);
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 10px;
    background: #F9FFFD;
    border: 1px solid #d1fae5;
    border-left: 4px solid #166534;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(15, 23, 42, 0.06);
    z-index: 2500;
    max-width: min(480px, calc(100vw - var(--sidebar-canvas-offset, 0px) - 48px));
    pointer-events: auto;
}

.file-load-success-toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

.file-load-success-toast__msg {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 400;
    color: #333f4d;
    white-space: nowrap;
}

.file-load-success-toast__dismiss {
    flex-shrink: 0;
    padding: 4px 10px;
    border: none;
    border-radius: 3px;
    background: #ffffff;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.file-load-success-toast__dismiss:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}

body.dark-mode .file-load-success-toast {
    background: #1c2621;
    border-color: #22543a;
    border-left-color: #22c55e;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.25);
}

body.dark-mode .file-load-success-toast__msg {
    color: #e8eaed;
}

body.dark-mode .file-load-success-toast__dismiss {
    background: #2d3239;
    border: 1px solid #3d424b;
    color: #9ca3af;
}

body.dark-mode .file-load-success-toast__dismiss:hover {
    background: #363c46;
    border-color: #4b5563;
    color: #e8eaed;
}

.react-flow__node {
    background: transparent !important;
    border: none;
    border-radius: 8px;
    padding: 0;
    box-shadow: none;
    /* Only animate shadow — never transform (RF positions nodes via transform) */
    transition: box-shadow 0.2s ease;
    cursor: move;
}

/* Sticky note border radius */
.react-flow__node.react-flow__node-textNote {
    border-radius: 8px 8px 8px 40px !important;
}

.react-flow__node:hover {
    box-shadow: none;
    transform: translateY(-1px);
}

/* Light smoothing while dragging — short enough to stay responsive (~1–2 frames at 60fps) */
.react-flow__node.dragging,
.react-flow__node.dragging:hover {
    will-change: transform;
    transition: transform 0.07s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.15s ease !important;
}

.react-flow__node.selected {
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.6);
}

/* Stronger visual while batch multi-selecting nodes */
.main-canvas--batch-multi-selected .react-flow__node.selected {
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.55);
    transform: translateY(-2px);
    z-index: 5;
}

body.dark-mode .main-canvas--batch-multi-selected .react-flow__node.selected {
    box-shadow: 0 12px 34px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    z-index: 5;
}

.custom-node {
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: box-shadow 0.2s;
    width: 100%;
    height: 100%;
    min-width: 240px;
    min-height: 150px;
}

.custom-node:hover {
    box-shadow: 0 4px 12px var(--shadow-color-hover);
}
/* Ensure all text content in nodes wraps properly */
.custom-node input[type="text"],
.custom-node textarea {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Text display areas should have scrollbars when content overflows */
.custom-node > div > div {
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure resize handle stays visible */
.custom-node > div[style*="resize"] {
    z-index: 100;
}
.node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.node-header-icon-wrapper {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.node-header-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-header-icon-emoji {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-edit-icon {
    filter: brightness(0);
}

body.dark-mode .node-edit-icon {
    filter: brightness(0) invert(1) brightness(0.80);
}

.node-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    cursor: text;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.node-title:hover {
    background: var(--bg-tertiary);
}

/* Invisible larger hit area around connection handles (circular) */
.handle-hit-area {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    z-index: 5;
}
.handle-hit-area-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-left: -11px;
}
.handle-hit-area-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-right: -11px;
}
.handle-hit-area-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -11px;
}
.handle-hit-area-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: -11px;
}

/* Center the handle dot in the middle of the invisible hit area */
.handle-hit-area .react-flow__handle {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
}

/* When cursor is in the invisible area or on the handle, make it active (keep centered) */
.handle-hit-area:hover .react-flow__handle,
.handle-hit-area .react-flow__handle:hover {
    transform: translate(-50%, -50%) scale(3);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

/* Connection Handles */
.react-flow__handle {
    width: 16px;
    height: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
    transform-origin: center center;
}

.react-flow__handle:hover {
    transform: scale(3);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

.react-flow__handle-connecting {
    background: #38f9d7 !important;
}

.react-flow__handle-valid {
    background: #43e97b !important;
}

/* Edge Styles */
.react-flow__edge-path {
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Make edges easier to interact with */
.react-flow__edge {
    pointer-events: all;
}

.react-flow__edge.selected {
    z-index: 2 !important;
}

.react-flow__edge:hover .react-flow__edge-path {
    stroke-width: 3.5;
}

/* Multi-select (Shift+click): highlight only edge label area, not full line */
.react-flow__edge.selected .react-flow__edge-path {
    stroke-width: 2.5px !important;
    filter: none !important;
}

.react-flow__edge.selected .react-flow__edge-textbg {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.45));
}

body.dark-mode .react-flow__edge.selected .react-flow__edge-textbg {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.55))
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.28));
}

.react-flow__edge:not(.selected):hover .react-flow__edge-path {
    opacity: 1;
}

/* Edge Labels - ensure clean rendering */
.react-flow__edge-text {
    fill: #555 !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    stroke: none !important;
    stroke-width: 0 !important;
}

.react-flow__edge-textbg {
    fill: white !important;
    fill-opacity: 0.9 !important;
    stroke: none !important;
}

.connection-edge-label {
    position: absolute;
    pointer-events: auto;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px 8px;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 150px;
}

.connection-edge-label--selected {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.45));
}

body.dark-mode .connection-edge-label--selected {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.55))
        drop-shadow(0 0 10px rgba(255, 255, 255, 0.28));
}

.connection-edge-label__text {
    line-height: 1;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-edge-label__chevron {
    width: 12px;
    height: 12px;
    display: block;
    opacity: 0.9;
}

/* Pulse animation for other use cases */
@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 0.9;
        transform: translateX(-50%) scale(1.02);
    }
}

/* Edge Updater Handles (for reconnection) */
.react-flow__edgeupdater {
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 50%;
    cursor: grab;
    pointer-events: all;
}

.react-flow__edgeupdater:hover {
    width: 16px;
    height: 16px;
    background: #667eea;
    border-color: #43e97b;
    border-width: 3px;
    cursor: grabbing;
}

/* Toolbar */
.toolbar {
    position: absolute;
    top: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    transition: all 0.3s ease;
}

.toolbar-left {
    left: calc(var(--sidebar-canvas-offset, 0px) + 15px);
}

.toolbar-right {
    right: 20px;
    overflow: visible;
}

.global-hover-tooltip {
    position: fixed;
    display: inline-block;
    width: max-content;
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    max-width: min(360px, calc(100vw - 40px));
    overflow: visible;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
    pointer-events: none;
    z-index: 20020;
}

.global-hover-tooltip--add-node {
    max-width: min(300px, calc(100vw - 40px));
    text-align: center;
}

.global-hover-tooltip--multiline {
    max-width: min(280px, calc(100vw - 40px));
    white-space: pre-line;
    text-align: center;
    line-height: 1.35;
}

.global-hover-tooltip::after {
    content: "";
    position: absolute;
    left: var(--tooltip-arrow-left, 50%);
    top: calc(100% - 4px);
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transform: translateX(-50%) rotate(45deg);
}

/* Tooltip opens below the anchor (e.g. top navbar) — arrow points up */
.global-hover-tooltip--below::after {
    top: -5px;
    bottom: auto;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
}

body.dark-mode .global-hover-tooltip {
    background: #2c3038;
    color: #d1d5db;
    border-color: #3a3f49;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

body.dark-mode .global-hover-tooltip::after {
    background: #2c3038;
    border-right-color: #3a3f49;
    border-bottom-color: #3a3f49;
}

body.dark-mode .global-hover-tooltip--below::after {
    border-left-color: #3a3f49;
    border-top-color: #3a3f49;
}

.toolbar button {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    height: 38px;
    box-sizing: border-box;
}

.toolbar button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.toolbar button:active {
    transform: translateY(0);
}

.toolbar button.primary {
    background: var(--primary-color);
    color: white;
}

.toolbar button.primary:hover {
    filter: brightness(1.1);
}

.toolbar button.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.toolbar button.secondary:hover {
    background: var(--bg-secondary);
}

.toolbar .file-button {
    background: transparent !important;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.toolbar .file-button:hover {
    background: var(--bg-tertiary) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .toolbar .file-button {
    color: var(--text-primary) !important;
}

body.dark-mode .toolbar .file-button img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Fix Pages icon white background in dark mode - invert colors so white becomes dark */
body.dark-mode .toolbar .file-button .pages-icon {
    filter: invert(1) hue-rotate(180deg);
    opacity: 1;
}

.toolbar .undo-redo-button {
    background: #E5E5E5;
    border: none;
    color: var(--text-primary);
}

.toolbar .undo-redo-button:hover {
    background: #D4D4D4;
}

.toolbar .undo-redo-button img {
    filter: brightness(0);
}

body.dark-mode .toolbar .undo-redo-button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.dark-mode .toolbar .undo-redo-button:hover {
    background: var(--bg-secondary);
}

body.dark-mode .toolbar .undo-redo-button img {
    filter: brightness(0) invert(1);
}

/* Toolbar Pages Dropdown */
.toolbar-pages-dropdown {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    width: 243px;
    height: auto;
    z-index: 1000;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.toolbar-pages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 16px 2px 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #364153;
    border-bottom: none;
    flex-shrink: 0;
}

body.dark-mode .toolbar-pages-header {
    color: var(--text-primary);
}

.pages-count-badge {
    background: transparent;
    color: #364153;
}

body.dark-mode .pages-count-badge {
    background: transparent;
    color: var(--text-primary) !important;
}

.toolbar-pages-add-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.pages-add-btn-dropdown {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    font-size: 20px;
    font-weight: 600;
}

.pages-add-btn-dropdown:hover {
    background: var(--bg-tertiary) !important;
}

.toolbar-pages-add-btn:hover {
    background: var(--bg-tertiary);
}

body.dark-mode .toolbar-pages-add-btn {
    color: #667eea;
}

body.dark-mode .toolbar-pages-add-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

body.dark-mode .toolbar-pages-add-btn:hover {
    background: var(--bg-tertiary);
    color: #667eea;
}

body.dark-mode .toolbar-pages-add-btn:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.toolbar-pages-list {
    flex: 1;
    padding: 12px 16px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    min-height: 0;
    max-height: 125px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #D1D5DC #F5F5F5;
}

/* Custom scrollbar for pages list */
.toolbar-pages-list::-webkit-scrollbar {
    width: 8px;
}

.toolbar-pages-list::-webkit-scrollbar-track {
    background: #F5F5F5;
    border-radius: 4px;
}

.toolbar-pages-list::-webkit-scrollbar-thumb {
    background: #D1D5DC;
    border-radius: 4px;
}

.toolbar-pages-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.toolbar-page-item {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-tertiary) !important;
    justify-content: space-between;
    width: 208px;
    height: 30px;
    padding: 0 8px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-secondary);
    background: transparent;
}

.toolbar-page-item:hover {
    background: #FFEDE7 !important;
}

body.dark-mode .toolbar-page-item:hover {
    color: #364153;
}

.toolbar-page-item.active {
    background: #FFEDE7 !important;
    color: var(--text-secondary);
}

body.dark-mode .toolbar-page-item.active {
    background: var(--primary-color) !important;
    color: white;
}

.toolbar-page-item span {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-page-menu-btn {
    background: transparent !important;
    border: none !important;
    color: #364153 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 0 !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: none !important;
    flex-shrink: 0;
    box-shadow: none !important;
}

.toolbar-page-menu-btn:hover,
.toolbar-page-menu-btn:focus,
.toolbar-page-menu-btn:active {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

body.dark-mode .toolbar-page-menu-btn {
    color: #e8eaed !important;
}

body.dark-mode .toolbar-page-item:hover .toolbar-page-menu-btn {
    color: #364153 !important;
}

body.dark-mode .toolbar-page-menu-btn:hover,
body.dark-mode .toolbar-page-menu-btn:focus,
body.dark-mode .toolbar-page-menu-btn:active {
    color: #e8eaed !important;
}

.toolbar-page-context-menu {
    position: fixed;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 10030;
    overflow: visible;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
}

.toolbar-page-context-menu button {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #364153;
    cursor: pointer;
    transition: background 0.2s;
}

.toolbar-page-context-menu button:hover {
    background: #F5F5F5;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.toolbar-page-context-menu button.delete {
    color: #ef4444;
}

.toolbar-page-context-menu button.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.toolbar-page-menu-divider {
    height: 1px;
    background: #E5E5E5;
    margin: 4px 0;
}

body.dark-mode .toolbar-page-context-menu {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .toolbar-page-context-menu button:not(.delete) {
    color: var(--text-primary);
}

body.dark-mode .toolbar-page-context-menu button:not(.delete):hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

body.dark-mode .toolbar-pages-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Toolbar Delete All Button */
.toolbar-delete-all-container {
    padding: 8px 16px 16px 16px;
}

.toolbar-delete-all-btn {
    width: 100%;
    padding: 8px !important;
    background: transparent !important;
    border: 2px solid #ef4444 !important;
    border-radius: 6px;
    color: #ef4444 !important;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    height: auto !important;
}

.toolbar-delete-all-btn:hover {
    background: #ef4444 !important;
    color: white !important;
}

.toolbar-delete-all-btn:hover .toolbar-delete-all-icon {
    filter: brightness(0) invert(1);
}

.toolbar-delete-all-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(7498%) hue-rotate(340deg) brightness(99%) contrast(95%);
    transition: filter 0.2s;
}

/* Toolbar Page Preview */
.toolbar-page-preview {
    pointer-events: none;
}

.toolbar-page-preview-content {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    width: 200px;
    padding: 8px;
}

.toolbar-page-preview-header {
    padding: 8px 12px;
    background: #F5F5F5;
    border-bottom: 1px solid #E5E5E5;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #364153;
    text-align: center;
}

.toolbar-page-preview-minimap {
    width: 184px;
    height: 150px;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
}

.toolbar-page-preview-minimap .react-flow {
    width: 184px !important;
    height: 150px !important;
}

.toolbar-page-preview-minimap .react-flow__viewport {
    width: 184px !important;
    height: 150px !important;
}

.toolbar-page-preview-minimap .react-flow__nodes {
    pointer-events: none;
}

.toolbar-page-preview-minimap .react-flow__edges {
    pointer-events: none;
}

/* Preview sits inside .toolbar — reset .toolbar button rules so sticky delete matches canvas */
.toolbar-page-preview .sticky-note-delete-btn {
    padding: 0 !important;
    border: none !important;
    border-radius: 6px;
    background: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    height: auto !important;
    width: 12px;
    min-width: 0;
    gap: 0 !important;
    white-space: normal !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.toolbar-page-preview .sticky-note-delete-btn:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    filter: none !important;
    transform: none !important;
}

.toolbar-page-preview .sticky-note-delete-btn:active {
    transform: none !important;
}

body.dark-mode .toolbar-page-preview .sticky-note-delete-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

.toolbar-page-preview-footer {
    padding: 8px 12px;
    background: #FFFFFF;
    border-top: 1px solid #E5E5E5;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #364153;
    text-align: left;
}

body.dark-mode .toolbar-page-preview-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .toolbar-page-preview-header {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .toolbar-page-preview-footer {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* React Flow Minimap */
.react-flow__minimap {
    right: 7px !important;
    margin-bottom: 95px !important;
}

/* Minimap size slider (Settings panel) */
.canvas-settings-minimap-size {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: opacity 0.2s ease;
}

.canvas-settings-minimap-size-label {
    font-size: 14px;
    font-weight: 500;
    color: #2c323f;
    line-height: 1.2;
    font-family: inherit;
}

.canvas-settings-minimap-size--disabled {
    opacity: 0.36;
    pointer-events: none;
    user-select: none;
}

body.dark-mode .canvas-settings-minimap-size-label {
    color: var(--text-primary);
}

body.dark-mode .canvas-settings-minimap-size--disabled {
    opacity: 0.4;
}

.canvas-settings-minimap-size--disabled .canvas-settings-minimap-size-slider-wrap {
    border-color: rgba(200, 205, 214, 0.55);
    background: rgba(246, 246, 246, 0.65);
}

body.dark-mode .canvas-settings-minimap-size--disabled .canvas-settings-minimap-size-slider-wrap {
    border-color: var(--border-color);
    background: rgba(42, 45, 52, 0.5);
}

.canvas-settings-minimap-size--disabled input[type="range"] {
    cursor: default;
}

.canvas-settings-minimap-size--disabled input[type="range"]::-webkit-slider-thumb {
    background: #e8c4c0;
    cursor: default;
    box-shadow: none;
}

.canvas-settings-minimap-size--disabled input[type="range"]::-webkit-slider-thumb:hover {
    transform: none;
    box-shadow: none;
}

.canvas-settings-minimap-size--disabled input[type="range"]::-moz-range-thumb {
    background: #e8c4c0;
    cursor: default;
}

.canvas-settings-minimap-size--disabled input[type="range"]::-moz-range-thumb:hover {
    transform: none;
    box-shadow: none;
}

.canvas-settings-minimap-size-slider-wrap {
    width: 110px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
}

.canvas-settings-minimap-size input[type="range"] {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.canvas-settings-minimap-size input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.canvas-settings-minimap-size input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.canvas-settings-minimap-size input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.canvas-settings-minimap-size input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}
/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 30px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal h2 {
    color: var(--text-primary);
    font-size: 24px;
}

.modal pre {
    background: #ffffff;
    color: #000000;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #e0e0e0;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.modal button {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.modal button.primary {
    background: var(--primary-color);
    color: white;
}

.modal button.primary:hover {
    filter: brightness(1.1);
}

.modal button.secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e0e0e0;
}

.modal button.secondary:hover {
    background: #e9ecef;
}

/* Export prompt modal (matches product Prompt dialog) */
.export-prompt-modal {
    max-width: 790px;
    width: calc(100vw - 32px);
    padding: 22px 24px 20px;
    background: var(--bg-secondary);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

/* Fit in viewport without inner scrollbar; illustration scales down */
.modal.export-prompt-modal {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.export-prompt-modal__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.export-prompt-modal__masthead {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 6px;
    align-items: start;
    flex-shrink: 0;
    margin-bottom: 14px;
}

.export-prompt-modal__spark {
    grid-column: 1;
    grid-row: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-top: 3px;
    color: var(--text-primary);
    line-height: 0;
}

.export-prompt-modal__spark svg {
    display: block;
    width: 100%;
    height: 100%;
}

.export-prompt-modal .export-prompt-modal__title {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.export-prompt-modal__lede {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
    padding: 0;
    text-indent: 0;
}

.export-prompt-modal__panel {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 14px 12px;
    margin-bottom: 16px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.export-prompt-modal__panel-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.export-prompt-modal__next {
    min-width: 0;
    flex: 1;
}

.export-prompt-modal__next-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.export-prompt-modal__next-body {
    margin: 0;
    padding: 0;
    text-indent: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.export-prompt-modal__doc-link {
    flex-shrink: 0;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    margin-top: 1px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid #c8cdd5;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.dark-mode .export-prompt-modal__doc-link {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.export-prompt-modal__doc-link:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: #aeb4bf;
    color: var(--text-primary);
}

body.dark-mode .export-prompt-modal__doc-link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-tertiary);
}

.export-prompt-modal__doc-arrow {
    font-size: 0.85em;
    opacity: 0.85;
    font-weight: 400;
}

.export-prompt-modal__illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    min-height: 0;
}

.export-prompt-modal__illustration img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.export-prompt-modal__tip {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 4px;
    background: #e6f4fe;
    border: 1px solid #b6e0f7;
    flex-shrink: 0;
    margin-top: 8px;
}

body.dark-mode .export-prompt-modal__tip {
    background: rgba(0, 184, 212, 0.12);
    border-color: rgba(0, 184, 212, 0.28);
}

.export-prompt-modal__tip-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.export-prompt-modal__tip-icon img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

body.dark-mode .export-prompt-modal__tip-icon img {
    opacity: 0.92;
}

.export-prompt-modal__tip-title {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 400;
    color: #364153;
}

body.dark-mode .export-prompt-modal__tip-title {
    color: #7dd3fc;
}

.export-prompt-modal__tip-body {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #364153;
}

body.dark-mode .export-prompt-modal__tip-body {
    color: var(--text-secondary);
}

.export-prompt-modal__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    flex-shrink: 0;
}

.export-prompt-modal__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    min-height: 42px;
    box-sizing: border-box;
    border-radius: 10px;
    white-space: nowrap;
}

.export-prompt-modal__copy-label {
    line-height: 1;
}

.export-prompt-modal__copy-check {
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.modal.export-prompt-modal button.export-prompt-modal__copy--copied {
    background: #f88e74;
    border-color: #f88e74;
    color: #ffffff;
    cursor: default;
    pointer-events: none;
}

.modal.export-prompt-modal button.export-prompt-modal__copy--copied:hover {
    filter: none;
    background: #f88e74;
}

.modal.export-prompt-modal button.export-prompt-modal__cancel {
    align-self: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.modal.export-prompt-modal button.export-prompt-modal__cancel:hover {
    color: var(--text-primary);
}

.modal.export-prompt-modal button.export-prompt-modal__cancel:focus {
    outline: none;
}

.modal.export-prompt-modal button.export-prompt-modal__cancel:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Exports toolbar + Connect MCP dropdown (matches design spec) */
.toolbar-exports-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Build with AI — opens MCP connect dropdown */
.toolbar button.toolbar-build-with-ai-btn {
    background: color-mix(in srgb, var(--primary-color) 7%, #ffffff);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    gap: 6px;
}

.toolbar button.toolbar-build-with-ai-btn:hover,
.toolbar button.toolbar-build-with-ai-btn.is-open {
    background: color-mix(in srgb, var(--primary-color) 10%, #ffffff);
    filter: none;
    transform: translateY(-1px);
}

.toolbar-build-with-ai-btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
}

.toolbar-build-with-ai-btn__beta {
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    margin-left: -4px;
    top: -0.4em;
    position: relative;
}

body.dark-mode .toolbar button.toolbar-build-with-ai-btn {
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-secondary));
}

body.dark-mode .toolbar button.toolbar-build-with-ai-btn:hover,
body.dark-mode .toolbar button.toolbar-build-with-ai-btn.is-open {
    background: color-mix(in srgb, var(--primary-color) 18%, var(--bg-secondary));
}

.toolbar button.toolbar-export-prompt-btn {
    background: var(--primary-color);
    color: #ffffff;
    border: 1px solid var(--primary-color);
    gap: 6px;
}

.toolbar button.toolbar-export-prompt-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.toolbar-export-prompt-btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
    filter: brightness(0) invert(1);
}

.toolbar-exports-group > .mcp-connect-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -9px;
    left: auto;
    z-index: 10025;
    width: min(420px, calc(100vw - 40px));
    max-height: min(680px, calc(100vh - 100px));
    max-height: min(680px, calc(100dvh - 100px));
    padding: 18px 18px 16px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
    color: #364153;
    font-family: 'Inter', sans-serif;
}

body.dark-mode .toolbar-exports-group > .mcp-connect-dropdown {
    background: #23262d;
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

/* Reset .toolbar button inside dropdown panel */
.mcp-connect-dropdown button {
    height: auto;
    min-height: 0;
    box-sizing: border-box;
    transform: none !important;
    filter: none !important;
    white-space: nowrap;
}

.mcp-connect-modal__title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #2c323f;
    line-height: 1.3;
}

body.dark-mode .mcp-connect-modal__title {
    color: var(--text-primary);
}

.mcp-connect-modal__primary-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 3px;
    margin-bottom: 12px;
    background: #eef0f3;
    border-radius: 8px;
}

body.dark-mode .mcp-connect-modal__primary-tabs {
    background: var(--bg-tertiary);
}

.mcp-connect-dropdown .mcp-connect-modal__primary-tab {
    padding: 7px 10px;
    border: none !important;
    border-radius: 6px;
    background: transparent !important;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-modal__primary-tab.is-active {
    background: #ffffff !important;
    color: #364153;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-modal__primary-tab.is-active {
    background: var(--bg-secondary) !important;
    color: var(--text-primary);
}

.mcp-connect-modal__panel {
    padding: 12px;
    margin-bottom: 12px;
    background: #f0f1f3;
    border-radius: 10px;
}

body.dark-mode .mcp-connect-modal__panel {
    background: var(--bg-tertiary);
}

.mcp-connect-modal__provider-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 3px;
    margin-bottom: 12px;
    background: #e4e6ea;
    border-radius: 8px;
}

body.dark-mode .mcp-connect-modal__provider-tabs {
    background: rgba(0, 0, 0, 0.2);
}

.mcp-connect-dropdown .mcp-connect-modal__provider-tab {
    padding: 6px 8px;
    border: none !important;
    border-radius: 6px;
    background: transparent !important;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-modal__provider-tab.is-active {
    background: #ffffff !important;
    color: #364153;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-modal__provider-tab.is-active {
    background: var(--bg-secondary) !important;
    color: var(--text-primary);
}

.mcp-connect-modal__step + .mcp-connect-modal__step {
    margin-top: 12px;
}

.mcp-connect-modal__step-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #364153;
    line-height: 1.35;
}

body.dark-mode .mcp-connect-modal__step-label {
    color: var(--text-primary);
}

.mcp-connect-modal__field {
    display: flex;
    align-items: stretch;
    min-height: 36px;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    overflow: hidden;
}

body.dark-mode .mcp-connect-modal__field {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.mcp-connect-modal__input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-family: inherit;
    color: #364153;
    outline: none;
}

body.dark-mode .mcp-connect-modal__input {
    color: var(--text-primary);
}

.mcp-connect-dropdown .mcp-connect-modal__copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px !important;
    border: none !important;
    border-left: 1px solid #e2e5ea !important;
    background: transparent !important;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    color: #6b7280 !important;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-modal__copy-btn {
    border-left-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.mcp-connect-dropdown .mcp-connect-modal__copy-btn:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    color: #364153 !important;
}

.mcp-connect-dropdown .mcp-connect-modal__copy-btn.is-copied {
    color: #2563eb !important;
    pointer-events: none;
}

.mcp-connect-modal__copy-icon,
.mcp-connect-modal__copy-check {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.mcp-connect-modal__note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #9ca3af;
}

.mcp-connect-modal__note-icon {
    flex-shrink: 0;
    margin-top: 1px;
    line-height: 0;
}

.mcp-connect-modal__note-icon img {
    display: block;
    width: 15px;
    height: 28px;
}

.mcp-connect-dropdown .mcp-connect-modal__doc-link {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #4b5563 !important;
    text-align: center;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-modal__doc-link:hover {
    color: #364153 !important;
}

.mcp-connect-dropdown .mcp-connect-modal__test-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 8px;
    background: #ffffff !important;
    color: var(--primary-color) !important;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-modal__test-btn:hover {
    background: color-mix(in srgb, var(--primary-color) 5%, #ffffff) !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-modal__test-btn {
    background: var(--bg-secondary) !important;
}

.mcp-connect-modal__test-icon {
    display: flex;
    line-height: 0;
}

.mcp-connect-modal__test-icon img {
    display: block;
    width: 13px;
    height: 13px;
}

/* MCP connect — toolbar dropdown (Build with AI) */
.mcp-connect-dialog__title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #364153;
    line-height: 1.3;
}

body.dark-mode .mcp-connect-dialog__title {
    color: var(--text-primary);
}

.mcp-connect-dialog__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 3px;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    box-sizing: border-box;
}

body.dark-mode .mcp-connect-dialog__tabs {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.mcp-connect-dropdown .mcp-connect-dialog__tab {
    padding: 8px 10px;
    border: none !important;
    border-radius: 6px;
    background: transparent !important;
    justify-content: center;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-dialog__tab.is-active {
    background: #F6F6F6 !important;
    color: #364153;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__tab {
    color: var(--text-secondary);
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__tab.is-active {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary);
}

.mcp-connect-dialog__panel {
    padding: 14px 14px 12px;
    margin-bottom: 14px;
    background: #F6F6F6;
    border-radius: 10px;
}

body.dark-mode .mcp-connect-dialog__panel {
    background: var(--bg-tertiary);
}

.mcp-connect-dialog__step + .mcp-connect-dialog__step {
    padding-top: 16px;
}

body.dark-mode .mcp-connect-dialog__step + .mcp-connect-dialog__step {
    border-top-color: var(--border-color);
}

.mcp-connect-dialog__step-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 400;
    color: #364153;
    line-height: 1.35;
}

body.dark-mode .mcp-connect-dialog__step-title {
    color: var(--text-primary);
}

.mcp-connect-dialog__step-num {
    font-size: 12px;
    font-weight: 500;
    color: inherit;
}

.mcp-connect-dropdown .mcp-connect-dialog__info-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin: 0 0 0 2px;
    padding: 0 !important;
    border: none !important;
    border-radius: 50%;
    background: transparent !important;
    cursor: pointer;
    vertical-align: middle;
    line-height: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-dialog__info-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.mcp-connect-dropdown .mcp-connect-dialog__info-btn img {
    display: block;
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.mcp-connect-dropdown .mcp-connect-dialog__info-btn:hover img {
    opacity: 0.75;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__info-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__info-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.45;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__info-btn:hover img {
    opacity: 0.7;
}

.mcp-connect-dialog__step-text {
    margin: 0 0 10px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;
    color: #6A7282;
}

.mcp-connect-dialog__step-text--secondary {
    margin-top: -4px;
}

.mcp-connect-dialog__step-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

body.dark-mode .mcp-connect-dialog__step-text {
    color: var(--text-secondary);
}

.mcp-connect-dialog__fieldset {
    margin: 0 0 10px;
    padding: 0 10px 6px;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    background: #ffffff;
}

body.dark-mode .mcp-connect-dialog__fieldset {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.mcp-connect-dialog__legend {
    padding: 0 6px;
    margin-left: 2px;
    font-size: 10px;
    font-weight: 400;
    color: #B1B1B1;
    font-family: inherit;
    background: #F6F6F6;
}

body.dark-mode .mcp-connect-dialog__legend {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.mcp-connect-dialog__field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.mcp-connect-dialog__input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    color: #364153;
}

body.dark-mode .mcp-connect-dialog__input {
    color: var(--text-primary);
}

.mcp-connect-dialog__copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 6px 8px !important;
    border: none !important;
    border-radius: 6px !important;
    background: #F6F6F6 !important;
    color: #364153 !important;
    font-size: 12px !important;
    line-height: 1;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

/* Override .toolbar button (14px) inside Build with AI dropdown */
.mcp-connect-dropdown .mcp-connect-dialog__copy-btn {
    font-size: 12px !important;
    line-height: 1;
    height: auto;
    min-height: 0;
}

body.dark-mode .mcp-connect-dialog__copy-btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

.mcp-connect-dialog__copy-btn:hover:not(:disabled) {
    background: #e9ecef !important;
    color: #364153 !important;
}

body.dark-mode .mcp-connect-dialog__copy-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--bg-tertiary) 75%, #ffffff) !important;
    color: var(--text-primary) !important;
}

.mcp-connect-dialog__copy-btn.is-copied {
    color: #364153 !important;
    background: transparent !important;
    font-size: 12px !important;
    line-height: 1;
    font-weight: 400;
    pointer-events: none;
}

body.dark-mode .mcp-connect-dialog__copy-btn.is-copied {
    color: var(--text-primary) !important;
    background: transparent !important;
}

.mcp-connect-dialog__copy-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mcp-connect-dialog__copy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    line-height: 0;
    flex-shrink: 0;
}

.mcp-connect-dialog__copy-icon img {
    display: block;
    width: 14px;
    height: 14px;
}

body.dark-mode .mcp-connect-dialog__copy-icon img {
    filter: brightness(0) invert(0.72);
}

.mcp-connect-dialog__copy-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    line-height: 0;
    flex-shrink: 0;
    color: #364153;
}

body.dark-mode .mcp-connect-dialog__copy-check {
    color: var(--text-primary);
}

.mcp-connect-dialog__note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.45;
    color: #6A7282;
}

.mcp-connect-dialog__note-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

.mcp-connect-dialog__note-icon img {
    display: block;
    width: 14px;
    height: 14px;
}

.mcp-connect-dialog__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #364153;
    margin-top: 2px;
}

.mcp-connect-dropdown .mcp-connect-dialog__doc-link {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    color: #4b5563 !important;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-dialog__doc-link:hover {
    color: #364153 !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__doc-link {
    color: var(--text-secondary) !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__doc-link:hover {
    color: var(--text-primary) !important;
}

.mcp-connect-dropdown .mcp-connect-dialog__test-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 11px 14px !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 8px;
    background: #ffffff !important;
    color: var(--primary-color) !important;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mcp-connect-dropdown .mcp-connect-dialog__test-btn:hover:not(:disabled) {
    background: #ffe1db !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__test-btn {
    background: var(--bg-secondary) !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__test-btn:hover:not(:disabled) {
    background: #ffe1db !important;
}

.mcp-connect-dropdown .mcp-connect-dialog__test-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mcp-connect-dropdown .mcp-connect-dialog__test-btn--streaming {
    background: color-mix(in srgb, var(--primary-color) 6%, #ffffff) !important;
}

body.dark-mode .mcp-connect-dropdown .mcp-connect-dialog__test-btn--streaming {
    background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-secondary)) !important;
}

.mcp-connect-dialog__stream-stop-icon {
    font-size: 12px;
    line-height: 1;
}

.mcp-connect-dialog__test-icon {
    display: flex;
    flex-shrink: 0;
    line-height: 0;
}

.mcp-connect-dialog__test-icon img {
    display: block;
    width: 13px;
    height: 13px;
}

.mcp-connect-dialog__test-icon.is-spinning img {
    animation: mcp-connect-test-spin 1s linear infinite;
}

@keyframes mcp-connect-test-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* MCP connection status banner (after Test connection) */
.toolbar-exports-group > .mcp-connection-banner {
    position: absolute;
    top: calc(100% + 10px);
    right: -9px;
    left: auto;
    z-index: 10024;
    width: min(470px, calc(100vw - 40px));
    box-sizing: border-box;
}

.mcp-connection-banner__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: stretch;
    gap: 0;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
    font-family: 'Inter', sans-serif;
}

body.dark-mode .mcp-connection-banner__body {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.mcp-connection-banner__left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid #e8eaed;
    min-width: 0;
}

body.dark-mode .mcp-connection-banner__left {
    border-right-color: var(--border-color);
}

.mcp-connection-banner__badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.01em;
}

.mcp-connection-banner__badge--connected {
    background: #e9f5e9;
    color: #006747;
}

.mcp-connection-banner__badge--loading {
    background: #f3f4f6;
    color: #364153;
    font-weight: 400;
}

body.dark-mode .mcp-connection-banner__badge--connected {
    background: rgba(0, 103, 71, 0.18);
    color: #4ade80;
}

body.dark-mode .mcp-connection-banner__badge--loading {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.mcp-connection-banner__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #006747;
    flex-shrink: 0;
}

body.dark-mode .mcp-connection-banner__badge-dot {
    background: #4ade80;
}

.mcp-connection-banner__badge-icon {
    display: inline-flex;
    line-height: 0;
}

.mcp-connection-banner__badge-icon img {
    display: block;
    width: 12px;
    height: 12px;
}

.mcp-connection-banner__badge-icon.is-spinning img {
    animation: mcp-connect-test-spin 1s linear infinite;
}

.mcp-connection-banner__title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #364153;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

body.dark-mode .mcp-connection-banner__title {
    color: var(--text-primary);
}

.mcp-connection-banner__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding-left: 12px;
    min-width: 0;
    flex-shrink: 0;
}

.mcp-connection-banner__id-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.mcp-connection-banner__id {
    font-size: 10px;
    font-weight: 400;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #364153;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

body.dark-mode .mcp-connection-banner__id {
    color: var(--text-secondary);
}

.toolbar-exports-group button.mcp-connection-banner__copy-btn,
.mcp-connection-banner__copy-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    min-height: 0;
    margin: 0;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: #6a7282 !important;
    font-size: 0;
    line-height: 0;
    gap: 0;
    cursor: pointer;
    transform: none !important;
    filter: none !important;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.toolbar-exports-group button.mcp-connection-banner__copy-btn:hover,
.mcp-connection-banner__copy-btn:hover,
.toolbar-exports-group button.mcp-connection-banner__copy-btn:active,
.mcp-connection-banner__copy-btn:active,
.toolbar-exports-group button.mcp-connection-banner__copy-btn:focus-visible,
.mcp-connection-banner__copy-btn:focus-visible {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
}

.toolbar-exports-group button.mcp-connection-banner__copy-btn:hover,
.mcp-connection-banner__copy-btn:hover {
    opacity: 0.7;
}

.toolbar-exports-group button.mcp-connection-banner__copy-btn.is-copied,
.mcp-connection-banner__copy-btn.is-copied {
    color: #364153 !important;
    opacity: 1;
}

.mcp-connection-banner__copy-btn img,
.mcp-connection-banner__copy-btn svg {
    display: block;
    width: 14px;
    height: 14px;
}

body.dark-mode .toolbar-exports-group button.mcp-connection-banner__copy-btn,
body.dark-mode .mcp-connection-banner__copy-btn {
    color: var(--text-secondary) !important;
    background: none !important;
}

body.dark-mode .toolbar-exports-group button.mcp-connection-banner__copy-btn:hover,
body.dark-mode .mcp-connection-banner__copy-btn:hover {
    color: var(--text-primary) !important;
    background: none !important;
}

body.dark-mode .toolbar-exports-group button.mcp-connection-banner__copy-btn.is-copied,
body.dark-mode .mcp-connection-banner__copy-btn.is-copied {
    color: var(--text-primary) !important;
}

body.dark-mode .mcp-connection-banner__copy-btn img {
    filter: brightness(0) invert(0.72);
}

.mcp-connect-dropdown button.mcp-connection-banner__end-btn,
.toolbar-exports-group button.mcp-connection-banner__end-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 6px 10px !important;
    border: none !important;
    border-radius: 4px !important;
    background: #F6F6F6 !important;
    color: #6A7282 !important;
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.mcp-connection-banner__end-btn:hover {
    background: #e4e6ea !important;
}

body.dark-mode .mcp-connection-banner__end-btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

body.dark-mode .mcp-connection-banner__end-btn:hover {
    background: #3a3d45 !important;
}

/* Add node popover — anchored beside + on floating toolbar */
.add-node-popover-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.add-node-popover {
    position: absolute;
    left: calc(100% + 15px);
    top: 0;
    z-index: 10020;
    width: min(300px, calc(100vw - 380px));
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
}

.add-node-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.add-node-popover-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.add-node-popover-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.add-node-popover-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0 0 16px;
}

.add-node-popover-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.add-node-popover-info-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    background-color: #F6F6F6;
}

.add-node-popover-info-btn:hover {
    background: var(--bg-tertiary);
}

.add-node-popover-info-btn img {
    width: 20px;
    height: 20px;
    display: block;
    opacity: 1;
}

.add-node-popover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.add-node-popover-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    cursor: grab;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    /* color: var(--text-primary); */
    background: var(--bg-tertiary);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    user-select: none;
    -webkit-user-drag: element;
    box-sizing: border-box;
}

.add-node-popover-option:active {
    cursor: grabbing;
}

.add-node-popover-option:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.add-node-popover-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.add-node-popover-option-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-node-popover-option-icon-img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

.add-node-popover-option-emoji {
    font-size: 18px;
    line-height: 1;
}

.add-node-popover-option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .add-node-popover-option {
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Info buttons in Add node + Connection type popovers: no light circle in dark mode */
body.dark-mode .add-node-popover-info-btn {
    background-color: transparent;
}

body.dark-mode .add-node-popover-info-btn:hover {
    background-color: #2A2A2A;
}

body.dark-mode .add-node-popover-info-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Double-click canvas: add node menu — matches light “Add a new node” spec (flat list, slate ink) */
.add-node-at-point-menu {
    --add-node-at-point-ink: #3d4d5c;
    --add-node-at-point-ink-muted: #8b95a1;
    --add-node-at-point-surface: #ffffff;
    --add-node-at-point-border: #e8eaed;
    --add-node-at-point-divider: #e5e7eb;
    width: 180px;
    padding: 8px 0 0px;
    background: var(--add-node-at-point-surface);
    border: 1px solid var(--add-node-at-point-border);
    border-radius: 8px;
    box-shadow: 4px 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.add-node-at-point-menu__title {
    margin: 0;
    padding: 0 12px 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--add-node-at-point-ink-muted);
    line-height: 1.35;
    letter-spacing: 0.01em;
    cursor: default;
}

.add-node-at-point-menu__divider {
    height: 1px;
    background: var(--add-node-at-point-divider);
    margin: 0 10px 6px;
}

.add-node-at-point-menu__list {
    list-style: none;
    margin: 0;
    padding: 0 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.add-node-at-point-menu__item {
    margin: 0;
}

.add-node-at-point-menu__option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 3px 0px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--add-node-at-point-ink);
    background: transparent;
    transition: background-color 0.12s ease;
    box-sizing: border-box;
}

.add-node-at-point-menu__option:hover {
    background: #f4f5f7;
}

.add-node-at-point-menu__option:focus {
    outline: none;
    background: #eef0f3;
    box-shadow: inset 0 0 0 2px rgba(61, 77, 92, 0.18);
}

.add-node-at-point-menu__option-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

/* Toolbar assets are white glyphs; tint to slate line-art for this menu */
.add-node-at-point-menu__option-icon-img {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
    filter: brightness(0) saturate(100%) invert(30%) sepia(12%) saturate(720%) hue-rotate(169deg) brightness(96%) contrast(92%);
}

.add-node-at-point-menu__option-emoji {
    font-size: 20px;
    line-height: 1;
    color: var(--add-node-at-point-ink);
    opacity: 0.88;
}

.add-node-at-point-menu__option-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.add-node-at-point-menu__option--active {
    background: #eef0f3;
}

.add-node-at-point-menu__footer {
    padding: 6px 10px 10px;
}

.add-node-at-point-menu__delete-btn {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--add-node-at-point-ink);
    background: #e8ecf0;
    transition: background-color 0.12s ease;
    box-sizing: border-box;
}

.add-node-at-point-menu__delete-btn:hover {
    background: #dde2e8;
}

.add-node-at-point-menu__delete-btn:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(61, 77, 92, 0.18);
}

body.dark-mode .add-node-at-point-menu {
    --add-node-at-point-ink: #c9d1d9;
    --add-node-at-point-ink-muted: #8a939e;
    --add-node-at-point-surface: #2b2f36;
    --add-node-at-point-border: #3d424b;
    --add-node-at-point-divider: #3d424b;
    box-shadow: 4px 12px 32px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.25);
}

body.dark-mode .add-node-at-point-menu__option:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .add-node-at-point-menu__option:focus {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 2px rgba(201, 209, 217, 0.25);
}

body.dark-mode .add-node-at-point-menu__option-icon-img {
    filter: brightness(0) saturate(100%) invert(88%) sepia(5%) saturate(280%) hue-rotate(169deg) brightness(96%) contrast(88%);
}

body.dark-mode .add-node-at-point-menu__option--active {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .add-node-at-point-menu__delete-btn {
    background: #3d424b;
    color: #e6edf3;
}

body.dark-mode .add-node-at-point-menu__delete-btn:hover {
    background: #4a5059;
    color: #f0f3f6;
}

body.dark-mode .add-node-at-point-menu__delete-btn:focus {
    box-shadow: inset 0 0 0 2px rgba(201, 209, 217, 0.25);
}

/* Blueprint information popover — anchored to floating info button */
.blueprint-info-popover-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.blueprint-info-popover {
    position: absolute;
    left: calc(100% + 15px);
    top: 0;
    z-index: 10020;
    width: min(250px, calc(100vw - 410px));
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.blueprint-info-popover-title-wrap {
    padding: 16px 16px 12px;
}

.blueprint-info-popover-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #2C323F;
    line-height: 1.2;
}

.blueprint-info-popover-body {
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blueprint-info-row {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    column-gap: 10px;
}

.blueprint-info-row-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.blueprint-info-row-label {
    font-size: 14px;
    font-weight: 500;
    color: #2C323F;
}

.blueprint-info-row-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #F05E3E;
}

.blueprint-info-popover-footer {
    padding: 12px 16px 16px 16px;
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: #878787;
    flex-wrap: wrap;
}

.blueprint-info-popover-footer-brand {
    font-family: 'Filson Pro', 'Filson Soft', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.dark-mode .blueprint-info-row-icon {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

body.dark-mode .blueprint-info-popover {
    background: #23262d;
    border-color: #3a3d45;
}

body.dark-mode .blueprint-info-popover-title {
    color: #E5E7EB;
}

body.dark-mode .blueprint-info-row-label {
    color: #D1D5DB;
}

body.dark-mode .blueprint-info-popover-title-wrap,
body.dark-mode .blueprint-info-popover-footer {
    border-color: #4B5563;
}

body.dark-mode .blueprint-info-popover-footer {
    color: #9CA3AF;
}

/* Connection type popover — anchored to floating connection button */
.connection-type-popover-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.connection-type-clear-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #FFFFFF;
    color: #364153;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10021;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.connection-type-clear-btn:hover {
    filter: brightness(1.08);
}

body.dark-mode .connection-type-clear-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

body.dark-mode .connection-type-clear-btn:hover {
    filter: brightness(1.15);
}

.connection-toolbar-icon {
    --connection-icon-color: #364153;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.connection-toolbar-icon-line {
    width: 6px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--connection-icon-color);
    margin-left: -0.5px;
    margin-right: -0.5px;
    margin-top: -0.5px;
}

.connection-toolbar-icon-dot {
    border-radius: 50%;
    border: 1.5px solid var(--connection-icon-color);
    background: transparent;
    box-sizing: border-box;
}

.connection-toolbar-icon-dot--left {
    width: 7px;
    height: 7px;
}

.connection-toolbar-icon-dot--right {
    width: 7px;
    height: 7px;
    background: var(--connection-icon-color);
}

.connection-type-popover {
    position: absolute;
    left: calc(100% + 15px);
    bottom: -240px;
    z-index: 10020;
    width: min(300px, calc(100vw - 410px));
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.connection-type-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 16px 12px 16px;
    /* border-bottom: 1px solid var(--border-color); */
}

.connection-type-popover-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.connection-type-popover-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.connection-type-popover-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.connection-type-popover-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.connection-type-popover-close:hover {
    background: var(--bg-tertiary);
}

.connection-type-popover-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px 16px 16px;
}

.connection-type-popover-item {
    width: 100%;
    border: 1px solid transparent;
    outline: 2px solid transparent;
    outline-offset: 1px;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #2C323F;
    text-align: left;
    cursor: pointer;
}

.connection-type-popover-item:hover {
    filter: brightness(0.99);
    border-color: transparent;
    outline-color: var(--hover-stroke-color, var(--primary-color));
}

.connection-type-popover-item.active {
    border-style: solid;
    border-color: transparent;
    outline-color: var(--hover-stroke-color, var(--primary-color));
}

.connection-type-popover-item.connection-type-popover-item--default:not(.active) {
    border-style: dashed;
    border-color: #98A2B3;
}

.connection-type-popover-item.connection-type-popover-item--default:not(.active):hover {
    border-color: #98A2B3;
}

.connection-type-popover-item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.connection-type-popover-item-label {
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    line-height: 1.2;
}

.connection-type-popover-item-description {
    font-size: 12px;
    color: #364153;
    line-height: 1.2;
    opacity: 0.9;
}

.connection-type-popover-item-indicator {
    flex-shrink: 0;
    display: inline-block;
}

/* Canvas settings popover — anchored to floating settings button */
.canvas-settings-popover-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-settings-popover {
    position: absolute;
    left: calc(100% + 15px);
    top: -200px;
    z-index: 10020;
    width: min(312px, calc(100vw - 410px));
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    /* One stack for the whole panel so plain text matches toggle rows (buttons use UA font unless reset). */
    font-family: Arial, Helvetica, sans-serif;
}

.canvas-settings-title-wrap {
    padding: 12px 16px;
}

.canvas-settings-title {
    margin: 0;
    color: #2C323F;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.canvas-settings-divider {
    display: block;
}

.canvas-settings-section {
    padding: 12px 16px 12px;
}

.canvas-settings-section:last-child {
    border-bottom: none;
}

.canvas-settings-label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
}

.canvas-settings-select {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: 1px solid #C8CDD6;
    background: var(--bg-secondary);
    color: #2C323F;
    font-size: 14px;
    padding: 0 38px 0 14px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("./assets/Type=ChevronDown.svg");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}

.canvas-settings-select:focus {
    border-color: var(--primary-color);
}

.canvas-settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.canvas-settings-divider {
    height: 1px;
    background: var(--border-color);
}

.canvas-settings-divider-top {
    height: 1px;
    background: var(--border-color);
    margin: 0 16px;
}

.canvas-settings-toggle-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.canvas-settings-toggle-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.canvas-settings-toggle-title {
    font-size: 14px;
    font-weight: 500;
    color: #2C323F;
    line-height: 1.2;
}

.canvas-settings-toggle-subtitle {
    font-size: 14px;
    color: #697386;
    line-height: 1.25;
}

.canvas-settings-switch {
    width: 38px;
    height: 22px;
    border-radius: 22px;
    background: #D0D4DC;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.canvas-settings-switch > span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.canvas-settings-switch.active {
    background: var(--primary-color);
}

.canvas-settings-switch.active > span {
    transform: translateX(16px);
}

body.dark-mode .canvas-settings-title,
body.dark-mode .canvas-settings-label,
body.dark-mode .canvas-settings-toggle-title {
    color: #E5E7EB;
}

body.dark-mode .canvas-settings-toggle-subtitle {
    color: #A4ACB9;
}

body.dark-mode .canvas-settings-select {
    border-color: var(--border-color);
    background-color: var(--bg-tertiary);
    color: #E5E7EB;
    background-image: url("./assets/Type=ChevronDown.svg");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}

/* Edge Context Menu */
.edge-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(0,0,0,0.1);
}

.edge-menu {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    width: 320px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideIn 0.2s ease-out;
}
.edge-menu-connection-type {
    width: 280px;
}

.edge-menu-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.edge-menu-header strong {
    font-size: 15px;
    font-weight: 600;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    width: 28px;
    height: 28px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.edge-menu-content {
    padding: 12px;
}

.edge-menu-section {
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
}

.edge-menu-section:last-child {
    margin-bottom: 0;
}

.edge-menu-label {
    font-size: 11px;
    color: var(--primary-color);
    padding: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.edge-notes-wrapper {
    position: relative;
    overflow: visible;
    display: block;
}

.edge-notes-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    transition: all 0.2s;
    background-color: #FFF8A7;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: visible;
    min-height: 80px;
    line-height: 1.4;
    margin: 0;
    display: block;
    box-sizing: border-box;
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 22px 100%, 0 calc(100% - 22px));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.edge-notes-input:focus {
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.edge-notes-input::placeholder {
    color: #666;
}

/* Bottom-left folded paper corner - back side */
.edge-notes-wrapper::before {
    content: '';
    position: absolute;
    bottom: 22px;
    left: 0px;
    width: 22px;
    height: 22px;
    background: #E8D98F;
    -webkit-clip-path: polygon(0 0, 100% 0, 0 100%);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    transform: rotate(90deg);
    -webkit-transform-origin: bottom left;
    -moz-transform-origin: bottom left;
    transform-origin: bottom left;
    z-index: 1;
    pointer-events: none;
}

/* Bottom-left folded paper corner - shadow */
.edge-notes-wrapper::after {
    content: '';
    position: absolute;
    bottom: 22px;
    left: 0px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.12);
    -webkit-clip-path: polygon(0 0, 100% 0, 0 100%);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    transform: rotate(90deg);
    -webkit-transform-origin: bottom left;
    -moz-transform-origin: bottom left;
    transform-origin: bottom left;
    z-index: 0;
    -webkit-filter: blur(2px);
    filter: blur(2px);
    pointer-events: none;
}

body.dark-mode .edge-notes-wrapper::after {
    background: rgba(0, 0, 0, 0.3);
}

.edge-menu-item {
    width: 100%;
    padding: 12px 14px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
    font-weight: 500;
}

.edge-menu-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(2px);
}

.edge-menu-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.edge-menu-item .connection-indicator {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-right: 10px;
}

.edge-menu-item.active .connection-indicator {
    background: white !important;
    opacity: 0.9;
}

.edge-menu-reconnect {
    width: 100%;
    padding: 12px 14px;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

.edge-menu-reconnect:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 233, 123, 0.4);
}

.edge-menu-delete {
    width: 100%;
    padding: 12px 14px;
    background: white;
    border: 2px solid #ffcdd2;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #d32f2f;
    font-weight: 600;
    transition: all 0.2s;
}

.edge-menu-delete:hover {
    background: #ffebee;
    border-color: #ef5350;
    transform: translateX(2px);
}

/* Node Menu Lock Button */
.node-menu-lock-btn {
    background: transparent;
    border: none;
}

.node-menu-lock-btn.locked {
    background: #FFEDE7;
    border: 1px solid #FF5C35;
}

.node-menu-lock-btn:hover:not(.locked) {
    background: var(--bg-tertiary);
}

body.dark-mode .node-menu-lock-btn.locked {
    background: rgba(255, 92, 53, 0.2);
    border: 1px solid #FF5C35;
}

body.dark-mode .node-menu-lock-icon {
    filter: brightness(0) invert(1);
}

.custom-node-locked .node-edit-icon {
    opacity: 0.45;
}

/* Node Menu Close Icon Dark Mode */
body.dark-mode .node-menu-close-icon {
    filter: brightness(0) invert(1);
}

/* Edge Menu Close Icon Dark Mode */
body.dark-mode .edge-menu-close-icon {
    filter: brightness(0) invert(1);
}

/* React Flow Custom Controls */
.react-flow__controls {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.react-flow__controls-button {
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.react-flow__controls-button:hover {
    background: #f8f9fa;
}

/* React Flow Attribution */
.react-flow__attribution {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #333 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    position: fixed !important;
    bottom: 20px !important;
    left: 370px !important;
    z-index: 1000 !important;
}

.react-flow__attribution a {
    color: #667eea !important;
    text-decoration: none !important;
}

.react-flow__attribution a:hover {
    text-decoration: underline !important;
}

body.dark-mode .react-flow__attribution {
    background: rgba(35, 38, 45, 0.9) !important;
    color: #e8eaed !important;
    border: 1px solid var(--border-color) !important;
}

body.dark-mode .react-flow__attribution a {
    color: #667eea !important;
}

/* Example blueprint quick-start toast (right of React Flow attribution) */
.example-blueprint-toast {
    position: fixed;
    left: calc(var(--sidebar-canvas-offset, 0px) + var(--canvas-left-align, 22px));
    bottom: 18px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    background: #f5f6f8;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
    width: min(380px, calc(100vw - (var(--sidebar-canvas-offset, 0px) + 40px)));
    padding: 10px;
    box-sizing: border-box;
}

.example-blueprint-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.example-blueprint-toast-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.example-blueprint-toast-icon {
    color: #3f4b5f;
    line-height: 1;
    flex-shrink: 0;
}

.example-blueprint-toast-icon img {
    width: 16px;
    height: 16px;
    display: block;
}

.example-blueprint-toast-title {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
    line-height: 1.2;
}

.example-blueprint-toast-close {
    border: none;
    background: transparent;
    color: #7c8da6;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.example-blueprint-toast-close:hover {
    color: #4b5563;
}

.example-blueprint-toast-divider {
    height: 1px;
    width: 100%;
    background: #dfe3ea;
    margin: 8px 0 10px;
}

.example-blueprint-toast-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.example-blueprint-toast-action-btn {
    width: 100%;
    border: 1px solid #e3e7ee;
    background: #ffffff;
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #55647e;
    text-align: center;
    cursor: pointer;
}

.example-blueprint-toast-action-btn:hover {
    background: #eef2f7;
    border-color: #cfd7e3;
}

body.dark-mode .example-blueprint-toast {
    background: #23262d;
    border-color: #3a3d45;
}

body.dark-mode .example-blueprint-toast-title {
    color: #e5ebf3;
}

body.dark-mode .example-blueprint-toast-close {
    color: #d0d6de;
}

body.dark-mode .example-blueprint-toast-icon img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

body.dark-mode .example-blueprint-toast-divider {
    background: #3a3d45;
}

body.dark-mode .example-blueprint-toast-action-btn {
    background: #2b2f37;
    border-color: #3a3f49;
    color: #d4dbe8;
}

body.dark-mode .example-blueprint-toast-action-btn:hover {
    background: #343945;
    border-color: #505766;
}

/* Instructions Panel */
.instructions {
    background: #f0f2ff;
    border: 1px solid #d4d9ff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.instructions strong {
    color: #667eea;
    display: block;
    margin-bottom: 4px;
}

/* Bottom navigation — two floating panels (zoom column + actions row), bottom-right */
.bottom-nav-area {
    position: absolute;
    right: 20px;
    bottom: 20px;
    left: auto;
    transform: none;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}

.bottom-nav-area > * {
    pointer-events: auto;
}

.bottom-nav-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow:
        0 4px 20px rgba(15, 23, 42, 0.1),
        0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.bottom-nav-panel--zoom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 37px;
    height: 62px;
    padding: 10px;
    box-sizing: border-box;
}

.bottom-nav-panel--actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: 62px;
    padding: 10px 12px;
    box-sizing: border-box;
}

.bottom-nav-tile-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: #F6F6F6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.bottom-nav-tile-btn:hover:not(:disabled) {
    background: #e4e6ea;
}

.bottom-nav-tile-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bottom-nav-tile-btn:disabled:hover {
    background: #f0f1f3;
}

.bottom-nav-panel--zoom .bottom-nav-tile-btn--zoom {
    flex: none;
    width: 12px;
    height: 15px;
    min-width: 21px;
    min-height: 21px;
    border-radius: 4px;
}

.bottom-nav-zoom-icon {
    width: 12px;
    height: 12px;
    display: block;
    object-fit: contain;
    filter: brightness(0);
    opacity: 0.72;
}

.bottom-nav-panel--actions .bottom-nav-tile-btn img {
    width: 21px;
    height: 21px;
    display: block;
    object-fit: contain;
    filter: brightness(0);
    opacity: 0.72;
}

.bottom-nav-panel--actions .bottom-nav-tile-btn img[src*='center-nodes'] {
    width: 24px;
    height: 24px;
}

.bottom-nav-panel--actions .bottom-nav-tile-btn img[src*='Broom'] {
    width: 21px;
    height: 21px;
}

.bottom-nav-stream-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 8px 12px;
    margin: 0;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}

.bottom-nav-stream-chip:hover {
    transform: none;
}

.bottom-nav-stream-chip:not(.streaming-active):hover {
    box-shadow: 0 2px 8px var(--shadow-color-hover, rgba(0, 0, 0, 0.08));
}

.bottom-nav-help-anchor {
    position: relative;
    z-index: 10006;
}

.bottom-nav-help-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: #1a2744;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.bottom-nav-help-btn:hover {
    background: #243552;
}

.bottom-nav-help-btn img {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

body.dark-mode .bottom-nav-panel {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);
}

body.dark-mode .bottom-nav-tile-btn {
    background: var(--bg-tertiary);
}

body.dark-mode .bottom-nav-tile-btn:hover:not(:disabled) {
    background: #3a3d45;
}

body.dark-mode .bottom-nav-tile-btn:disabled:hover {
    background: var(--bg-tertiary);
}

body.dark-mode .bottom-nav-panel--actions .bottom-nav-tile-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.88;
}

body.dark-mode .bottom-nav-panel--zoom .bottom-nav-zoom-icon {
    filter: brightness(0) invert(1);
    opacity: 0.88;
}

body.dark-mode .bottom-nav-stream-chip:not(.streaming-active) {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .bottom-nav-help-btn {
    background: #1e2a3d;
}

body.dark-mode .bottom-nav-help-btn:hover {
    background: #2a3a52;
}

/* Resize Button */
.resize-button {
    width: 42px;
    height: 42px;
    background: #F6F6F6;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.zoom-panel-button img {
    width: 12px;
    height: 12px;
}

.zoom-panel-button {
    width: 25px;
    height: 21px;
    border-radius: 6px;
}

.resize-button:hover {
    background: #E8E8E8;
}

body.dark-mode .resize-button {
    background: var(--bg-tertiary);
}

body.dark-mode .resize-button:hover {
    background: var(--bg-secondary);
}

.resize-button svg {
    width: 24px;
    height: 24px;
    color: #364153;
    stroke: #364153;
}

.resize-button img {
    width: 14px;
    height: 14px;
    filter: brightness(0);
    opacity: 1;
}

body.dark-mode .resize-button img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.resize-button.locked {
    background: #FFEDE7;
    border: 1px solid #FF5C35;
}

.resize-button.locked:hover {
    background: #FFE0D4;
}

body.dark-mode .resize-button.locked {
    background: rgba(255, 92, 53, 0.2);
    border: 1px solid #FF5C35;
}

body.dark-mode .resize-button.locked:hover {
    background: rgba(255, 92, 53, 0.3);
}

.resize-button.locked svg {
    stroke: #FF5C35;
}

body.dark-mode .resize-button.locked svg {
    stroke: #FF5C35;
}

/* Lock button icon in dark mode when not locked */
body.dark-mode .resize-button.lock-button:not(.locked) svg {
    stroke: var(--text-primary);
    opacity: 0.9;
}

/* Theme Toggle Button */
.theme-toggle-button {
    background: #281A47;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #FFFFFF;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    height: 52px;
}

.theme-toggle-button:hover {
    background: #1F1335;
}

.theme-toggle-button img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* How it Works Button */
.how-it-works-button {
    width: fit-content;
    height: 40px;
    background: #364153;
    border: none;
    border-radius: 8px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    box-sizing: border-box;
}

.how-it-works-button:hover {
    background: #4B5565;
}

.how-it-works-button svg {
    width: 16px;
    height: 16px;
    color: #FFFFFF;
    flex-shrink: 0;
    stroke: #FFFFFF;
}

/* Modal Header Layout */
.modal-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.modal-header-content {
    flex: 1;
}

.modal-header-content h2 {
    margin-top: 0;
}

.modal-header-button {
    margin-left: 20px;
    margin-top: 0;
}

/* Documentation Button */
.docs-button {
    display: inline-block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.docs-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Demo Blueprint List Items */
.demo-blueprint-item {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.demo-blueprint-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Help Dropdown Menu */
.bottom-nav-help-anchor .help-dropdown {
    right: 0;
    left: auto;
}

.help-dropdown {
    position: absolute;
    bottom: calc(100% + 12px);
    right: -12px;
    background: #F6F6F6;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 10005 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-dropdown-item {
    padding: 10px 14px;
    color: #364153;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    white-space: nowrap;
    margin: 0;
}

.help-dropdown-item:hover {
    background-color: #E5E5E5;
    color: #111827;
}

.help-dropdown-divider {
    height: 1px;
    background-color: #E5E7EB;
    margin: 2px 0;
    border: none;
    flex-shrink: 0;
}

.help-dropdown-item--logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fb2c36;
    white-space: nowrap;
}

.help-dropdown-item--logout:hover {
    background-color: rgba(251, 44, 54, 0.08);
    color: #fb2c36;
}

.help-dropdown-logout-icon {
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

body.dark-mode .help-dropdown {
    background: #23262d;
}

body.dark-mode .help-dropdown-item {
    color: #e8eaed;
}

body.dark-mode .help-dropdown-item:hover {
    background-color: #F05E3E;
    color: #FFFFFF;
}

body.dark-mode .help-dropdown-divider {
    background-color: #3a3d45;
}

body.dark-mode .help-dropdown-item--logout {
    color: #fb2c36;
}

body.dark-mode .help-dropdown-item--logout:hover {
    background-color: rgba(251, 44, 54, 0.18);
    color: #fb2c36;
}

/* Account popover (opened from floating profile icon) */
.account-popover-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.account-popover {
    position: absolute;
    left: calc(100% + 15px);
    top: -93px;
    z-index: 10025;
}

.account-modal-card {
    width: min(300px, calc(100vw - 24px));
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.account-modal-header {
    padding: 14px 16px 12px;
}

.account-modal-header h3 {
    margin: 0;
    color: #364153;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
}

.account-modal-email {
    margin: 0px 16px 12px;
    padding: 14px 14px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    color: #364153;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
}

.account-modal-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 12px 24px;
    color: #6A7282;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.account-modal-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 5px;
    accent-color: #f15e3c;
    flex: 0 0 auto;
}

.account-modal-error {
    margin: -4px 24px 14px;
    color: #b42318;
    font-size: 14px;
    font-weight: 500;
}

.account-modal-logout-btn {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 24px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fb2c36;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
    text-align: left;
}

.account-modal-logout-btn img {
    width: 18px;
    height: 18px;
}

body.dark-mode .account-modal-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

body.dark-mode .account-modal-header h3 {
    color: #e6e9ef;
}

body.dark-mode .account-modal-email {
    border-color: var(--border-color);
    color: #e6e9ef;
    background: var(--bg-tertiary);
}

body.dark-mode .account-modal-checkbox-row {
    color: #d0d6e1;
}

body.dark-mode .account-modal-logout-btn:hover {
    background: rgba(251, 44, 54, 0.18);
}

/* Top toolbar Load dropdown */
.load-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 250px;
    background: #F6F6F6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px;
    z-index: 10020;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.load-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #364153;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    margin: 0;
    /* Override generic .toolbar button styling inside the toolbar */
    background: transparent !important;
    border: none !important;
    transform: none !important;
    filter: none !important;
}

.load-dropdown-item:hover {
    background: #E5E5E5 !important;
    color: #111827;
}

.load-dropdown-item--static {
    cursor: default;
}

.load-dropdown-item--static:hover {
    background: transparent !important;
    color: #364153;
}

.load-dropdown-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.load-dropdown-item:disabled:hover {
    background: transparent !important;
    color: #364153;
}

.load-dropdown-item img {
    filter: none;
    opacity: 1;
    flex-shrink: 0;
}

/* Ensure clipboard icon in light mode matches other icons */
.load-dropdown-item img[src*="clipboard.svg"] {
    filter: brightness(0) saturate(100%) invert(25%) sepia(6%) saturate(900%) hue-rotate(190deg) brightness(92%) contrast(90%);
}

.load-dropdown-item span {
    flex: 1;
    display: inline-block;
    color: #364153;
}

/* Dark mode text alignment with menu colors */
body.dark-mode .load-dropdown-item span {
    color: #e5e7eb;
}

.load-dropdown-divider {
    height: 1px;
    background-color: #E5E7EB;
    margin: 2px 0;
    border: none;
    flex-shrink: 0;
}

body.dark-mode .load-dropdown-menu {
    /* Preserve original dark dropdown background */
    background: #23262d;
}

body.dark-mode .load-dropdown-item {
    color: #e8eaed;
}

body.dark-mode .load-dropdown-item:hover {
    /* Preserve original dark hover color */
    background: #F05E3E !important;
    color: #FFFFFF;
}

body.dark-mode .load-dropdown-item--static:hover {
    background: transparent !important;
    color: #e8eaed;
}

body.dark-mode .load-dropdown-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.dark-mode .load-dropdown-item:disabled:hover {
    background: transparent !important;
    color: #e8eaed;
}

body.dark-mode .load-dropdown-divider {
    /* Preserve original dark divider color */
    background-color: #3a3d45;
}

body.dark-mode .load-dropdown-item img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Report bug modal — anchored above bottom toolbar */
.bug-report-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 100100;
    pointer-events: auto;
    box-sizing: border-box;
}

.bug-report-card {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: min(396px, calc(100vw - 24px));
    max-height: min(80vh, calc(100vh - 130px));
    overflow-y: auto;
    background: #F6F6F6;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 14px;
    box-sizing: border-box;
    z-index: 100101;
    pointer-events: auto;
}

.bug-report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.bug-report-title {
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 2px;
    line-height: 1.15;
}

.bug-report-subtitle {
    margin-top: 8px;
    font-size: 12px;
    color: #585858;
    line-height: 1.35;
}

.bug-report-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    margin: -3px -2px 0 0;
}

.bug-report-close:hover {
    color: #374151;
}

.bug-report-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 10px 0 8px;
}

.bug-report-section {
    margin-top: 12px;
}

.bug-report-section-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px;
    color: #000000;
}

.bug-report-required {
    color: #F15E3C;
}

.bug-report-helper-text {
    margin: -2px 0 8px;
    font-size: 13px;
    color: #585858;
}

.bug-report-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 10px 0 5px;
}

.bug-report-input,
.bug-report-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #D9D9D9;
    border-radius: 6px;
    background: #FFFFFF;
    color: #111827;
    font-size: 14px;
    font-family: inherit;
}

.bug-report-input {
    height: 36px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.bug-report-input--other {
    margin-top: 8px;
    margin-bottom: 2px;
}

.bug-report-textarea {
    min-height: 86px;
    resize: vertical;
    padding: 8px 10px;
}

.bug-report-input:focus,
.bug-report-textarea:focus {
    outline: none;
    border-color: #F15E3C;
    box-shadow: 0 0 0 2px rgba(240, 90, 62, 0.12);
}

.bug-report-input::placeholder,
.bug-report-textarea::placeholder {
    color: #9ca3af;
}

.bug-report-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.bug-report-chip {
    border: 1px solid #d1d5db;
    background: #FFFFFF;
    color: #111827;
    font-size: 14px;
    border-radius: 6px;
    height: 36px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bug-report-chip:hover:not(.bug-report-chip--selected) {
    border-color: #F15E3C;
    box-shadow: 0 0 0 1px #F15E3C;
}

.bug-report-chip--selected {
    background: #F15E3C;
    border-color: #F15E3C;
    color: #FFFFFF;
}

.bug-report-file-input {
    display: none;
}

.bug-report-upload-row {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.bug-report-upload-row--success {
    border: 1px solid #0A896B;
    background: #F0FDFA;
}

.bug-report-upload-row--error {
    border: 1px solid #EB2027;
    background: #FFFFFF;
}

.bug-report-upload-file {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.bug-report-upload-name {
    font-size: 10px;
    font-weight: 500;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bug-report-upload-size {
    font-size: 14px;
    color: #A1A1AA;
    flex-shrink: 0;
}

.bug-report-upload-file--error {
    color: #BA0000;
    font-size: 14px;
    font-weight: 500;
}

.bug-report-upload-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.bug-report-upload-link {
    border: none;
    background: none;
    color: #585858;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.bug-report-upload-link:hover {
    text-decoration: underline;
}

.bug-report-upload-link--error {
    color: #111827;
    font-weight: 600;
}

.bug-report-upload-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0A896B;
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.bug-report-upload-close {
    border: none;
    background: none;
    color: #111827;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.bug-report-dropzone {
    margin-top: 4px;
    width: 100%;
    min-height: 136px;
    border: 1px dashed #D9D9D9;
    border-radius: 0;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    padding: 16px;
}

.bug-report-dropzone:hover {
    border-color: #F15E3C;
    background: #FFF8F5;
}

.bug-report-dropzone-icon {
    width: 18px;
    height: 18px;
    display: block;
    margin-bottom: 4px;
    object-fit: contain;
}

.bug-report-dropzone-title {
    font-size: 12px;
    font-weight: 500;
    color: #585858;
    line-height: 1;
}

.bug-report-dropzone-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #585858;
    line-height: 1;
}

.bug-report-dropzone-limit {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 400;
    color: #585858;
}

.bug-report-error {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #c53030;
}

.bug-report-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 8px;
}

.bug-report-cancel,
.bug-report-submit {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
}

.bug-report-cancel {
    background: transparent;
    color: #F15E3C;
    border: 1px solid #F15E3C;
}

.bug-report-cancel:hover {
    background: #fff5f0;
}

.bug-report-submit {
    background: #F15E3C;
    color: #FFFFFF;
    border: 1px solid #F15E3C;
}

.bug-report-submit:hover:not(:disabled) {
    background: #F15E3C;
}

.bug-report-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bug-report-success {
    padding: 6px 2px 0;
}

body.dark-mode .bug-report-card {
    background: #2d3139;
    border-color: #4b5563;
}

body.dark-mode .bug-report-title,
body.dark-mode .bug-report-section-title,
body.dark-mode .bug-report-label {
    color: #f3f4f6;
}

body.dark-mode .bug-report-subtitle,
body.dark-mode .bug-report-helper-text {
    color: #d1d5db;
}

body.dark-mode .bug-report-divider {
    background: #4b5563;
}

body.dark-mode .bug-report-input,
body.dark-mode .bug-report-textarea,
body.dark-mode .bug-report-chip {
    background: #1f2329;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .bug-report-chip:hover:not(.bug-report-chip--selected) {
    background: #3d2a24;
}

body.dark-mode .bug-report-cancel:hover {
    background: rgba(240, 90, 62, 0.15);
}

body.dark-mode .bug-report-upload-row--success {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

body.dark-mode .bug-report-upload-row--error {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

body.dark-mode .bug-report-upload-name,
body.dark-mode .bug-report-upload-file--error,
body.dark-mode .bug-report-upload-link,
body.dark-mode .bug-report-upload-link--error,
body.dark-mode .bug-report-upload-close,
body.dark-mode .bug-report-dropzone-title,
body.dark-mode .bug-report-dropzone-subtitle {
    color: #f3f4f6;
}

body.dark-mode .bug-report-upload-size,
body.dark-mode .bug-report-dropzone-limit {
    color: #d1d5db;
}

body.dark-mode .bug-report-dropzone {
    background: #1f2329;
    border-color: #4b5563;
}

body.dark-mode .bug-report-dropzone:hover {
    background: #2a2020;
    border-color: #F15E3C;
}

/* Submit feedback survey — no dimming; canvas stays fully visible */
.feedback-survey-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 100100;
    pointer-events: none;
    box-sizing: border-box;
}

.feedback-survey-card {
    position: fixed;
    right: 20px;
    /* Above bottom nav (bottom:20px, ~62px bar) + margin */
    bottom: 90px;
    left: auto;
    width: min(380px, calc(100vw - 24px));
    max-height: min(78vh, calc(100vh - 130px));
    overflow-y: auto;
    background: #F6F6F6;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 12px 14px 12px;
    box-sizing: border-box;
    z-index: 100101;
    pointer-events: auto;
}

.feedback-survey-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.feedback-survey-progress {
    font-size: 10px;
    color: #585858;
    font-weight: 500;
}

.feedback-survey-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    margin: -4px -4px 0 0;
}

.feedback-survey-close:hover {
    color: #374151;
}

.feedback-survey-close--thanks {
    position: absolute;
    top: 10px;
    right: 10px;
}

.feedback-survey-question {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 8px;
    line-height: 1.35;
}

.feedback-survey-required {
    color: #F05A3E;
    font-weight: 700;
}

.feedback-survey-scale {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.feedback-survey-num {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.feedback-survey-num:hover:not(.feedback-survey-num--selected) {
    background: #fff5f0;
    border-color: #F05A3E;
    box-shadow: 0 0 0 1px #F05A3E;
}

.feedback-survey-num--selected {
    background: #F05A3E;
    border-color: #F05A3E;
    color: #fff;
}

.feedback-survey-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #585858;
}

.feedback-survey-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 64px;
    margin-bottom: 0;
}

.feedback-survey-textarea::placeholder {
    color: #9ca3af;
}

.feedback-survey-textarea:focus {
    outline: none;
    border-color: #F05A3E;
    box-shadow: 0 0 0 2px rgba(240, 90, 62, 0.15);
}

.feedback-survey-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0 8px;
}

.feedback-survey-error {
    font-size: 12px;
    color: #c53030;
    margin: 0 0 8px;
    text-align: center;
    line-height: 1.35;
}

.feedback-survey-footer {
    display: flex;
    justify-content: center;
}

.feedback-survey-next {
    background: #F05A3E;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    width: fit-content;
    box-sizing: border-box;
}

.feedback-survey-next:hover:not(:disabled) {
    background: #e04a30;
}

.feedback-survey-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.feedback-survey-thanks {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 4px 4px 0;
    position: relative;
}

.feedback-survey-check {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 6px;
    margin-top: 16px;
}

.feedback-survey-thanks-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 2px;
}

.feedback-survey-thanks-text {
    font-size: 14px;
    color: #585858;
    margin: 0 0 10px;
    font-weight: 400;
}

.feedback-survey-thanks .feedback-survey-next {
    margin-top: 16px;
    align-self: center;
    margin-left: auto;
    margin-right: auto;
}

body.dark-mode .feedback-survey-card {
    background: #2d3139;
}

body.dark-mode .feedback-survey-progress {
    font-size: 10px;
    color: #9ca3af;
}

body.dark-mode .feedback-survey-scale-labels {
    color: #9ca3af;
}

body.dark-mode .feedback-survey-question,
body.dark-mode .feedback-survey-thanks-title {
    color: #f3f4f6;
}

body.dark-mode .feedback-survey-thanks-text {
    color: #d1d5db;
}

body.dark-mode .feedback-survey-num {
    background: #1f2329;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .feedback-survey-num:hover:not(.feedback-survey-num--selected) {
    background: #3d2a24;
    border-color: #c45c45;
}

body.dark-mode .feedback-survey-textarea {
    background: #1f2329;
    border-color: #4b5563;
    color: #f3f4f6;
}

body.dark-mode .feedback-survey-divider {
    background: #4b5563;
}

/* Auth routes — shared shell (signup + signin) */
.auth-route-page {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: block;
    background: #ffffff;
    color: #2c323f;
}

.auth-route-main {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.auth-route-main--split {
    padding: 0;
}

.auth-route-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #ffffff;
    overflow: hidden;
}

.auth-route-shell-left {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 30px 42px 24px;
}

.auth-route-brand {
    display: flex;
    align-items: center;
    min-height: 36px;
}

.auth-route-brand img {
    width: 188px;
    height: auto;
    display: block;
}

.auth-route-shell-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 0;
}

.auth-route-shell-right {
    border-left: 1px solid #e5e7eb;
    background-color: #f5f3f0;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.auth-route-shell-demo-frame {
    border: 0;
    width: 110vh;
    height: 107vh;
    display: block;
    transform: scale(0.95);
}

.auth-route-card {
    width: 80%;
    background: #FFFFFF;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 0 22px;
}

.auth-route-card h1 {
    margin: 0 0 8px;
    text-align: center;
    color: #252525;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.1;
}

.auth-route-card > h1 + form {
    margin-top: 20px;
}

.auth-route-subtitle {
    margin: 0 0 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #6a7282;
}

.auth-route-subtitle[role='alert'] a {
    text-decoration: none;
    font-weight: 500;
    color: #c0392b;
}

.auth-route-subtitle[role='alert'] a:hover {
    text-decoration: underline;
}

.auth-route-card form > label:first-of-type,
.auth-route-card form label[for='signup-email'],
.auth-route-card form label[for='signin-email'] {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6A7282;
    font-weight: 500;
}

.auth-route-card input[type="email"] {
    width: 100%;
    height: 40px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    background: #FFFFFF;
    color: #374151;
    font-size: 12px;
    padding: 0 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.auth-route-card input[type="email"]::placeholder {
    color: #878787;
    font-size: 12px;
    font-weight: 400;
}

.auth-route-card input[type="email"]:focus {
    outline: none;
    border-color: #364153;
    box-shadow: none;
}

.auth-route-checkbox-row {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #364153 !important;
    line-height: 1.35;
}

.auth-route-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex: 0 0 auto;
    accent-color: #f05e3e;
}

.auth-route-checkbox-row a {
    color: #364153;
    text-decoration: none;
    font-weight: 600;
}

.auth-route-checkbox-row--required {
    margin-bottom: 24px !important;
}

.auth-required-indicator {
    color: #f15e3c;
    font-weight: 700;
}

/* Signup — primary submit */
.auth-submit-primary {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 4px;
    background: #F15E3C;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.auth-submit-primary:hover:not(:disabled) {
    opacity: 0.94;
}

.auth-submit-primary:disabled {
    background: #E5E5E5;
    color: #FFFFFF;
    cursor: not-allowed;
    opacity: 1;
}

.auth-submit-primary.auth-submit-primary--loading,
.auth-submit-primary.auth-submit-primary--loading:disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffeae5;
    border: 1px solid #f15e3c;
    color: transparent;
    cursor: wait;
    opacity: 1;
}

.auth-submit-primary-icon {
    display: block;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* Signin — magic link button */
.auth-magic-link-btn {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 4px;
    background: #f15e3c;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.auth-magic-link-btn:hover:not(:disabled) {
    opacity: 0.94;
}

.auth-magic-link-btn:disabled {
    background: #e5e5e5;
    border: none;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 1;
}

.auth-magic-link-btn-icon {
    display: block;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.auth-magic-link-btn.auth-magic-link-btn--loading,
.auth-magic-link-btn.auth-magic-link-btn--loading:disabled {
    display: flex;
    background: #ffeae5;
    border: 1px solid #f15e3c;
    color: transparent;
    cursor: wait;
    opacity: 1;
}

.auth-magic-link-btn--loading .auth-submit-spinner-dash {
    background: #e04a2c;
}

.auth-route-switch {
    text-align: center;
    margin: 34px 0 0;
    font-size: 14px;
    color: #6A7282;
    font-weight: 500;
}

.auth-route-switch a {
    color: #F15E3C;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.auth-route-footer {
    margin-top: auto;
    padding-top: 8px;
    width: 100%;
    text-align: center;
    color: #6A7282;
    font-size: 10px;
    line-height: 1.4;
    font-weight: 400;
}

.auth-route-footer a {
    color: inherit;
    text-decoration: underline;
}

.auth-route-footer-inner--minimal .auth-route-footer-sep::before {
    content: ' · ';
}

@media (max-width: 1024px) {
    .auth-route-main--split {
        padding: 0;
    }

    .auth-route-shell {
        width: 100%;
        min-height: 100vh;
        grid-template-columns: 1fr;
    }

    .auth-route-shell-right {
        display: none;
    }

    .auth-route-shell-left {
        padding: 24px 26px 18px;
    }

    .auth-route-brand {
        justify-content: center;
    }
}

/* Shared submit spinner */
.auth-submit-spinner {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    animation: auth-submit-spinner-rotate 0.75s linear infinite;
}

@keyframes auth-submit-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.auth-submit-spinner-dash {
    position: absolute;
    left: 11px;
    top: 2px;
    width: 2px;
    height: 8px;
    border-radius: 1px;
    background: #e04a2c;
    transform-origin: 1px 10px;
}

/* Auth — check email (success) */
.auth-route-card--success {
    text-align: center;
    padding: 32px 40px 32px;
    border-radius: 8px;
    background: #FFFFFF;
}

.auth-success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
}

.auth-success-sparkle-img {
    display: block;
    width: 28px;
    height: 28px;
}

.auth-route-card--success .auth-success-heading {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    color: #252525;
}

.auth-success-lead {
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    color: #6A7282;
}

.auth-success-email {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    color: #6A7282;
}

.auth-email-sent-change-email-wrap {
    margin-top: 14px;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    color: #6a7282;
}

.auth-email-sent-change-email-prefix {
    font-size: 14px;
    font-weight: 400;
    color: #6a7282;
}

button.auth-email-sent-change-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #f15e3c;
    cursor: pointer;
    text-decoration: none;
}

button.auth-email-sent-change-email:hover {
    text-decoration: underline;
}

.auth-email-sent-resend-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 0.35em;
    row-gap: 4px;
    margin: 14px 0 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    color: #6a7282;
}

.auth-email-sent-resend-prefix {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: #6a7282;
}

button.auth-email-sent-resend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #f15e3c;
    cursor: pointer;
    text-decoration: none;
    vertical-align: baseline;
}

.auth-email-sent-resend-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.45;
}

.auth-email-sent-resend-status-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

button.auth-email-sent-resend:hover:not(:disabled) {
    text-decoration: underline;
}

button.auth-email-sent-resend:disabled {
    cursor: not-allowed;
}

button.auth-email-sent-resend.auth-email-sent-resend--muted {
    color: #9ca3af;
    text-decoration: none;
}

button.auth-email-sent-resend.auth-email-sent-resend--muted:hover {
    text-decoration: none;
}

.auth-email-sent-resend-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    line-height: 0;
}

.auth-email-sent-resend-spinner .auth-submit-spinner {
    width: 14px;
    height: 14px;
    animation: auth-submit-spinner-rotate 0.75s linear infinite;
}

.auth-email-sent-resend-spinner .auth-submit-spinner-dash {
    left: 6px;
    top: 1px;
    width: 2px;
    height: 5px;
    transform-origin: 1px 6px;
}

.auth-email-sent-resend-error {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #c0392b;
}

.auth-magic-link-notice__title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
    color: #1f2937;
}

.auth-magic-link-notice__body {
    margin: 0 auto 12px;
    max-width: 28rem;
}

.auth-magic-link-notice__footer-link {
    margin: 22px 0 0;
    text-align: center;
}

/* Signin magic-link success — check your inbox */
.auth-route-card--success--signin {
    border-radius: 14px;
    padding: 40px 36px 36px;
}

.auth-route-card--success--signin .auth-success-icon {
    margin-bottom: 0;
}

.auth-route-card--success--signin .auth-success-heading {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 500;
    color: #364153;
}

.auth-route-card--success--signin .auth-success-lead {
    max-width: 22rem;
    margin: 0 auto 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #6a7282;
}

.auth-route-card--success--signin .auth-success-email {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #364153;
}

.auth-route-card--onboarding {
    position: relative;
    max-width: 520px;
    width: min(520px, calc(100vw - 44px));
}

.auth-route-card--onboarding.auth-route-card--onboarding-goal-other {
    padding-top: 0;
}

.auth-route-card--onboarding.auth-route-card--onboarding-goal-other .auth-onboarding-back-icon {
    top: 0;
}

.auth-route-card--onboarding .auth-onboarding-back-icon {
    position: absolute;
    top: 14px;
    left: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-route-card--onboarding .auth-onboarding-back-icon:hover:not(:disabled) {
    background: #f3f4f6;
    color: #111827;
}

.auth-route-card--onboarding .auth-onboarding-readonly-input {
    background: #eceff3 !important;
    border-color: #d5dbe4 !important;
    color: #8a94a6 !important;
    cursor: not-allowed;
    opacity: 1;
    -webkit-text-fill-color: #8a94a6;
}

body.dark-mode .auth-route-card--onboarding .auth-onboarding-readonly-input {
    background: #252b38 !important;
    border-color: #3a4254 !important;
    color: #8e99ad !important;
    -webkit-text-fill-color: #8e99ad;
}

.auth-route-card--onboarding .auth-onboarding-back-icon:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-route-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.auth-route-card--onboarding form {
    margin-top: 20px;
}

.auth-route-card--onboarding .auth-route-subtitle {
    margin-bottom: 18px;
}

.auth-onboarding-field {
    margin-bottom: 14px;
}

.auth-onboarding-field label {
    display: block;
    margin: 0 0 6px;
    color: #6a7282;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
}

.auth-route-card--onboarding input[type="text"],
.auth-route-card--onboarding select {
    width: 100%;
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    padding: 0 14px;
    box-sizing: border-box;
}

.auth-route-card--onboarding input[type="text"]::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

.auth-route-card--onboarding select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%236B7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.auth-route-card--onboarding input[type="text"]:focus,
.auth-route-card--onboarding select:focus {
    outline: none;
    border-color: #9ca3af;
}

/* Onboarding goal: custom combobox opens above the field (matches design) */
.auth-onboarding-field--goal {
    position: relative;
    z-index: 1;
}

.auth-onboarding-field--goal-open {
    z-index: 50;
}

.auth-goal-dropdown {
    position: relative;
}

.auth-goal-dropdown__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    padding: 0 14px;
    box-sizing: border-box;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    line-height: 1.25;
    transition: border-color 0.15s ease;
}

.auth-goal-dropdown__trigger:hover {
    border-color: #c4c9d0;
}

.auth-goal-dropdown__trigger:focus {
    outline: none;
    border-color: #9ca3af;
}

.auth-goal-dropdown__trigger--open {
    border-color: #9ca3af;
}

.auth-goal-dropdown__trigger-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.auth-goal-dropdown__trigger-text--placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.auth-goal-dropdown__chevron {
    flex-shrink: 0;
    display: flex;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.auth-goal-dropdown__trigger--open .auth-goal-dropdown__chevron {
    transform: rotate(180deg);
}

.auth-goal-dropdown__menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    margin: 0;
    padding: 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12), 0 4px 16px rgba(15, 23, 42, 0.08);
    max-height: min(52vh, 320px);
    overflow-y: auto;
    z-index: 1;
}

.auth-goal-dropdown__item {
    margin: 0;
}

.auth-goal-dropdown__option {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid #eceef1;
    background: transparent;
    color: #6a7282;
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.12s ease, color 0.12s ease;
}

.auth-goal-dropdown__item:last-child .auth-goal-dropdown__option {
    border-bottom: none;
}

.auth-goal-dropdown__option:hover,
.auth-goal-dropdown__option:focus-visible {
    background: rgba(241, 94, 60, 0.2);
    color: #f15e3c;
    outline: none;
}

.auth-goal-dropdown__option[aria-selected='true'] {
    background: rgba(241, 94, 60, 0.2);
    color: #f15e3c;
    font-weight: 500;
}

.auth-onboarding-divider {
    width: 100%;
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0 20px;
}

.auth-route-card--onboarding .auth-submit-primary {
    height: 46px;
}

@media (max-width: 640px) {
    .auth-route-inline-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Session expiry warning — anchored under top-right toolbar (.toolbar-right top: 20px, right: 20px) */
.appmap-session-expiry-overlay {
    position: fixed;
    inset: 0;
    z-index: 100045;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    /* toolbar top + vertical padding + button row (~44px) + bottom padding + gap */
    padding: calc(20px + 8px + 44px + 8px + 10px) 20px 20px 20px;
    background: transparent;
    pointer-events: none;
}

.appmap-session-expiry-modal {
    width: 100%;
    max-width: 300px;
    height: 125px;
    margin: 0;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    pointer-events: auto;
}

.appmap-session-expiry-modal__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.appmap-session-expiry-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.appmap-session-expiry-modal__icon-img {
    filter: none;
}

.appmap-session-expiry-modal__copy {
    min-width: 0;
}

.appmap-session-expiry-modal__eyebrow {
    margin: 0;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
    color: #364153;
}

.appmap-session-expiry-modal__close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    margin: -4px -4px 0 0;
    align-self: flex-start;
    justify-self: end;
}

.appmap-session-expiry-modal__close:hover {
    color: #374151;
}

.appmap-session-expiry-modal__title {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    color: #364153;
}

.appmap-session-expiry-modal__actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: stretch;
}

.appmap-session-expiry-modal__btn {
    flex: 1 1 0;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.appmap-session-expiry-modal__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.appmap-session-expiry-modal__btn--outline {
    border: 2px solid #F15E3C;
    background: #ffffff;
    color: #F15E3C;
}

.appmap-session-expiry-modal__btn--outline:hover:not(:disabled) {
    opacity: 0.92;
}

.appmap-session-expiry-modal__btn--primary {
    border: 2px solid #F15E3C;
    background: #F15E3C;
    color: #ffffff;
}

.appmap-session-expiry-modal__btn--primary:hover:not(:disabled) {
    opacity: 0.94;
}

body.dark-mode .appmap-session-expiry-modal {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .appmap-session-expiry-modal__header {
    border-bottom-color: var(--border-color);
}

body.dark-mode .appmap-session-expiry-modal__eyebrow {
    color: #cbd5e1;
}

body.dark-mode .appmap-session-expiry-modal__title {
    color: var(--text-primary);
}

body.dark-mode .appmap-session-expiry-modal__icon-img {
    filter: brightness(0) invert(1);
}

body.dark-mode .appmap-session-expiry-modal__close {
    color: #94a3b8;
}

body.dark-mode .appmap-session-expiry-modal__close:hover {
    color: #e2e8f0;
}

body.dark-mode .appmap-session-expiry-modal__btn--outline {
    background: rgba(255, 255, 255, 0.08);
    border-color: #f15e3c;
    color: #f15e3c;
}

body.dark-mode .appmap-session-expiry-modal__btn--outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

/* ============================================
   Live Blueprint Streaming Styles
   ============================================ */

/* Stream button in bottom navigation — matches bottom-nav tiles + primary accent */
.stream-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: #f6f6f6;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
}

.stream-button__icon {
    line-height: 1;
    font-size: 12px;
}

.stream-button:hover {
    background: #e4e6ea;
}

.stream-button.streaming-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    animation: stream-button-pulse 2s ease-in-out infinite;
}

.bottom-nav-area .bottom-nav-stream-chip.stream-button:hover {
    transform: none;
}

.bottom-nav-area .bottom-nav-stream-chip.stream-button.streaming-active:hover {
    background: var(--primary-color);
    filter: brightness(1.05);
}

@keyframes stream-button-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-color) 35%, transparent);
    }
    50% {
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary-color) 0%, transparent);
    }
}

body.dark-mode .stream-button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.dark-mode .stream-button:hover {
    background: #3a3d45;
}

body.dark-mode .stream-button.streaming-active,
body.dark-mode .stream-button.streaming-active:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* Fade-in animation for streamed nodes */
@keyframes streamingNodeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.streaming-node-fade-in {
    animation: streamingNodeFadeIn 0.6s ease-out forwards;
}

/* Stream status indicator */
.stream-status {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(15, 23, 42, 0.06);
    z-index: 1000;
    pointer-events: none;
    animation: slideDown 0.3s ease-out;
}

body.dark-mode .stream-status {
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.stream-status__counts {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Session ID display for debugging */
.stream-session-id {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Stream Session Info Panel */
.stream-session-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    max-width: 400px;
    z-index: 1000;
    color: var(--text-secondary);
    font-size: 13px;
}

.stream-session-panel__header {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.stream-session-panel__content {
    padding: 16px;
}

.stream-session-panel__label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stream-session-panel__id-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 16px;
}

.stream-session-panel__id {
    flex: 1;
    min-width: 0;
    background: #f6f6f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    word-break: break-all;
    color: #364153;
    border: 1px solid #e5e7eb;
}

.stream-session-panel__copy-btn {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    transition: filter 0.15s ease, background 0.15s ease;
}

.stream-session-panel__copy-btn:hover {
    filter: brightness(1.08);
}

.stream-session-panel__copy-btn:active {
    filter: brightness(0.95);
}

.stream-session-panel__instructions {
    background: color-mix(in srgb, var(--primary-color) 6%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--primary-color) 18%, #ffffff);
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.stream-session-panel__instructions strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.stream-session-panel__instructions ol {
    margin: 0;
    padding-left: 20px;
}

.stream-session-panel__instructions li {
    margin-bottom: 6px;
}

.stream-session-panel__instructions li:last-child {
    margin-bottom: 0;
}

body.dark-mode .stream-session-panel {
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}

body.dark-mode .stream-session-panel__id {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .stream-session-panel__instructions {
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-secondary));
    border-color: color-mix(in srgb, var(--primary-color) 28%, var(--border-color));
}

/* Welcome modal (onboarding) */
.welcome-modal-overlay {
    z-index: 10050;
    background: rgba(55, 58, 64, 0.72);
    backdrop-filter: blur(4px);
}

.welcome-modal {
    position: relative;
    width: min(630px, calc(100vw - 32px));
    max-height: min(90vh, calc(100dvh - 32px));
    overflow-y: auto;
    padding: 32px 36px 28px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e8eaed;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
    font-family: 'Inter', sans-serif;
    color: #2c323f;
    box-sizing: border-box;
}

.welcome-modal--stream {
    width: min(760px, calc(100vw - 32px));
    padding: 22px 30px 20px;
}

.welcome-modal--stream .welcome-modal__title.welcome-modal__title--left {
    font-size: 18px;
}

.welcome-modal--stream .welcome-modal__back {
    margin-bottom: 10px;
}

.welcome-modal--stream .welcome-modal__continue {
    margin-top: 18px;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
}

.welcome-mcp-modal__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 3px;
    margin-bottom: 10px;
    border: 1px solid #E8E8E8;
    border-radius: 6px;
    background: #ffffff;
}

.welcome-mcp-modal__tab {
    border: none;
    border-radius: 4px;
    padding: 7px 12px;
    background: transparent;
    color: #5f6b7a;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.welcome-mcp-modal__tab.is-active {
    background: #f6f7f9;
    color: #2c323f;
}

.welcome-mcp-modal__step-label {
    margin: 0 0 2px;
    color: var(--primary-color);
    font-size: 10px;
    font-weight: 600;
}

.welcome-mcp-modal__heading {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    color: #364153;
}

.welcome-mcp-modal__text {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: #364153;
}

.welcome-mcp-modal__text a {
    color: inherit;
    text-decoration: underline;
}

.welcome-mcp-modal__instructions {
    margin: 0 0 14px 10px;
    padding-left: 1.25em;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: #364153;
    list-style-type: disc;
}

.welcome-mcp-modal__instructions li + li {
    margin-top: 6px;
}

.welcome-mcp-modal__instructions a {
    color: inherit;
    text-decoration: underline;
}

.welcome-mcp-modal__note {
    font-size: 10px;
    font-weight: 400;
    line-height: 1.45;
    color: #6a7282;
}

.welcome-mcp-modal__note strong {
    font-weight: 600;
}

/* Welcome MCP wizard — shared mcp-connect-dialog field + copy (Build with AI parity) */
.welcome-modal--stream .mcp-connect-dialog__copy-btn {
    font-size: 12px !important;
    line-height: 1;
}

.welcome-modal--stream .mcp-connect-dialog__fieldset {
    margin: 0 0 14px;
}

.welcome-modal--stream .mcp-connect-dialog__legend {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    background: #ffffff;
}

body.dark-mode .welcome-modal--stream .mcp-connect-dialog__legend {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.welcome-modal--stream .mcp-connect-dialog__input {
    font-size: 14px;
}

.welcome-mcp-modal__demo-frame {
    margin: 14px 0;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.welcome-mcp-modal__iframe,
.welcome-mcp-modal__demo-video {
    width: 100%;
    height: 384px;
    border: none;
    display: block;
}

.welcome-mcp-modal__demo-video {
    object-fit: contain;
    background: #000000;
}

.welcome-mcp-modal__prompt-wrap {
    margin-top: 4px;
    padding: 8px;
    border-radius: 4px;
    background: #f5f5f5;
}

.welcome-mcp-modal__prompt-label {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 400;
    color: #6B6B6B;
    font-family: inherit;
}

.welcome-mcp-modal__prompt-box {
    padding: 8px;
    border-radius: 4px;
    background: #ffffff;
}

.welcome-mcp-modal__prompt-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
    font-family: inherit;
}

.welcome-mcp-modal__prompt-highlight {
    color: var(--primary-color);
}

.welcome-mcp-modal__actions {
    /* margin-top: 14px; */
}

.welcome-mcp-modal__actions--split {
    display: flex;
    gap: 10px;
}

.welcome-mcp-modal__action-btn {
    flex: 1;
    min-width: 0;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
}

.welcome-mcp-modal__action-btn--ghost {
    border: 1px solid var(--primary-color);
    background: #ffffff;
    color: var(--primary-color);
}

.welcome-mcp-modal__action-btn--primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: var(--primary-color);
    color: #ffffff;
}

.welcome-mcp-modal__action-btn--primary.welcome-mcp-modal__action-btn--streaming {
    opacity: 0.92;
}

.welcome-mcp-modal__action-btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.welcome-mcp-modal__test-icon {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.welcome-mcp-modal__test-icon img {
    display: block;
    width: 13px;
    height: 13px;
}

.welcome-mcp-modal__test-icon.is-spinning img {
    animation: mcp-connect-test-spin 1s linear infinite;
}

.welcome-mcp-modal__skip {
    display: block;
    margin: 8px auto 8px;
    border: none;
    background: none;
    color: #6A7282;
    font-size: 12px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
}

body.dark-mode .welcome-mcp-modal__tabs,
body.dark-mode .welcome-modal--stream .mcp-connect-dialog__fieldset,
body.dark-mode .welcome-mcp-modal__demo-frame {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .welcome-mcp-modal__tab.is-active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.dark-mode .welcome-mcp-modal__tab,
body.dark-mode .welcome-mcp-modal__text,
body.dark-mode .welcome-mcp-modal__instructions,
body.dark-mode .welcome-mcp-modal__note,
body.dark-mode .welcome-mcp-modal__skip {
    color: var(--text-secondary);
}

body.dark-mode .welcome-mcp-modal__heading {
    color: var(--text-primary);
}

body.dark-mode .welcome-mcp-modal__prompt-wrap {
    background: var(--bg-tertiary);
}

body.dark-mode .welcome-mcp-modal__prompt-label {
    color: var(--text-secondary);
}

body.dark-mode .welcome-mcp-modal__prompt-box {
    background: var(--bg-secondary);
}

body.dark-mode .welcome-mcp-modal__prompt-text {
    color: var(--text-primary);
}

.stream-session-panel--welcome {
    position: static;
    top: auto;
    right: auto;
    max-width: none;
    width: 100%;
    z-index: auto;
    box-shadow: none;
    border: 1px solid #e8eaed;
    background: #ffffff;
}

body.dark-mode .stream-session-panel--welcome {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: none;
}

.welcome-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.welcome-modal__close:hover {
    color: #364153;
}

.welcome-modal__title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-align: center;
    color: #1f2937;
}

.welcome-modal__title--left {
    text-align: left;
    font-size: 22px;
    margin-top: 4px;
}

.welcome-modal__subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    text-align: center;
    font-weight: 400;
    color: #364153;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-modal__subtitle--left {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 20px;
    font-size: 12px;
    font-weight: 400;
}

.welcome-modal__cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 24px;
    align-items: center;
}

.welcome-modal__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 4px;
    min-height: 164px;
    height: 164px;
    padding: 18px 14px;
    border-radius: 10px;
    border: 1px solid #d8dce3;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    font-family: inherit;
    color: inherit;
}

.welcome-modal__card:hover {
    border-color: #e5e5e5;
    background: #E5E5E54D;
    /* box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); */
    transform: translateY(-1px);
}

.welcome-modal__card--scratch {
    border-style: dashed;
}

.welcome-modal__card--examples,
.welcome-modal__card--scratch {
    padding-bottom: 16px;
}

.welcome-modal__card-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.welcome-modal__card-label,
.welcome-modal__card-title {
    font-size: 14px;
    font-weight: 500;
    color: #364153;
}

.welcome-modal__card-sub {
    font-size: 12px;
    font-weight: 400;
    color: #364153;
}

.welcome-modal__card--mcp {
    position: relative;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    padding: 16px;
    min-height: 188px;
    height: 188px;
}

.welcome-modal__mcp-image {
    width: 100%;
    height: 96px;
    margin-bottom: 10px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.welcome-modal__mcp-art {
    position: relative;
    width: 100%;
    height: 72px;
    margin-bottom: 4px;
}

.welcome-modal__mcp-orbit {
    position: absolute;
    width: 36px;
    height: 24px;
    border-radius: 6px;
    opacity: 0.9;
}

.welcome-modal__mcp-orbit--teal {
    background: #3bb9cf;
    top: 8px;
    left: 18%;
}

.welcome-modal__mcp-orbit--blue {
    background: #5b8def;
    top: 28px;
    right: 22%;
}

.welcome-modal__mcp-orbit--pink {
    background: #e879a8;
    top: 4px;
    right: 38%;
}

.welcome-modal__mcp-core {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid #e2e5ea;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-modal__mcp-core img {
    width: 18px;
    height: 18px;
}

.welcome-modal__card-arrow {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #364153;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #364153;
    background: #ffffff;
}

.welcome-modal__scratch-plus {
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    color: #364153;
}

.welcome-modal__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid #e8eaed;
}

.welcome-modal__footer-link {
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    font-weight: 400;
    color: #364153;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.welcome-modal__footer-link:hover:not(:disabled) {
    color: var(--primary-color);
}

.welcome-modal__footer-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.welcome-modal__footer-sep {
    color: #d1d5db;
    font-size: 12px;
}

.welcome-modal__back {
    border: none;
    background: none;
    padding: 0;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 400;
    color: #364153;
    cursor: pointer;
    font-family: inherit;
}

.welcome-modal__back:hover {
    color: #364153;
}

.welcome-modal__example-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.welcome-modal__example-item {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.welcome-modal__example-item:hover {
    border-color: #c5cad3;
}

.welcome-modal__example-item.is-selected {
    background: #f3f4f6;
    border-color: #c5cad3;
}

.welcome-modal__example-item-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.welcome-modal__example-name {
    font-size: 14px;
    font-weight: 500;
    color: #364153;
}

.welcome-modal__example-pages {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
    flex-shrink: 0;
}

.welcome-modal__example-desc {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: #364153;
}

.welcome-modal__continue {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.welcome-modal__continue:hover:not(:disabled) {
    filter: brightness(1.05);
}

.welcome-modal__continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.welcome-modal__continue--secondary {
    margin-top: 12px;
    background: #ffffff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.welcome-modal__recovery-tip {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #E2F1FF;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #364153;
}

.welcome-modal__recovery-tip img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.welcome-modal__recovery-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(42vh, 360px);
    overflow-y: auto;
    margin-bottom: 14px;
}

.welcome-modal__recovery-item {
    position: relative;
    width: 100%;
    text-align: left;
    padding: 16px;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.welcome-modal__recovery-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    background: #F7F7F7;
}

.welcome-modal__recovery-item.is-selected {
    border-color: #c9d0db;
    background: #F7F7F7;
}

.welcome-modal__recovery-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e5f0ff;
    color: #2a7de1;
    font-size: 14px;
    font-weight: 500;
}

.welcome-modal__recovery-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    margin-bottom: 8px;
    padding-right: 64px;
}

.welcome-modal__recovery-item-title img {
    width: 18px;
    height: 18px;
}

.welcome-modal__recovery-brand {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 12%, #ffffff);
}

.welcome-modal__recovery-meta {
    font-size: 12px;
    color: #364153;
    margin-bottom: 4px;
}

body.dark-mode .welcome-modal {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .welcome-modal__title {
    color: var(--text-primary);
}

body.dark-mode .welcome-modal__subtitle,
body.dark-mode .welcome-modal__card-sub,
body.dark-mode .welcome-modal__footer-link,
body.dark-mode .welcome-modal__back {
    color: var(--text-secondary);
}

body.dark-mode .welcome-modal__card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .welcome-modal__card-label,
body.dark-mode .welcome-modal__card-title {
    color: var(--text-primary);
}

body.dark-mode .welcome-modal__card-icon {
    filter: brightness(0) invert(0.72);
}

body.dark-mode .welcome-modal__scratch-plus {
    color: #8f9db3;
}

body.dark-mode .welcome-modal__example-item,
body.dark-mode .welcome-modal__recovery-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .welcome-modal__example-item.is-selected {
    background: var(--bg-tertiary);
}

body.dark-mode .welcome-modal__example-item:hover,
body.dark-mode .welcome-modal__recovery-item:hover {
    border-color: color-mix(in srgb, var(--primary-color) 48%, var(--border-color));
}

body.dark-mode .welcome-modal__example-name,
body.dark-mode .welcome-modal__recovery-item-title {
    color: var(--text-primary);
}

body.dark-mode .welcome-modal__example-desc,
body.dark-mode .welcome-modal__recovery-meta {
    color: var(--text-secondary);
}

body.dark-mode .welcome-modal__example-pages {
    color: #ff7a59;
}

body.dark-mode .welcome-modal__recovery-item.is-selected {
    background: #2c3240;
    border-color: #4b5568;
}

body.dark-mode .welcome-modal__recovery-item {
    background: #1f2430;
    border-color: #343b4a;
}

body.dark-mode .welcome-modal__recovery-item-title {
    color: #e5e7eb;
}

body.dark-mode .welcome-modal__recovery-meta {
    color: #aeb6c3;
}

body.dark-mode .welcome-modal__recovery-tip {
    background: color-mix(in srgb, #dce8f5 16%, var(--bg-secondary));
    border-color: color-mix(in srgb, #dce8f5 38%, var(--border-color));
    color: var(--text-primary);
}

body.dark-mode .welcome-modal__recovery-tip img {
    filter: brightness(0) invert(0.8);
}

body.dark-mode .welcome-modal__recovery-badge {
    background: rgba(66, 153, 255, 0.2);
    color: #8ab8ff;
}

@media (max-width: 640px) {
    .welcome-modal__cards {
        grid-template-columns: 1fr;
    }

    .welcome-modal__card--mcp {
        min-height: 140px;
    }
}