/* Olympus — workspace styles */
:root {
  --bg: #ffffff;
  --side: #f7f6f3;
  --text: #2f2e2b;
  --text-2: #6f6c66;
  --text-3: #a29f98;
  --hover: rgba(55, 45, 30, 0.06);
  --hover-2: rgba(55, 45, 30, 0.1);
  --line: rgba(55, 40, 10, 0.09);
  --line-2: rgba(55, 40, 10, 0.16);
  --accent: #4757c4;
  --accent-hover: #3a49ad;
  --accent-soft: rgba(71, 87, 196, 0.12);
  --danger: #c8473b;
  --shadow: 0 0 0 1px rgba(30, 25, 15, 0.06), 0 4px 10px rgba(30, 25, 15, 0.07), 0 12px 32px rgba(30, 25, 15, 0.1);
  --radius: 6px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Inter", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sb-w: 264px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(71, 87, 196, 0.22); }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.ico { flex: none; display: block; }
.muted { color: var(--text-2); }
.hidden { display: none !important; }
.boot { height: 100vh; background: linear-gradient(90deg, var(--side) var(--sb-w), #fff var(--sb-w)); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .12s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.small { height: 28px; padding: 0 9px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost-light { background: rgba(255,255,255,.85); border-color: transparent; color: var(--text-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 28px; height: 28px; padding: 0 4px; border-radius: var(--radius); color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn .count { font-size: 12px; font-weight: 600; }
.link-btn { color: var(--text-2); font-size: 14px; padding: 4px 2px; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.input { width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--line-2); background: #fbfbfa; outline: none; font-size: 14px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.input.small { height: 30px; font-size: 13px; padding: 0 8px; width: auto; min-width: 0; }
select.input { padding-right: 4px; }
kbd { font-family: var(--font); font-size: 11px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- layout ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.scroller { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }

/* ---------- sidebar ---------- */
.sidebar { width: var(--sb-w); flex: none; background: var(--side); display: flex; flex-direction: column; border-right: 1px solid var(--line); position: relative; user-select: none; transition: margin-left .18s ease; font-size: 14px; }
body.sb-hidden .sidebar { margin-left: calc(-1 * var(--sb-w)); }
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 8px; }
.sb-ws { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius); min-width: 0; font-weight: 600; font-size: 14px; }
.sb-ws:hover { background: var(--hover); }
.ws-logo { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #3d4a8f, #7d8be0); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ws-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-top-actions { display: flex; gap: 2px; }
.sb-search { margin: 6px 8px 6px; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--text-3); font-size: 14px; }
.sb-search span { flex: 1; text-align: left; }
.sb-search:hover { border-color: rgba(55,40,10,.25); }
.sb-nav { padding: 2px 0 6px; }
.sb-item { display: flex; align-items: center; gap: 8px; height: 30px; margin: 0 8px; padding: 0 8px; border-radius: var(--radius); color: var(--text-2); font-weight: 500; cursor: pointer; width: calc(100% - 16px); text-align: left; position: relative; }
.sb-item:hover { background: var(--hover); }
.sb-item.active { background: var(--hover-2); color: var(--text); }
.sb-icon { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.sb-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-scroll { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.sb-section { display: flex; align-items: center; justify-content: space-between; margin: 14px 8px 2px; padding: 0 8px; height: 26px; font-size: 12px; font-weight: 600; color: var(--text-3); border-radius: var(--radius); }
.sb-section:hover { background: var(--hover); }
.sb-section-add { opacity: 0; min-width: 22px; height: 22px; }
.sb-section:hover .sb-section-add { opacity: 1; }
.sb-empty { font-size: 13px; color: var(--text-3); padding: 2px 16px 2px 38px; }
.sb-page { margin: 0 8px; width: calc(100% - 16px); }
.sb-pi { display: inline-flex; }
.sb-toggle { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; border-radius: 4px; color: var(--text-2); }
.sb-toggle:hover { background: var(--hover-2); }
.sb-toggle.open .ico { transform: rotate(90deg); }
.sb-page:hover .sb-toggle { display: inline-flex; }
.sb-page:hover .sb-pi { visibility: hidden; }
.sb-actions { display: none; gap: 2px; }
.sb-actions .icon-btn { min-width: 22px; height: 22px; padding: 0; }
.sb-page:hover .sb-actions { display: inline-flex; }
.sb-page.dragging { opacity: .4; }
.sb-page.drop-inside { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.sb-page.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.sb-page.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.sb-tree { min-height: 6px; }
.sb-bottom { border-top: 1px solid var(--line); padding: 6px 0 8px; }
.sb-online { display: flex; align-items: center; gap: 2px; padding: 6px 16px 0; font-size: 12px; color: var(--text-3); }
.sb-online > span:last-child { margin-left: 6px; }
.page-icon-img { border-radius: 4px; object-fit: cover; display: block; }

/* ---------- top bar ---------- */
.topbar { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; gap: 12px; font-size: 14px; background: rgba(255,255,255,.96); }
.tb-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sb-show { display: none; }
body.sb-hidden .sb-show { display: inline-flex; }
.crumbs { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: var(--radius); text-decoration: none; white-space: nowrap; max-width: 220px; color: var(--text); }
.crumb span:last-child { overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { background: var(--hover); }
.crumb-icon { display: inline-flex; }
.crumb-sep { color: var(--text-3); padding: 0 1px; }
.tb-right { display: flex; align-items: center; gap: 4px; flex: none; }
.tb-edited { color: var(--text-3); font-size: 13px; margin-right: 6px; white-space: nowrap; }
.presence { display: flex; align-items: center; margin-right: 4px; }
.presence-av { margin-left: -4px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; display: inline-flex; }
.share-btn { height: 28px; padding: 0 8px; color: var(--text); }
.fav.on { color: #e3a008; }
.fav.on .ico { fill: #f5c23e; }

/* ---------- page ---------- */
.page-loading { height: 3px; background: linear-gradient(90deg, transparent, var(--accent-soft), transparent); animation: load 1s infinite linear; background-size: 50% 100%; background-repeat: no-repeat; }
@keyframes load { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.cover { height: 30vh; min-height: 180px; max-height: 280px; background-size: cover; background-position: center 40%; position: relative; }
.cover.none { display: none; }
.cover-actions { position: absolute; right: 16px; bottom: 12px; opacity: 0; transition: opacity .15s; }
.cover:hover .cover-actions { opacity: 1; }
.page { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 96px 30vh; }
.page.full { max-width: none; }
.page.is-db { max-width: none; padding-left: 96px; padding-right: 96px; }
.page-header { padding-top: 64px; position: relative; }
.cover:not(.none) + .page .page-header { padding-top: 12px; }
.page-icon { font-size: 72px; line-height: 1; width: 78px; height: 78px; display: flex; align-items: center; justify-content: center; border-radius: 8px; margin-bottom: 6px; }
.page-icon:hover { background: var(--hover); }
.page-icon.none { display: none; }
.cover:not(.none) + .page .page-icon:not(.none) { margin-top: -54px; position: relative; }
.cover:not(.none) + .page .page-header { padding-top: 0; }
.page-add-bar { display: flex; gap: 4px; height: 30px; margin: 0 0 4px -8px; opacity: 0; transition: opacity .15s; }
.page-add-bar:empty { height: 0; margin: 0; }
.page-header:hover .page-add-bar { opacity: 1; }
.page-title { font-size: 40px; line-height: 1.2; font-weight: 700; margin: 0; padding: 3px 2px; outline: none; word-break: break-word; letter-spacing: -0.01em; }
.page.is-db .page-title { font-size: 34px; }
[data-ph]:empty::before { content: attr(data-ph); color: #c9c6c0; pointer-events: none; }
.page-sep { height: 10px; }
.row-db-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); text-decoration: none; padding: 2px 6px; border-radius: var(--radius); margin: 0 0 6px -6px; }
.row-db-link:hover { background: var(--hover); }

.row-props { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.rp-row { display: flex; align-items: flex-start; min-height: 34px; }
.rp-name { width: 170px; flex: none; display: flex; align-items: center; gap: 8px; color: var(--text-2); height: 34px; padding: 0 6px; }
.rp-value { flex: 1; min-height: 34px; display: flex; align-items: center; padding: 4px 8px; border-radius: var(--radius); cursor: pointer; }
.rp-value:hover { background: var(--hover); }
.rp-value.readonly { cursor: default; }
.rp-value.readonly:hover { background: none; }
.rp-value .empty { color: var(--text-3); }

.backlinks { margin: 10px 0 0; font-size: 14px; }
.backlinks-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); padding: 3px 6px; border-radius: var(--radius); margin-left: -6px; }
.backlinks-toggle:hover { background: var(--hover); }
.backlinks-toggle.open .ico:last-child { transform: rotate(180deg); }
.backlinks-list { display: flex; flex-direction: column; margin: 4px 0 0; }
.backlink { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius); text-decoration: none; margin-left: -6px; }
.backlink:hover { background: var(--hover); }
.bl-icon { display: inline-flex; }
.bl-via { color: var(--text-3); font-size: 12px; margin-left: auto; }
.page-body { margin-top: 4px; }
.page-db { margin-top: 18px; }
.empty-state { text-align: center; margin: 18vh auto; max-width: 420px; color: var(--text-2); }
.empty-state h2 { color: var(--text); }

/* ---------- editor ---------- */
.editor { position: relative; padding-bottom: 8px; }
.blk { position: relative; padding-left: calc(var(--indent, 0) * 26px); margin: 1px 0; border-radius: 4px; }
.blk-gutter { position: absolute; top: 3px; left: calc(var(--indent, 0) * 26px - 50px); display: flex; gap: 1px; opacity: 0; transition: opacity .1s; }
.blk:hover > .blk-gutter, .blk:focus-within > .blk-gutter { opacity: 1; }
.blk-btn { width: 24px; height: 24px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); }
.blk-btn:hover { background: var(--hover); color: var(--text-2); }
.blk-handle { cursor: grab; }
.blk[data-type=h1] .blk-gutter { top: 14px; }
.blk[data-type=h2] .blk-gutter { top: 11px; }
.blk[data-type=h3] .blk-gutter { top: 8px; }
.blk-body { min-width: 0; }
.blk-text { outline: none; padding: 3px 2px; min-height: 1.5em; white-space: pre-wrap; word-break: break-word; caret-color: var(--text); }
.blk-text:focus:empty::before { content: attr(data-ph); color: #c9c6c0; }
.blk[data-type=text] .blk-text:not(:focus):empty::before { content: ''; }
.blk[data-type=h1] .blk-text { font-size: 30px; font-weight: 700; line-height: 1.3; margin-top: 22px; letter-spacing: -0.01em; }
.blk[data-type=h2] .blk-text { font-size: 24px; font-weight: 650; line-height: 1.3; margin-top: 16px; }
.blk[data-type=h3] .blk-text { font-size: 20px; font-weight: 600; line-height: 1.3; margin-top: 10px; }
.blk-row { display: flex; align-items: flex-start; }
.blk-row .blk-text { flex: 1; min-width: 0; }
.blk-marker { width: 26px; flex: none; display: flex; align-items: center; justify-content: center; height: 30px; }
.blk-marker.bullet .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.blk[style*="--indent: 1"] .blk-marker.bullet .dot, .blk[style*="--indent:1"] .blk-marker.bullet .dot { background: transparent; border: 1.5px solid currentColor; }
.blk[style*="--indent: 2"] .blk-marker.bullet .dot { border-radius: 1px; }
.blk-marker.num { font-variant-numeric: tabular-nums; justify-content: flex-end; padding-right: 6px; width: 30px; }
.todo-box { width: 16px; height: 16px; border: 1.5px solid #8f8b84; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.todo-box:hover { background: var(--hover); }
.todo-box.on { background: var(--accent); border-color: var(--accent); }
.blk.checked .blk-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.toggle-btn { width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); transition: transform .12s; }
.toggle-btn:hover { background: var(--hover); }
.toggle-btn.open { transform: rotate(90deg); }
.blk[data-type=quote] .blk-text { border-left: 3px solid currentColor; padding-left: 14px; margin: 4px 0; font-size: 17px; }
.callout { display: flex; gap: 10px; padding: 14px 16px 14px 12px; border-radius: var(--radius); background: #f3f2ef; margin: 4px 0; }
.callout .blk-text { flex: 1; padding: 0; }
.callout-emoji { font-size: 20px; line-height: 1; width: 26px; height: 26px; border-radius: 4px; flex: none; }
.callout-emoji:hover { background: var(--hover); }
.divider { padding: 8px 0; outline: none; border-radius: 4px; }
.divider hr { border: 0; border-top: 1px solid var(--line-2); margin: 0; }
.divider:focus, .media:focus, .media-ph:focus, .page-link:focus, .bookmark:focus { box-shadow: 0 0 0 2px var(--accent-soft); outline: none; background: var(--accent-soft); }
.code-box { background: #f6f5f3; border-radius: var(--radius); margin: 6px 0; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 0; opacity: 0; transition: opacity .1s; }
.code-box:hover .code-head, .code-box:focus-within .code-head { opacity: 1; }
.code-lang { border: 0; background: transparent; color: var(--text-2); font-size: 12px; }
.code-text { margin: 0; padding: 6px 18px 18px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; outline: none; white-space: pre-wrap; tab-size: 2; overflow-x: auto; min-height: 1.5em; }
.media { margin: 6px 0; border-radius: 4px; outline: none; }
.media img { max-width: 100%; display: block; border-radius: 4px; }
.video-frame { position: relative; width: 100%; padding-top: 56.25%; background: #111; border-radius: 6px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.caption { font-size: 14px; color: var(--text-2); padding: 6px 2px 0; outline: none; min-height: 1em; }
.caption:empty:not(:focus)::before { content: ''; }
.caption:focus:empty::before { content: attr(data-ph); color: #c9c6c0; }
.media-ph { display: flex; align-items: center; gap: 10px; padding: 14px 14px; border-radius: var(--radius); background: #f3f2ef; color: var(--text-2); cursor: pointer; margin: 4px 0; font-size: 14px; outline: none; }
.media-ph:hover { background: #ecebe7; }
.media-pop { width: 360px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.or { text-align: center; color: var(--text-3); font-size: 12px; }
.bookmark { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius); text-decoration: none; margin: 6px 0; overflow: hidden; outline: none; }
.bookmark:hover { background: #fafaf9; }
.bm-main { flex: 1; padding: 12px 14px; min-width: 0; }
.bm-title { font-size: 14px; font-weight: 500; }
.bm-url { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-icon { width: 80px; display: flex; align-items: center; justify-content: center; background: #f3f2ef; color: var(--text-3); }
.page-link { display: flex; align-items: center; gap: 6px; padding: 3px 2px; border-radius: 4px; text-decoration: none; font-weight: 500; outline: none; }
.page-link:hover { background: var(--hover); }
.pl-title { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.pl-icon { width: 22px; display: inline-flex; justify-content: center; }
.pl-arrow { color: var(--text-3); }
.page-link.missing { color: var(--text-3); }
.inline-db { margin: 10px 0 14px; outline: none; }
.editor-tail { height: 120px; cursor: text; }
.editor-tail:only-child::before { content: 'Click here to start writing…'; display: block; color: #c9c6c0; padding: 3px 2px; }
.blk.dragging { opacity: .35; }
.blk.drop-line-before::before, .blk.drop-line-after::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: rgba(71,87,196,.5); border-radius: 2px; }
.blk.drop-line-before::before { top: -2px; }
.blk.drop-line-after::after { bottom: -2px; }
.blk.remote-edit { box-shadow: -3px 0 0 0 var(--rc); background: color-mix(in srgb, var(--rc) 6%, transparent); }
.remote-tag { position: absolute; right: -4px; top: -10px; display: inline-flex; align-items: center; gap: 4px; background: var(--rc); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px 1px 2px; border-radius: 10px; pointer-events: none; z-index: 2; }
.remote-tag .avatar { box-shadow: 0 0 0 1px #fff; }

/* rich text */
.blk-text b { font-weight: 650; }
.blk-text code, .val code { font-family: var(--mono); font-size: 85%; background: rgba(135, 120, 95, 0.15); color: #c0392b; padding: 1px 4px; border-radius: 4px; }
.blk-text a:not(.mention) { color: inherit; text-decoration: underline; text-decoration-color: rgba(55,40,10,.35); text-underline-offset: 2px; }
a.mention { display: inline; color: var(--text); font-weight: 500; text-decoration: none; border-bottom: 1px solid rgba(55,40,10,.25); cursor: pointer; padding: 0 1px; border-radius: 2px; }
a.mention:hover { background: var(--hover); }
a.mention::before { content: '↗'; font-size: 0.8em; color: var(--text-3); margin-right: 2px; }
a.mention.missing { color: var(--text-3); text-decoration: line-through; }
[data-color=gray] { color: #8a8780; } [data-color=brown] { color: #8c5a45; } [data-color=orange] { color: #c9661d; } [data-color=yellow] { color: #a8820f; }
[data-color=green] { color: #3c8a5a; } [data-color=blue] { color: #2f6fb0; } [data-color=purple] { color: #8059b5; } [data-color=pink] { color: #b5487d; } [data-color=red] { color: #c8473b; }
[data-color=gray_bg] { background: #ebe9e5; } [data-color=brown_bg] { background: #f1e6df; } [data-color=orange_bg] { background: #fbe9da; } [data-color=yellow_bg] { background: #f9f0cf; }
[data-color=green_bg] { background: #e1efe6; } [data-color=blue_bg] { background: #e0ebf7; } [data-color=purple_bg] { background: #ece4f5; } [data-color=pink_bg] { background: #f7e3ec; } [data-color=red_bg] { background: #f9e1de; }
.blk[data-color$=_bg] { border-radius: 4px; }
.color-a { width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }

/* selection toolbar */
.sel-toolbar { position: fixed; z-index: 60; display: flex; align-items: center; gap: 1px; padding: 3px; background: #fff; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; }
.tb-btn { height: 28px; min-width: 28px; padding: 0 7px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.tb-btn:hover { background: var(--hover); color: var(--text); }
.tb-sep { width: 1px; align-self: stretch; background: var(--line); margin: 3px 2px; }
.tb-color { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: #c9661d; font-weight: 600; }

/* ---------- popovers, menus, modals ---------- */
.popover { position: fixed; z-index: 80; background: #fff; border-radius: 10px; box-shadow: var(--shadow); max-height: min(70vh, 560px); overflow: auto; font-size: 14px; animation: pop .1s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.menu { padding: 5px; min-width: 220px; outline: none; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 8px; border-radius: 6px; text-align: left; color: var(--text); }
.menu-item .ico { color: var(--text-2); }
.menu-item:hover, .menu-item.active { background: var(--hover); }
.menu-item.static:hover { background: none; }
.menu-item.danger, .menu-item.danger .ico { color: var(--danger); }
.menu-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-hint { color: var(--text-3); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px -5px; }
.menu-heading { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 6px 8px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-menu { padding: 8px; min-width: 260px; }
.prop-menu > .input { margin-bottom: 4px; }
.prop-menu .menu { padding: 0; }
.slash-menu { width: 320px; padding: 5px; }
.slash-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 6px; border-radius: 6px; text-align: left; }
.slash-item.active, .slash-item:hover { background: var(--hover); }
.slash-icon { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #fff; flex: none; color: var(--text-2); }
.slash-text { display: flex; flex-direction: column; min-width: 0; }
.slash-label { font-size: 14px; }
.slash-desc { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-picker { width: 340px; padding: 6px; }
.pp-head { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 6px; }
.pp-input { margin: 2px 0 6px; }
.pp-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 6px; text-align: left; min-width: 0; }
.pp-item.active, .pp-item:hover { background: var(--hover); }
.pp-title { flex: none; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-path { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pp-none { color: var(--text-3); font-size: 13px; padding: 8px; }
.si-icon { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-2); }
.emoji-pop { width: 352px; padding: 8px; }
.emoji-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; font-size: 13px; color: var(--text-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.emoji-cell { font-size: 22px; height: 32px; border-radius: 6px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji-cell:hover { background: var(--hover); }
.cover-pop { width: 380px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cover-swatch { height: 52px; border-radius: 6px; border: 1px solid var(--line); }
.cover-swatch:hover { outline: 2px solid var(--accent); }
.share-pop { width: 340px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.share-row { display: flex; gap: 10px; align-items: flex-start; }
.share-title { font-weight: 600; }
.share-sub { color: var(--text-2); font-size: 13px; margin: 0; }
.share-avatars { display: flex; gap: 4px; flex-wrap: wrap; }

.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(15, 12, 8, 0.32); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); max-height: 76vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-back.small .modal { width: 420px; }
.confirm { padding: 20px; }
.confirm p { margin: 0 0 4px; }
.confirm h3 { margin: 0 0 12px; font-size: 16px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #2f2e2b; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); transition: opacity .3s; }
.toast.error { background: #8c2f27; }
.toast.out { opacity: 0; }
.live-status:empty { display: none; }
.live-status { position: fixed; bottom: 14px; right: 14px; background: #fff6e0; border: 1px solid #f0d58e; color: #7a5d12; padding: 8px 12px; border-radius: 8px; font-size: 13px; z-index: 50; max-width: 320px; }

/* search */
.search-modal { padding-top: 9vh; }
.search-box { width: 820px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; height: min(640px, 76vh); }
.search-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.search-input { flex: 1; border: 0; outline: none; font-size: 18px; background: transparent; color: var(--text); }
.search-body { flex: 1; display: flex; min-height: 0; }
.search-results { flex: 1; overflow-y: auto; padding: 6px; outline: none; }
.search-group { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px 10px 4px; }
.search-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; }
.search-item.active, .search-item:hover { background: var(--hover); }
.si-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.si-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.si-path { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.si-snippet { flex-basis: 100%; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-time { color: var(--text-3); font-size: 12px; white-space: nowrap; padding-top: 2px; }
mark { background: #f9ecb8; color: inherit; border-radius: 2px; }
.search-none { padding: 24px; color: var(--text-3); text-align: center; }
.search-preview { width: 300px; flex: none; border-left: 1px solid var(--line); padding: 28px 22px; overflow: hidden; background: #fbfbfa; }
.sp-icon { margin-bottom: 10px; }
.sp-path { color: var(--text-3); font-size: 12px; }
.sp-title { font-size: 20px; font-weight: 700; margin: 4px 0 10px; }
.sp-snippet { font-size: 13px; color: var(--text-2); }
.sp-meta { font-size: 12px; color: var(--text-3); margin-top: 12px; }
.search-foot { display: flex; gap: 18px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }

/* ---------- tags, avatars, values ---------- */
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 13px; line-height: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; gap: 4px; }
.tag[data-c=gray] { background: #ebe9e5; color: #55534e; } .tag[data-c=brown] { background: #f1e6df; color: #6e4b3a; }
.tag[data-c=orange] { background: #fbe4d3; color: #8a4b1d; } .tag[data-c=yellow] { background: #f8eecb; color: #7a5d12; }
.tag[data-c=green] { background: #dcece2; color: #2f6142; } .tag[data-c=blue] { background: #dbe8f5; color: #28537a; }
.tag[data-c=purple] { background: #e8e0f2; color: #5b3f80; } .tag[data-c=pink] { background: #f5dfe9; color: #7f3558; }
.tag[data-c=red] { background: #f8dcd9; color: #8c2f27; }
.tag.removable button { font-size: 14px; line-height: 1; opacity: .6; }
.color-dot { width: 18px; height: 18px; border-radius: 4px; display: inline-block; flex: none; }
.color-dot[data-c=gray] { background: #d6d3cd; } .color-dot[data-c=brown] { background: #dcc3b4; } .color-dot[data-c=orange] { background: #f4c299; }
.color-dot[data-c=yellow] { background: #f0da8a; } .color-dot[data-c=green] { background: #a9d4b8; } .color-dot[data-c=blue] { background: #a9c9ea; }
.color-dot[data-c=purple] { background: #c9b6e3; } .color-dot[data-c=pink] { background: #ebb4cc; } .color-dot[data-c=red] { background: #f0aaa3; }
.avatar { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none; background: #999; line-height: 1; }
.person { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; white-space: nowrap; }
.val { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.val a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val .num { font-variant-numeric: tabular-nums; }
.cb { width: 16px; height: 16px; border: 1.5px solid #8f8b84; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.cb.on { background: var(--accent); border-color: var(--accent); }
.rel-chip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none !important; border-bottom: 1px solid var(--line-2); font-size: 14px; white-space: nowrap; max-width: 100%; }
.rel-chip:hover { background: var(--hover); }
.rc-icon { display: inline-flex; }

/* ---------- databases ---------- */
.db { font-size: 14px; }
.db-loading { color: var(--text-3); padding: 12px 0; }
.db-title-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.db-title { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; text-decoration: none; padding: 2px 4px; border-radius: var(--radius); margin-left: -4px; }
.db-title:hover { background: var(--hover); }
.db-title-icon { display: inline-flex; }
.db-open { opacity: 0; }
.db-title-row:hover .db-open { opacity: 1; }
.db-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 0; }
.db-tabs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 0; overflow-x: auto; scrollbar-width: none; }
.db-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 16px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.db-tab:hover { background: var(--hover); }
.db-tab.active { background: var(--hover); color: var(--text); }
.db-add-view { border-radius: 50%; }
.db-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.db-search { height: 28px; border: 0; outline: none; border-bottom: 1px solid var(--line-2); width: 160px; font-size: 14px; background: transparent; }
.db-new { height: 28px; padding: 0 10px; margin-left: 6px; }
.db-hint { padding: 24px 4px; color: var(--text-2); }
.db-scroll { overflow-x: auto; padding-bottom: 4px; }
.page.is-db .db-scroll { margin: 0 -96px; padding: 0 96px 4px; }

.tbl { display: inline-flex; flex-direction: column; min-width: 100%; }
.tbl-row { display: flex; border-bottom: 1px solid var(--line); position: relative; }
.tbl-cell { flex: none; min-height: 36px; padding: 6px 8px; border-right: 1px solid var(--line); display: flex; align-items: center; overflow: hidden; cursor: pointer; position: relative; }
.tbl-row:not(.tbl-head) .tbl-cell:hover { background: rgba(55,45,30,.03); }
.tbl-cell.readonly { cursor: default; }
.tbl-cell.tbl-fill { flex: 1; border-right: 0; cursor: default; }
.tbl-head .tbl-cell { color: var(--text-2); font-weight: 400; gap: 6px; white-space: nowrap; min-height: 34px; }
.tbl-head .tbl-cell span { overflow: hidden; text-overflow: ellipsis; }
.tbl-head .tbl-cell:hover { background: var(--hover); }
.tbl-add { width: 40px; justify-content: center; border-right: 0 !important; }
.col-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 1; }
.col-resize:hover { background: rgba(71,87,196,.35); }
.cell-title-wrap { cursor: default; }
.cell-title { display: flex; align-items: center; gap: 6px; font-weight: 500; flex: 1; min-width: 0; cursor: text; }
.ct-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ct-text.ph, .ph { color: var(--text-3); text-decoration: none; }
.ct-icon { display: inline-flex; flex: none; color: var(--text-2); }
.open-btn { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-2); background: #fff; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tbl-row:hover .open-btn { display: inline-flex; }
.row-menu { position: absolute; left: -30px; top: 50%; transform: translateY(-50%); width: 22px; height: 24px; border-radius: 4px; color: var(--text-3); display: none; align-items: center; justify-content: center; }
.row-menu:hover { background: var(--hover); }
.cell-title-wrap { overflow: visible; }
.tbl-row:hover .row-menu { display: inline-flex; }
.tbl-new { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; color: var(--text-3); width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.tbl-new:hover { background: var(--hover); color: var(--text-2); }
.tbl-foot { font-size: 12px; color: var(--text-3); padding: 6px 8px; }
.cell-edit { padding: 4px; }
.cell-input { width: 100%; border: 0; outline: none; font-size: 14px; padding: 6px 8px; resize: vertical; background: transparent; }
.date-pop { width: 280px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.date-end { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.opt-pop { min-width: 260px; padding: 6px; }
.opt-chosen { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 4px 0; }
.opt-chosen:empty { display: none; }
.opt-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.opt-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; text-align: left; width: 100%; }
.opt-item > span:not(.tag):not(.avatar):not(.si-icon) { flex: 1; }
.opt-item .ico:last-child { margin-left: auto; color: var(--text-2); }
.opt-item.active, .opt-item:hover { background: var(--hover); }
.opt-editor { width: 300px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.opt-edit-row { display: flex; align-items: center; gap: 6px; }
.opt-edit-row .input { flex: 1; }
.filter-box { width: 460px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.filter-row { display: flex; gap: 6px; align-items: center; width: 100%; }
.filter-row .input { flex: 1; }
.switch { width: 30px; height: 18px; border-radius: 9px; background: #d6d3cd; position: relative; flex: none; transition: background .15s; }
.switch span { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--accent); }
.switch.on span { left: 14px; }

/* board */
.board { display: flex; gap: 14px; padding: 12px 0 8px; align-items: flex-start; }
.board-col { width: 264px; flex: none; border-radius: 10px; padding: 6px; background: rgba(240, 238, 234, 0.6); }
.board-col.drop { background: var(--accent-soft); }
.board-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.board-head .count { color: var(--text-3); font-size: 13px; }
.board-cards { display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.board-new { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; width: 100%; color: var(--text-3); border-radius: 6px; margin-top: 6px; }
.board-new:hover { background: var(--hover); color: var(--text-2); }
.card { background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px rgba(30,25,15,.08), 0 2px 4px rgba(30,25,15,.05); padding: 10px 10px 8px; cursor: pointer; position: relative; }
.card:hover { background: #fcfcfb; }
.card.dragging { opacity: .4; }
.card-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; padding-right: 22px; }
.card-props { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; font-size: 13px; }
.card-menu { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 5px; display: none; align-items: center; justify-content: center; color: var(--text-2); background: #fff; }
.card:hover .card-menu, .list-row:hover .card-menu { display: inline-flex; }
.card-menu:hover { background: var(--hover); }

/* list */
.list { display: flex; flex-direction: column; padding-top: 4px; }
.list-row { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 6px; border-radius: 6px; cursor: pointer; position: relative; }
.list-row:hover { background: var(--hover); }
.lr-title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-props { margin-left: auto; display: flex; gap: 10px; align-items: center; overflow: hidden; color: var(--text-2); font-size: 13px; padding-right: 26px; }
.lr-props .val { flex-wrap: nowrap; }
.list-row .card-menu { top: 50%; transform: translateY(-50%); }

/* calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px 8px; }
.cal-month { font-weight: 600; font-size: 15px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-dow { font-size: 12px; color: var(--text-3); text-align: center; padding: 4px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.weekend { background: #fbfaf8; }
.cal-day.out .cal-num { color: var(--text-3); }
.cal-day.drop { background: var(--accent-soft); }
.cal-num { text-align: right; font-size: 13px; color: var(--text-2); padding: 0 4px; height: 22px; line-height: 22px; }
.cal-day.today .cal-num { color: #fff; }
.cal-day.today .cal-num::after { content: ''; }
.cal-day.today .cal-num { background: var(--accent); border-radius: 11px; margin-left: auto; padding: 0 7px; min-width: 22px; text-align: center; }
.cal-item { display: flex; align-items: center; gap: 4px; background: #fff; box-shadow: 0 0 0 1px rgba(30,25,15,.1), 0 1px 2px rgba(30,25,15,.06); border-radius: 5px; padding: 2px 6px; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item span:last-child { overflow: hidden; text-overflow: ellipsis; }
.cal-item:hover { background: #f7f6f3; }
.cal-add { position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; border-radius: 5px; display: none; align-items: center; justify-content: center; color: var(--text-2); }
.cal-day:hover .cal-add { display: inline-flex; }
.cal-add:hover { background: var(--hover); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 14px 0 4px; }
.gcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.gcard .card-title { padding: 10px 10px 0; }
.gcard .card-props { padding: 0 10px 10px; }
.gcard .card-title:last-of-type { padding-bottom: 10px; }
.gcover { height: 130px; background: #f3f2ef center/cover no-repeat; border-bottom: 1px solid var(--line); overflow: hidden; }
.gexcerpt { padding: 12px; font-size: 11px; color: var(--text-2); line-height: 1.5; }
.gnew { align-items: center; justify-content: center; flex-direction: row; gap: 6px; min-height: 190px; color: var(--text-3); background: transparent; box-shadow: 0 0 0 1px var(--line); border-radius: 8px; }
.gnew:hover { background: var(--hover); color: var(--text-2); }

/* ---------- home ---------- */
.home { max-width: 960px; margin: 0 auto; padding: 56px 48px 120px; }
.home-title { font-size: 32px; font-weight: 700; text-align: center; margin: 12px 0 36px; }
.home-sec { margin-bottom: 36px; }
.home-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 12px; }
.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.home-card { position: relative; display: flex; flex-direction: column; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px rgba(30,25,15,.08), 0 2px 6px rgba(30,25,15,.04); overflow: hidden; text-decoration: none; height: 150px; text-align: left; }
.home-card:hover { box-shadow: 0 0 0 1px rgba(30,25,15,.12), 0 6px 16px rgba(30,25,15,.08); }
.hc-cover { height: 46px; }
.hc-icon { position: absolute; top: 28px; left: 14px; }
.hc-title { padding: 30px 14px 0; font-weight: 600; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hc-time { padding: 6px 14px 0; font-size: 12px; color: var(--text-3); margin-top: auto; margin-bottom: 12px; }
.hc-new { align-items: center; justify-content: center; color: var(--text-3); background: #fbfbfa; box-shadow: 0 0 0 1px var(--line); }
.hc-new .hc-title { padding: 6px 0 0; color: var(--text-2); }
.home-list { display: flex; flex-direction: column; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.home-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; }
.home-row:last-child { border-bottom: 0; }
.home-row:hover { background: var(--hover); }
.hr-title { font-weight: 500; white-space: nowrap; }
.hr-path { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-time { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.home-tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tip { display: flex; gap: 10px; padding: 14px; border-radius: 10px; background: #f7f6f3; font-size: 13px; }
.tip-icon { color: var(--accent); }
.tip-title { font-weight: 600; margin-bottom: 2px; }
.tip-desc { color: var(--text-2); }

/* ---------- settings ---------- */
.settings-modal .modal { width: 880px; height: 76vh; }
.settings { display: flex; height: 100%; min-height: 0; }
.set-nav { width: 220px; flex: none; background: var(--side); padding: 12px 0; border-right: 1px solid var(--line); font-size: 14px; }
.set-nav-head { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 16px 8px; }
.set-nav .sb-item.active { background: var(--hover-2); color: var(--text); }
.set-body { flex: 1; overflow-y: auto; padding: 28px 40px 40px; font-size: 14px; }
.set-body h2 { font-size: 18px; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.set-body h3 { font-size: 14px; margin: 28px 0 10px; }
.set-body > .btn { margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; max-width: 420px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); }
.set-user { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.su-name { font-weight: 600; font-size: 16px; }
.su-mail, .su-role { color: var(--text-2); font-size: 13px; }
.color-row { display: flex; gap: 8px; }
.color-pick { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; }
.color-pick.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.invite-box { background: #f7f6f3; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.invite-box p { margin: 0; color: var(--text-2); }
.invite-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.invite-row > span:first-child { width: 110px; }
.invite-row code { background: #fff; border: 1px solid var(--line-2); padding: 3px 8px; border-radius: 5px; font-family: var(--mono); font-size: 13px; }
.member-list { display: flex; flex-direction: column; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.m-main { flex: 1; min-width: 0; }
.m-name { font-weight: 500; display: flex; align-items: center; gap: 4px; }
.m-mail { color: var(--text-2); font-size: 13px; }
.m-role { color: var(--text-2); font-size: 13px; }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: #3f9b5d; display: inline-block; margin-left: 6px; }
.trash-pop { width: 400px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.trash-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.trash-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.trash-item:hover { background: var(--hover); }
.ti-main { flex: 1; min-width: 0; cursor: pointer; }
.ti-main > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-path { color: var(--text-3); font-size: 12px; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(ellipse at top, #f2f0fb 0%, #fbfaf8 55%, #f7f6f3 100%); }
.auth-card { width: 400px; max-width: 100%; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 32px 32px 24px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.auth-logo { width: 30px; height: 30px; display: inline-block; }
.auth h1 { font-size: 22px; margin: 0 0 4px; }
.auth-sub { color: var(--text-2); margin: 0 0 20px; font-size: 14px; }
.auth-form .field { max-width: none; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: -4px 0 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 2px 0 14px; color: var(--text-2); }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-2); margin: 16px 0 0; }
.auth-switch a { color: var(--accent); }
.auth-foot { color: var(--text-3); font-size: 13px; margin-top: 18px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 40; height: 100vh; box-shadow: var(--shadow); }
  .page, .page.is-db { padding-left: 22px; padding-right: 22px; }
  .page.is-db .db-scroll { margin: 0 -22px; padding: 0 22px 4px; }
  .tb-edited, .share-btn { display: none; }
  .page-title { font-size: 30px; }
  .blk-gutter { display: none; }
  .search-preview { display: none; }
  .home { padding: 32px 18px; }
  .settings { flex-direction: column; }
  .set-nav { width: auto; display: flex; overflow-x: auto; padding: 6px; }
  .set-nav-head { display: none; }
  .set-body { padding: 18px; }
  .rp-name { width: 120px; }
  .main { max-width: 100vw; overflow-x: hidden; }
  .page { max-width: 100vw; }
  .editor, .blk, .blk-body, .page-body, .page-db { max-width: 100%; min-width: 0; }
  .db-scroll { overflow-x: auto; max-width: calc(100% + 44px); }
}
@media print {
  .sidebar, .topbar, .blk-gutter { display: none !important; }
  .scroller { overflow: visible; }
}
