:root {
  --bg-content: #191919;
  --bg-sidebar: #202020;
  --bg-hover: rgba(255,255,255,0.055);
  --bg-active: rgba(255,255,255,0.09);
  --bg-popover: #2b2b2b;
  --bg-card: #242424;
  --bg-callout: #242424;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --text-strong: #ffffff;
  --text: #e9e9e7;
  --text-2: #cfcfcf;
  --text-3: #9b9b9b;
  --text-muted: #7d7d7d;
  --accent: #5aa9ee;
  --radius: 6px;
}
[data-theme="black"] {
  --bg-content: #000000;
  --bg-sidebar: #000000;
  --bg-hover: rgba(255,255,255,0.07);
  --bg-active: rgba(255,255,255,0.11);
  --bg-popover: #141414;
  --bg-card: #0c0c0c;
  --bg-callout: #0f0f0f;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --text-strong: #ffffff;
  --text: #ececec;
  --text-2: #c8c8c8;
  --text-3: #8e8e8e;
  --text-muted: #6a6a6a;
}
[data-theme="light"] {
  --bg-content: #ffffff;
  --bg-sidebar: #f7f7f5;
  --bg-hover: rgba(0,0,0,0.045);
  --bg-active: rgba(0,0,0,0.07);
  --bg-popover: #ffffff;
  --bg-card: #f7f7f5;
  --bg-callout: #f1f1ef;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --text-strong: #1f1f1f;
  --text: #37352f;
  --text-2: #37352f;
  --text-3: #787774;
  --text-muted: #9b9a97;
  --accent: #2383e2;
}
[data-theme="dark"] {
  --bg-content: #101010;
  --bg-sidebar: #101010;
  --bg-hover: rgba(255,255,255,0.06);
  --bg-active: rgba(255,255,255,0.10);
  --bg-popover: #1a1a1a;
  --bg-card: #181818;
  --bg-callout: #181818;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text-strong: #ffffff;
  --text: #ececec;
  --text-2: #c8c8c8;
  --text-3: #8e8e8e;
  --text-muted: #6a6a6a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  background: var(--bg-content); color: var(--text);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
#app { display: flex; height: 100vh; }

/* ---------- Sidebar ---------- */
#sidebar {
  width: 260px; flex: 0 0 260px; background: var(--bg-sidebar);
  border-right: 0.5px solid var(--border); display: flex; flex-direction: column;
  padding-top: 10px; padding-bottom: 4px; user-select: none;
}
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.sb-scroll::-webkit-scrollbar, .icon-grid::-webkit-scrollbar, .search-results::-webkit-scrollbar, .kanban::-webkit-scrollbar { width: 8px; height: 8px; }
.sb-scroll::-webkit-scrollbar-thumb, .icon-grid::-webkit-scrollbar-thumb, .search-results::-webkit-scrollbar-thumb, .kanban::-webkit-scrollbar-thumb { background: rgba(150,150,150,0.25); border-radius: 4px; }

.traffic { display: flex; gap: 8px; align-items: center; padding: 14px 0 8px 16px; }
.traffic span { width: 12px; height: 12px; border-radius: 50%; }
.t-red { background: #ff5f57; } .t-yellow { background: #febc2e; } .t-green { background: #28c840; }

/* account avatar — shown as the icon of the account hub row in the Personal section */
.ws-avatar { width: 20px; height: 20px; border-radius: 5px; background: #4a4a4a; color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: 0 0 20px; overflow: hidden; }
.account-row .page-name { color: var(--text-strong); font-weight: 500; }

.nav-row { display: flex; align-items: center; gap: 9px; margin: 0 8px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font-size: 14px; }
.nav-row:hover { background: var(--bg-hover); }
.nav-row i { font-size: 18px; }
.nav-row.primary { color: var(--text); }
.nav-row.primary i { color: var(--text-2); }
.nav-row.secondary { color: var(--text-3); }
.nav-row.secondary i { color: var(--text-3); }
.nav-row.active { background: var(--bg-active); color: var(--text-strong); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 8px 2px; padding: 2px 8px; }
.section-head:first-of-type { margin-top: 18px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px; }
.section-add { font-size: 16px; color: var(--text-muted); opacity: 0; transition: opacity .12s; cursor: pointer; padding: 2px; border-radius: 4px; }
.section-head:hover .section-add { opacity: 1; }
.section-add:hover { color: var(--text-2); background: var(--bg-hover); }

.page-row { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font-size: 14px; color: var(--text-2); }
.page-row:hover { background: var(--bg-hover); }
.page-row.active { background: var(--bg-active); color: var(--text-strong); }
.page-row.depth1 { padding-left: 8px; }
.page-row.depth2 { padding-left: 8px; }

.icon-wrap { position: relative; width: 20px; height: 20px; flex: 0 0 20px; display: flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; }
.icon-wrap .pi-chevron { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--text-3); border-radius: 4px; }
.icon-wrap .pi-chevron i { font-size: 14px; transition: transform .12s; }
.page-row.expandable:hover .pi-main { opacity: 0; }
.page-row.expandable:hover .pi-chevron { display: flex; }
.icon-wrap .pi-chevron:hover { background: var(--bg-active); }
.page-row.expanded .pi-chevron i { transform: rotate(90deg); }
.pi-main { display: flex; align-items: center; justify-content: center; }
.pi-main i { font-size: 17px; color: var(--text-2); }
.tile { width: 20px; height: 20px; border-radius: 5px; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.tile i { font-size: 13px; }
.page-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: none; align-items: center; gap: 2px; margin-left: auto; }
.page-row:hover .row-actions { display: flex; }
.row-actions i { font-size: 16px; color: var(--text-3); padding: 2px; border-radius: 4px; }
.row-actions i:hover { background: var(--bg-active); color: var(--text); }
/* drag-to-reorder rows */
.page-row.dragging { opacity: 0.4; }
.page-row.drop-above { box-shadow: inset 0 2px 0 var(--text-2); }
.page-row.drop-below { box-shadow: inset 0 -2px 0 var(--text-2); }

.add-row { display: flex; align-items: center; gap: 9px; margin: 0 8px; padding: 5px 8px; border-radius: var(--radius); cursor: pointer; font-size: 14px; color: var(--text-muted); }
.add-row:hover { background: var(--bg-hover); }
.add-row i { font-size: 16px; }
.sb-bottom { padding-top: 6px; border-top: 0.5px solid var(--border); }

/* ---------- Content ---------- */
#content { flex: 1; min-width: 0; background: var(--bg-content); display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-bottom: 0.5px solid var(--border); flex: 0 0 46px; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.crumb .tile { width: 18px; height: 18px; font-size: 11px; }
.crumb > i { font-size: 16px; color: var(--text-2); }
.crumb .pi-main i { font-size: 15px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--text-3); }
.topbar-actions .btn { font-size: 13px; cursor: pointer; }
.topbar-actions i { font-size: 17px; cursor: pointer; }
.topbar-actions i:hover, .topbar-actions .btn:hover { color: var(--text); }
.doc-scroll { flex: 1; overflow-y: auto; }
.doc { max-width: 720px; margin: 0 auto; padding: 56px 56px 160px; }
.doc-icon { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; cursor: pointer; }
.doc-icon.line i { font-size: 46px; color: var(--text-2); }
.doc-icon.line:hover { background: var(--bg-hover); }
.doc-icon.tilebig { font-size: 32px; font-weight: 600; }
.doc-icon.tilebig i { font-size: 34px; }
.doc-title { font-size: 34px; font-weight: 700; color: var(--text-strong); line-height: 1.25; outline: none; margin-bottom: 6px; }
.doc-title:empty:before { content: attr(data-placeholder); color: var(--text-muted); }

/* ---------- Block editor ---------- */
.blocks { margin-top: 6px; }
.block { display: flex; align-items: flex-start; position: relative; margin-left: -48px; padding-left: 48px; border-radius: 6px; }
.block.grabbed, .block.slash-on { background: var(--bg-active); }
.block-gutter { position: absolute; left: 0; top: 0; width: 46px; display: flex; align-items: center; justify-content: flex-end; gap: 1px; opacity: 0; transition: opacity .1s; padding-top: 4px; }
.block:hover .block-gutter { opacity: 1; }
.block[data-type="h1"] .block-gutter { padding-top: 16px; }
.block[data-type="h2"] .block-gutter { padding-top: 11px; }
.block[data-type="h3"] .block-gutter { padding-top: 8px; }
.b-add, .b-handle { color: var(--text-3); border-radius: 4px; padding: 2px; font-size: 17px; display: flex; }
.b-add { cursor: pointer; } .b-handle { cursor: grab; }
.b-add:hover, .b-handle:hover { background: var(--bg-hover); }
.block-content { flex: 1; min-width: 0; }
.b-row { display: flex; align-items: flex-start; gap: 8px; }
.b-edit { outline: none; line-height: 1.6; font-size: 16px; color: var(--text); flex: 1; min-width: 0; padding: 3px 0; word-break: break-word; }
.b-edit:empty:focus::before { content: attr(data-placeholder); color: var(--text-muted); }
.block[data-type="h1"] .b-edit { font-size: 30px; font-weight: 700; color: var(--text-strong); padding-top: 8px; }
.block[data-type="h2"] .b-edit { font-size: 24px; font-weight: 600; color: var(--text-strong); padding-top: 6px; }
.block[data-type="h3"] .b-edit { font-size: 20px; font-weight: 600; color: var(--text-strong); padding-top: 4px; }
.b-row { align-items: flex-start; }
.b-marker { color: var(--text-2); user-select: none; line-height: 1; height: 25.6px; margin-top: 3px; display: flex; align-items: center; }
.b-bullet { font-size: 20px; min-width: 16px; justify-content: center; }
.b-num { font-size: 16px; min-width: 22px; justify-content: flex-start; }
.b-check { width: 19px; height: 19px; border: 1.6px solid var(--text-3); border-radius: 50%; margin-top: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 19px; }
.b-check i { font-size: 12px; opacity: 0; color: #fff; }
.block.checked .b-check { background: #1A7F37; border-color: #1A7F37; }
.block.checked .b-check i { opacity: 1; }
.block.checked .b-edit { color: var(--text-muted); text-decoration: line-through; }
.block[data-type="quote"] .block-content { border-left: 3px solid var(--text-2); padding-left: 14px; }
.b-callout { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-callout); border-radius: 8px; padding: 12px 14px; }
.b-callout .b-cicon { font-size: 19px; height: 25.6px; margin-top: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 5px; padding: 0 3px; }
.b-callout .b-cicon:hover { background: rgba(255,255,255,0.10); }
.b-callout .b-edit { padding: 3px 0; }
.b-divider { border: none; border-top: 1px solid var(--border-strong); margin: 8px 0; }
.b-pagelink { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 4px; cursor: pointer; color: var(--text); }
.b-pagelink:hover { background: var(--bg-hover); }
.b-pagelink .pl-name { border-bottom: 0.5px solid var(--border-strong); font-size: 16px; }
.b-table-wrap { overflow-x: auto; padding: 4px 0; }
.b-table { border-collapse: collapse; }
.b-table td { border: 1px solid var(--border-strong); padding: 7px 10px; min-width: 90px; font-size: 15px; color: var(--text); outline: none; vertical-align: top; }
.b-table td:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.tbl-btn { font-size: 13px; color: var(--text-3); cursor: pointer; padding: 4px 8px; border-radius: 6px; display: inline-flex; gap: 4px; align-items: center; }
.tbl-btn:hover { background: var(--bg-hover); color: var(--text); }
.drop-line { height: 2px; background: var(--accent); border-radius: 2px; margin: 0 0 0 0; }
.block.grabbed { background: var(--bg-active); border-radius: 6px; }
.b-color-default { }

/* ---------- Home ---------- */
.home-wrap { max-width: 720px; margin: 0 auto; padding: 72px 56px; }
.home-hi { font-size: 28px; font-weight: 700; color: var(--text-strong); margin-bottom: 24px; }
.home-section-label { font-size: 13px; color: var(--text-3); margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; }
.home-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 10px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 84px; }
.home-card:hover { background: var(--bg-hover); }
.home-card .hc-name { font-size: 14px; color: var(--text); font-weight: 500; }

/* ---------- Settings / themes ---------- */
.settings-wrap { max-width: 720px; margin: 0 auto; padding: 56px; }
.settings-h { font-size: 26px; font-weight: 700; color: var(--text-strong); margin-bottom: 28px; }
.settings-label { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.theme-card { border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px; cursor: pointer; }
.theme-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-prev { height: 84px; border-radius: 8px; display: flex; overflow: hidden; border: 0.5px solid var(--border); }
.theme-prev .tp-sb { width: 34%; } .theme-prev .tp-main { flex: 1; }
.theme-name { font-size: 14px; color: var(--text); margin-top: 10px; display: flex; align-items: center; gap: 7px; }
.theme-name i { font-size: 16px; color: var(--accent); opacity: 0; }
.theme-card.sel .theme-name i { opacity: 1; }

/* ---------- Settings full-screen overlay ---------- */
.settings-overlay { position: fixed; inset: 0; z-index: 250; background: var(--bg-content); display: flex; flex-direction: column; }
.settings-top { flex: 0 0 auto; height: 52px; display: flex; align-items: center; padding: 0 16px; border-bottom: 0.5px solid var(--border); }
.settings-back { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: none; color: var(--text-2); font-size: 14px; cursor: pointer; padding: 7px 10px; border-radius: 7px; }
.settings-back i { font-size: 18px; }
.settings-back:hover { background: var(--bg-hover); color: var(--text-strong); }
.settings-layout { display: flex; flex: 1; min-height: 0; }
.settings-nav { width: 220px; flex: 0 0 220px; border-right: 0.5px solid var(--border); padding: 18px 12px; overflow-y: auto; display: flex; flex-direction: column; }
.settings-nav-foot { margin-top: auto; padding-top: 12px; }
.settings-nav-item.logout, .settings-nav-item.logout i { color: var(--danger, #e5484d); }
.settings-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); padding: 0 8px 8px; }
.settings-nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.settings-nav-item i { font-size: 17px; color: var(--text-3); }
.settings-nav-item:hover { background: var(--bg-hover); }
.settings-nav-item.active { background: var(--bg-active); color: var(--text-strong); }
.settings-nav-item.active i { color: var(--text-strong); }
.settings-pane-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.settings-pane { max-width: 620px; padding: 48px 56px; }
.av-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.set-avatar-row { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 28px; }
.set-avatar-row .acc-avatar-big { margin: 0; cursor: pointer; overflow: hidden; }
.set-avatar-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.set-btn { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.set-btn i { font-size: 16px; }
.set-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.set-btn.ghost { border-color: transparent; color: var(--text-3); padding: 4px 6px; }
.set-btn.ghost:hover { color: var(--text-strong); background: transparent; }
.set-btn.danger { border-color: var(--danger, #e5484d); color: var(--danger, #e5484d); }
.set-btn.danger:hover { background: var(--danger, #e5484d); color: #fff; }
.av-swatches { display: flex; flex-wrap: wrap; gap: 6px; max-width: 230px; }
.av-swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.av-swatch i { font-size: 13px; opacity: 0; }
.av-swatch.sel i { opacity: 1; }
.set-field { margin-bottom: 20px; max-width: 420px; }
.set-label { font-size: 13px; color: var(--text-3); margin-bottom: 7px; }
.set-input { width: 100%; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--text); outline: none; }
.set-input:focus { border-color: var(--accent); }
.set-input:disabled { color: var(--text-3); cursor: not-allowed; }
.set-input.err { border-color: var(--danger, #e5484d); }
.set-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.set-id-row { display: flex; align-items: center; gap: 10px; }
.set-id { flex: 1; min-width: 0; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-handle-wrap { display: flex; align-items: center; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; padding-left: 12px; }
.set-handle-wrap:focus-within { border-color: var(--accent); }
.set-handle-at { color: var(--text-3); font-size: 14px; }
.set-handle-input { border: 0; background: transparent; padding-left: 4px; }
.set-handle-input:focus { border: 0; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; padding: 8px 24px 40px; align-items: flex-start; overflow-x: auto; height: 100%; user-select: none; }
.kcol { width: 300px; flex: 0 0 300px; background: var(--bg-card); border-radius: 12px; padding: 10px; max-height: 100%; display: flex; flex-direction: column; }
.kcol.kcol-over { box-shadow: inset 0 0 0 2px var(--accent); }
.kcol-head { font-size: 14px; font-weight: 600; color: var(--text-strong); display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; }
.kcol-head .kc-count { color: var(--text-3); font-weight: 400; margin-left: 6px; }
.kcards { flex: 1; overflow-y: auto; min-height: 8px; }
.kcard { background: var(--bg-content); border: 0.5px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; color: var(--text); cursor: grab; outline: none; line-height: 1.4; }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: 0.35; }
.kcard:empty:before { content: "New card"; color: var(--text-muted); }
.kcard-drop { height: 2px; background: var(--accent); border-radius: 2px; margin: 0 0 8px; }
.kadd { color: var(--text-3); font-size: 14px; padding: 7px 8px; cursor: pointer; border-radius: 8px; display: flex; gap: 6px; align-items: center; }
.kadd:hover { background: var(--bg-hover); }

/* ---------- Popover / menus ---------- */
.popover { position: fixed; z-index: 700; background: var(--bg-popover); border: 0.5px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.45); padding: 8px; }
.popover.hidden { display: none; }
.popover.picker { width: 280px; padding: 10px; }
.pop-section-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: .3px; margin: 6px 4px 8px; text-transform: uppercase; }
.color-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.swatch { width: 26px; height: 26px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.swatch.sel { box-shadow: 0 0 0 2px var(--text-strong); }
.swatch i { font-size: 14px; opacity: 0; } .swatch.sel i { opacity: 1; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; max-height: 200px; overflow-y: auto; overflow-x: hidden; }
.icon-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; }
.icon-cell:hover { background: var(--bg-hover); }
.icon-cell.sel { background: var(--bg-active); color: var(--text-strong); }
.icon-cell i { font-size: 18px; }
.menu { width: 240px; }
.menu-label { padding: 5px 10px 7px; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.menu-item:hover, .menu-item.active { background: var(--bg-hover); }
.menu-item i.lead { font-size: 17px; color: var(--text-3); }
.menu-item .kbd { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.menu-item.danger:hover { color: #e8645a; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-scroll { max-height: 300px; overflow-y: auto; }

.inline-toolbar { position: fixed; z-index: 690; background: var(--bg-popover); border: 0.5px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); display: flex; align-items: center; padding: 4px; gap: 2px; }
.inline-toolbar.hidden { display: none; }
.it-btn { min-width: 30px; height: 30px; padding: 0 7px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-2); cursor: pointer; font-size: 16px; }
.it-btn:hover { background: var(--bg-hover); }
.it-btn.active { color: var(--accent); }
.it-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 2px; }

/* ---------- Search modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 140px; }
.modal-overlay.hidden { display: none; }
.search-box { width: 560px; max-width: 90vw; background: var(--bg-popover); border: 0.5px solid var(--border-strong); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.55); overflow: hidden; }
.search-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 0.5px solid var(--border); }
.search-input-row i { font-size: 20px; color: var(--text-3); }
.search-input-row input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 17px; }
.search-input-row input::placeholder { color: var(--text-muted); }
.search-input-row kbd { font-size: 11px; color: var(--text-3); border: 0.5px solid var(--border-strong); border-radius: 4px; padding: 2px 6px; }
.search-results { max-height: 360px; overflow-y: auto; padding: 8px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.sr-item:hover, .sr-item.active { background: var(--bg-hover); }
.sr-item .tile { width: 18px; height: 18px; font-size: 11px; }
.sr-empty { padding: 16px; color: var(--text-muted); font-size: 14px; text-align: center; }

/* ---------- Sidebar V2 (Apple-style grouped containers) ---------- */
:root { --bg-group: #2b2b2b; --group-sep: rgba(255,255,255,0.05); }
[data-theme="dark"] { --bg-group: #1a1a1a; --group-sep: rgba(255,255,255,0.06); }
[data-theme="black"] { --bg-group: #161616; --group-sep: rgba(255,255,255,0.07); }
[data-theme="light"] { --bg-group: #ffffff; --group-sep: rgba(0,0,0,0.06); }

#sidebar.v2 .section-head { margin: 16px 8px 6px; }
#sidebar.v2 .group { background: var(--bg-group); border-radius: 10px; margin: 0 8px; overflow: hidden; }
#sidebar.v2 .group .page-row { margin: 0; border-radius: 0; padding: 6px 10px; position: relative; }
#sidebar.v2 .group .page-row:not(:last-child)::after { content: ''; position: absolute; left: 38px; right: 0; bottom: 0; height: 0.5px; background: var(--group-sep); }
#sidebar.v2 .group .page-row.depth1::after { left: 56px; }
#sidebar.v2 .group .page-row.depth2::after { left: 74px; }
#sidebar.v2 .add-row { margin: 6px 8px 0; padding: 6px 10px; }

/* segmented control (settings) */
.seg { display: inline-flex; background: var(--bg-card); border-radius: 9px; padding: 3px; gap: 3px; }
.seg-btn { padding: 7px 16px; border-radius: 6px; font-size: 13px; color: var(--text-3); cursor: pointer; }
.seg-btn.sel { background: var(--bg-active); color: var(--text-strong); }

/* ---------- Untitled pages ---------- */
.page-name.untitled { color: var(--text-muted); }

/* ---------- Account / profile page ---------- */
.nav-row.account { gap: 9px; }
.acc-mini { width: 22px; height: 22px; border-radius: 6px; background: #4a4a4a; color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: 0 0 22px; }
.account-wrap { max-width: 600px; margin: 0 auto; padding: 44px 32px 120px; }
.acc-avatar-big { width: 96px; height: 96px; border-radius: 50%; background: var(--bg-active); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 600; color: var(--text-strong); margin: 0 auto 16px; }
.acc-name { text-align: center; font-size: 26px; font-weight: 700; color: var(--text-strong); outline: none; line-height: 1.2; }
.acc-name:empty:before { content: attr(data-placeholder); color: var(--text-muted); }
.acc-sub { text-align: center; color: var(--text-3); font-size: 14px; margin-top: 4px; }
.acc-section-label { font-size: 13px; color: var(--text-3); margin: 26px 4px 9px; }
.acc-group { background: var(--bg-card); border-radius: 12px; overflow: hidden; }
.acc-about { padding: 13px 16px; }
.ab-edit { outline: none; font-size: 15px; color: var(--text); line-height: 1.55; min-height: 22px; }
.ab-edit:empty:before { content: attr(data-placeholder); color: var(--text-muted); }
.acc-row { display: flex; align-items: center; gap: 13px; padding: 11px 14px; cursor: pointer; position: relative; }
.acc-row:hover { background: var(--bg-hover); }
.acc-row:not(:last-child)::after { content: ''; position: absolute; left: 53px; right: 0; bottom: 0; height: 0.5px; background: var(--group-sep); }
.acc-tile { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 30px; color: #fff; }
.acc-tile i { font-size: 19px; }
.acc-label { flex: 1; font-size: 15px; color: var(--text-strong); }
.acc-handle { font-size: 14px; color: var(--text-3); }
.acc-ext { font-size: 17px; color: var(--text-3); }
.acc-remove { font-size: 17px; color: var(--text-3); display: none; padding: 2px; border-radius: 4px; }
.acc-row:hover .acc-remove { display: block; }
.acc-remove:hover { color: #e8645a; background: var(--bg-active); }
.acc-add { display: flex; align-items: center; gap: 11px; padding: 11px 14px; color: var(--text-3); cursor: pointer; font-size: 15px; }
.acc-add:hover { background: var(--bg-hover); }
.acc-add i { font-size: 18px; }

/* ---------- Code block ---------- */
.b-code { position: relative; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 2px 0; }
.code-edit { outline: none; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 13.5px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; min-height: 20px; }
.code-edit:empty:focus::before { content: "Paste or type code…"; color: var(--text-muted); }
.code-copy { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-3); cursor: pointer; background: var(--bg-content); opacity: 0; transition: opacity .12s; }
.b-code:hover .code-copy { opacity: 1; }
.code-copy:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- Media blocks ---------- */
.b-image { margin: 4px 0; }
.b-image img { max-width: 100%; border-radius: 8px; display: block; }
.b-video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 4px 0; }
.b-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; }
.b-file { display: flex; align-items: center; gap: 11px; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 8px; padding: 10px 13px; margin: 2px 0; text-decoration: none; color: var(--text); }
.b-file:hover { background: var(--bg-hover); }
.b-file .file-ic { width: 30px; height: 30px; border-radius: 7px; background: var(--bg-active); display: flex; align-items: center; justify-content: center; flex: 0 0 30px; }
.b-file .file-ic i { font-size: 17px; color: var(--text-2); }
.b-file .file-name { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-file .file-size { font-size: 13px; color: var(--text-3); }
.b-file .file-dl { font-size: 18px; color: var(--text-3); }

/* ---------- Dynamic blocks (inline) ---------- */
.b-dynamic { border: 0.5px solid var(--border); border-radius: 10px; padding: 8px; margin: 4px 0; background: var(--bg-card); }
.dyn-label { font-size: 12px; font-weight: 600; color: var(--text-3); display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; }
.dyn-label i { font-size: 15px; }
.b-dynamic .kanban { padding: 0; }
.b-dynamic .kcol { width: 230px; flex: 0 0 230px; background: var(--bg-content); }
.notes-list { display: flex; flex-direction: column; gap: 7px; padding: 2px; }
.note-card { background: var(--bg-content); border: 0.5px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--text); cursor: text; outline: none; position: relative; }
.note-card:hover { border-color: var(--border-strong); }
.note-empty { color: var(--text-muted); }
.note-del { position: absolute; top: 8px; right: 8px; font-size: 15px; color: var(--text-3); display: none; cursor: pointer; }
.note-card:hover .note-del { display: block; }
.note-del:hover { color: #e8645a; }
.notes-add { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 14px; padding: 7px 8px; cursor: pointer; border-radius: 7px; }
.notes-add:hover { background: var(--bg-hover); }

/* ---------- Slash menu sections ---------- */
.menu-group-label { font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .3px; text-transform: uppercase; padding: 8px 10px 4px; }
.menu-item .mi-ic { width: 26px; height: 26px; border-radius: 5px; border: 0.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px; }
.menu-item .mi-ic i { font-size: 16px; color: var(--text-2); }
.popover.slash { width: 280px; }

/* ---------- Picker search ---------- */
.picker-search { width: 100%; height: 32px; background: var(--bg-hover); border: 0.5px solid var(--border-strong); border-radius: 7px; color: var(--text); font-size: 14px; padding: 0 10px; outline: none; margin-bottom: 8px; }
.picker-search::placeholder { color: var(--text-muted); }

/* ---------- Settings switch ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 520px; }
.setting-title { font-size: 15px; color: var(--text); }
.setting-desc { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--bg-active); position: relative; cursor: pointer; flex: 0 0 44px; transition: background .15s; }
.switch.on { background: #34C759; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch.on .switch-knob { left: 21px; }

/* ---------- multi-block selection ---------- */
.block.block-selected { background: rgba(90,169,238,0.20); }

/* ---------- generic modal overlay ---------- */
.ovl { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; }

/* ---------- task modal ---------- */
.task-modal { width: 560px; max-width: 94vw; max-height: 88vh; overflow-y: auto; background: var(--bg-content); border: 0.5px solid var(--border-strong); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); padding: 14px 22px 26px; }
.task-top { display: flex; justify-content: flex-end; }
.task-close { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--text-3); cursor: pointer; font-size: 18px; }
.task-close:hover { background: var(--bg-hover); color: var(--text); }
.task-title { width: 100%; background: transparent; border: none; outline: none; color: var(--text-strong); font-size: 26px; font-weight: 700; margin: 2px 0 18px; }
.task-title::placeholder { color: var(--text-muted); }
.task-fields { display: flex; flex-direction: column; gap: 4px; }
.task-field { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.tf-label { display: flex; align-items: center; gap: 8px; width: 130px; flex: 0 0 130px; color: var(--text-3); font-size: 14px; }
.tf-label i { font-size: 17px; }
.tf-input { flex: 1; background: var(--bg-hover); border: 0.5px solid var(--border); border-radius: 7px; color: var(--text); font-size: 14px; padding: 7px 10px; outline: none; color-scheme: dark; }
.prio-seg { display: inline-flex; gap: 6px; }
.prio-opt { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--text-3); border: 1px solid var(--border-strong); cursor: pointer; }
.prio-opt.sel { color: #fff; background: var(--pc); border-color: var(--pc); }
.task-desc-label { font-size: 13px; color: var(--text-3); margin: 20px 0 8px; }
.task-desc { min-height: 120px; background: var(--bg-hover); border: 0.5px solid var(--border); border-radius: 9px; padding: 12px 14px; font-size: 15px; line-height: 1.6; color: var(--text); outline: none; }
.task-desc:empty:before { content: attr(data-placeholder); color: var(--text-muted); }

/* ---------- board page: title + tabs ---------- */
.board-head { width: 100%; max-width: 720px; margin: 0 auto; padding: 56px 56px 0; flex: 0 0 auto; }
.board-proj { font-size: 14px; color: var(--text-3); margin-bottom: 4px; }
.board-title { font-size: 34px; font-weight: 700; color: var(--text-strong); line-height: 1.25; margin-bottom: 6px; outline: none; }
.board-title:empty:before { content: attr(data-placeholder); color: var(--text-muted); }
.page-body { width: 100%; max-width: 720px; margin: 0 auto; padding: 14px 56px 120px; }
.board-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.board-tab { padding: 7px 16px; border-radius: 999px; font-size: 14px; color: var(--text-3); background: var(--bg-card); cursor: pointer; user-select: none; }
.board-tab:hover { background: var(--bg-hover); color: var(--text); }
.board-tab.active { background: var(--bg-active); color: var(--text-strong); }
.board-tab-add { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-3); cursor: pointer; background: var(--bg-card); }
.board-tab-add:hover { background: var(--bg-hover); color: var(--text); }
.board-body { flex: 1; min-height: 0; }
.board-body .kanban { padding-top: 16px; }

/* ---------- kanban card meta ---------- */
.kcard-title { font-size: 14px; line-height: 1.4; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kbadge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); background: var(--bg-active); padding: 2px 8px; border-radius: 999px; }
.kbadge i { font-size: 13px; }
.kdot { width: 7px; height: 7px; border-radius: 50%; }
.kassignee { width: 22px; height: 22px; padding: 0; justify-content: center; font-weight: 600; color: var(--text); }

/* ---------- notes: sticker board ---------- */
.sticker-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 18px 32px 60px; align-content: start; }
.sticker { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 14px; padding: 16px; min-height: 130px; cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 8px; }
.sticker:hover { background: var(--bg-hover); }
.sticker-title { font-size: 16px; font-weight: 600; color: var(--text-strong); }
.sticker-text { font-size: 13.5px; color: var(--text-3); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.sticker-del { position: absolute; top: 10px; right: 10px; font-size: 16px; color: var(--text-3); display: none; }
.sticker:hover .sticker-del { display: block; }
.sticker-del:hover { color: #e8645a; }
.sticker-drop { border: 2px dashed var(--accent); border-radius: 14px; min-height: 130px; }
.sticker-add { border: 1px dashed var(--border-strong); border-radius: 14px; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); cursor: pointer; font-size: 14px; }
.sticker-add:hover { background: var(--bg-hover); color: var(--text); }
.sticker-add i { font-size: 22px; }

/* ---------- sticker fullscreen ---------- */
.sticker-full { position: fixed; inset: 0; background: var(--bg-content); z-index: 320; display: flex; flex-direction: column; }
.sticker-full-bar { height: 48px; flex: 0 0 48px; display: flex; align-items: center; padding: 0 20px; border-bottom: 0.5px solid var(--border); }
.sticker-back { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; cursor: pointer; padding: 6px 10px; border-radius: 7px; }
.sticker-back:hover { background: var(--bg-hover); }
.sticker-full-body { flex: 1; overflow-y: auto; max-width: 720px; width: 100%; margin: 0 auto; padding: 48px 40px 120px; display: flex; flex-direction: column; gap: 10px; }
.sticker-full-title { background: transparent; border: none; outline: none; color: var(--text-strong); font-size: 34px; font-weight: 700; }
.sticker-full-title::placeholder { color: var(--text-muted); }
.sticker-full-sub { background: transparent; border: none; outline: none; color: var(--text-2); font-size: 18px; }
.sticker-full-sub::placeholder { color: var(--text-muted); }
.sticker-full-text { background: transparent; border: none; outline: none; resize: none; color: var(--text); font-size: 16px; line-height: 1.7; min-height: 50vh; font-family: inherit; margin-top: 10px; }
.sticker-full-text::placeholder { color: var(--text-muted); }

/* ---------- sticker modal (window + block editor) ---------- */
.note-modal { width: 680px; max-width: 94vw; max-height: 88vh; overflow-y: auto; background: var(--bg-content); border: 0.5px solid var(--border-strong); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); padding: 38px 28px 48px 56px; }
.note-modal .task-top { margin-right: -28px; }
.note-modal-title { width: 100%; background: transparent; border: none; outline: none; color: var(--text-strong); font-size: 28px; font-weight: 700; margin: 2px 0 4px; }
.note-modal-title::placeholder { color: var(--text-muted); }
.note-modal-sub { width: 100%; background: transparent; border: none; outline: none; color: var(--text-2); font-size: 16px; margin-bottom: 10px; }
.note-modal-sub::placeholder { color: var(--text-muted); }
.note-blocks { padding-right: 4px; min-height: 200px; }
.note-blocks .doc-title { display: none; }

/* ---------- nicer drag & drop ---------- */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 600; pointer-events: none; margin: 0; box-shadow: 0 16px 40px rgba(0,0,0,0.5); opacity: 0.97; }
.kcard.dragging, .sticker.dragging { display: none; }
.kcard-drop { height: 40px; background: transparent; border: 2px dashed var(--accent); border-radius: 8px; margin: 0 0 8px; }

/* ---------- blog database ---------- */
.blog-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; position: relative; }
.blog-row:not(:last-child)::after { content: ''; position: absolute; left: 14px; right: 0; bottom: 0; height: 0.5px; background: var(--group-sep); }
.blog-text { flex: 1; outline: none; font-size: 15px; color: var(--text); min-width: 0; }
.blog-text:empty:before { content: attr(data-placeholder); color: var(--text-muted); }
.blog-type { display: inline-flex; background: var(--bg-active); border-radius: 8px; padding: 2px; gap: 2px; flex: 0 0 auto; }
.bt-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.bt-opt i { font-size: 14px; }
.bt-opt.sel { background: var(--bg-content); color: var(--text-strong); }
.blog-del { font-size: 16px; color: var(--text-3); cursor: pointer; opacity: 0; flex: 0 0 auto; }
.blog-row:hover .blog-del { opacity: 1; }
.blog-del:hover { color: #e8645a; }

/* ---------- trash ---------- */
.trash-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; position: relative; }
.trash-row:not(:last-child)::after { content: ''; position: absolute; left: 46px; right: 0; bottom: 0; height: 0.5px; background: var(--group-sep); }
.trash-ic { width: 22px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.trash-ic .tile { width: 20px; height: 20px; }
.trash-name { flex: 1; font-size: 15px; color: var(--text); }
.trash-meta { font-size: 12px; color: var(--text-muted); }
.trash-restore { font-size: 13px; color: var(--accent); cursor: pointer; }
.trash-restore:hover { text-decoration: underline; }
.trash-del { font-size: 16px; color: var(--text-3); cursor: pointer; }
.trash-del:hover { color: #e8645a; }

/* ---------- note modal close fix + sticker trash ---------- */
.note-modal { position: relative; }
.note-modal .task-top { position: absolute; top: 12px; right: 14px; margin: 0; }
.sticker-del:hover { color: #e8645a; }
.task-trash { color: #e8645a; font-size: 18px; cursor: pointer; display: flex; align-items: center; }
.task-trash:hover { opacity: 0.8; }
.task-top { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }

/* ---------- kanban column icons ---------- */
.kcol-titlewrap { display: inline-flex; align-items: center; gap: 7px; }
.kcol-ic { font-size: 17px; color: var(--text-3); }

/* ---------- blog: done + type dropdown ---------- */
.blog-check { width: 18px; height: 18px; border: 1.6px solid var(--text-3); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 18px; }
.blog-check i { font-size: 12px; opacity: 0; color: #fff; }
.blog-check.on { background: #1f9d4e; border-color: #1f9d4e; }
.blog-check.on i { opacity: 1; }
.blog-row.done .blog-text { color: var(--text-muted); text-decoration: line-through; }
.blog-done-group { opacity: 0.55; }
.blog-type-dd { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-active); border-radius: 8px; padding: 5px 10px; font-size: 13px; color: var(--text); cursor: pointer; flex: 0 0 auto; }
.blog-type-dd i:first-child { font-size: 15px; }
.blog-type-dd { min-width: 108px; }
.blog-type-dd .dd-caret { font-size: 13px; color: var(--text-3); margin-left: auto; }
.blog-drag { opacity: 0; cursor: grab; color: var(--text-3); font-size: 17px; flex: 0 0 auto; display: flex; align-items: center; margin-left: -8px; }
.blog-row:hover .blog-drag { opacity: 1; }
.blog-row.dragging { display: none; }
.blog-drop { height: 2px; background: var(--accent); border-radius: 2px; margin: 0; }

/* ---------- About / project description callout ---------- */
.about-callout { display: flex; gap: 11px; align-items: flex-start; background: var(--bg-callout); border-radius: 10px; padding: 13px 15px; }
.about-callout .about-cicon { font-size: 18px; height: 25.6px; display: flex; align-items: center; color: var(--text-2); cursor: pointer; border-radius: 6px; padding: 0 2px; }
.about-callout .about-cicon:hover { background: var(--bg-hover); }
.about-callout .ab-edit { flex: 1; outline: none; font-size: 15px; color: var(--text); line-height: 1.6; }
.about-callout .ab-edit:empty:before { content: attr(data-placeholder); color: var(--text-muted); }

/* ---------- project overview ---------- */
/* same left edge / width as board + doc pages, so the icon lines up across page types */
.ov-wrap { max-width: 720px; margin: 0 auto; padding: 56px 56px 120px; }
/* header is left-aligned and stacked: icon, then name, then the website + nav pills row */
.ov-head { display: flex; align-items: center; justify-content: flex-start; gap: 16px; }
.ov-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.ov-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.ov-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--bg-card); border-radius: 999px; height: 36px; padding: 0 15px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.ov-pill:hover { background: var(--bg-hover); color: var(--text-strong); }
.ov-pill i { font-size: 16px; }
.ov-title-row { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 14px; margin: 16px 0 14px; }
.ov-title-row .doc-title { margin: 0; text-align: left; }
.ov-site { display: inline-flex; align-items: center; gap: 7px; background: var(--bg-card); border-radius: 999px; height: 36px; padding: 0 15px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.ov-site:hover { background: var(--bg-hover); }
.ov-site i { font-size: 15px; }
.ov-site .ov-site-url { cursor: pointer; }
.ov-site .ov-site-edit { color: var(--text-3); }
.ov-site.add { color: var(--text-muted); }
.ov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.ov-card { position: relative; background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 12px; padding: 13px 15px; cursor: pointer; min-height: 62px; }
.ov-card:hover { background: var(--bg-hover); }
.ovc-title { font-size: 15px; font-weight: 500; color: var(--text-strong); }
.ovc-meta { display: flex; gap: 8px; margin-top: 9px; }
.ovc-desc { font-size: 13px; color: var(--text-3); margin-top: 6px; line-height: 1.45; }
.ovc-del { position: absolute; top: 11px; right: 12px; font-size: 15px; color: var(--text-3); opacity: 0; cursor: pointer; }
.ov-card:hover .ovc-del { opacity: 1; }
.ovc-del:hover { color: #e8645a; }
.ov-card-add { display: flex; align-items: center; gap: 8px; color: var(--text-muted); border-style: dashed; }
.ov-card-add:hover { background: transparent; color: var(--text-2); }

/* ---------- project Pages repository ---------- */
.pl-ic { display: flex; align-items: center; justify-content: center; }
.pl-ic .tile { width: 20px; height: 20px; }
.pl-del { font-size: 16px; color: var(--text-3); opacity: 0; cursor: pointer; flex: 0 0 auto; }
.acc-row:hover .pl-del { opacity: 1; }
.pl-del:hover { color: #e8645a; }

/* ---------- custom dialogs ---------- */
.dialog { width: 460px; max-width: 92vw; background: var(--bg-popover); border: 0.5px solid var(--border-strong); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); padding: 20px 22px; }
.dialog-title { font-size: 16px; font-weight: 600; color: var(--text-strong); margin-bottom: 14px; }
.dialog-msg { font-size: 14px; color: var(--text-2); margin: -6px 0 16px; line-height: 1.5; }
.dialog-input { width: 100%; height: 40px; background: var(--bg-content); border: 0.5px solid var(--border-strong); border-radius: 9px; color: var(--text); font-size: 15px; padding: 0 12px; outline: none; }
.dialog-input:focus { border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--text-2); }
.dialog-btn:hover { background: var(--bg-hover); }
.dialog-btn.primary { background: var(--accent); color: #fff; }
.dialog-btn.danger { background: #e8645a; color: #fff; }
.dialog-btn.primary:hover, .dialog-btn.danger:hover { opacity: 0.9; }

/* ---------- Share button + sheet ---------- */
.tb-share { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); border-radius: 7px; padding: 5px 12px; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.tb-share i { font-size: 16px; }
.tb-share:hover { background: var(--bg-hover); color: var(--text-strong); }
.share-dialog { width: 520px; }
.sh-section { padding: 16px 0; border-top: 0.5px solid var(--border); }
.sh-section:first-of-type { border-top: 0; padding-top: 0; }
.sh-row { display: flex; align-items: center; gap: 16px; }
.sh-row-text { flex: 1; }
.sh-row-title { font-size: 14px; color: var(--text-strong); font-weight: 500; }
.sh-row-desc { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.sh-url { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: var(--bg-content); border: 0.5px solid var(--border-strong); border-radius: 9px; padding: 8px 10px; }
.sh-url > i { font-size: 16px; color: var(--text-3); }
.sh-url-text { flex: 1; min-width: 0; font-size: 13px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-invite { display: flex; gap: 8px; margin-top: 12px; }
.sh-invite .set-input { flex: 1; }
.sh-role { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-2); font-size: 13px; padding: 0 8px; outline: none; cursor: pointer; }
.sh-members { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.sh-member { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.sh-av { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-active); color: var(--text-strong); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: 0 0 26px; text-transform: uppercase; }
.sh-email { flex: 1; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-remove { font-size: 15px; color: var(--text-3); cursor: pointer; padding: 4px; }
.sh-remove:hover { color: var(--danger, #e5484d); }
.sh-empty { font-size: 13px; color: var(--text-3); padding: 8px 4px; }
a.sh-url-text { text-decoration: none; }
a.sh-url-text:hover { text-decoration: underline; }
.sh-note { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.sh-note.err { color: var(--danger, #e5484d); }
.sh-url-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.sh-future { font-size: 11px; color: var(--text-muted); }
.switch.disabled { opacity: 0.45; pointer-events: none; }
.sh-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); background: var(--bg-active); border-radius: 6px; padding: 3px 9px; }
.sh-badge i { font-size: 14px; }
.sh-badge.view { color: var(--text-muted); }
.sh-rolelabel { font-size: 12px; color: var(--text-3); }
/* read-only view for 'view' collaborators */
.viewonly .b-add, .viewonly .b-handle, .viewonly .row-actions, .viewonly .add-row,
.viewonly .section-add, .viewonly .ov-pill[data-add], .viewonly .kadd, .viewonly .k-add,
.viewonly .fb-toolbar, .viewonly .add-social, .viewonly .goal-add { display: none !important; }
.viewonly [contenteditable] { cursor: default; }
.viewonly input, .viewonly textarea { pointer-events: none; }

/* shorter type pill */
.blog-type-dd { min-width: 88px; }

/* ---------- goal cards (project overview) ---------- */
.goal-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.goal-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 12px; padding: 20px 18px; cursor: pointer; }
.goal-meta { display: flex; gap: 8px; margin-top: 12px; }
.goal-card:hover { background: var(--bg-hover); }
.goal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.goal-title { font-size: 15px; font-weight: 500; color: var(--text-strong); }
.goal-pct { font-size: 13px; color: #1f9d4e; font-weight: 500; flex: 0 0 auto; }
.goal-bar { height: 6px; background: var(--bg-active); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.goal-bar-fill { height: 100%; background: #1f9d4e; border-radius: 4px; transition: width .15s; }
.goal-add { display: flex; align-items: center; gap: 8px; color: var(--text-muted); padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 12px; cursor: pointer; margin-top: 12px; }
.goal-add:hover { color: var(--text-2); }
.prog-row { display: flex; align-items: center; gap: 10px; flex: 1; }
.prog-row input[type=range] { flex: 1; accent-color: #1f9d4e; }
.prog-val { font-size: 13px; color: var(--text-2); min-width: 40px; text-align: right; }

/* ---------- Free Board (infinite canvas) ---------- */
.fb-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none;
  background-color: var(--bg-content);
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 26px 26px; background-position: 0 0; }
.fb-canvas { position: absolute; top: 0; left: 0; width: 0; height: 0; transform-origin: 0 0; }
.fb-item { position: absolute; }
.fb-item.fb-dragging { z-index: 50; opacity: 0.92; }
.fb-text { padding: 6px 8px; border-radius: 8px; display: flex; flex-direction: column; }
.fb-textedit { outline: none; font-size: 15px; line-height: 1.5; color: var(--text); min-height: 22px; flex: 1; overflow-y: auto; word-break: break-word; cursor: default; }
.fb-textedit[contenteditable="true"] { cursor: text; }
.fb-textedit:empty:before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.fb-note { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.fb-note-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: grab; user-select: none; flex-shrink: 0; }
.fb-note.fb-dragging .fb-note-head { cursor: grabbing; }
.fb-note-title { font-size: 13.5px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.fb-note-title.empty { color: var(--text-muted); font-weight: 500; }
.fb-note-body { flex: 1; min-height: 0; overflow: hidden; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.fb-note-empty { color: var(--text-muted); font-size: 13px; }
.fb-note-body .fb-pv-h1 { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.fb-note-body .fb-pv-h2 { font-size: 14.5px; font-weight: 700; color: var(--text-strong); }
.fb-note-body .fb-pv-h3 { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.fb-note-body .fb-pv-p, .fb-note-body .fb-pv-li, .fb-note-body .fb-pv-todo { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.fb-note-body .fb-pv-todo { display: flex; align-items: center; gap: 6px; }
.fb-note-body .fb-pv-quote { font-size: 13px; color: var(--text-3); border-left: 2px solid var(--border-strong); padding-left: 8px; }
.fb-note-body .fb-pv-callout { font-size: 13px; color: var(--text-2); background: var(--bg-callout); border-radius: 6px; padding: 4px 8px; }
.fb-note-body .fb-pv-code { font-size: 12px; font-family: monospace; color: var(--text-2); background: var(--bg-active); border-radius: 6px; padding: 3px 8px; white-space: pre-wrap; }
.fb-note-body .fb-pv-img { max-width: 100%; border-radius: 6px; }
.fb-note-body .fb-pv-hr { border: none; border-top: 1px solid var(--border-strong); margin: 4px 0; width: 100%; }
/* selection + resize handles */
.fb-item.fb-selected { z-index: 20; }
.fb-text.fb-selected, .fb-image.fb-selected { box-shadow: 0 0 0 1.5px var(--accent); }
.fb-note.fb-selected { box-shadow: 0 0 0 1.5px var(--accent), 0 1px 3px rgba(0,0,0,0.18); }
.fb-sticker.fb-selected { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.fb-rs { position: absolute; z-index: 5; display: none; }
.fb-item.fb-selected .fb-rs { display: block; }
.fb-rs-n, .fb-rs-s { left: 8px; right: 8px; height: 9px; cursor: ns-resize; }
.fb-rs-e, .fb-rs-w { top: 8px; bottom: 8px; width: 9px; cursor: ew-resize; }
.fb-rs-n { top: -5px; } .fb-rs-s { bottom: -5px; }
.fb-rs-e { right: -5px; } .fb-rs-w { left: -5px; }
.fb-rs-ne, .fb-rs-nw, .fb-rs-se, .fb-rs-sw { width: 14px; height: 14px; z-index: 6; }
.fb-rs-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.fb-rs-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.fb-rs-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.fb-rs-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.fb-rs-ne:after, .fb-rs-nw:after, .fb-rs-se:after, .fb-rs-sw:after { content: ''; position: absolute; inset: 3px; background: var(--bg-content); border: 1.5px solid var(--accent); border-radius: 2px; }
/* image */
.fb-image { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.18); cursor: grab; }
.fb-image.fb-dragging { cursor: grabbing; }
.fb-image-img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; pointer-events: none; }
/* reaction sticker */
.fb-sticker { cursor: grab; user-select: none; z-index: 40; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.fb-sticker.fb-dragging { cursor: grabbing; }
.fb-sticker-emoji { font-size: 32px; line-height: 1; }
.fb-sticker-pop { position: absolute; display: flex; flex-wrap: wrap; gap: 4px; width: 204px; padding: 8px; background: var(--bg-popover); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 8px 26px rgba(0,0,0,0.4); z-index: 40; }
.fb-sticker-pick { font-size: 24px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; }
.fb-sticker-pick:hover { background: var(--bg-hover); }
.fb-stamp-ghost { position: fixed; z-index: 9999; font-size: 32px; line-height: 1; transform: translate(-50%, -50%); pointer-events: none; opacity: 0.85; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.fb-wrap.fb-stamping, .fb-wrap.fb-stamping .fb-canvas { cursor: copy; }
.fb-marquee { position: absolute; z-index: 45; border: 1px solid var(--accent); background: rgba(90,169,238,0.12); pointer-events: none; }
/* mind map */
.fb-mind { outline: none; }
.fb-mind-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.fb-mind-edge { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.fb-mind-node { position: absolute; display: flex; align-items: center; padding: 0 12px; background: var(--bg-card); border: 1.5px solid var(--border-strong); border-radius: 8px; cursor: pointer; color: var(--text); }
.fb-mind-node.root { background: #ffffff; border-color: #ffffff; color: #111111; }
.fb-mind-node.root .fb-mind-text { font-weight: 600; }
.fb-mind-node.sel { box-shadow: 0 0 0 3px rgba(90,169,238,0.45); }
.fb-mind-ic { margin-right: 6px; font-size: 15px; }
.fb-mind-text { font-size: 13.5px; color: inherit; outline: none; white-space: nowrap; }
.fb-mind-text.editing { white-space: normal; min-width: 30px; }
.fb-mind-text:empty:before { content: attr(data-placeholder); color: var(--text-muted); }
.fb-mind-node.root .fb-mind-text:empty:before { color: rgba(0,0,0,0.4); }
.fb-mind-paint { display: none; margin-left: 8px; opacity: 0.65; cursor: pointer; }
.fb-mind-node.sel .fb-mind-paint { display: inline-flex; }
.fb-mind-paint:hover { opacity: 1; }
.fb-mind-paint i { font-size: 13px; }
.fb-toolbar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--bg-popover); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 6px 22px rgba(0,0,0,0.32); z-index: 30; }
.fb-tool { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; white-space: nowrap; }
.fb-tool:hover { background: var(--bg-hover); color: var(--text-strong); }
.fb-tool.fb-icon { padding: 7px 9px; }
.fb-tool i { font-size: 16px; }
.fb-sep { width: 1px; align-self: stretch; background: var(--border-strong); margin: 4px 3px; }
.fb-zoomval { font-size: 12.5px; color: var(--text-3); min-width: 42px; text-align: center; user-select: none; }
.fb-hint { position: absolute; left: 14px; bottom: 16px; font-size: 12px; color: var(--text-muted); pointer-events: none; user-select: none; }
.fb-titlebar { position: absolute; left: 14px; top: 12px; z-index: 25; display: flex; align-items: center; gap: 6px; max-width: 60%; }
.fb-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.fb-icon i { font-size: 24px; color: var(--text-2); }
.fb-icon:hover { background: var(--bg-hover); }
.fb-title { font-size: 19px; font-weight: 700; color: var(--text-strong); outline: none; border-radius: 6px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-title:hover, .fb-title:focus { background: var(--bg-hover); }
.fb-title:empty:before { content: attr(data-placeholder); color: var(--text-muted); }

/* ---------- auth screen ---------- */
.auth-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-content); padding: 20px; }
.auth-card { width: 100%; max-width: 360px; background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 12px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.auth-logo { font-size: 26px; font-weight: 800; color: var(--text-strong); text-align: center; letter-spacing: -0.5px; }
.auth-sub { margin: 6px 0 24px; text-align: center; color: var(--text-3); font-size: 14px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input { background: var(--bg-content); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 11px 13px; color: var(--text); font-size: 14px; outline: none; transition: border-color 0.15s; }
.auth-card input:focus { border-color: var(--accent); }
.auth-btn { margin-top: 4px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.auth-btn:hover { opacity: 0.9; }
.auth-btn:disabled { opacity: 0.55; cursor: default; }
.auth-error { display: none; color: #e8845c; font-size: 13px; margin: 2px 0 0; line-height: 1.4; }
.auth-error code { background: var(--bg-content); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.auth-toggle { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }
.auth-toggle a { color: var(--accent); text-decoration: none; margin-left: 4px; }
.auth-toggle a:hover { text-decoration: underline; }
.settings-logout { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.settings-logout:hover { background: var(--bg-hover); color: var(--text-strong); }

/* ---------- Graph view ---------- */
.graph-wrap { position: relative; flex: 1; min-height: 0; margin-top: 12px; overflow: hidden; background: var(--bg-content); cursor: grab; touch-action: none; }
.graph-wrap.panning { cursor: grabbing; }
.graph-svg { width: 100%; height: 100%; display: block; }
.graph-node { cursor: pointer; }
.graph-node circle { stroke: transparent; stroke-width: 2; }
.graph-node:hover circle { stroke: var(--text-2); }
.graph-edge { stroke: var(--border-strong); stroke-width: 1; opacity: 0.45; }
.graph-label { fill: var(--text-3); font-size: 11px; pointer-events: none; transition: opacity .15s ease; }
.graph-node.hub .graph-label { fill: var(--text-2); }
#graphScene.labels-hidden .graph-label { opacity: 0; }
.graph-hint { position: absolute; left: 16px; bottom: 12px; color: var(--text-muted); font-size: 12px; pointer-events: none; }
