        /* Disable long-press context menu on touch devices / WebView */
        * { -webkit-touch-callout: none; -webkit-user-select: none; -ms-touch-action: manipulation; touch-action: manipulation; }
        .text-editor, input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
        :root {
            --bg-primary: #ffffff; --bg-secondary: #f8f9fa; --bg-tertiary: #e9ecef; --bg-elevated: #dee2e6;
            --border-color: #ced4da; --border-focus: #6366f1;
            --text-primary: #212529; --text-secondary: #495057; --text-muted: #6c757d;
            --accent-primary: #4f46e5; --accent-secondary: #6366f1; --accent-tertiary: #818cf8;
            --success: #34d399; --warning: #fbbf24; --danger: #f87171;
            --canvas-bg: #f5f5f7; --canvas-grid: #e5e5e7;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'DM Sans', -apple-system, sans-serif; background: var(--bg-primary); color: var(--text-primary); height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
        .menubar { background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 8px; height: 28px; gap: 2px; }
        .menubar-logo { display: flex; align-items: center; gap: 6px; margin-right: 10px; padding-right: 10px; border-right: 1px solid var(--border-color); }
        .menubar-logo svg { width: 18px; height: 18px; }
        .menubar-logo span { font-weight: 600; font-size: 13px; background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        .menu-item { position: relative; padding: 3px 8px; font-size: 12px; color: var(--text-secondary); cursor: pointer; border-radius: 3px; transition: all 0.15s; }
        .menu-item:hover, .menu-item:focus, .menu-item[aria-expanded="true"] { background: var(--bg-tertiary); color: var(--text-primary); outline: none; }
        .menu-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 8px; min-width: 140px; padding: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 1000; display: none; animation: dropdownIn 0.15s; }
        @keyframes dropdownIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
        .menu-item[aria-expanded="true"] .menu-dropdown { display: block; }
        .dropdown-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 13px; color: var(--text-secondary); cursor: pointer; border-radius: 4px; transition: all 0.1s; }
        .dropdown-item:hover { background: var(--accent-tertiary); color: var(--text-primary); }
        .dropdown-item.selected { background: var(--accent-tertiary); color: var(--accent-primary); font-weight: 500; }
        .dropdown-item[style*="width:"].selected { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
        .dropdown-item svg { width: 16px; height: 16px; margin-right: 10px; flex-shrink: 0; }
        .dropdown-item-content { display: flex; align-items: center; }
        .dropdown-shortcut { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
        .dropdown-divider { height: 1px; background: var(--border-color); margin: 6px 0; }
        .dropdown-submenu { position: relative; }
        .dropdown-submenu > .dropdown-item-content::after { content: '▸'; margin-left: auto; padding-left: 12px; }
        .dropdown-submenu-content { position: absolute; left: 100%; top: 0; min-width: 180px; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); padding: 6px; display: none; }
        .dropdown-submenu:hover > .dropdown-submenu-content { display: block; animation: dropdownIn 0.15s; }
        .ribbon-dropdown { position: relative; }
        .ribbon-dropdown-btn { display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-primary); font-size: 12px; font-family: inherit; cursor: pointer; min-width: 110px; }
        .ribbon-dropdown-btn:hover { border-color: var(--accent-primary); }
        .ribbon-dropdown-menu { position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 180px; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); padding: 6px; display: none; z-index: 1000; }
        .ribbon-dropdown.active .ribbon-dropdown-menu { display: block; animation: dropdownIn 0.15s; }
        .ribbon-dropdown.active #layoutDropdownMenu { display: flex; flex-wrap: wrap; gap: 3px; }
        #layoutDropdownMenu .dropdown-item { width: 48px !important; height: 48px !important; }
        #layoutDropdownMenu .dropdown-item svg { min-width: 42px; min-height: 42px; margin-right: 0 !important; }
        .ribbon-dropdown.active #textAlignDropdownMenu { display: flex; flex-wrap: wrap; gap: 3px; }
        #textAlignDropdownMenu .dropdown-item { display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
        #textAlignDropdownMenu .dropdown-item svg { min-width: 28px; min-height: 28px; margin-right: 0 !important; }
        .ribbon-dropdown.active #iconPosDropdownMenu { display: flex; flex-wrap: wrap; gap: 3px; }
        #iconPosDropdownMenu .dropdown-item { display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
        #iconPosDropdownMenu .dropdown-item svg { min-width: 28px; min-height: 28px; margin-right: 0 !important; }
        .ribbon-dropdown.active #linkStyleDropdownMenu { display: flex; flex-wrap: wrap; gap: 3px; }
        #linkStyleDropdownMenu .dropdown-item { display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
        #linkStyleDropdownMenu .dropdown-item svg { min-width: 28px; min-height: 28px; margin-right: 0 !important; }
        .ribbon-dropdown.active #linkRouteDropdownMenu { display: flex; flex-wrap: wrap; gap: 3px; }
        #linkRouteDropdownMenu .dropdown-item { display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
        #linkRouteDropdownMenu .dropdown-item svg { min-width: 28px; min-height: 28px; margin-right: 0 !important; }
        .ribbon-dropdown.active #linkEndDropdownMenu { display: flex; flex-wrap: wrap; gap: 3px; }
        #linkEndDropdownMenu .dropdown-item { display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
        #linkEndDropdownMenu .dropdown-item svg { min-width: 28px; min-height: 28px; margin-right: 0 !important; }
        .ribbon-group.disabled { opacity: 0.4; pointer-events: none; }
        .ribbon-submenu { left: 100%; top: -6px; min-width: 140px; }
        .ribbon-wrapper { background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
        .ribbon-wrapper::-webkit-scrollbar { height: 6px; }
        .ribbon-wrapper::-webkit-scrollbar:vertical { display: none; }
        .ribbon-wrapper::-webkit-scrollbar-track { background: transparent; }
        .ribbon-wrapper::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
        .ribbon-wrapper::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
        .ribbon { padding: 2px 1px 1px; display: flex; align-items: stretch; gap: 3px; flex-wrap: nowrap; width: max-content; min-width: 100%; }
        .ribbon-dropdown-menu { position: fixed; z-index: 3000; }
        .ribbon-group { display: flex; flex-direction: column; align-items: center; gap: 0px; padding: 0 3px; border-right: 1px solid var(--border-color); flex-shrink: 0; position: relative; }
        .ribbon-group:last-child { border-right: none; }
        .ribbon-group-content { display: flex; align-items: center; gap: 2px; flex: 1; }
        .ribbon-group-label { font-size: 9px; letter-spacing: 0.03em; color: var(--text-muted); text-align: center; margin-top: 0px; line-height: 1; padding-bottom: 1px; }
        .ribbon-btn { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: transparent; border: 1px solid transparent; border-radius: 3px; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
        .ribbon-btn:hover:not(:disabled) { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border-color); }
        .ribbon-btn:active:not(:disabled) { transform: scale(0.95); }
        .ribbon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .ribbon-btn svg { width: 14px; height: 14px; }
        .ribbon-btn[aria-pressed="true"] { background: var(--accent-tertiary); color: var(--text-primary); border-color: var(--accent-secondary); }
        .ribbon-checkbox { display: flex; align-items: center; gap: 3px; cursor: pointer; font-size: 10px; color: var(--text-secondary); user-select: none; }
        .ribbon-checkbox input[type="checkbox"] { display: none; }
        .ribbon-checkbox .checkbox-box { width: 12px; height: 12px; border: 1.5px solid var(--border-color); border-radius: 2px; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); transition: all 0.15s ease; }
        .ribbon-checkbox input[type="checkbox"]:checked + .checkbox-box { background: var(--accent-primary); border-color: var(--accent-primary); }
        .ribbon-checkbox input[type="checkbox"]:checked + .checkbox-box svg { opacity: 1; }
        .ribbon-checkbox .checkbox-box svg { width: 8px; height: 8px; stroke: white; stroke-width: 3; fill: none; opacity: 0; transition: opacity 0.15s ease; }
        .ribbon-checkbox:hover .checkbox-box { border-color: var(--accent-secondary); }
        .ribbon-checkbox input[type="checkbox"]:disabled + .checkbox-box { opacity: 0.5; cursor: not-allowed; }
        .ribbon-checkbox.disabled { opacity: 0.5; cursor: not-allowed; }
        .ribbon-btn.recording { animation: pulse-record 1s infinite; }
        .ribbon-btn.paste-btn { width: 32px; height: 32px; }
        .ribbon-btn.paste-btn svg { width: 20px; height: 20px; }
        .ribbon-btn.small-btn { width: 16px; height: 16px; }
        .ribbon-btn.small-btn svg { width: 10px; height: 10px; }
        @keyframes pulse-record { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
        .audio-btn { width: 24px; height: 24px; }
        .audio-btn svg { width: 16px; height: 16px; }
        .node-audio-controls { position: absolute; z-index: 100; display: flex; gap: 3px; }
        .node-audio-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 50%; cursor: pointer; color: var(--text-secondary); padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
        .node-audio-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
        .node-audio-btn.node-audio-delete:hover { color: var(--danger); }
        .node-audio-btn svg { width: 14px; height: 14px; }
        .ribbon-select { height: 24px; padding: 0 6px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 3px; color: var(--text-primary); font-size: 11px; font-family: inherit; cursor: pointer; min-width: 80px; }
        .ribbon-select:focus { outline: none; border-color: var(--border-focus); }
        .ribbon-input { height: 24px; padding: 0 8px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 3px; color: var(--text-primary); font-size: 11px; font-family: inherit; min-width: 150px; }
        .ribbon-input:focus { outline: none; border-color: var(--border-focus); }
        .ribbon-input::placeholder { color: var(--text-muted); }
        .color-swatch { width: 20px; height: 20px; border-radius: 3px; border: 2px solid var(--border-color); cursor: pointer; transition: all 0.15s; }
        .color-swatch:hover { transform: scale(1.1); border-color: var(--accent-primary); }
        .color-input { position: absolute; top: 0; left: 0; opacity: 0; width: 20px; height: 20px; cursor: pointer; }
        .main-container { display: flex; flex: 1; overflow: hidden; }
        .shapes-panel { width: 140px; min-width: 120px; max-width: 200px; background: var(--bg-secondary); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; transition: none; overflow: hidden; position: relative; }
        .shapes-panel.collapsed { width: 0; min-width: 0; border-right: none; }
        .shapes-panel-header { padding: 8px; text-align: center; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
        .shapes-panel-header h3 { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
        .shapes-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 60px; }
        .shapes-grid { flex: 1; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; overflow-y: auto; align-content: flex-start; justify-content: center; }
        .shape-item { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer; transition: all 0.15s; color: var(--text-secondary); flex-shrink: 0; }
        .icon-item { }
        .icon-item svg { width: 28px; height: 28px; }
        .resize-handle-right { position: absolute; top: 0; right: 0; width: 5px; height: 100%; cursor: ew-resize; background: transparent; z-index: 10; }
        .resize-handle-right:hover { background: var(--accent-primary); opacity: 0.5; }
        .resize-handle-top { position: absolute; top: 0; left: 0; right: 0; height: 5px; cursor: ns-resize; background: transparent; z-index: 10; }
        .resize-handle-top:hover { background: var(--accent-primary); opacity: 0.5; }
        .shapes-divider-handle { width: 100%; height: 8px; background: var(--border-color); cursor: ns-resize; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
        .shapes-divider-handle:hover { background: var(--accent-primary); }
        .shapes-divider-handle::after { content: ''; width: 30px; height: 3px; background: var(--text-muted); border-radius: 2px; }
        .shape-item:hover { background: var(--bg-elevated); border-color: var(--accent-primary); color: var(--accent-primary); transform: scale(1.05); }
        .shape-item svg { width: 28px; height: 28px; }
        .graph-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
        .graph-container { flex: 1; background: var(--canvas-bg); background-image: linear-gradient(var(--canvas-grid) 1px, transparent 1px), linear-gradient(90deg, var(--canvas-grid) 1px, transparent 1px); background-size: 20px 20px; overflow: hidden; position: relative; }
        .graph-container:focus { outline: 2px solid var(--border-focus); outline-offset: -2px; }
        /* Persistent selection-info bar at the very bottom of the window
           (direct child of body, below main-container). Displays the
           full label of the currently selected node; stays visible at
           all times — does NOT clear on mouse-out. Multi-line content
           (e.g. if a label contains `##` it gets rendered with breaks)
           is allowed via white-space: pre-line. Long single-line labels
           wrap rather than ellipsis-truncate so the full text is always
           readable. */
        .node-status-bar { flex: 0 0 auto; padding: 8px 16px; background: var(--bg-tertiary); border-top: 1px solid var(--border-color); color: var(--text-primary); font-size: 13px; line-height: 1.4; white-space: pre-line; word-break: break-word; max-height: 25vh; overflow-y: auto; cursor: default; }
        .node-status-bar.empty { color: var(--text-muted); font-style: italic; }
        .node-status-bar.multi { color: var(--text-secondary); }
        .text-panel { background: var(--bg-secondary); border-top: 1px solid var(--border-color); display: flex; flex-direction: column; height: 112px; min-height: 36px; max-height: 400px; transition: height 0.2s ease; position: relative; }
        .text-panel.collapsed { height: 36px; min-height: 36px; }
        .text-panel-header { display: flex; align-items: center; padding: 4px 16px; gap: 8px; border-bottom: 1px solid var(--border-color); }
        .text-panel-header h3 { font-size: 12px; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
        .text-panel-header > h3 > svg { width: 14px; height: 14px; transition: transform 0.2s; }
        .text-panel.collapsed .text-panel-header > h3 > svg { transform: rotate(180deg); }
        .notes-toolbar { display: flex; align-items: center; gap: 4px; margin-left: 12px; flex-wrap: nowrap; overflow: hidden; }
        .notes-toolbar.disabled { opacity: 0.4; pointer-events: none; }
        .notes-toolbar .notes-tb-btn { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; background: none; border: 1px solid transparent; border-radius: 3px; cursor: pointer; color: var(--text-secondary); padding: 0; }
        .notes-toolbar .notes-tb-btn:hover { background: var(--bg-tertiary); border-color: var(--border-color); }
        .notes-toolbar .notes-tb-btn[aria-pressed="true"] { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }
        .notes-toolbar .notes-tb-sep { width: 1px; height: 16px; background: var(--border-color); margin: 0 2px; flex-shrink: 0; }
        .notes-toolbar .notes-tb-select { height: 22px; padding: 0 4px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 3px; color: var(--text-primary); font-size: 11px; font-family: inherit; cursor: pointer; }
        .notes-toolbar .notes-tb-select:focus { outline: none; border-color: var(--border-focus); }
        .notes-toolbar .notes-color-label { position: relative; display: flex; }
        .notes-toolbar .notes-color-swatch { width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--border-color); cursor: pointer; }
        .notes-toolbar .notes-color-input { position: absolute; opacity: 0; width: 18px; height: 18px; cursor: pointer; }
        .text-panel.collapsed .notes-toolbar { display: none; }
        .text-panel-content { display: flex; flex: 1; overflow: hidden; }
        .text-panel.collapsed .text-panel-content { display: none; }
        .text-editor-container { flex: 1; display: flex; flex-direction: column; }
        .text-editor { flex: 1; width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; color: var(--text-primary); font-family: inherit; font-size: 13px; line-height: 1.5; resize: none; overflow-y: auto; min-height: 60px; white-space: pre-wrap; word-wrap: break-word; }
        .text-editor:focus { outline: none; border-color: var(--border-focus); }
        .text-editor:empty:before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
        .text-editor[contenteditable="false"] { opacity: 0.6; cursor: not-allowed; }
        .datetime-panel { padding: 12px 16px; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
        .datetime-display { font-size: 12px; color: var(--text-secondary); padding: 8px 12px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 6px; line-height: 1.5; cursor: pointer; transition: all 0.15s; }
        .datetime-display:hover { background: var(--bg-elevated); border-color: var(--accent-primary); }
        .datetime-display .date-label { color: var(--accent-primary); font-weight: 500; }
        .datetime-display .date-comment { color: var(--text-muted); font-style: italic; margin-top: 4px; }
        .datetime-field { display: flex; flex-direction: column; gap: 4px; }
        .datetime-field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
        .datetime-field input { height: 36px; padding: 0 10px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-family: inherit; font-size: 13px; }
        .datetime-field input:focus { outline: none; border-color: var(--border-focus); }
        .set-date-btn { padding: 8px 12px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all 0.15s; }
        .set-date-btn:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--accent-primary); }
        .set-date-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .statusbar { background: var(--bg-secondary); border-top: 1px solid var(--border-color); height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 12px; color: var(--text-muted); }
        .statusbar-left, .statusbar-right { display: flex; align-items: center; gap: 16px; }
        .statusbar-right { gap: 12px; }
        .zoom-controls { display: flex; align-items: center; gap: 8px; }
        .zoom-btn { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 4px; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
        .zoom-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
        .zoom-btn svg { width: 14px; height: 14px; }
        .zoom-slider { width: 100px; height: 4px; -webkit-appearance: none; background: var(--bg-tertiary); border-radius: 2px; cursor: pointer; }
        .zoom-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--accent-primary); border-radius: 50%; cursor: pointer; }
        .zoom-value { font-family: 'JetBrains Mono', monospace; font-size: 11px; min-width: 40px; text-align: center; }
        .toggle-btn { padding: 4px 10px; background: transparent; border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer; color: var(--text-secondary); font-size: 11px; font-family: inherit; transition: all 0.15s; }
        .toggle-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
        .toggle-btn.active { background: var(--accent-tertiary); border-color: var(--accent-secondary); color: var(--text-primary); }
        .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.2s; }
        .modal-overlay.active { opacity: 1; visibility: visible; }
        .modal { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 12px; width: 90%; max-width: 500px; max-height: 80vh; overflow: clip; transform: scale(0.95); transition: transform 0.2s; display: flex; flex-direction: column; }
        .modal-overlay.active .modal { transform: scale(1); }
        .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
        .modal-header h2 { font-size: 16px; font-weight: 600; }
        .modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 6px; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
        .modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
        .modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; }
        .modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; }
        .btn { padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; transition: all 0.15s; }
        .btn-secondary { background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-primary); }
        .btn-primary { background: var(--accent-tertiary); border: 1px solid var(--accent-secondary); color: var(--text-primary); }
        .btn-primary:hover { background: var(--accent-secondary); }
        .context-menu { position: fixed; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 8px; min-width: 180px; padding: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 3000; display: none; }
        .context-menu.active { display: block; animation: dropdownIn 0.15s; }
        .ctx-color-section { padding: 4px 6px 6px; }
        .ctx-style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
        .ctx-style-btn { width: 100%; height: 26px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.12); cursor: pointer; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; transition: transform 0.1s, box-shadow 0.1s; }
        .ctx-style-btn:hover { transform: scale(1.1); box-shadow: 0 2px 6px rgba(0,0,0,0.25); z-index: 1; }
        .toast-container { position: fixed; bottom: 60px; right: 20px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 4000; }
        .toast { padding: 12px 20px; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: 8px; font-size: 13px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); animation: toastIn 0.3s; }
        .toast.warning { border-left: 3px solid var(--warning); }
        @keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
        .toast.success { border-left: 3px solid var(--success); }
        .toast.error { border-left: 3px solid var(--danger); }
        .recent-map-item { transition: background 0.15s; }
        .recent-map-item:hover { background: var(--bg-tertiary); }
        .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; }
        :focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
        ::-webkit-scrollbar { width: 8px; height: 8px; }
        ::-webkit-scrollbar-track { background: var(--bg-secondary); }
        ::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }
        .loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; z-index: 9999; flex-direction: column; gap: 16px; }
        .loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border-color); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 1s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-text { color: var(--text-secondary); font-size: 14px; }

        .map-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; transition: all 0.2s; cursor: pointer; }
        .map-card:hover { border-color: var(--accent-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(-2px); }
        .map-card.current { border-color: var(--accent-primary); background: var(--accent-primary-alpha, rgba(59, 130, 246, 0.1)); }
        .map-card-preview { height: 120px; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--border-color); cursor: pointer; }
        .map-card-preview svg { max-width: 100%; max-height: 100%; }
        .map-card-preview .no-preview { color: var(--text-muted); font-size: 12px; }
        .map-card-info { padding: 12px; }
        .map-card-name { font-weight: 600; font-size: 14px; color: var(--text-primary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .map-card-date { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
        .map-card-current { font-size: 10px; color: var(--accent-primary); font-weight: 500; }
        .map-card-actions { display: flex; gap: 6px; }
        .map-card-actions button { flex: 1; padding: 6px 8px; font-size: 11px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-secondary); transition: all 0.15s; }
        .map-card-actions button:hover { background: var(--bg-tertiary); color: var(--text-primary); }
        .map-card-actions button.delete-btn { color: var(--danger); }
        .map-card-actions button.delete-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }
