/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-side: #f7f7f5;
  --bg-hover: rgba(55, 53, 47, 0.06);
  --bg-active: rgba(55, 53, 47, 0.1);
  --bg-selected: rgba(47, 111, 235, 0.14);
  --bg-code: #f6f6f4;
  --bg-callout: #f1f1ef;
  --bg-menu: #ffffff;
  --fg: #1f1f1f;
  --fg-2: #6b6b6b;
  --fg-3: #a0a0a0;
  --border: #e6e6e3;
  --accent: #2f6feb;
  --accent-fg: #ffffff;
  --danger: #d23b3b;
  --mark: #fff3a3;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-w: 260px;
  --content-w: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --bg-side: #202020; --bg-hover: rgba(255, 255, 255, 0.06); --bg-active: rgba(255, 255, 255, 0.1);
    --bg-selected: rgba(90, 150, 255, 0.22); --bg-code: #232323; --bg-callout: #262626; --bg-menu: #252525;
    --fg: #e6e6e6; --fg-2: #9b9b9b; --fg-3: #6d6d6d; --border: #313131; --accent: #5a96ff; --mark: #6b5b12;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --bg-side: #202020; --bg-hover: rgba(255, 255, 255, 0.06); --bg-active: rgba(255, 255, 255, 0.1);
  --bg-selected: rgba(90, 150, 255, 0.22); --bg-code: #232323; --bg-callout: #262626; --bg-menu: #252525;
  --fg: #e6e6e6; --fg-2: #9b9b9b; --fg-3: #6d6d6d; --border: #313131; --accent: #5a96ff; --mark: #6b5b12;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font);
  display: flex; overflow: hidden; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
kbd { font: 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: var(--bg-active); color: var(--fg-2); }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
.muted { color: var(--fg-2); }
.small { font-size: 13px; }
::selection { background: rgba(47, 111, 235, 0.25); }

.btn { padding: 6px 12px; border-radius: 6px; background: var(--bg-active); color: var(--fg); font-size: 14px; }
.btn:hover { filter: brightness(0.95); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; color: var(--fg-2); display: inline-grid; place-items: center; font-size: 15px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); }

/* ---------- Sidebar ---------- */
#sidebar {
  width: var(--sidebar-w); flex: none; background: var(--bg-side); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 8px; gap: 2px; transition: margin-left 0.18s ease; user-select: none;
}
body.sidebar-hidden #sidebar { margin-left: calc(-1 * var(--sidebar-w)); }
#sidebar.file-over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.sidebar-opener { position: fixed; top: 10px; left: 10px; z-index: 5; display: none; }
body.sidebar-hidden .sidebar-opener { display: inline-grid; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; }
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 15px; }
.side-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 6px; color: var(--fg-2); font-size: 14px; text-align: left;
}
.side-btn:hover { background: var(--bg-hover); color: var(--fg); }
.side-btn span:first-child { width: 18px; text-align: center; }
.side-btn kbd { margin-left: auto; }
.tree { flex: 1; overflow: auto; margin-top: 8px; padding-bottom: 20px; }
.tree-empty { color: var(--fg-3); font-size: 13px; padding: 12px 8px; }
.tree-row {
  display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px calc(6px + var(--depth) * 14px);
  border-radius: 6px; font-size: 14px; color: var(--fg-2); cursor: pointer; position: relative; min-height: 28px;
}
.tree-row:hover { background: var(--bg-hover); color: var(--fg); }
.tree-row.active { background: var(--bg-active); color: var(--fg); font-weight: 500; }
.tree-row.drop-inside { box-shadow: inset 0 0 0 2px var(--accent); }
.tree-row.drop-before::before, .tree-row.drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--accent); }
.tree-row.drop-before::before { top: -1px; } .tree-row.drop-after::after { bottom: -1px; }
.tree-chevron { width: 18px; height: 18px; border-radius: 4px; color: var(--fg-3); font-size: 15px; transition: transform 0.12s; display: grid; place-items: center; flex: none; }
.tree-chevron.open { transform: rotate(90deg); }
.tree-chevron.empty { visibility: hidden; }
.tree-row:hover .tree-chevron:not(.empty) { background: var(--bg-active); color: var(--fg); }
.tree-icon { width: 20px; text-align: center; flex: none; font-size: 15px; }
.tree-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-actions { display: none; gap: 2px; }
.tree-row:hover .tree-actions { display: flex; }
.tree-actions .icon-btn { width: 22px; height: 22px; font-size: 14px; }
.sidebar-bottom { border-top: 1px solid var(--border); padding-top: 8px; }
.sidebar-tools { display: flex; gap: 4px; padding: 6px 4px 0; }

/* ---------- Main / page ---------- */
#main { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.topbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 8px 52px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); font-size: 14px; min-height: 44px; }
body:not(.sidebar-hidden) .topbar { padding-left: 16px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.crumbs { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.crumb { color: var(--fg-2); text-decoration: none; padding: 2px 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.crumb:hover { background: var(--bg-hover); color: var(--fg); }
.crumb.current { color: var(--fg); }
.crumb-sep { color: var(--fg-3); }
#save-status { font-size: 12px; color: var(--fg-3); }
#save-status[data-state="busy"] { color: var(--fg-2); }
#save-status[data-state="err"] { color: var(--danger); }

.page { max-width: var(--content-w); margin: 0 auto; padding: 48px 24px 30vh; }
body.wide .page { max-width: min(1400px, 100% - 96px); }
.page-head { margin-bottom: 8px; }
.page-icon { font-size: 56px; line-height: 1; padding: 6px; margin-left: -6px; border-radius: 8px; display: inline-block; }
.page-icon:hover { background: var(--bg-hover); }
.page-icon.empty { font-size: 13px; color: var(--fg-3); opacity: 0; padding: 4px 6px; }
.page-head:hover .page-icon.empty, .page-icon.empty:focus { opacity: 1; }
.page-title { font-size: 40px; font-weight: 700; line-height: 1.2; margin: 6px 0 0; outline: none; letter-spacing: -0.02em; word-break: break-word; }
.page-title:empty::before { content: attr(data-placeholder); color: var(--fg-3); }
.page-title.static { margin-bottom: 8px; }
.page-footer { margin-top: 48px; display: grid; gap: 20px; }
.footer-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); margin-bottom: 6px; }
.footer-link { display: flex; gap: 8px; align-items: center; padding: 4px 6px; margin-left: -6px; border-radius: 6px; color: var(--fg); text-decoration: none; font-size: 15px; }
.footer-link:hover { background: var(--bg-hover); }
.footer-link span:last-child { border-bottom: 1px solid var(--border); }

/* ---------- Editor ---------- */
.editor { position: relative; }
.blocks { display: flex; flex-direction: column; }
.editor-tail { height: 120px; cursor: text; }
.drop-line { display: none; position: absolute; height: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; z-index: 2; }

.block { position: relative; display: flex; align-items: flex-start; padding: 2px 0; margin-left: calc(var(--indent, 0) * 28px); border-radius: 4px; }
.block.selected { background: var(--bg-selected); }
.block.dragging { opacity: 0.4; }
.block-handle {
  position: absolute; left: -26px; top: 50%; transform: translateY(-50%); width: 20px; height: 24px; border-radius: 4px; cursor: grab;
  display: grid; place-items: center; color: var(--fg-3); opacity: 0; transition: opacity 0.1s;
}
.block:hover > .block-handle, .block.selected > .block-handle { opacity: 1; }
.block-handle:hover { background: var(--bg-hover); color: var(--fg-2); }
.block-handle:active { cursor: grabbing; }
.t-heading1 > .block-handle, .t-heading2 > .block-handle, .t-heading3 > .block-handle { top: auto; bottom: 8px; transform: none; }
.block-body { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 4px; }
.block-text { flex: 1; min-width: 0; outline: none; padding: 3px 2px; white-space: pre-wrap; word-break: break-word; caret-color: var(--fg); }
.block-text:empty::before { content: attr(data-placeholder); color: var(--fg-3); pointer-events: none; }
.t-paragraph .block-text:not(:focus):empty::before { content: ""; }
.block-text b { font-weight: 600; }
.block-text code { font: 0.86em var(--mono); background: var(--bg-code); color: #c7254e; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--border); }
:root[data-theme="dark"] .block-text code { color: #ff8a8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .block-text code { color: #ff8a8a; } }
.block-text mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.block-text a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg-3); text-underline-offset: 3px; cursor: pointer; }
.block-text a:hover { text-decoration-color: var(--fg); }
.block-text a.pagelink { text-decoration: none; font-weight: 500; padding: 0 3px; border-radius: 4px; background: var(--bg-hover); white-space: nowrap; }
.block-text a.pagelink:hover { background: var(--bg-active); }
.block-text a.pagelink.dead, .pageref.dead { color: var(--fg-3); text-decoration: line-through; }

.t-heading1 .block-text { font-size: 30px; font-weight: 700; line-height: 1.25; margin-top: 26px; letter-spacing: -0.015em; }
.t-heading2 .block-text { font-size: 24px; font-weight: 650; line-height: 1.3; margin-top: 18px; letter-spacing: -0.01em; }
.t-heading3 .block-text { font-size: 19px; font-weight: 600; line-height: 1.35; margin-top: 10px; }
.gutter { flex: none; width: 24px; display: flex; justify-content: center; align-items: center; min-height: 30px; user-select: none; }
.gutter.marker { color: var(--fg); font-variant-numeric: tabular-nums; font-size: 15px; }
.t-todo .gutter input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.t-todo .block-text { transition: color 0.1s; }
.t-todo:has(input:checked) .block-text { color: var(--fg-3); text-decoration: line-through; }
.t-quote .block-body { border-left: 3px solid var(--fg); padding-left: 14px; margin: 4px 0; }
.t-quote .block-text { font-size: 17px; }
.t-callout .block-body { background: var(--bg-callout); border-radius: var(--radius); padding: 12px 14px; gap: 10px; margin: 4px 0; align-items: flex-start; }
.callout-icon { font-size: 20px; line-height: 1.3; border-radius: 4px; padding: 0 2px; }
.callout-icon:hover { background: var(--bg-active); }
.t-divider { padding: 10px 0; }
.t-divider hr { flex: 1; width: 100%; }
.t-divider .block-body { align-items: center; min-height: 12px; }

.code-wrap { position: relative; flex: 1; min-width: 0; background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); margin: 4px 0; }
.code-wrap .block-text { font: 13.5px/1.6 var(--mono); padding: 14px 16px; tab-size: 2; white-space: pre-wrap; }
.code-wrap .block-text:empty::before { content: "Write some code…"; }
.code-lang { position: absolute; top: 6px; right: 8px; font-size: 12px; color: var(--fg-3); background: transparent; border: 0; opacity: 0; cursor: pointer; appearance: none; padding: 2px 6px; border-radius: 4px; }
.code-wrap:hover .code-lang, .code-lang:focus { opacity: 1; background: var(--bg-active); }
.code-wrap:has(.block-text:focus) .code-lang { opacity: 1; }

.image-wrap { width: 100%; }
.image-wrap img { max-width: 100%; border-radius: var(--radius); display: block; cursor: default; }
.t-image .block-body { flex-direction: column; gap: 4px; }
.t-image .caption { font-size: 13.5px; color: var(--fg-2); }
.image-empty { width: 100%; background: var(--bg-callout); border-radius: var(--radius); padding: 14px; color: var(--fg-2); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-input { flex: 1; min-width: 200px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 13px; }

.pageref { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px; margin: 1px 0; border-radius: 6px; color: var(--fg); text-decoration: none; font-weight: 500; }
.pageref:hover { background: var(--bg-hover); }
.pageref-title { border-bottom: 1px solid var(--border); }

/* ---------- Menus ---------- */
.menu {
  position: fixed; z-index: 110; background: var(--bg-menu); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); /* above #overlay dialogs (60) and modals (100): menus open from inside them */
  max-height: min(380px, 70vh); display: flex; flex-direction: column; overflow: hidden; font-size: 14px; animation: pop 0.1s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-3px) scale(0.98); } }
.menu-input { border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 10px 12px; outline: none; font-size: 14px; width: 100%; }
.menu-list { overflow-y: auto; padding: 6px; }
.menu-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); padding: 8px 8px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--fg); }
.menu-item.active { background: var(--bg-active); }
.menu-item.danger { color: var(--danger); }
.menu-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--fg-2); }
.menu-label { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.menu-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-hint { font-size: 12px; color: var(--fg-3); }
.menu-shortcut { font-size: 11px; color: var(--fg-3); font-family: var(--mono); }
.menu-empty { padding: 12px; color: var(--fg-3); text-align: center; }
.emoji-picker { width: 340px; padding: 8px; gap: 8px; }
.emoji-head { display: flex; gap: 6px; align-items: center; }
.emoji-head .menu-input { border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; overflow-y: auto; }
.emoji-btn { font-size: 20px; padding: 4px; border-radius: 6px; line-height: 1.2; }
.emoji-btn:hover, .emoji-btn.active { background: var(--bg-active); }

/* ---------- Formatting toolbar ---------- */
.fmt-toolbar { position: fixed; z-index: 40; display: none; background: var(--bg-menu); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 3px; }
.fmt-toolbar.show { display: block; }
.fmt-row { display: flex; gap: 1px; }
.fmt-toolbar.linking .fmt-row { display: none; }
.fmt-link { display: none; }
.fmt-toolbar.linking .fmt-link { display: block; }
.fmt-btn { width: 30px; height: 28px; border-radius: 5px; display: grid; place-items: center; font-size: 14px; color: var(--fg); }
.fmt-btn code { font-size: 12px; background: none; color: inherit; }
.fmt-btn mark { background: var(--mark); padding: 0 3px; border-radius: 3px; }
.fmt-btn:hover { background: var(--bg-hover); }
.fmt-btn.on { color: var(--accent); background: var(--bg-selected); }
.fmt-link-input { border: 0; outline: none; background: transparent; padding: 6px 10px; width: 280px; font-size: 14px; }

/* ---------- Overlay: palette & help ---------- */
#overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.25); display: none; padding: 12vh 16px 0; justify-content: center; align-items: flex-start; }
#overlay.show { display: flex; }
.palette { width: min(640px, 100%); background: var(--bg-menu); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; animation: pop 0.12s ease-out; }
.palette-input { border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 16px 18px; font-size: 17px; outline: none; }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.palette-row.active { background: var(--bg-active); }
.palette-text { display: flex; flex-direction: column; min-width: 0; }
.palette-title { font-size: 15px; }
.palette-hint { font-size: 12px; color: var(--fg-3); }
.palette-snippet { font-size: 13px; color: var(--fg-2); margin-top: 2px; }
.palette-snippet mark { background: var(--mark); color: inherit; border-radius: 2px; }
.palette-foot { border-top: 1px solid var(--border); padding: 8px 14px; font-size: 12px; color: var(--fg-3); }
.palette.help { padding: 20px 24px; gap: 12px; }
.palette.help h2 { margin: 0; font-size: 18px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; overflow-y: auto; }
.help-col h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); }
.help-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.help-row kbd { min-width: 78px; text-align: center; white-space: nowrap; }

/* ---------- Trash ---------- */
.trash-list { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); }
.trash-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); animation: pop 0.15s ease-out; }
.toast .btn { background: rgba(255, 255, 255, 0.15); color: inherit; }
.toast.hide { opacity: 0; transition: opacity 0.3s; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; box-shadow: var(--shadow); }
  body.sidebar-hidden #sidebar { box-shadow: none; }
  .page { padding: 40px 16px 30vh; }
  .page-title { font-size: 32px; }
  .topbar { padding-left: 52px; }
  .block-handle { left: -22px; }
  .block { margin-left: calc(var(--indent, 0) * 20px); }
}
@media print { #sidebar, .topbar, .block-handle, .editor-tail { display: none !important; } .page { padding: 0; } }

/* ---------- Databases ---------- */
.t-database { padding: 6px 0; }
.t-database .block-body { display: block; min-width: 0; }
.dbv-host { width: 100%; min-width: 0; }
.dbv { font-size: 14px; }
.dbv-header-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dbv-linked { color: var(--fg-3); text-decoration: none; font-size: 16px; padding: 2px 6px; border-radius: 4px; flex: none; }
.dbv-linked:hover { background: var(--bg-hover); color: var(--fg); }
.dbv-title { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 20px; font-weight: 650; padding: 4px 0; color: var(--fg); letter-spacing: -0.01em; }
.dbv-title::placeholder { color: var(--fg-3); }
.dbv-tools { display: flex; gap: 2px; align-items: center; flex: none; opacity: 0.85; }
.dbv:hover .dbv-tools, .dbv:focus-within .dbv-tools { opacity: 1; }
.tool { padding: 4px 8px; border-radius: 6px; color: var(--fg-2); font-size: 13px; }
.tool:hover { background: var(--bg-hover); color: var(--fg); }
.tool.on { color: var(--accent); }
.tool.primary { background: var(--accent); color: var(--accent-fg); font-weight: 500; padding: 4px 10px; margin-left: 4px; }
.tool.primary:hover { filter: brightness(1.05); background: var(--accent); }
.dbv-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 8px; overflow-x: auto; }
.dbv-tab { padding: 6px 8px; font-size: 13px; color: var(--fg-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.dbv-tab:hover { color: var(--fg); background: var(--bg-hover); border-radius: 6px 6px 0 0; }
.dbv-tab.active { color: var(--fg); border-bottom-color: var(--fg); font-weight: 500; }
.dbv-tab.add { color: var(--fg-3); }
.tab-icon { font-size: 12px; opacity: 0.7; }
.dbv-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.rule-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--fg-2); background: var(--bg); }
.rule-chip:hover { border-color: var(--fg-3); color: var(--fg); }
.rule-chip.sort { color: var(--accent); }
.dbv-count { font-size: 12px; color: var(--fg-3); padding: 6px 4px; }
.dbv-missing { color: var(--fg-3); padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); display: flex; gap: 8px; align-items: center; }

/* table */
.dbv-table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.dbv-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 0; min-width: 100%; } /* width:0 makes the fixed layout honour column widths; long titles no longer stretch the Name column */
.dbv-table th, .dbv-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; vertical-align: top; padding: 0; position: relative; }
.dbv-table th:first-child, .dbv-table td:first-child { border-left: 1px solid transparent; }
.dbv-table th { border-top: 1px solid var(--border); font-weight: 500; color: var(--fg-2); font-size: 13px; height: 34px; background: var(--bg); position: sticky; top: 0; z-index: 1; }
.dbv-table .th-add, .dbv-table .td-pad { width: 40px; border-right: 0; }
.th-label { width: 100%; height: 100%; display: flex; gap: 6px; align-items: center; padding: 6px 8px; text-align: left; overflow: hidden; }
.th-label:hover { background: var(--bg-hover); }
.th-icon { color: var(--fg-3); font-size: 12px; width: 14px; text-align: center; flex: none; }
.th-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-input { width: 100%; height: 34px; border: 2px solid var(--accent); border-radius: 4px; padding: 4px 8px; outline: none; background: var(--bg); }
.th-resize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 2; }
.th-resize:hover, body.resizing .th-resize { background: var(--accent); opacity: 0.5; }
body.resizing { cursor: col-resize; user-select: none; }
.dbv-table td { height: 34px; }
.dbv-table tr:hover td { background: var(--bg-hover); }
.dbv-table .tr-new td { border-right: 0; border-left: 0; }
.dbv-table .tr-new:hover td { background: transparent; }
.new-row { width: 100%; text-align: left; padding: 7px 8px; color: var(--fg-3); font-size: 13px; border-radius: 6px; }
.new-row:hover { background: var(--bg-hover); color: var(--fg); }
.row-menu { position: absolute; left: -26px; top: 6px; width: 22px; height: 22px; border-radius: 4px; color: var(--fg-3); opacity: 0; font-size: 13px; }
.dbv-table tr:hover .row-menu { opacity: 1; }
.row-menu:hover { background: var(--bg-active); color: var(--fg); }

/* cells */
.cell { min-height: 33px; padding: 6px 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; cursor: text; line-height: 1.4; word-break: break-word; position: relative; }
.cell.type-title { font-weight: 500; cursor: pointer; flex-wrap: nowrap; }
.cell.type-title .cell-title { display: flex; gap: 6px; align-items: center; min-width: 0; flex: 1; }
.cell.type-title .cell-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.type-title.empty .cell-text { color: var(--fg-3); font-weight: 400; }
.cell.type-checkbox, .cell.type-select, .cell.type-multi_select, .cell.type-date { cursor: pointer; }
.cell.type-checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.cell.type-number { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.cell a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cell.editing { padding: 0; }
.cell-input { width: 100%; min-height: 33px; border: 0; outline: none; background: var(--bg); box-shadow: inset 0 0 0 2px var(--accent); padding: 6px 8px; font: inherit; color: inherit; resize: none; border-radius: 2px; }
.cell.compact .cell-input { box-shadow: inset 0 0 0 1px var(--accent); min-height: 26px; padding: 3px 6px; }
.open-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--bg-menu); border: 1px solid var(--border); color: var(--fg-2); opacity: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.06); font-weight: 500; }
.dbv-table tr:hover .open-btn { opacity: 1; }
.open-btn:hover { color: var(--fg); background: var(--bg-hover); }
.row-icon { font-size: 15px; }
.cell.compact { min-height: 0; padding: 2px 4px; font-size: 13px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 4px; font-size: 13px; line-height: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.chip.removable { padding-right: 4px; }
.chip-x { font-size: 13px; line-height: 1; padding: 0 3px; border-radius: 3px; color: inherit; opacity: 0.6; }
.chip-x:hover { opacity: 1; background: rgba(0,0,0,0.1); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.c-none { background: var(--bg-active); color: var(--fg-2); }
.c-gray { background: #e9e9e7; } .c-brown { background: #eee0da; } .c-orange { background: #fadec9; } .c-yellow { background: #fdecc8; }
.c-green { background: #dbeddb; } .c-blue { background: #d3e5ef; } .c-purple { background: #e8deee; } .c-pink { background: #f5e0e9; } .c-red { background: #ffe2dd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-gray { background: #5a5a5a; } :root:not([data-theme="light"]) .c-brown { background: #603b2c; } :root:not([data-theme="light"]) .c-orange { background: #854c1d; }
  :root:not([data-theme="light"]) .c-yellow { background: #89632a; } :root:not([data-theme="light"]) .c-green { background: #2b593f; } :root:not([data-theme="light"]) .c-blue { background: #28456c; }
  :root:not([data-theme="light"]) .c-purple { background: #492f64; } :root:not([data-theme="light"]) .c-pink { background: #69314c; } :root:not([data-theme="light"]) .c-red { background: #6e3630; }
}
:root[data-theme="dark"] .c-gray { background: #5a5a5a; } :root[data-theme="dark"] .c-brown { background: #603b2c; } :root[data-theme="dark"] .c-orange { background: #854c1d; }
:root[data-theme="dark"] .c-yellow { background: #89632a; } :root[data-theme="dark"] .c-green { background: #2b593f; } :root[data-theme="dark"] .c-blue { background: #28456c; }
:root[data-theme="dark"] .c-purple { background: #492f64; } :root[data-theme="dark"] .c-pink { background: #69314c; } :root[data-theme="dark"] .c-red { background: #6e3630; }

/* select editor & popovers */
.popover { padding: 0; }
.sel-editor { display: flex; flex-direction: column; max-height: 360px; }
.sel-current { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 0; }
.sel-list { overflow-y: auto; }
.sel-opt { gap: 8px; }
.sel-opt .drag-dot { color: var(--fg-3); font-size: 10px; letter-spacing: -2px; }
.sel-opt .check { color: var(--fg-2); font-size: 12px; }
.spacer { flex: 1; }
.icon-btn.tiny { width: 22px; height: 22px; font-size: 13px; }
.date-pop { display: flex; gap: 6px; padding: 8px; align-items: center; }
.date-input { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; background: var(--bg); font-size: 13px; }
.rules-pop { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rule { display: flex; gap: 6px; align-items: center; }
.rule-sel, .rule-input { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; background: var(--bg); font-size: 13px; min-width: 0; flex: 1; }
.rule-sel { flex: 0 1 auto; max-width: 160px; }
.add-rule { color: var(--fg-2); font-size: 13px; width: 100%; }
.props-pop { padding: 6px; max-height: 360px; overflow-y: auto; }
.menu-item.selected { background: transparent; }

/* board */
.dbv-board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 2px 0 12px; }
.dbv-col { width: 240px; flex: none; border-radius: var(--radius); padding: 4px; }
.dbv-col.drop { background: var(--bg-selected); }
.dbv-col.ghost { width: 180px; }
.col-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 8px; }
.col-count { font-size: 12px; color: var(--fg-3); }
.cards { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.card { position: relative; background: var(--bg-menu); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.card:hover { background: var(--bg-hover); }
.card.dragging { opacity: 0.4; }
.card-title { font-weight: 500; }
.card-title .cell { padding: 0; min-height: 0; }
.card-title .cell.type-title .cell-text { white-space: normal; }
.card-prop .cell { padding: 0; font-size: 12.5px; color: var(--fg-2); }
.card-prop .cell.type-number { justify-content: flex-start; }
.card-menu { position: absolute; right: 4px; top: 4px; opacity: 0; }
.card:hover .card-menu { opacity: 1; }
.new-card, .add-group { text-align: left; width: 100%; padding: 6px 8px; border-radius: 6px; color: var(--fg-3); font-size: 13px; }
.new-card:hover, .add-group:hover { background: var(--bg-hover); color: var(--fg); }

/* list */
.dbv-list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 4px 6px; border-radius: 6px; cursor: pointer; min-height: 36px; }
.list-row:hover { background: var(--bg-hover); }
.list-title { flex: 1; min-width: 0; }
.list-title .cell { padding: 2px 4px; }
.list-props { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; color: var(--fg-2); font-size: 13px; }
.list-prop .cell.type-number { justify-content: flex-start; }
.list-prop .cell.empty:not(.type-checkbox) { display: none; }

/* row page property panel */
.row-panel { margin: 4px 0 20px; }
.row-db-link { display: inline-flex; gap: 4px; font-size: 13px; color: var(--fg-2); text-decoration: none; padding: 2px 6px; margin-left: -6px; border-radius: 4px; margin-bottom: 8px; }
.row-db-link:hover { background: var(--bg-hover); color: var(--fg); }
.props-panel { display: grid; grid-template-columns: 160px 1fr; gap: 2px 8px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.prop-row { display: contents; }
.prop-name { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 14px; padding: 6px 4px; min-height: 34px; }
.props-panel .cell { border-radius: 4px; }
.props-panel .cell.type-number { justify-content: flex-start; }
.card-check { font-size: 12.5px; color: var(--fg-2); }
.props-panel .cell:hover { background: var(--bg-hover); }
.props-panel .cell.empty:not(.type-checkbox)::before { content: "Empty"; color: var(--fg-3); }
.props-panel .cell.editing::before { content: none; }
@media (max-width: 800px) { .props-panel { grid-template-columns: 120px 1fr; } .dbv-col { width: 220px; } }

/* ---------- Workspaces, accounts, presence, sharing ---------- */
.ws-switch { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; min-width: 0; flex: 1; text-align: left; }
.ws-switch:hover { background: var(--bg-hover); }
.ws-icon { width: 22px; height: 22px; border-radius: 6px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.ws-icon.emoji { background: transparent; color: inherit; font-size: 18px; }
.ws-icon.big { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; cursor: pointer; }
.ws-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chev { color: var(--fg-3); font-size: 12px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-size: 13px; color: var(--fg-2); min-width: 0; }
.user-btn:hover { background: var(--bg-hover); color: var(--fg); }
.user-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: white; font-size: 10px; font-weight: 700; flex: none; letter-spacing: 0.02em; }
.avatar.small { width: 22px; height: 22px; font-size: 9px; border: 2px solid var(--bg); margin-left: -6px; }
.avatar.small:first-child { margin-left: 0; }
.avatar.big { width: 36px; height: 36px; font-size: 13px; }
.avatar.ws { background: var(--bg-active); color: var(--fg); font-size: 13px; }
.avatar.more { background: var(--bg-active); color: var(--fg-2); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); opacity: 0.5; margin: 0 4px; }
.conn-dot.on { background: #34c759; opacity: 1; }
.sidebar-tools { align-items: center; }
.tree-section { display: flex; align-items: center; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); padding: 12px 8px 4px; }
.tree-section .icon-btn { opacity: 0; }
.tree-section:hover .icon-btn { opacity: 1; }
.tree-lock { font-size: 11px; opacity: 0.6; }
.presence { display: flex; align-items: center; margin-right: 6px; }
.share-btn { padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--fg-2); }
.share-btn:hover { background: var(--bg-hover); color: var(--fg); }
.ro-banner { background: var(--bg-callout); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; color: var(--fg-2); margin-bottom: 20px; }
.page.readonly .page-title { cursor: default; }
.page-icon.static { font-size: 56px; line-height: 1; }
.page-icon:disabled { cursor: default; }
.page-icon.empty:disabled { display: none; }

.editor.readonly .block-handle, .editor.readonly .editor-tail { display: none; }
.editor.readonly .block-text { cursor: default; }
.editor.readonly .block-text a { cursor: pointer; }
.block.remote { box-shadow: inset 3px 0 0 var(--remote-color); border-radius: 2px; }
.block.remote::after { content: attr(data-remote-names); position: absolute; right: 0; top: -14px; font-size: 10px; line-height: 14px; padding: 0 6px; border-radius: 4px 4px 0 4px; background: var(--remote-color); color: white; pointer-events: none; z-index: 2; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* share popover */
.share-pop { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.share-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.share-note { background: var(--bg-callout); border-radius: 6px; padding: 8px 10px; font-size: 13px; color: var(--fg-2); }
.link-btn { color: var(--accent); font-size: 13px; padding: 0; }
.share-row { display: flex; align-items: center; gap: 10px; }
.share-row .member-info { flex: 1; min-width: 0; }
.share-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.member-info div:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-select { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; background: var(--bg); font-size: 13px; }
.set-select:disabled { opacity: 0.6; }
.switch { width: 36px; height: 20px; appearance: none; background: var(--bg-active); border-radius: 999px; position: relative; cursor: pointer; margin: 0; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: left 0.15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 18px; }
.switch:disabled { opacity: 0.5; cursor: default; }

/* settings modal */
.palette.settings { padding: 22px 26px; gap: 18px; overflow-y: auto; max-height: 82vh; }
.palette.settings h2 { margin: 0; font-size: 18px; }
.palette.settings h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); }
.set-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.set-input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; background: var(--bg); font-size: 14px; }
.set-list { display: flex; flex-direction: column; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.member-row .member-info { flex: 1; min-width: 0; }
.invite-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.invite-url { font: 12px var(--mono); background: var(--bg-code); padding: 4px 8px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; flex: 1; min-width: 160px; }

/* empty states & public */
.empty-state { text-align: center; padding-top: 18vh; }
.empty-state .btn { margin-top: 12px; }
.big-icon { font-size: 48px; margin-bottom: 8px; }
body.public #sidebar, body.public .sidebar-opener, body.public #save-status { display: none; }
body.public .topbar { padding-left: 16px; }
.brand-link { font-size: 12px; color: var(--fg-3); text-decoration: none; }
.brand-link:hover { color: var(--fg); }
@media (max-width: 800px) { .palette.settings { max-height: 88vh; } }

/* ---------- Published pages (server-rendered + public reader) ---------- */
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.share-publish { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.share-publish .share-actions { border: 0; margin: 0; padding: 0; }
.pagelink.inert, .pageref.inert { cursor: default; opacity: 0.7; }
.pagelink.inert:hover, .pageref.inert:hover { background: var(--bg-hover); }
.page.ssr .ssr-body { font-size: 16px; line-height: 1.6; }
.ssr-body p { margin: 0 0 4px; padding: 3px 2px; }
.ssr-body p.blank { height: 1.5em; margin: 0; }
.ssr-body h2 { font-size: 30px; font-weight: 700; margin: 26px 0 4px; letter-spacing: -0.015em; }
.ssr-body h3 { font-size: 24px; font-weight: 650; margin: 18px 0 4px; }
.ssr-body h4 { font-size: 19px; font-weight: 600; margin: 10px 0 4px; }
.ssr-body ul, .ssr-body ol { margin: 2px 0; padding-left: 26px; }
.ssr-body li { padding: 3px 2px; }
.ssr-body li.todo { list-style: none; margin-left: -22px; }
.ssr-body li.todo.done { color: var(--fg-3); text-decoration: line-through; }
.ssr-body li.todo input { margin-right: 6px; accent-color: var(--accent); }
.ssr-body blockquote { margin: 6px 0; padding: 2px 14px; border-left: 3px solid var(--fg); font-size: 17px; }
.ssr-callout { display: flex; gap: 10px; background: var(--bg-callout); border-radius: var(--radius); padding: 12px 14px; margin: 6px 0; }
.ssr-callout-icon { font-size: 20px; line-height: 1.3; }
.ssr-body pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; margin: 6px 0; font: 13.5px/1.6 var(--mono); }
.ssr-body code { font: 0.86em var(--mono); }
.ssr-body p code, .ssr-body li code { background: var(--bg-code); color: #c7254e; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--border); }
.ssr-body hr { margin: 12px 0; }
.ssr-body figure { margin: 8px 0; }
.ssr-body figure img { max-width: 100%; border-radius: var(--radius); display: block; }
.ssr-body figcaption { font-size: 13.5px; color: var(--fg-2); margin-top: 4px; }
.ssr-page { display: inline-flex; gap: 6px; padding: 4px 6px; border-radius: 6px; color: var(--fg); text-decoration: none; font-weight: 500; margin: 2px 0; }
.ssr-page:hover { background: var(--bg-hover); }
.ssr-page.inert { opacity: 0.7; }
.ssr-db { margin: 8px 0; overflow-x: auto; }
.ssr-db h3 { font-size: 20px; margin: 4px 0 8px; }
.ssr-db table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.ssr-db th, .ssr-db td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.ssr-db th { color: var(--fg-2); font-weight: 500; font-size: 13px; background: var(--bg-side); }
.ssr-db .chip { margin-right: 4px; }
.ssr-body a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg-3); text-underline-offset: 3px; }
.ssr-body .pagelink { text-decoration: none; font-weight: 500; padding: 0 3px; border-radius: 4px; background: var(--bg-hover); }

/* ---------- Page history ---------- */
.palette.history { width: min(1040px, 96vw); max-height: 86vh; padding: 0; }
.hist-head { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.hist-head h2 { margin: 0; font-size: 17px; }
.hist-body { display: flex; min-height: 0; flex: 1; }
.hist-list { width: 260px; flex: none; overflow-y: auto; border-right: 1px solid var(--border); padding: 8px; }
.hist-row { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.hist-row:hover { background: var(--bg-hover); }
.hist-row.active { background: var(--bg-active); }
.hist-when { font-size: 14px; font-weight: 500; display: flex; gap: 6px; align-items: center; }
.hist-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-selected); color: var(--accent); padding: 1px 6px; border-radius: 999px; }
.hist-who { display: flex; align-items: center; gap: 6px; }
.hist-who .avatar.small { margin: 0; }
.hist-preview { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 28px 40px; }
.hist-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hist-title { font-size: 22px; font-weight: 700; }
.hist-editor { pointer-events: auto; }
.hist-editor .editor.readonly .block { padding-left: 0; }
@media (max-width: 800px) { .hist-body { flex-direction: column; } .hist-list { width: auto; max-height: 160px; border-right: 0; border-bottom: 1px solid var(--border); } }

/* ---------- Comments & notifications ---------- */
.badge { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: white; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.badge[hidden] { display: none; }
.inbox-btn, .comments-btn { position: relative; }
.comments-btn .badge { background: var(--accent); }
.block .block-comments { position: absolute; right: -60px; top: 4px; font-size: 11px; color: var(--fg-2); padding: 2px 6px; border-radius: 999px; background: var(--bg-hover); white-space: nowrap; }
.block .block-comments:hover { background: var(--bg-active); color: var(--fg); }
.block.flash, .thread.flash, .cm.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: var(--bg-selected); } 100% { background: transparent; } }
.mention { display: inline-block; padding: 0 4px; border-radius: 4px; background: var(--bg-selected); color: var(--accent); font-weight: 500; white-space: nowrap; text-decoration: none !important; cursor: default; }
.block-text a.mention { color: var(--accent); }
.comments-panel { width: 340px; flex: none; border-left: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.comments-panel[hidden] { display: none; }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.cp-toggle { margin-left: auto; font-size: 12px; color: var(--fg-2); display: flex; align-items: center; gap: 4px; }
.cp-body { overflow-y: auto; padding: 10px 12px 40px; display: flex; flex-direction: column; gap: 12px; }
.cp-note { padding: 4px 2px; }
.thread { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-menu); }
.thread.resolved { opacity: 0.7; }
.thread.new { border-color: var(--accent); }
.cp-quote { text-align: left; font-size: 12px; color: var(--fg-2); border-left: 2px solid var(--fg-3); padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-quote:hover { color: var(--fg); border-color: var(--fg); }
.cm { display: flex; flex-direction: column; gap: 4px; }
.cm-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cm-head .avatar.small { margin: 0; }
.cm-name { font-weight: 600; }
.cm-actions { display: flex; gap: 8px; opacity: 0; }
.cm:hover .cm-actions { opacity: 1; }
.link-btn.small { font-size: 12px; color: var(--fg-2); }
.link-btn.small:hover { color: var(--fg); }
.link-btn.small.danger:hover { color: var(--danger); }
.cm-body { font-size: 14px; line-height: 1.45; word-break: break-word; }
.composer-box { display: flex; flex-direction: column; gap: 6px; }
.composer { min-height: 34px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; background: var(--bg); }
.composer:focus { border-color: var(--accent); }
.composer:empty::before { content: attr(data-placeholder); color: var(--fg-3); }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.inbox { display: flex; flex-direction: column; max-height: 70vh; }
.inbox-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.inbox-row { display: flex; gap: 10px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13px; align-items: flex-start; }
.inbox-row:hover { background: var(--bg-hover); }
.inbox-row.unread { background: var(--bg-selected); }
.inbox-row .avatar.small { margin: 0; flex: none; }
.inbox-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-pop .menu-empty { padding: 20px; }
@media (max-width: 900px) { .comments-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 15; box-shadow: var(--shadow); } }

/* ---------- Relations, rollups, formulas ---------- */
.rel-chip { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--bg-hover); color: var(--fg); text-decoration: none !important; font-size: 13px; border-bottom: 0 !important; }
.rel-chip:hover { background: var(--bg-active); }
.cell.computed { cursor: default; color: var(--fg-2); }
.cell .err { color: var(--danger); font-family: var(--mono); font-size: 12px; }
.rule-label { width: 80px; font-size: 12px; color: var(--fg-2); flex: none; }
.rule-sel.wide { flex: 1; max-width: none; }
.formula-pop { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.formula-input { width: 100%; font: 13px/1.5 var(--mono); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: var(--bg); color: inherit; resize: vertical; }
.formula-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.formula-preview { padding: 0 2px; min-height: 1.3em; }
.formula-preview.err { color: var(--danger); }
.formula-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px 4px; }
.formula-chips .chip { cursor: pointer; font-size: 12px; }
.date-pop.col { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
.date-row { display: flex; align-items: center; gap: 8px; }
.date-range-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.cal-title { font-weight: 600; font-size: 15px; padding: 0 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-3); padding: 6px; text-align: right; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; gap: 3px; position: relative; }
.cal-cell.other { background: var(--bg-side); color: var(--fg-3); }
.cal-cell.drop { background: var(--bg-selected); }
.cal-day { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 0 2px; min-height: 20px; }
.cal-cell.today .cal-day > span { background: var(--danger); color: white; border-radius: 999px; width: 20px; height: 20px; display: grid; place-items: center; }
.cal-add { opacity: 0; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-card { font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--bg-selected); border-left: 3px solid var(--accent); cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; flex-direction: column; }
.cal-card:hover { filter: brightness(0.97); }
.cal-card.cont { border-left-color: transparent; border-radius: 0 4px 4px 0; opacity: 0.85; }
.cal-card.more { border-radius: 4px 0 0 4px; }
.cal-card.cont.more { border-radius: 0; }
.cal-card-prop { color: var(--fg-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Gallery ---------- */
.dbv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 4px 0; }
.gcard { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-menu); cursor: pointer; display: flex; flex-direction: column; text-align: left; }
.gcard:hover { box-shadow: var(--shadow); }
.gcover { height: 120px; background: var(--bg-side) center/cover no-repeat; display: grid; place-items: center; font-size: 36px; }
.gcover.empty { color: var(--fg-3); }
.gbody { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.gtitle .cell { padding: 0; min-height: 0; font-weight: 500; }
.gtitle .cell.type-title .cell-text { white-space: normal; }
.gcard.gnew { min-height: 120px; align-items: center; justify-content: center; color: var(--fg-3); border-style: dashed; background: transparent; font-size: 14px; }
.gcard.gnew:hover { color: var(--fg); box-shadow: none; background: var(--bg-hover); }
.gcard .card-menu { position: absolute; top: 6px; right: 6px; opacity: 0; background: var(--bg-menu); }
.gcard:hover .card-menu { opacity: 1; }

/* ---------- Timeline ---------- */
.dbv-timeline { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tl-left { width: 220px; flex: none; border-right: 1px solid var(--border); background: var(--bg); }
.tl-corner { height: 44px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--fg-3); display: flex; align-items: flex-end; padding: 0 10px 6px; }
.tl-label { height: 36px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 6px; font-size: 13px; }
.tl-label .cell { padding: 2px 4px; min-height: 0; }
.tl-right { flex: 1; overflow-x: auto; position: relative; }
.tl-header { position: relative; height: 44px; border-bottom: 1px solid var(--border); }
.tl-month { position: absolute; top: 0; height: 20px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-3); padding: 3px 6px; border-left: 1px solid var(--border); overflow: hidden; white-space: nowrap; }
.tl-dayhead { position: absolute; top: 22px; height: 22px; font-size: 11px; text-align: center; color: var(--fg-2); line-height: 22px; }
.tl-dayhead.weekend { color: var(--fg-3); }
.tl-dayhead.today { color: white; }
.tl-dayhead.today::before { content: ""; position: absolute; left: 50%; top: 1px; width: 20px; height: 20px; margin-left: -10px; border-radius: 999px; background: var(--danger); z-index: -1; }
.tl-rows { position: relative; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: 0.4; pointer-events: none; }
.tl-lane { height: 36px; border-bottom: 1px solid var(--border); position: relative; }
.tl-bar { position: absolute; top: 6px; height: 24px; background: var(--bg-selected); border: 1px solid var(--accent); border-radius: 6px; font-size: 12px; line-height: 22px; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; min-width: 30px; }
.tl-bar:hover { filter: brightness(0.97); }
.tl-undated { margin-top: 10px; }

/* ---------- Block tree: nesting, toggles, columns ---------- */
.block { flex-wrap: wrap; }
.block > .block-body { flex: 1 1 100%; }
.block > .block-children { flex: 1 1 100%; display: flex; flex-direction: column; margin-left: 28px; min-width: 0; }
.block > .block-children:empty { display: none; }
.t-toggle.collapsed > .block-children { display: none; }
.t-toggle .toggle-chev { width: 22px; height: 22px; border-radius: 4px; color: var(--fg-2); font-size: 14px; display: grid; place-items: center; transition: transform 0.12s; transform: rotate(90deg); }
.t-toggle.collapsed .toggle-chev { transform: rotate(0deg); }
.t-toggle .toggle-chev:hover { background: var(--bg-active); color: var(--fg); }
.children-empty { font-size: 13.5px; color: var(--fg-3); padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.children-empty:hover { background: var(--bg-hover); color: var(--fg-2); }
.block.t-columns { padding: 0; }
.block.t-columns > .block-body { display: none; }
.block.t-columns > .block-children.columns-row { flex-direction: row; margin-left: 0; gap: 0; align-items: stretch; }
.block.t-column { flex: 1 1 0; min-width: 0; padding: 0; position: relative; display: block; margin: 0; }
.block.t-column > .block-body { display: none; }
.block.t-column > .block-children { margin-left: 0; padding: 0 14px 0 0; }
.block.t-column + .block.t-column > .block-children { padding-left: 14px; }
.block.t-column .col-resizer { position: absolute; top: 0; bottom: 0; right: -2px; width: 8px; cursor: col-resize; z-index: 2; }
.block.t-column .col-resizer::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background 0.1s; }
.block.t-column .col-resizer:hover::after, body.resizing .col-resizer::after { background: var(--accent); }
.block.t-column:last-child .col-resizer { display: none; }
.block.t-column > .block-handle { display: none; }
.block.t-columns > .block-handle { top: 10px; transform: none; }
.drop-line { transition: none; }
.block.selected.t-columns { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Page covers ---------- */
.page-cover { height: 220px; background: var(--bg-side) center/cover no-repeat; position: relative; }
.page-cover.none { display: none; }
.page-cover .cover-actions { position: absolute; right: 24px; bottom: 12px; display: flex; gap: 6px; opacity: 0; transition: opacity 0.12s; }
.page-cover:hover .cover-actions { opacity: 1; }
.page-cover .cover-actions .btn { background: rgba(255,255,255,0.9); color: #222; }
.page-cover.repositioning { cursor: ns-resize; outline: 2px dashed var(--accent); outline-offset: -2px; }
.page-cover.repositioning .cover-actions { display: none; }
.cover-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(0,0,0,0.6); color: white; font-size: 12px; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.cover-save { position: absolute; right: 24px; bottom: 12px; }
body.has-cover .page { padding-top: 28px; }
body.has-cover .page-icon { margin-top: -44px; background: var(--bg); border-radius: 10px; padding: 4px 8px; }
.head-actions { display: flex; gap: 6px; height: 24px; margin-bottom: 4px; }
.head-btn { font-size: 13px; color: var(--fg-3); padding: 2px 6px; border-radius: 4px; opacity: 0; }
.page-head:hover .head-btn { opacity: 1; }
.head-btn:hover { background: var(--bg-hover); color: var(--fg); }
body.has-cover .head-actions { display: none; }
.cover-pop { padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.cover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cover-swatch { height: 56px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.cover-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Public / SSR nesting */
.ssr-children { margin-left: 28px; }
.ssr-body details { margin: 2px 0; }
.ssr-body summary { cursor: pointer; padding: 3px 2px; font-weight: 500; }
.ssr-columns { display: flex; gap: 28px; }
.ssr-column { flex: 1 1 0; min-width: 0; }
.public .page-cover, .page.ssr + .page-cover { height: 220px; }

/* ---------- Forms ---------- */
body.formpage { display: block; overflow: auto; background: var(--bg-side); }
body.formpage.embed { background: transparent; }
#form-root { max-width: 640px; margin: 0 auto; padding: 40px 16px 60px; }
body.embed #form-root { padding: 8px 4px; }
.form-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 28px 30px 24px; box-shadow: 0 6px 30px rgba(0,0,0,0.06); }
.form-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.form-desc { color: var(--fg-2); margin: 0 0 18px; white-space: pre-wrap; }
.form-fields { display: flex; flex-direction: column; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.invalid .form-input, .form-field.invalid .form-options { outline: 2px solid var(--danger); outline-offset: -1px; border-radius: 8px; }
.form-label { font-weight: 600; font-size: 15px; }
.form-label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.form-label .req { color: var(--danger); }
.form-help { margin-top: -2px; }
.form-input { font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: inherit; width: 100%; resize: vertical; }
.form-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form-options { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.form-option { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.form-option input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error.top:not(:empty) { padding: 8px 12px; background: rgba(210,59,59,0.08); border-radius: 8px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.form-submit { padding: 9px 18px; font-size: 15px; }
.form-closed { background: var(--bg-callout); padding: 14px; border-radius: 10px; color: var(--fg-2); }
.palette.forms { width: min(1000px, 96vw); max-height: 86vh; padding: 0; }
.forms-list { width: 240px; flex: none; overflow-y: auto; border-right: 1px solid var(--border); padding: 8px; }
.forms-detail { flex: 1; overflow-y: auto; padding: 16px 22px 30px; display: flex; flex-direction: column; gap: 8px; }
.forms-h { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); }
.form-title { font-size: 18px; font-weight: 600; }
.forms-questions { display: flex; flex-direction: column; gap: 10px; }
.forms-q { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.forms-q-head { display: flex; align-items: center; gap: 4px; }
.set-input.small { font-size: 13px; padding: 5px 8px; }
.forms-req, .forms-setting { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-embed-wrap { width: 100%; position: relative; }
.form-embed { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.form-embed-link { position: absolute; right: 12px; top: 10px; font-size: 12px; color: var(--fg-3); text-decoration: none; }
.form-embed-link:hover { color: var(--fg); }

/* ---------- API tokens, webhooks, docs ---------- */
.secret-modal { position: fixed; left: 50%; top: 20%; transform: translateX(-50%); z-index: 100; background: var(--bg-menu); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; width: min(560px, 92vw); }
.secret-value { font: 13px var(--mono); background: var(--bg-code); padding: 10px 12px; border-radius: 8px; word-break: break-all; user-select: all; }
body.docs { display: block; overflow: auto; }
.docs-wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 80px; }
.docs-wrap h1 { font-size: 28px; margin: 0 0 6px; }
.docs-wrap h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); margin: 28px 0 8px; }
.docs-intro { color: var(--fg-2); }
.docs-intro pre, .docs-ep pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.5 var(--mono); overflow-x: auto; }
.docs-ep { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.docs-ep summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.docs-ep summary .method { font: 11px/1 var(--mono); font-weight: 700; padding: 4px 6px; border-radius: 4px; color: white; min-width: 52px; text-align: center; }
.m-get { background: #2f8f5b; } .m-post { background: #2f6feb; } .m-patch { background: #c9861d; } .m-put { background: #7c5cff; } .m-delete { background: #d23b3b; }
.docs-ep .path { font: 13px var(--mono); }
.docs-ep table { font-size: 13px; border-collapse: collapse; margin: 8px 0; }
.docs-ep td, .docs-ep th { padding: 3px 10px 3px 0; text-align: left; vertical-align: top; }
.docs-ep th { color: var(--fg-3); font-weight: 500; }

.form-captcha { min-height: 65px; display: flex; justify-content: flex-start; }

/* ---------- Security, audit log, server admin ---------- */
.security-box { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.tfa-setup { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.tfa-qr { flex: none; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.tfa-steps { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 240px; font-size: 14px; }
.secret-value.codes { white-space: pre; font: 14px/1.7 var(--mono); }
.sessions { display: flex; flex-direction: column; }
.audit-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.audit-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; align-items: flex-start; }
.audit-row .avatar.small { margin: 0; flex: none; }
.audit-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.audit-text a { color: var(--fg); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stat { background: var(--bg-callout); border-radius: 8px; padding: 10px 12px; }
.stat-value { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }

/* ---------- Code highlighting (an editable transparent layer over a highlighted one) ---------- */
.code-wrap { display: grid; }
.code-wrap > .code-hl, .code-wrap > .block-text { grid-area: 1 / 1; margin: 0; font: 13.5px/1.6 var(--mono); padding: 14px 16px; tab-size: 2; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.code-wrap > .code-hl { pointer-events: none; color: var(--fg); background: transparent; border: 0; }
.code-wrap > .block-text.code { color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--fg); position: relative; z-index: 1; }
.code-wrap > .block-text.code::selection, .code-wrap > .block-text.code *::selection { background: rgba(47, 111, 235, 0.25); -webkit-text-fill-color: transparent; }
.code-wrap > .block-text.code:empty::before { -webkit-text-fill-color: var(--fg-3); }
.hl-kw { color: #a626a4; } .hl-str { color: #50a14f; } .hl-cm { color: #a0a1a7; font-style: italic; } .hl-num { color: #986801; } .hl-fn { color: #4078f2; } .hl-ty { color: #c18401; } .hl-lit { color: #0184bc; } .hl-op { color: #0184bc; } .hl-punc { color: var(--fg-2); } .hl-meta { color: #e45649; } .hl-attr { color: #986801; } .hl-var { color: #e45649; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl-kw { color: #c678dd; } :root:not([data-theme="light"]) .hl-str { color: #98c379; } :root:not([data-theme="light"]) .hl-cm { color: #7f848e; } :root:not([data-theme="light"]) .hl-num { color: #d19a66; } :root:not([data-theme="light"]) .hl-fn { color: #61afef; } :root:not([data-theme="light"]) .hl-ty { color: #e5c07b; } :root:not([data-theme="light"]) .hl-lit { color: #56b6c2; } :root:not([data-theme="light"]) .hl-op { color: #56b6c2; } :root:not([data-theme="light"]) .hl-meta { color: #e06c75; } :root:not([data-theme="light"]) .hl-attr { color: #d19a66; } :root:not([data-theme="light"]) .hl-var { color: #e06c75; } }
:root[data-theme="dark"] .hl-kw { color: #c678dd; } :root[data-theme="dark"] .hl-str { color: #98c379; } :root[data-theme="dark"] .hl-cm { color: #7f848e; } :root[data-theme="dark"] .hl-num { color: #d19a66; } :root[data-theme="dark"] .hl-fn { color: #61afef; } :root[data-theme="dark"] .hl-ty { color: #e5c07b; } :root[data-theme="dark"] .hl-lit { color: #56b6c2; } :root[data-theme="dark"] .hl-op { color: #56b6c2; } :root[data-theme="dark"] .hl-meta { color: #e06c75; } :root[data-theme="dark"] .hl-attr { color: #d19a66; } :root[data-theme="dark"] .hl-var { color: #e06c75; }

/* ---------- Text and block colors ---------- */
.tc-gray, [data-color="gray"] { color: #787774; } .tc-brown, [data-color="brown"] { color: #9f6b53; } .tc-orange, [data-color="orange"] { color: #d9730d; } .tc-yellow, [data-color="yellow"] { color: #cb912f; }
.tc-green, [data-color="green"] { color: #448361; } .tc-blue, [data-color="blue"] { color: #337ea9; } .tc-purple, [data-color="purple"] { color: #9065b0; } .tc-pink, [data-color="pink"] { color: #c14c8a; } .tc-red, [data-color="red"] { color: #d44c47; }
[data-bg="gray"] { background: #e9e9e7; } [data-bg="brown"] { background: #eee0da; } [data-bg="orange"] { background: #fadec9; } [data-bg="yellow"] { background: #fdecc8; } [data-bg="green"] { background: #dbeddb; } [data-bg="blue"] { background: #d3e5ef; } [data-bg="purple"] { background: #e8deee; } [data-bg="pink"] { background: #f5e0e9; } [data-bg="red"] { background: #ffe2dd; }
[data-bg] { border-radius: 3px; padding: 0 1px; }
.block.bc-gray > .block-body { color: #787774; } .block.bc-brown > .block-body { color: #9f6b53; } .block.bc-orange > .block-body { color: #d9730d; } .block.bc-yellow > .block-body { color: #cb912f; } .block.bc-green > .block-body { color: #448361; } .block.bc-blue > .block-body { color: #337ea9; } .block.bc-purple > .block-body { color: #9065b0; } .block.bc-pink > .block-body { color: #c14c8a; } .block.bc-red > .block-body { color: #d44c47; }
.block[class*="bbg-"] { border-radius: 6px; }
.block.bbg-gray { background: #e9e9e7; } .block.bbg-brown { background: #eee0da; } .block.bbg-orange { background: #fadec9; } .block.bbg-yellow { background: #fdecc8; } .block.bbg-green { background: #dbeddb; } .block.bbg-blue { background: #d3e5ef; } .block.bbg-purple { background: #e8deee; } .block.bbg-pink { background: #f5e0e9; } .block.bbg-red { background: #ffe2dd; }
.ssr-colored.c-gray { color: #787774; } .ssr-colored.c-brown { color: #9f6b53; } .ssr-colored.c-orange { color: #d9730d; } .ssr-colored.c-yellow { color: #cb912f; } .ssr-colored.c-green { color: #448361; } .ssr-colored.c-blue { color: #337ea9; } .ssr-colored.c-purple { color: #9065b0; } .ssr-colored.c-pink { color: #c14c8a; } .ssr-colored.c-red { color: #d44c47; }
.ssr-colored[class*="bg-"] { border-radius: 6px; padding: 2px 6px; margin: 2px 0; }
span.c-gray { color: #787774; } span.c-brown { color: #9f6b53; } span.c-orange { color: #d9730d; } span.c-yellow { color: #cb912f; } span.c-green { color: #448361; } span.c-blue { color: #337ea9; } span.c-purple { color: #9065b0; } span.c-pink { color: #c14c8a; } span.c-red { color: #d44c47; }
span.bg-gray { background: #e9e9e7; } span.bg-brown { background: #eee0da; } span.bg-orange { background: #fadec9; } span.bg-yellow { background: #fdecc8; } span.bg-green { background: #dbeddb; } span.bg-blue { background: #d3e5ef; } span.bg-purple { background: #e8deee; } span.bg-pink { background: #f5e0e9; } span.bg-red { background: #ffe2dd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-bg="gray"], :root:not([data-theme="light"]) .block.bbg-gray, :root:not([data-theme="light"]) span.bg-gray { background: #5a5a5a; } :root:not([data-theme="light"]) [data-bg="brown"], :root:not([data-theme="light"]) .block.bbg-brown, :root:not([data-theme="light"]) span.bg-brown { background: #603b2c; }
  :root:not([data-theme="light"]) [data-bg="orange"], :root:not([data-theme="light"]) .block.bbg-orange, :root:not([data-theme="light"]) span.bg-orange { background: #854c1d; } :root:not([data-theme="light"]) [data-bg="yellow"], :root:not([data-theme="light"]) .block.bbg-yellow, :root:not([data-theme="light"]) span.bg-yellow { background: #89632a; }
  :root:not([data-theme="light"]) [data-bg="green"], :root:not([data-theme="light"]) .block.bbg-green, :root:not([data-theme="light"]) span.bg-green { background: #2b593f; } :root:not([data-theme="light"]) [data-bg="blue"], :root:not([data-theme="light"]) .block.bbg-blue, :root:not([data-theme="light"]) span.bg-blue { background: #28456c; }
  :root:not([data-theme="light"]) [data-bg="purple"], :root:not([data-theme="light"]) .block.bbg-purple, :root:not([data-theme="light"]) span.bg-purple { background: #492f64; } :root:not([data-theme="light"]) [data-bg="pink"], :root:not([data-theme="light"]) .block.bbg-pink, :root:not([data-theme="light"]) span.bg-pink { background: #69314c; } :root:not([data-theme="light"]) [data-bg="red"], :root:not([data-theme="light"]) .block.bbg-red, :root:not([data-theme="light"]) span.bg-red { background: #6e3630; }
}
:root[data-theme="dark"] [data-bg="gray"], :root[data-theme="dark"] .block.bbg-gray, :root[data-theme="dark"] span.bg-gray { background: #5a5a5a; } :root[data-theme="dark"] [data-bg="brown"], :root[data-theme="dark"] .block.bbg-brown, :root[data-theme="dark"] span.bg-brown { background: #603b2c; }
:root[data-theme="dark"] [data-bg="orange"], :root[data-theme="dark"] .block.bbg-orange, :root[data-theme="dark"] span.bg-orange { background: #854c1d; } :root[data-theme="dark"] [data-bg="yellow"], :root[data-theme="dark"] .block.bbg-yellow, :root[data-theme="dark"] span.bg-yellow { background: #89632a; }
:root[data-theme="dark"] [data-bg="green"], :root[data-theme="dark"] .block.bbg-green, :root[data-theme="dark"] span.bg-green { background: #2b593f; } :root[data-theme="dark"] [data-bg="blue"], :root[data-theme="dark"] .block.bbg-blue, :root[data-theme="dark"] span.bg-blue { background: #28456c; }
:root[data-theme="dark"] [data-bg="purple"], :root[data-theme="dark"] .block.bbg-purple, :root[data-theme="dark"] span.bg-purple { background: #492f64; } :root[data-theme="dark"] [data-bg="pink"], :root[data-theme="dark"] .block.bbg-pink, :root[data-theme="dark"] span.bg-pink { background: #69314c; } :root[data-theme="dark"] [data-bg="red"], :root[data-theme="dark"] .block.bbg-red, :root[data-theme="dark"] span.bg-red { background: #6e3630; }
.swatch-text { font-weight: 700; font-size: 14px; }
.fmt-color { font-weight: 700; text-decoration: underline; text-decoration-color: #d44c47; text-decoration-thickness: 3px; }

/* ---------- Simple tables ---------- */
.t-table .block-body { display: block; }
.sim-table-wrap { position: relative; overflow-x: auto; padding: 4px 22px 22px 0; }
.sim-table { border-collapse: collapse; min-width: 240px; width: calc(100% - 4px); font-size: 15px; }
.sim-table td, .sim-table th { border: 1px solid var(--border); padding: 0; vertical-align: top; min-width: 100px; }
.sim-table th { background: var(--bg-side); font-weight: 600; }
.tcell { min-height: 34px; padding: 6px 9px; outline: none; white-space: pre-wrap; word-break: break-word; }
.tcell:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.tbl-add { position: absolute; background: var(--bg-hover); color: var(--fg-3); border-radius: 4px; font-size: 14px; opacity: 0; display: grid; place-items: center; }
.tbl-add-col { right: 0; top: 4px; bottom: 22px; width: 18px; }
.tbl-add-row { left: 0; right: 22px; bottom: 2px; height: 18px; }
.t-table:hover .tbl-add { opacity: 1; }
.tbl-add:hover { background: var(--bg-active); color: var(--fg); }

/* ---------- Bookmarks, embeds, files ---------- */
.bookmark { display: flex; width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; margin: 4px 0; min-height: 88px; background: var(--bg); }
.bookmark:hover { background: var(--bg-hover); }
.bm-text { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.bm-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-desc { font-size: 13px; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-site { font-size: 12px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: auto; }
.bm-favicon { width: 14px; height: 14px; border-radius: 2px; }
.bm-image { width: 30%; max-width: 220px; flex: none; background-size: cover; background-position: center; }
.ssr-bookmark { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none !important; color: inherit; margin: 6px 0; min-height: 88px; }
.embed-wrap { position: relative; width: 100%; height: 400px; margin: 4px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-side); }
.embed-wrap.pdf { height: 600px; }
.embed-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-link { position: absolute; right: 8px; top: 6px; font-size: 11px; background: var(--bg-menu); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; color: var(--fg-2); text-decoration: none; opacity: 0; }
.t-embed:hover .embed-link { opacity: 1; }
.embed-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.embed-resize:hover { background: var(--accent); opacity: 0.5; }
.t-embed .block-body, .t-bookmark .block-body, .t-file .block-body, .t-toc .block-body, .t-equation .block-body, .t-button .block-body { display: block; }
.file-card { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; margin: 2px 0; max-width: 100%; }
.file-card:hover { background: var(--bg-hover); }
.file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssr-file { text-decoration: none !important; font-weight: 500; }

/* ---------- Table of contents, equations, synced blocks, buttons ---------- */
.toc { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.toc-item { color: var(--fg-2); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; font-size: 15px; padding: 2px 0; }
.toc-item:hover { color: var(--fg); }
.toc-item.heading2 { margin-left: 18px; } .toc-item.heading3 { margin-left: 36px; font-size: 14px; }
.ssr-toc { list-style: none; padding-left: 0; } .ssr-toc li.heading2 { margin-left: 18px; } .ssr-toc li.heading3 { margin-left: 36px; }
.eq-view { width: 100%; text-align: center; padding: 10px 8px; border-radius: var(--radius); font-size: 20px; cursor: pointer; min-height: 40px; }
.eq-view:hover { background: var(--bg-hover); }
.eq-view.empty { font-size: 14px; }
.eq-view math { font-size: 1.2em; }
.eq-preview { text-align: center; font-size: 20px; min-height: 32px; padding: 6px; }
.ssr-equation { text-align: center; font-family: var(--mono); }
.block.t-synced { display: block; }
.block.t-synced > .block-body { display: block; }
.synced-original > .block-children, .synced-copy > .block-body .synced-host { border-left: 3px solid #c14c8a; padding-left: 12px; margin: 2px 0; border-radius: 2px; }
.synced-label { font-size: 11px; color: #c14c8a; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 0; }
.synced-label a { color: inherit; }
.synced-host .editor .block-handle { display: none; }
.ssr-synced { border-left: 3px solid #c14c8a; padding-left: 12px; margin: 4px 0; }
.button-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.cm-button { background: var(--bg-active); border-radius: 6px; padding: 6px 14px; font-weight: 500; }
.cm-button:hover { background: var(--accent); color: var(--accent-fg); }
.t-button > .block-children { display: none; }
.t-button.editing-template > .block-children { display: block; border-left: 3px dashed var(--border); padding-left: 12px; margin: 4px 0 4px 8px; }
.t-button.editing-template > .block-children::before { content: "Template"; display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-3); }
.button-config { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.button-config .rule-label { width: 70px; }

/* ---------- Find & replace ---------- */
.find-bar { position: sticky; top: 44px; z-index: 2; display: flex; gap: 6px; align-items: center; background: var(--bg-menu); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; box-shadow: var(--shadow); flex-wrap: wrap; }
.find-input { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; background: var(--bg); font-size: 13px; min-width: 140px; }
.find-count { font-size: 12px; color: var(--fg-3); min-width: 70px; }
.block.find-hit > .block-body { box-shadow: inset 0 0 0 2px var(--mark); border-radius: 4px; }
.word-count { white-space: nowrap; }
@media (max-width: 800px) { .word-count { display: none; } }

/* ---------- Database extras: status, people, files, templates, sub-items, grouping, calculations, filter groups, dependencies ---------- */
.chip.status .status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.7; margin-right: 2px; }
.chip.person { padding-left: 3px; gap: 6px; }
.avatar.tiny { width: 18px; height: 18px; font-size: 8px; border: 0; margin: 0; }
.file-chip { text-decoration: none !important; color: var(--fg) !important; }
.files-editor { padding: 8px; gap: 8px; }
.files-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.files-list .menu-label { text-decoration: none; color: inherit; }
.tool-split { display: inline-flex; margin-left: 4px; }
.tool-split .tool.primary { margin-left: 0; border-radius: 6px 0 0 6px; }
.tool-split .tool.primary.caret { border-radius: 0 6px 6px 0; padding: 4px 6px; border-left: 1px solid rgba(255,255,255,0.3); }
.template-banner { grid-column: 1 / -1; background: var(--bg-selected); color: var(--accent); border-radius: 6px; padding: 6px 10px; font-size: 13px; margin-bottom: 6px; }
.sub-chev { width: 18px; height: 18px; display: inline-grid; place-items: center; vertical-align: middle; margin: 6px 0 0 2px; float: left; }
.sub-chev.empty { visibility: hidden; }
.dbv-table tr.sub-row td:first-child .cell { font-weight: 400; }
.dbv-groups { display: flex; flex-direction: column; gap: 4px; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 10px 4px 4px; font-size: 13px; }
.group-head .tree-chevron { color: var(--fg-2); }
.group-body { margin-bottom: 8px; }
.lane-head { border-top: 1px solid var(--border); margin-top: 6px; }
.dbv-table tfoot td { border-top: 1px solid var(--border); border-bottom: 0; background: transparent; height: 30px; }
.dbv-table tr.tr-calc:hover td { background: transparent; }
.calc-btn { width: 100%; height: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; color: var(--fg-2); opacity: 0; }
.td-calc.on .calc-btn, .dbv-table:hover .calc-btn { opacity: 1; }
.calc-btn:hover { background: var(--bg-hover); }
.calc-label { color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; }
.calc-label.dim { opacity: 0.7; }
.calc-value { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 500; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group.nested { border-left: 3px solid var(--border); padding-left: 10px; margin: 2px 0 2px 4px; background: var(--bg-side); border-radius: 0 6px 6px 0; padding-top: 6px; padding-bottom: 6px; }
.group-head-row .op-sel { flex: 0 0 auto; }
.tl-rows { position: relative; }
.tl-deps { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tl-dep { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.8; }
.tl-dep.late { stroke: var(--danger); }

/* ---------- Favorites, recents, teamspaces, page invites, search filters ---------- */
.tree-section.collapsible .tree-section-label { cursor: pointer; }
.tree-section.collapsible .tree-section-label::before { content: "▾"; display: inline-block; width: 12px; font-size: 9px; opacity: 0.7; transition: transform 0.12s; }
.tree-section.collapsed .tree-section-label::before { transform: rotate(-90deg); }
.tree-section-actions { display: flex; gap: 2px; }
.tree-section-actions .icon-btn { opacity: 0; }
.tree-section:hover .tree-section-actions .icon-btn { opacity: 1; }
.recent-row { color: var(--fg-3); font-size: 13px; min-height: 24px; }
.star-btn.on { color: #e3a008; }
.ts-row .ws-icon { width: 28px; height: 28px; font-size: 13px; }
.invite-row-share .inline-input { flex: 1; }
.palette-filters { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.set-select.small { font-size: 12px; padding: 3px 6px; }
.dbv-search { border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; background: var(--bg); font-size: 13px; width: 160px; margin-left: 2px; }
.recent-row { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 24px; border-radius: 6px; font-size: 13px; color: var(--fg-3); cursor: pointer; min-height: 24px; }
.recent-row:hover { background: var(--bg-hover); color: var(--fg); }
.recent-row.active { color: var(--fg); }
.recent-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Settings dialog (two panes) ---------- */
.palette.settings { width: min(1040px, 96vw); height: 84vh; max-height: 84vh; padding: 0; flex-direction: row; gap: 0; animation: none; overflow: hidden; }
.settings-side { width: 224px; flex: none; background: var(--bg-side); border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; }
.settings-brand { font-weight: 700; font-size: 15px; padding: 4px 8px 10px; letter-spacing: -0.01em; }
.settings-group { margin-bottom: 10px; }
.settings-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); padding: 6px 8px 2px; }
.settings-nav-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 6px; color: var(--fg-2); font-size: 14px; text-align: left; }
.settings-nav-item:hover { background: var(--bg-hover); color: var(--fg); }
.settings-nav-item.active { background: var(--bg-active); color: var(--fg); font-weight: 500; }
.settings-nav-icon { width: 20px; text-align: center; font-size: 14px; flex: none; }
.settings-main { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 28px 40px; }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.settings-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.settings-desc { margin: 4px 0 0; color: var(--fg-2); font-size: 13.5px; max-width: 64ch; line-height: 1.45; }
.settings-body { display: flex; flex-direction: column; gap: 14px; }
.settings-body > .set-list { gap: 14px; }
.set-card { border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px; display: flex; flex-direction: column; background: var(--bg); }
.set-card-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); padding: 10px 0 2px; }
.set-card > .set-row { padding: 10px 0; margin: 0; }
.set-card > .set-item-hint { padding: 0 0 10px; }
.set-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.set-item + .set-item, .set-row + .set-item, .set-card-title + .set-item + .set-item { border-top: 1px solid var(--border); }
.set-item-text { flex: 1; min-width: 0; }
.set-item-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-item-title .tag { font-size: 10px; background: var(--bg-selected); color: var(--accent); padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle; font-weight: 600; }
.set-item-hint { font-size: 12.5px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.set-item-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.set-glyph { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-callout); display: grid; place-items: center; font-size: 16px; flex: none; }
.set-glyph.mono { font: 11px var(--mono); color: var(--fg-2); }
.set-empty { padding: 14px 0; color: var(--fg-3); font-size: 13px; }
.set-foot { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); margin-top: 2px; }
.set-item-title .invite-url { display: block; max-width: 100%; font-size: 12px; padding: 2px 6px; }
.set-item-hint .invite-url { font-size: 11px; padding: 1px 5px; }
.settings-body .security-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0; }
.settings-body .sessions { border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px; }
.settings-body .sessions .invite-row { padding: 10px 0; }
.settings-body .audit-list { max-height: none; }
.settings-body .set-row > .rule-label { width: auto; }
@media (max-width: 800px) {
  .palette.settings { flex-direction: column; height: 90vh; max-height: 90vh; }
  .settings-side { width: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px 8px; }
  .settings-brand { display: none; }
  .settings-nav { display: flex; gap: 4px; overflow-x: auto; }
  .settings-group { display: flex; gap: 2px; margin: 0; }
  .settings-group-label { display: none; }
  .settings-nav-item { white-space: nowrap; width: auto; font-size: 13px; }
  .settings-main { padding: 16px; }
}
.invite-url.inline { display: inline; font-size: 11px; padding: 1px 5px; margin-left: 4px; }

/* Column reordering: drag a header; a bar shows where it lands */
.dbv-table th[draggable="true"] .th-label { cursor: grab; }
.dbv-table th.dragging { opacity: 0.4; }
.dbv-table th.drop-before::before, .dbv-table th.drop-after::after { content: ''; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--accent); z-index: 3; }
.dbv-table th.drop-before::before { left: -2px; }
.dbv-table th.drop-after::after { right: -2px; }
