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

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 300;
    src: url('./fonts/DM-Sans-300-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/DM-Sans-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 500;
    src: url('./fonts/DM-Sans-500-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 600;
    src: url('./fonts/DM-Sans-600-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/Lora-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: italic;
    font-weight: 400;
    src: url('./fonts/Lora-400-italic.woff2') format('woff2');
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 600;
    src: url('./fonts/Lora-600-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    src: url('./fonts/JetBrains-Mono-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    src: url('./fonts/JetBrains-Mono-500-normal.woff2') format('woff2');
}

:root {
    --bg: #1a1b1e;
    --bg-sidebar: #16171a;
    --bg-tab: #1e1f23;
    --bg-tab-active: #25262b;
    --bg-hover: #2a2b30;
    --bg-active: #2e3a4e;
    --surface: #25262b;
    --surface2: #2c2d33;
    --border: #2e2f35;
    --border-light: #3a3b42;
    --text: #c9cad4;
    --text-dim: #6b6d7a;
    --text-bright: #e8e9f0;
    --accent: #5b8af0;
    --accent-dim: #3d5fa8;
    --accent-glow: rgba(91,138,240,0.15);
    --green: #4ec9a0;
    --yellow: #e2c97e;
    --purple: #c792ea;
    --ember: #a55b00;
    --zotRed: #cc2936; /* #db2c3a */
    --font-ui: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-prose: 'Lora', Georgia, serif;
    --radius: 6px;
    --tab-h: 38px;
    --toolbar-h: 44px;
    --sidebar-w: 260px;
    --right-sidebar-w: 220px;
    --transition: 140ms ease;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-ui);
    font-size: 13.5px;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Toolbar */
#toolbar {
    height: var(--toolbar-h);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 4px;
    flex-shrink: 0;
    z-index: 10;
    -webkit-app-region: drag;
    app-region: drag;
}

#toolbar button, #toolbar .icon-btn {
    -webkit-app-region: no-drag;
    app-region: no-drag;
}

.toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: -0.3px;
    margin-right: 6px;
    user-select: none;
}

.app-name span {
    color: var(--accent);
}

.icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: var(--radius);
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
    position: relative;
}

.icon-btn:hover {
    color: var(--text-bright);
    background: var(--bg-hover);
}

.icon-btn.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.icon-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    color: var(--text-bright);
    font-size: 11px;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms;
    z-index: 1000;
}

.icon-btn:hover::after {
    opacity: 1;
}

#save-indicator {
    font-size: 11px;
    color: var(--text-dim);
    margin-right: 4px;
    min-width: 60px;
    text-align: right;
}

#save-indicator.saving {
    color: var(--yellow);
}

#save-indicator.saved {
    color: var(--green);
}

#vault-name {
    font-size: 12px;
    color: var(--text-dim);
    padding: 3px 8px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layout */
#layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

/* Sidebar resize handles */
.sidebar-resize-handle {
    width: 4px;
    background: transparent;
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 80ms;
    z-index: 5;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--accent-dim);
}

/* Right sidebar (Outline) */
#right-sidebar {
    width: var(--right-sidebar-w);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

/* Outline panel */
.outline-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.outline-item {
    display: block;
    padding: 3px 8px;
    border-radius: var(--radius);
    margin: 0 4px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    font-size: 12.5px;
    min-height: 24px;
    line-height: 24px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.outline-item:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

.outline-item.ol-h1 {
    padding-left: 10px;
    font-weight: 600;
    color: var(--text-bright);
    font-size: 13px;
}

.outline-item.ol-h2 {
    padding-left: 18px;
    font-weight: 500;
}

.outline-item.ol-h3 {
    padding-left: 26px;
    color: var(--text-dim);
}

.outline-item.ol-h4 {
    padding-left: 34px;
    color: var(--text-dim);
    font-size: 12px;
}

.outline-item.ol-h5 {
    padding-left: 42px;
    color: var(--text-dim);
    font-size: 12px;
}

.outline-item.ol-h6 {
    padding-left: 50px;
    color: var(--text-dim);
    font-size: 11.5px;
}

.outline-empty {
    padding: 20px 12px;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
    line-height: 1.6;
}

.sidebar-header {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 12px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
    flex-shrink: 0;
}

.sidebar-header-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    flex: 1;
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

/* Tree nodes */
.tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius);
    margin: 0 4px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
    min-height: 26px;
}

.tree-row:hover {
    background: var(--bg-hover);
}

.tree-row.active-folder {
    background: var(--bg-active);
}

.tree-row.active-file {
    background: var(--accent-glow);
    color: var(--accent);
}

.tree-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-dim);
}

.tree-folder-icon {
    color: var(--yellow);
}

.tree-chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--text-dim);
}

.tree-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.tree-label-edit {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 3px;
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 1px 5px;
    outline: none;
}

.tree-children {
    padding-left: 16px;
}

/* Search */
.search-input-wrap {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.search-input-wrap input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-bright);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 5px 9px;
    outline: none;
    transition: border-color var(--transition);
}

.search-input-wrap input:focus {
    border-color: var(--accent);
}

.search-input-wrap input::placeholder {
    color: var(--text-dim);
}

.search-btn {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    padding: 0 10px;
    cursor: pointer;
    transition: background var(--transition);
}

.search-btn:hover {
    background: var(--accent-dim);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.search-result-item {
    padding: 7px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-context {
    font-size: 11.5px;
    color: var(--text-dim);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-context mark {
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 2px;
    padding: 0 1px;
}

.search-empty {
    padding: 20px 12px;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
}

.sidebar-empty {
    padding: 20px 12px;
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
    line-height: 1.6;
}

/* Main */
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

/* Tabs */
#tabs-bar {
    height: var(--tab-h);
    background: var(--bg-tab);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    padding: 0 4px;
}

#tabs-bar::-webkit-scrollbar {
    height: 0;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 0 14px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
    position: relative;
    flex-shrink: 0;
    max-width: 200px;
}

.tab:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.tab.active {
    background: var(--bg-tab-active);
    border-color: var(--border);
    color: var(--text-bright);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--bg-tab-active);
}

.tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.tab-close {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition);
    flex-shrink: 0;
}

.tab:hover .tab-close, .tab.active .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: var(--bg-hover);
}

.tab-close svg {
    width: 10px;
    height: 10px;
}

/* Editor area */
#editor-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.editor-pane {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: row;
    pointer-events: auto;
}

.editor-pane.active {
    display: flex;
}

/* Column panes inside editor-pane */
.col-pane {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-width: 0;
    height: 100%;
}

.col-divider {
    width: 1px;
    flex-shrink: 0;
    background: linear-gradient(
        to bottom,
        transparent 10%,
        var(--border-light) 10%,
        var(--border-light) 90%,
        transparent 90%
    );
}

#welcome {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    gap: 12px;
    user-select: none;
}

#welcome h2 {
    font-size: 22px;
    font-weight: 300;
    color: var(--text);
    letter-spacing: -0.5px;
}

#welcome p {
    font-size: 13px;
    max-width: 320px;
    text-align: center;
    line-height: 1.6;
}

#welcome .open-btn {
    margin-top: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 8px 18px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

#welcome .open-btn:hover {
    background: var(--accent-dim);
}

/* CodeMirror 5 overrides */
.CodeMirror {
    flex: 1;
    height: 100%;
    font-family: var(--font-ui) !important;
    font-size: 14px;
    background: var(--bg) !important;
    color: var(--text) !important;
    line-height: 1.75;
}

.CodeMirror-scroll {
    padding: 0;
}

.CodeMirror-lines {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 40px !important;
}

.CodeMirror-cursor {
    border-left: 2px solid var(--accent) !important;
}

.CodeMirror-selected {
    background: rgba(91,138,240,0.2) !important;
}

.CodeMirror-focused .CodeMirror-selected {
    background: rgba(91,138,240,0.2) !important;
}

.CodeMirror-gutters {
    display: none !important;
}

.CodeMirror-activeline-background {
    background: rgba(255,255,255,0.025) !important;
}

/* Live preview decoration classes */
.cm-spell-error {
    text-decoration: underline wavy #e06c75;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
}
.cm-md-hidden {
    opacity: 0 !important;
    font-size: 1px !important;
    line-height: 0 !important;
}

.cm-h1 {
    font-family: var(--font-ui) !important;
    font-size: 1.9em !important;
    font-weight: 600 !important;
    color: var(--text-bright) !important;
    line-height: 1.3 !important;
}

.cm-h2 {
    font-family: var(--font-ui) !important;
    font-size: 1.5em !important;
    font-weight: 600 !important;
    color: var(--text-bright) !important;
    line-height: 1.3 !important;
}

.cm-h3 {
    font-family: var(--font-ui) !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    color: var(--text-bright) !important;
    line-height: 1.3 !important;
}

.cm-h4 {
    font-size: 1.05em !important;
    font-weight: 600 !important;
    color: var(--text-bright) !important;
}

.cm-h5 {
    font-size: 0.95em !important;
    font-weight: 600 !important;
    color: var(--text-dim) !important;
}

.cm-h6 {
    font-size: 0.9em !important;
    font-weight: 600 !important;
    color: var(--text-dim) !important;
}

.cm-md-bold {
    font-weight: 700 !important;
    color: var(--text-bright) !important;
}

.cm-md-italic {
    font-style: italic !important;
}

.cm-md-code {
    font-family: var(--font-mono) !important;
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.88em !important;
    color: var(--ember) !important;
}

.cm-md-link {
    color: var(--accent) !important;
    text-decoration: none !important;
    cursor: pointer;
}

.cm-md-wikilink {
    color: var(--green) !important;
    text-decoration: none !important;
    cursor: pointer;
}

.cm-md-zotero-link {
    color: var(--zotRed) !important;
    text-decoration: none !important;
    cursor: pointer;
}

.cm-md-syntax {
    color: var(--text-dim) !important;
    opacity: 0.4;
}

.cm-md-highlight, mark {
    background: rgba(226,201,126,0.3);
    border-radius: 2px;
}

.cm-md-superscript {
    font-size: 0.75em !important;
    vertical-align: super;
}

.cm-md-subscript {
    font-size: 0.75em !important;
    vertical-align: sub;
}

.cm-s-default .cm-quote {
    color: var(--text-dim) !important;
    font-style: italic;
}

.cm-s-default .cm-comment {
    color: var(--ember) !important;
}

/* Preview-only pane */
.preview-only-pane {
    position: absolute;
    inset: 0;
    display: none;
    overflow-y: auto;
    padding: 0;
    pointer-events: auto;
}

.preview-only-pane.active {
    display: flex;
    flex-direction: row;
}

.preview-col-pane {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
    height: 100%;
}

.preview-content {
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
    padding: 40px 40px;
}

.preview-content h1,.preview-content h2,.preview-content h3, .preview-content h4,.preview-content h5,.preview-content h6 {
    font-family: var(--font-ui);
    color: var(--text-bright);
    margin: 1.4em 0 0.5em;
    line-height: 1.3;
    font-weight: 600;
}

.preview-content h1 {
    font-size: 2em;
}

.preview-content h2 {
    font-size: 1.5em;
}

.preview-content h3 {
    font-size: 1.2em;
}

.preview-content p {
    margin: 0.7em 0;
}

.preview-content a {
    color: var(--accent);
    text-decoration: none;
}

.preview-content a[href^="zotero"] {
    color: var(--zotRed);
}

.preview-content code {
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.87em;
    color: var(--ember);
}

.preview-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 1em 0;
}

.preview-content pre code {
    background: none;
    padding: 0;
    color: var(--text);
}

.preview-content blockquote {
    border-left: 3px solid var(--accent-dim);
    padding-left: 14px;
    color: var(--text-dim);
    font-style: italic;
    margin: 1em 0;
}

.preview-content hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1.5em 0;
}

.preview-content ul, .preview-content ol {
    padding-left: 1.5em;
    margin: 0.7em 0;
}

.preview-content li {
    margin: 0.2em 0;
}

.preview-content strong {
    font-weight: 700;
    color: var(--text-bright);
}

.preview-content em {
    font-style: italic;
}

#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    color: var(--text-bright);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 12.5px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms, transform 200ms;
    pointer-events: none;
    z-index: 9999;
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
}

.wikilink {
    color: var(--green) !important;
}

#context-menu {
    position: fixed;
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 4px;
    z-index: 9999;
    min-width: 140px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    display: none;
}

#context-menu.show {
    display: block;
}

.ctx-item {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition);
}

.ctx-item:hover {
    background: var(--bg-hover);
}

.ctx-item.danger {
    color: #e06c75;
}

.ctx-item.danger:hover {
    background: rgba(224,108,117,0.12);
}

.ctx-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.ctx-disabled {
    opacity: 0.35;
    cursor: default;
}

.ctx-disabled:hover {
    background: transparent !important;
}

#confirm-dialog {
    background: var(--surface2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px 24px;
    min-width: 280px;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 13.5px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    margin: auto;
}

#confirm-dialog::backdrop {
    background: rgba(0,0,0,0.4);
}

#confirm-message {
    margin-bottom: 18px;
    line-height: 1.5;
    color: var(--text-bright);
}

.confirm-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.confirm-buttons button {
    padding: 5px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    font-family: var(--font-ui);
    font-size: 13px;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

.confirm-buttons button:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

#confirm-ok {
    background: var(--accent-dim);
    color: var(--text-bright);
    border-color: var(--accent);
}

#confirm-ok:hover {
    background: var(--accent);
}

/* ── Drawer ─────────────────────────────────────────────────── */
#drawer-section {
    border-top: 1px solid var(--border);
    padding: 4px 0;
    flex-shrink: 0;
}

.drawer-section-header {
    padding: 5px 12px 3px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    user-select: none;
}

#drawer-list {
    max-height: 200px;
    overflow-y: auto;
}

.drawer-remove-btn {
    display: none;
    margin-left: auto;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    border-radius: 3px;
    flex-shrink: 0;
    padding: 0;
}

.drawer-remove-btn svg {
    width: 10px;
    height: 10px;
    pointer-events: none;
}

.tree-row:hover .drawer-remove-btn {
    display: flex;
}

.drawer-remove-btn:hover {
    color: var(--text-bright);
    background: var(--bg-hover);
}

#welcome .btn-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
#welcome .btn-row .open-btn {
    margin-top: 0;
}