/* ─────────────────────────────────────────────────────────────────────────────
   Wiki — Notion-like document editor
   ───────────────────────────────────────────────────────────────────────────── */

:root,
html[data-bs-theme="light"] {
    --wk-text: rgb(55, 53, 47);
    --wk-text-2: rgba(55, 53, 47, 0.65);
    --wk-text-3: rgba(55, 53, 47, 0.4);
    --wk-hover: rgba(55, 53, 47, 0.08);
    --wk-active: rgba(55, 53, 47, 0.12);
    --wk-border: rgba(55, 53, 47, 0.16);
    --wk-accent: rgb(35, 131, 226);
    --wk-accent-soft: rgba(35, 131, 226, 0.14);
    --wk-danger: rgb(235, 87, 87);
    --wk-popup: #fff;
    --wk-shadow: rgba(15, 15, 15, 0.05) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 3px 6px, rgba(15, 15, 15, 0.2) 0 9px 24px;
    --wk-code-bg: rgb(247, 246, 243);
    --wk-inline-code: rgb(235, 87, 87);
    --wk-inline-code-bg: rgba(135, 131, 120, 0.15);
    --wk-callout-bg: rgb(241, 241, 239);
    --wk-mark: rgba(251, 243, 219, 1);
    --wk-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    --wk-mono: "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace;
}

html[data-bs-theme="dark"] {
    --wk-text: rgba(255, 255, 255, 0.84);
    --wk-text-2: rgba(255, 255, 255, 0.52);
    --wk-text-3: rgba(255, 255, 255, 0.3);
    --wk-hover: rgba(255, 255, 255, 0.055);
    --wk-active: rgba(255, 255, 255, 0.09);
    --wk-border: rgba(255, 255, 255, 0.13);
    --wk-accent: rgb(82, 156, 202);
    --wk-accent-soft: rgba(82, 156, 202, 0.2);
    --wk-danger: rgb(255, 115, 105);
    --wk-popup: rgb(37, 37, 37);
    --wk-shadow: rgba(15, 15, 15, 0.1) 0 0 0 1px, rgba(15, 15, 15, 0.2) 0 3px 6px, rgba(15, 15, 15, 0.4) 0 9px 24px;
    --wk-code-bg: rgba(255, 255, 255, 0.04);
    --wk-inline-code: rgb(255, 115, 105);
    --wk-inline-code-bg: rgba(135, 131, 120, 0.25);
    --wk-callout-bg: rgba(255, 255, 255, 0.05);
    --wk-mark: rgba(89, 86, 59, 1);
}

/* ── Scroll container & page ─────────────────────────────────────────────── */

.main-content:has(> .wk-scroll) {
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

.wk-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    color: var(--wk-text);
    font-family: var(--wk-font);
}

.wk-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 56px 72px 30vh 96px;
    font-size: 16px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .wk-page { padding: 32px 24px 30vh 64px; }
}

.wk-banner {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 24px;
    border-radius: 6px;
    background: rgba(235, 87, 87, 0.1);
    color: var(--wk-danger);
    font-size: 14px;
}

.wk-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 96px 24px;
    text-align: center;
    color: var(--wk-text-2);
}

.wk-empty-state > i { font-size: 40px; color: var(--wk-text-3); }
.wk-empty-state p { margin: 0; }

/* ── Buttons & menus ─────────────────────────────────────────────────────── */

.wk-icon-btn,
.wk-ghost-btn,
.wk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--wk-text-2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 80ms ease-in;
    user-select: none;
}

.wk-icon-btn { width: 24px; height: 24px; padding: 0; }
.wk-ghost-btn { padding: 2px 8px; height: 28px; }
.wk-btn {
    padding: 4px 10px;
    height: 32px;
    border: 1px solid var(--wk-border);
    color: var(--wk-text);
    text-decoration: none;
}

.wk-icon-btn:hover,
.wk-ghost-btn:hover,
.wk-btn:hover { background: var(--wk-hover); color: var(--wk-text); }

.wk-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.wk-menu {
    position: absolute;
    z-index: 1050;
    min-width: 220px;
    max-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px 0;
    border-radius: 8px;
    background: var(--wk-popup);
    box-shadow: var(--wk-shadow);
    color: var(--wk-text);
    font-family: var(--wk-font);
    font-size: 14px;
}

.wk-menu-right { right: 0; top: 32px; }
.wk-block-menu { position: fixed; }

.wk-menu-label {
    padding: 6px 14px 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--wk-text-2);
    user-select: none;
}

.wk-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 8px);
    margin: 0 4px;
    padding: 5px 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.wk-menu-item:hover { background: var(--wk-hover); color: inherit; }
.wk-menu-item > .bi:first-child { width: 18px; text-align: center; color: var(--wk-text-2); }
.wk-menu-item.wk-danger:hover { color: var(--wk-danger); }
.wk-menu-item.wk-danger:hover > .bi { color: var(--wk-danger); }
.wk-menu-sep { height: 1px; margin: 6px 0; background: var(--wk-border); }
.wk-menu-footer { padding: 4px 14px; font-size: 12px; color: var(--wk-text-3); }

/* ── Header (breadcrumbs, presence, status) ──────────────────────────────── */

.wk-crumbs {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    font-family: var(--wk-font);
    font-size: 14px;
    color: var(--wk-text-2);
}

.wk-crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 240px;
    padding: 2px 6px;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

a.wk-crumb:hover { background: var(--wk-hover); color: var(--wk-text); }
.wk-crumb-current { color: var(--wk-text); }
.wk-crumb-sep { color: var(--wk-text-3); }

.wk-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
    font-family: var(--wk-font);
}

.wk-presence { display: flex; }

.wk-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: -6px;
    border-radius: 50%;
    border: 2px solid var(--bs-card-bg, #fff);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    user-select: none;
}

.wk-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--wk-text-2);
    white-space: nowrap;
}

/* ── Page head: icon + title ─────────────────────────────────────────────── */

.wk-page-head { position: relative; margin-bottom: 8px; }

.wk-page-controls {
    display: flex;
    gap: 4px;
    min-height: 28px;
    margin-bottom: 4px;
    opacity: 0;
    transition: opacity 120ms ease-in;
}

.wk-page-head:hover .wk-page-controls { opacity: 1; }

.wk-page-icon {
    display: block;
    width: 78px;
    height: 78px;
    padding: 0;
    margin: 0 0 8px -4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 64px;
    line-height: 78px;
    cursor: pointer;
}

.wk-page-icon:hover { background: var(--wk-hover); }

.wk-icon-picker { left: 0; top: 36px; min-width: 0; max-width: none; padding: 8px; }
.wk-icon-picker .nav-tabs { border-bottom-color: var(--wk-border); }

.wk-icon-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--wk-text-2);
}

.wk-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 2px;
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
    caret-color: var(--wk-text);
}

.wk-title:empty::before {
    content: attr(data-placeholder);
    color: var(--wk-text-3);
    pointer-events: none;
}

/* ── Blocks ──────────────────────────────────────────────────────────────── */

.wk-blocks { display: flex; flex-direction: column; }

.wk-block {
    --wk-indent-step: 1.625em;
    position: relative;
    display: flex;
    margin: 1px 0;
    padding-left: calc(var(--wk-indent, 0) * var(--wk-indent-step));
}

.wk-body {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 3px;
}

.wk-editable {
    flex: 1 1 auto;
    min-width: 1px;
    padding: 3px 2px;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    caret-color: var(--wk-text);
}

.wk-editable:empty::before {
    content: attr(data-placeholder);
    color: var(--wk-text-3);
    pointer-events: none;
}

/* Plain text blocks show their hint only while focused (like Notion). */
.wk-editable[data-type="text"]:empty:not(:focus)::before,
.wk-editable[data-type="caption"]:empty:not(:focus)::before { content: none; }

.wk-editable a { color: inherit; text-decoration: underline; text-decoration-color: var(--wk-text-3); text-underline-offset: 2px; cursor: pointer; }
.wk-editable a:hover { text-decoration-color: var(--wk-text); }
.wk-editable b { font-weight: 600; }
.wk-editable mark { background: var(--wk-mark); color: inherit; padding: 0 2px; border-radius: 2px; }
.wk-editable code {
    font-family: var(--wk-mono);
    font-size: 85%;
    color: var(--wk-inline-code);
    background: var(--wk-inline-code-bg);
    border-radius: 4px;
    padding: 0.2em 0.4em;
}

/* Gutter: "+" and drag handle */
.wk-gutter {
    position: absolute;
    top: 3px;
    left: calc(var(--wk-indent, 0) * var(--wk-indent-step) - 50px);
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 120ms ease-in;
    user-select: none;
}

.wk-block:hover > .wk-gutter { opacity: 1; }
body.wk-drag-active .wk-gutter { opacity: 0 !important; }

.wk-gutter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wk-text-3);
    font-size: 16px;
    cursor: pointer;
}

.wk-gutter-btn:hover { background: var(--wk-hover); color: var(--wk-text-2); }
.wk-handle { width: 18px; cursor: grab; }
.wk-handle:active { cursor: grabbing; }

.wk-dragging { opacity: 0.4; }
body.wk-drag-active, body.wk-drag-active * { cursor: grabbing !important; user-select: none !important; }

.wk-drop-line {
    position: fixed;
    z-index: 1060;
    height: 4px;
    border-radius: 2px;
    background: var(--wk-accent);
    opacity: 0.6;
    pointer-events: none;
}

/* Headings */
.wk-block-h1 { margin-top: 1.6em; }
.wk-block-h2 { margin-top: 1.1em; }
.wk-block-h3, .wk-block-h4, .wk-block-h5, .wk-block-h6 { margin-top: 0.8em; }
.wk-blocks > .wk-block:first-child { margin-top: 2px; }
.wk-block-h1 .wk-editable { font-size: 1.875em; font-weight: 600; line-height: 1.3; }
.wk-block-h2 .wk-editable { font-size: 1.5em; font-weight: 600; line-height: 1.3; }
.wk-block-h3 .wk-editable { font-size: 1.25em; font-weight: 600; line-height: 1.3; }
.wk-block-h4 .wk-editable, .wk-block-h5 .wk-editable, .wk-block-h6 .wk-editable { font-size: 1.05em; font-weight: 600; }
.wk-block-h1 .wk-gutter { top: 0.55em; }
.wk-block-h2 .wk-gutter { top: 0.35em; }
.wk-block-h3 .wk-gutter { top: 0.2em; }

/* Lists & todo */
.wk-prefix {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: calc(1.5em + 6px);
    margin-right: 2px;
    user-select: none;
}

.wk-bullet { font-size: 1.4em; line-height: 1; }
.wk-number { min-width: 24px; justify-content: flex-end; padding-right: 4px; font-variant-numeric: tabular-nums; }

.wk-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--wk-text-2);
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 100ms ease-out;
}

.wk-check:hover { background: var(--wk-hover); }
.wk-check.checked { background: var(--wk-accent); border-color: var(--wk-accent); }
.wk-block-todo.checked .wk-editable { text-decoration: line-through; color: var(--wk-text-3); }

/* Quote & callout */
.wk-block-quote .wk-body { padding-left: 14px; }
.wk-block-quote .wk-body::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    background: currentColor;
}
.wk-block-quote .wk-editable { font-size: 1.15em; }

.wk-block-callout { margin: 4px 0; }
.wk-block-callout .wk-body {
    padding: 14px 14px 14px 12px;
    border-radius: 4px;
    background: var(--wk-callout-bg);
}
.wk-callout-icon { font-size: 1.3em; margin-right: 8px; }
.wk-block-callout .wk-gutter { top: 17px; }

/* Code */
.wk-block-code { margin: 6px 0; }
.wk-block-code .wk-body {
    flex-direction: column;
    align-items: stretch;
    padding: 34px 16px 16px;
    border-radius: 4px;
    background: var(--wk-code-bg);
}
.wk-block-code .wk-editable {
    font-family: var(--wk-mono);
    font-size: 85%;
    line-height: 1.6;
    tab-size: 2;
    white-space: pre;
    overflow-x: auto;
    padding: 0;
}
.wk-block-code .wk-gutter { top: 8px; }

.wk-code-bar {
    position: absolute;
    top: 6px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 120ms ease-in;
}

.wk-block-code:hover .wk-code-bar,
.wk-code-bar:focus-within { opacity: 1; }

.wk-code-lang,
.wk-code-copy {
    height: 24px;
    padding: 0 6px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wk-text-2);
    font-family: var(--wk-font);
    font-size: 12px;
    cursor: pointer;
}

.wk-code-lang:hover, .wk-code-copy:hover { background: var(--wk-hover); }
.wk-code-lang option { background: var(--wk-popup); color: var(--wk-text); }

/* Divider */
.wk-block-divider .wk-body { padding: 10px 2px; cursor: default; }
.wk-block-divider .wk-gutter { top: 7px; }
.wk-divider { flex: 1; border-top: 1px solid var(--wk-border); }
.wk-divider-dashed { border-top-style: dashed; }
.wk-divider-dotted { border-top-style: dotted; border-top-width: 2px; }
.wk-divider-sample { display: inline-block; width: 18px; border-top: 1px solid var(--wk-text-2); }
.wk-divider-sample.wk-divider-dashed { border-top-style: dashed; }
.wk-divider-sample.wk-divider-dotted { border-top-style: dotted; border-top-width: 2px; }

/* Image */
.wk-block-image { margin: 6px 0; }
.wk-block-image .wk-body { flex-direction: column; align-items: stretch; }
.wk-image { margin: 0; }
.wk-image img { display: block; max-width: 100%; max-height: 80vh; border-radius: 4px; }
.wk-caption { font-size: 14px; color: var(--wk-text-2); padding-top: 6px; }

.wk-image-empty {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 4px;
    background: var(--wk-callout-bg);
    color: var(--wk-text-2);
    font-size: 14px;
}

.wk-image-empty-title { display: flex; gap: 8px; align-items: center; }
.wk-image-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.wk-input {
    flex: 1 1 240px;
    height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--wk-border);
    border-radius: 4px;
    background: var(--wk-popup);
    color: var(--wk-text);
    font-size: 14px;
    outline: none;
}

.wk-input:focus { border-color: var(--wk-accent); box-shadow: 0 0 0 3px var(--wk-accent-soft); }

/* Table */
.wk-block-table, .wk-block-columns { margin: 6px 0; }
.wk-block-table .wk-body, .wk-block-columns .wk-body { flex-direction: column; align-items: stretch; }
.wk-block-table .wk-gutter { top: 20px; }

.wk-table-wrap { position: relative; padding: 0 22px 22px 0; }
.wk-table-scroll { overflow-x: auto; }

.wk-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.wk-table td {
    min-width: 100px;
    padding: 0;
    border: 1px solid var(--wk-border);
    vertical-align: top;
}

.wk-table .wk-cell { padding: 6px 8px; min-height: 1.5em; }
.wk-table-header tbody tr:first-child td { background: var(--wk-callout-bg); }
.wk-table-header tbody tr:first-child .wk-cell { font-weight: 600; }

/* Delete column (above each column) / delete row (after each row), shown on hover */
.wk-table-tools th { height: 18px; padding: 0; text-align: center; font-weight: normal; }
.wk-table th.wk-table-row-tools,
.wk-table td.wk-table-row-tools { width: 24px; min-width: 24px; border: none; text-align: center; vertical-align: middle; }

.wk-table-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--wk-text-3);
    font-size: 14px;
    opacity: 0;
    cursor: pointer;
}

.wk-table-tools:hover .wk-table-tool,
.wk-table tr:hover > .wk-table-row-tools .wk-table-tool { opacity: 1; }
.wk-table-tool:hover { background: var(--wk-hover); color: var(--wk-danger); }

.wk-table-add {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--wk-text-3);
    font-size: 12px;
    opacity: 0;
    cursor: pointer;
}

.wk-table-wrap:hover .wk-table-add { opacity: 1; }
.wk-table-add:hover { background: var(--wk-hover); color: var(--wk-text); }
.wk-table-add-row { left: 0; right: 46px; bottom: 0; height: 18px; }
.wk-table-add-col { top: 18px; right: 0; bottom: 22px; width: 18px; }

/* Columns */
.wk-columns {
    display: grid;
    grid-template-columns: repeat(var(--wk-cols, 2), minmax(0, 1fr));
    gap: 24px;
}

.wk-column { min-width: 0; padding: 2px 6px; border-radius: 4px; }
.wk-block-columns:hover .wk-column { box-shadow: inset 0 0 0 1px var(--wk-border); }
.wk-column .wk-cell { min-height: 1.5em; }

/* Someone else is editing this block */
.wk-remote-focus > .wk-body { box-shadow: -3px 0 0 0 var(--wk-remote); }

.wk-remote-tag {
    position: absolute;
    top: -9px;
    right: 0;
    z-index: 2;
    padding: 0 6px;
    border-radius: 3px;
    background: var(--wk-remote);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    pointer-events: none;
    user-select: none;
}

/* Area below the blocks: click to continue writing */
.wk-tail { min-height: 120px; cursor: text; padding-top: 4px; }
.wk-tail-hint { color: var(--wk-text-3); padding: 3px 2px; }

/* Sub-pages list */
.wk-subpages { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--wk-border); }
.wk-subpages-label { font-size: 12px; font-weight: 500; color: var(--wk-text-2); margin-bottom: 4px; }

.wk-subpage {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
    border-radius: 4px;
    color: var(--wk-text);
    text-decoration: underline;
    text-decoration-color: var(--wk-border);
    text-underline-offset: 3px;
}

.wk-subpage:hover { background: var(--wk-hover); color: var(--wk-text); }

.wk-page-glyph { color: var(--wk-text-2); }
.wk-page-emoji { line-height: 1; }

/* ── Floating: slash menu & inline toolbar ───────────────────────────────── */

.wk-slash-menu {
    position: fixed;
    z-index: 1070;
    width: 324px;
    max-height: 360px;
    overflow-y: auto;
    padding: 6px 0;
    border-radius: 8px;
    background: var(--wk-popup);
    box-shadow: var(--wk-shadow);
    color: var(--wk-text);
    font-family: var(--wk-font);
    font-size: 14px;
}

.wk-slash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}

.wk-slash-item.selected { background: var(--wk-hover); }

.wk-slash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 1px solid var(--wk-border);
    border-radius: 4px;
    background: var(--wk-popup);
    font-size: 22px;
    color: var(--wk-text);
}

.wk-slash-text { display: flex; flex-direction: column; min-width: 0; }
.wk-slash-title { line-height: 1.3; }
.wk-slash-hint { font-size: 12px; color: var(--wk-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-slash-empty { padding: 6px 14px; color: var(--wk-text-2); }

.wk-toolbar {
    position: fixed;
    z-index: 1070;
    display: flex;
    padding: 3px;
    border-radius: 6px;
    background: var(--wk-popup);
    box-shadow: var(--wk-shadow);
}

.wk-toolbar button {
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wk-text);
    font-size: 16px;
    cursor: pointer;
}

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

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.wk-side {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: var(--wk-font);
    font-size: 14px;
    color: var(--wk-text-2);
}

.wk-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 8px 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--wk-text);
}

.wk-side-scroll { flex: 1 1 auto; overflow-y: auto; margin-top: 10px; }
.wk-side-section { margin-bottom: 10px; }

.wk-side-row {
    --depth: 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 30px;
    padding: 2px 6px 2px calc(8px + var(--depth) * 14px);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}

.wk-side-row:hover { background: var(--wk-hover); color: var(--wk-text-2); }
.wk-side-row.active { background: var(--wk-active); color: var(--wk-text); font-weight: 500; }
.wk-side-static { cursor: default; }
.wk-side-static:hover { background: transparent; }
.wk-side-muted { color: var(--wk-text-3); font-size: 13px; }

.wk-side-project { font-weight: 600; color: var(--wk-text); }
.wk-side-chevron { font-size: 11px; color: var(--wk-text-3); }

.wk-side-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
}

.wk-side-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wk-side-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 20px;
    margin-right: -4px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--wk-text-3);
    font-size: 10px;
}

.wk-side-toggle:hover { background: var(--wk-active); color: var(--wk-text); }

.wk-side-actions { display: none; gap: 2px; flex-shrink: 0; }
.wk-side-row:hover .wk-side-actions { display: inline-flex; }

.wk-side-rename {
    flex: 1 1 auto;
    min-width: 0;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--wk-accent);
    border-radius: 4px;
    background: var(--wk-popup);
    color: var(--wk-text);
    outline: none;
}

.wk-side-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; color: var(--wk-text-3); }

/* ── Search ──────────────────────────────────────────────────────────────── */

.wk-search { padding-top: 40px; }

.wk-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    margin-bottom: 20px;
    height: 48px;
    border-radius: 8px;
    box-shadow: var(--wk-shadow);
    background: var(--wk-popup);
    color: var(--wk-text-2);
}

.wk-search-box input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--wk-text);
    font-size: 18px;
}

.wk-search-results { display: flex; flex-direction: column; gap: 2px; }

.wk-search-result {
    display: flex;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--wk-text);
    text-decoration: none;
}

.wk-search-result:hover { background: var(--wk-hover); color: var(--wk-text); }
.wk-search-icon { flex: 0 0 22px; font-size: 18px; line-height: 1.4; }
.wk-search-body { display: flex; flex-direction: column; min-width: 0; }
.wk-search-title { font-weight: 500; }
.wk-search-snippet { font-size: 14px; color: var(--wk-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-search-meta { font-size: 12px; color: var(--wk-text-3); }
.wk-search mark { background: var(--wk-mark); color: inherit; padding: 0; }
