/* Slate — Brain v2: category-first notes library */

/* ─── VIEW VISIBILITY ─── */
#brainRoot { display: none; }
#brainTabs { display: none; }        /* v2: no Board/Library sub-tabs */
.fab { display: none; }
#wsSwitcher, #tidyBtn { display: flex; }

body[data-view="brain"] #wsSwitcher,
body[data-view="brain"] #tidyBtn { display: none; }
body[data-view="brain"] #brainRoot { display: block; }
body[data-view="brain"] #viewport { display: none; }   /* hide the canvas viewport */
body[data-view="brain"] #canvas { display: none; }
body[data-view="brain"] #hint { display: none; }
body[data-view="brain"] .fab { display: flex; }

/* ─── BRAIN ROOT SCROLL CONTAINER ─── */
#brainRoot {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
}

/* ─── SHARED: centered content column ─── */
.bi-inner, .bc-inner, .be-inner {
  margin: 0 auto;
  padding-bottom: 80px;
}

/* ─────────────────────────────────────
   INDEX (shelves)
───────────────────────────────────── */
#brainRoot .bi-header {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 32px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.bi-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-right: 4px;
}
.bi-sub {
  font-size: 13px;
  color: var(--ink-3);
  flex: 1;
  min-width: 0;
}
.bi-new-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px;
  font-size: 13px; font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background 120ms;
  flex-shrink: 0;
}
.bi-new-btn:hover { background: rgba(58,91,240,0.15); }
[data-theme="dark"] .bi-new-btn:hover { background: rgba(109,135,255,0.2); }

/* ─── CAT LIST ─── */
.bi-cat-list {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── CAT ROW (shelf row + all-notes) ─── */
.bi-cat-row,
.bi-all-notes {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.bi-cat-row:hover,
.bi-all-notes:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.bi-all-notes {
  border-style: dashed;
  /* appended as a sibling of .bi-cat-list — needs the same centered column */
  max-width: calc(860px - 64px);
  margin: 0 auto 10px;
  width: calc(100% - 64px);
}
.bi-cat-bar {
  width: 4px;
  flex-shrink: 0;
  background: var(--t-bar, var(--ink-3));
}
.bi-cat-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 0;
  min-width: 0;
}
.bi-cat-badge {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--t-bg, var(--hover));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-right: 14px;
  color: var(--t-text, var(--ink-2));
}
.bi-cat-info { flex: 1; min-width: 0; }
.bi-cat-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 3px;
}
.bi-cat-latest {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}
.bi-cat-latest strong { color: var(--ink-2); font-weight: 500; }
.bi-cat-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: 16px;
}
.bi-cat-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--hover);
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.bi-cat-age {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.bi-cat-chev {
  color: var(--ink-3);
  margin-left: 6px;
  flex-shrink: 0;
  opacity: 0.6;
  display: flex; align-items: center;
}

/* ─── EMPTY STATE ─── */
.bi-empty {
  padding: 48px 0;
  text-align: center;
  display: flex; flex-direction: column; gap: 8px;
}
.bi-empty-title { font-size: 15px; font-weight: 650; color: var(--ink-2); letter-spacing: -0.01em; }
.bi-empty-sub { font-size: 13px; color: var(--ink-3); }

/* ─── INLINE NEW CAT ROW ─── */
.bi-new-cat-row {
  max-width: 860px;
  margin: 0 auto 10px;
  padding: 0 32px;
  display: none;
  align-items: center;
  gap: 8px;
}
.bi-new-cat-input {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
  outline: none;
}
.bi-new-cat-input::placeholder { color: var(--ink-3); font-weight: 500; }
.bi-new-cat-add {
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  transition: opacity 120ms;
}
.bi-new-cat-add:hover { opacity: 0.88; }
.bi-new-cat-cancel {
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--ink-3);
  transition: background 100ms;
}
.bi-new-cat-cancel:hover { background: var(--hover); color: var(--ink); }

/* ─────────────────────────────────────
   CATEGORY PAGE
───────────────────────────────────── */
.bc-breadcrumb {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 32px 0;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 20px;
}
.bc-back {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  border-radius: 6px;
  padding: 4px 0;
  transition: color 120ms;
}
.bc-back:hover { color: var(--accent); }
.bc-sep {
  font-size: 12px; color: var(--ink-3); opacity: 0.5;
}
.bc-current {
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}

.bc-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.bc-hero-badge {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--t-bg, var(--hover));
  color: var(--t-text, var(--ink-2));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.bc-hero-info { flex: 1; }
.bc-hero-name {
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.bc-hero-stats {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.bc-rename-input {
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.025em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  outline: none;
  width: 100%;
  padding: 0 0 2px;
}
.bc-hero-actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px;
}
.bc-action-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-3);
  padding: 5px 9px; border-radius: 7px;
  transition: background 100ms, color 100ms;
}
.bc-action-btn:hover { background: var(--hover); color: var(--ink); }
.bc-action-danger:hover { background: rgba(209,77,77,0.09); color: var(--danger); }

/* Composer */
.bc-composer {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 0 32px;
}
.bc-composer > div {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: box-shadow 160ms, border-color 160ms;
}
/* wrap the textarea + foot inside a div */
.bc-composer {
  display: block;
}
.bc-composer-area {
  display: block;
  width: 100%;
  resize: none;
  border: none;
  background: var(--surface);
  border-radius: 14px 14px 0 0;
  padding: 14px 16px 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
  min-height: 58px;
  border: 1px solid var(--line);
  border-bottom: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.bc-composer-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.bc-composer-area::placeholder { color: var(--ink-3); }
.bc-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 8px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: var(--surface);
}
.bc-composer-hint {
  font-size: 11.5px;
  color: var(--ink-3);
}
.bc-composer-save {
  padding: 5px 14px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 600;
  transition: opacity 120ms;
}
.bc-composer-save:hover { opacity: 0.88; }

/* Section label */
.bc-section-label {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}

/* Notes list */
.bc-notes-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.bc-notes-empty {
  background: var(--surface);
  padding: 28px 16px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.bc-note-entry {
  background: var(--surface);
  padding: 14px 16px;
  cursor: pointer;
  transition: background 100ms;
}
.bc-note-entry:hover,
.bc-note-entry.focused { background: var(--hover); }
.bc-note-entry.focused { outline: 2px solid var(--accent); outline-offset: -2px; }
.bc-note-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.bc-note-title {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bc-note-age {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.bc-note-snippet {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bc-note-cat-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--t-bg);
  color: var(--t-text);
}

/* ─────────────────────────────────────
   EDITOR (full pane)
───────────────────────────────────── */
.be-breadcrumb {
  max-width: 660px;
  margin: 0 auto;
  padding: 32px 32px 0;
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 22px;
  opacity: 0.75;
}
.be-bc-btn {
  font-size: 12.5px; color: var(--ink-3); font-weight: 500;
  border-radius: 5px; padding: 2px 4px; margin: -2px -4px;
  transition: color 120ms;
}
.be-bc-btn:hover { color: var(--accent); }
.be-bc-sep { font-size: 11px; color: var(--ink-3); opacity: 0.4; }
.be-bc-note { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

.be-toolbar {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.be-toolbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px;
}
.be-tool-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-3);
  transition: background 100ms, color 100ms;
}
.be-tool-btn:hover { background: var(--hover); color: var(--ink); }
.be-tool-danger:hover { background: rgba(209,77,77,0.09); color: var(--danger); }
.be-autosave {
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 5px;
  margin-left: 4px;
}
.be-autosave-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #6FA85E;
  animation: pulse-save 2s infinite;
}
@keyframes pulse-save {
  0%,100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.be-title {
  display: block;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.25;
  outline: none;
  resize: none;
  overflow: hidden;
  margin-bottom: 8px;
}
.be-title::placeholder { color: var(--ink-3); font-weight: 600; }

.be-meta {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.be-cat-chip {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  color: var(--t-text);
  background: var(--t-bg);
  padding: 3px 10px;
  border-radius: 99px;
}
.be-meta-date {
  font-size: 12px;
  color: var(--ink-3);
}

.be-body {
  display: block;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink);
  outline: none;
  resize: none;
  min-height: 420px;
}
.be-body::placeholder { color: var(--ink-3); }

.be-wordcount {
  max-width: 660px;
  margin: 0 auto;
  padding: 12px 32px 0;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
}

/* ─────────────────────────────────────
   QUICK CAPTURE SHEET
───────────────────────────────────── */
#captureOverlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(9,11,16,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
#captureOverlay.open { display: flex; }
.capture-sheet {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  animation: sheet-in 180ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.capture-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.capture-label {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3);
}
.capture-close {
  padding: 4px; border-radius: 6px; color: var(--ink-3);
  transition: background 100ms, color 100ms;
}
.capture-close:hover { background: var(--hover); color: var(--ink); }
#captureArea {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  outline: none;
  resize: none;
  min-height: 110px;
}
#captureArea::placeholder { color: var(--ink-3); }
.capture-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
}
#captureCatPicker {
  flex: 1;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 13px;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
  font-family: var(--font);
}
#captureCatPicker:focus { border-color: var(--accent); }
.capture-hint {
  font-size: 11.5px; color: var(--ink-3);
  white-space: nowrap;
}
#captureSaveBtn {
  padding: 7px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 120ms;
}
#captureSaveBtn:hover { opacity: 0.88; }

/* ─────────────────────────────────────
   FAB (Brain context: always round)
───────────────────────────────────── */
.fab {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px -8px rgba(58,91,240,0.55), 0 2px 8px -2px rgba(27,34,48,0.2);
  transition: transform 140ms cubic-bezier(0.2,0.8,0.3,1), filter 140ms ease;
}
.fab:hover { filter: brightness(1.08); transform: scale(1.06); }
.fab:active { transform: scale(0.96); }

/* ─────────────────────────────────────
   MOVE POPOVER helper
───────────────────────────────────── */
.pop-move { min-width: 180px; }

/* ─── TOOLBAR LEFT/RIGHT (wave 2a: left side gets mode + pin) ─── */
.be-toolbar-left {
  display: flex; align-items: center; gap: 6px;
}
.be-mode-btn { font-size: 12px; }
.be-pin-active {
  color: var(--accent);
  background: var(--accent-soft);
}
.be-pin-active:hover { background: var(--accent-soft); color: var(--accent); opacity: 0.9; }

/* ─── PREVIEW MODE (FG-03) ─── */
.be-preview {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 32px 40px;
  cursor: text; /* hint: click to edit */
}
.be-preview-empty {
  color: var(--ink-3);
  font-size: 14px;
  font-style: italic;
  padding: 20px 0;
}
/* Markdown rendered elements */
.be-preview .md-h1,
.be-preview .md-h2,
.be-preview .md-h3 { margin: 1.3em 0 0.4em; font-weight: 700; color: var(--ink); }
.be-preview .md-h1 { font-size: 20px; }
.be-preview .md-h2 { font-size: 17px; }
.be-preview .md-h3 { font-size: 15px; }
.be-preview .md-p { margin: 0.85em 0; font-size: 15.5px; line-height: 1.8; color: var(--ink); }
.be-preview .md-ul,
.be-preview .md-ol { padding-left: 22px; margin: 0.7em 0; }
.be-preview .md-ul li,
.be-preview .md-ol li { margin: 0.3em 0; font-size: 15px; line-height: 1.7; color: var(--ink); }
.be-preview .md-blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.8em 0; padding: 6px 14px;
  color: var(--ink-2);
  font-size: 15px;
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}
.be-preview .md-code-block {
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0.8em 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.be-preview .md-code-inline {
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}
.be-preview .md-link,
.be-preview a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.be-preview .md-link:hover { opacity: 0.8; }
.be-preview .md-wikilink {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.be-preview .md-wikilink:hover { opacity: 0.85; }
.be-preview .md-wikilink-dead {
  color: var(--ink-3);
  background: var(--hover);
  padding: 1px 6px;
  border-radius: 4px;
  font-style: italic;
  cursor: default;
}

/* ─── BACKLINKS (FG-04) ─── */
.be-backlinks {
  max-width: 660px;
  margin: 16px auto 0;
  padding: 14px 32px;
  border-top: 1px solid var(--line);
}
.be-backlinks-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.be-backlink-item {
  display: inline-block;
  margin: 3px 5px 3px 0;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 120ms;
}
.be-backlink-item:hover { opacity: 0.8; }

/* ─── PIN BUTTON on note rows ─── */
.bc-pin-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 120ms, background 100ms;
  margin-right: 2px;
}
.bc-note-entry:hover .bc-pin-btn,
.bc-pin-btn.bc-pin-active { opacity: 1; }
.bc-pin-btn:hover { background: var(--hover); }
.bc-pin-btn.bc-pin-active { color: var(--accent); }

.bc-note-pinned { background: var(--accent-soft) !important; }
.bc-note-pinned:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--hover)) !important; }
.bc-note-pin-glyph { font-size: 11px; opacity: 0.7; }

/* ─── PINNED BADGE on category rows ─── */
.bi-cat-latest-untitled { font-style: italic; color: var(--ink-3); }
.bi-cat-pinned-badge {
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--hover);
  padding: 2px 6px;
  border-radius: 99px;
}
.bi-pin-glyph { font-size: 10px; margin-left: 4px; opacity: 0.7; }

/* ─── TRASH ROW ─── */
.bi-trash-row { border-color: rgba(209,77,77,0.25); }

/* ─── TRASH VIEW ─── */
.bc-trash-entry { cursor: default !important; }
.bc-trash-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ─── WIKILINK AUTOCOMPLETE ─── */
.wikilink-autocomplete {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  min-width: 220px;
  max-width: 340px;
  overflow: hidden;
  animation: sheet-in 120ms ease;
}
.wikilink-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--ink);
  transition: background 80ms;
}
.wikilink-ac-item:hover { background: var(--hover); }

/* ─── SHORTCUTS OVERLAY (FG-07) ─── */
.shortcuts-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(9,11,16,0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 180ms;
}
.shortcuts-backdrop.show { opacity: 1; }
.shortcuts-panel {
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--line-strong);
}
.shortcuts-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
}
.shortcuts-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.shortcuts-close {
  padding: 5px; border-radius: 6px; color: var(--ink-3);
  transition: background 100ms, color 100ms;
}
.shortcuts-close:hover { background: var(--hover); color: var(--ink); }
.shortcuts-section {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.shortcuts-section:last-child { border-bottom: none; }
.shortcuts-group-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.shortcuts-table { display: flex; flex-direction: column; gap: 6px; }
.shortcuts-row { display: flex; align-items: center; gap: 14px; }
.shortcuts-key-wrap { min-width: 150px; flex-shrink: 0; }
.shortcuts-kbd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--hover);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.shortcuts-desc { font-size: 13px; color: var(--ink-2); }

/* ─────────────────────────────────────
   RESPONSIVE
───────────────────────────────────── */
@media (max-width: 640px) {
  #brainRoot .bi-header,
  .bi-cat-list,
  .bi-new-cat-row { padding-left: 14px; padding-right: 14px; }

  .bc-breadcrumb,
  .bc-hero,
  .bc-composer,
  .bc-section-label,
  .bc-notes-list { padding-left: 14px; padding-right: 14px; max-width: 100%; }

  .be-breadcrumb,
  .be-toolbar,
  .be-title,
  .be-meta,
  .be-body,
  .be-wordcount { padding-left: 16px; padding-right: 16px; max-width: 100%; }

  .be-body { min-height: 60dvh; }

  #captureOverlay { padding-top: 60px; }
  .fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
