:root {
  color-scheme: dark;
  --graph-bg: #111416;
  --graph-surface: #181c20;
  --graph-surface-2: #20262a;
  --graph-text: #f1f5f2;
  --graph-muted: #aab5ae;
  --graph-faint: #7c8881;
  --graph-line: #30383d;
  --graph-line-strong: #526168;
  --graph-accent: #60d6a2;
  --graph-accent-soft: rgba(96, 214, 162, 0.14);
  --graph-danger: #f07f72;
  --graph-archived: #e0ad64;
  --cat-0: #60d6a2;
  --cat-1: #72b7f0;
  --cat-2: #f0c166;
  --cat-3: #ef8d7b;
  --cat-4: #bc9be8;
  --cat-5: #e58bc5;
  --cat-6: #5fc9c5;
  --cat-7: #a8ce72;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-width: 0; min-height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--graph-bg);
  color: var(--graph-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
button, input, select { font: inherit; letter-spacing: 0; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.graph-app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr) 0;
  background: var(--graph-bg);
  transition: grid-template-columns 180ms ease;
}
.graph-app.inspector-open { grid-template-columns: 284px minmax(0, 1fr) 344px; }

.mobile-bar { display: none; }
.vault-sidebar {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--graph-line);
  background: var(--graph-surface);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 18px; }
.brand-lockup { min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--graph-text); text-decoration: none; }
.brand-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 214, 162, 0.38);
  border-radius: 7px;
  background: var(--graph-accent-soft);
  color: var(--graph-accent);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-lockup strong, .brand-lockup small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-lockup strong { font-size: 14px; font-weight: 650; }
.brand-lockup small { margin-top: 3px; color: var(--graph-muted); font-size: 11px; }
.sidebar-close { display: none; }

.view-nav { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--graph-line); }
.view-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--graph-muted);
  text-decoration: none;
  font-size: 13px;
}
.view-link svg { width: 16px; height: 16px; }
.view-link:hover { color: var(--graph-text); background: rgba(255, 255, 255, 0.04); }
.view-link.active { color: var(--graph-accent); background: var(--graph-accent-soft); font-weight: 600; }

.ingest-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--graph-line);
  border-radius: 7px;
  background: var(--graph-bg);
}
.ingest-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--graph-text);
  font-size: 11px;
  font-weight: 650;
}
.format-list { color: var(--graph-faint); font-size: 8px; font-weight: 600; white-space: nowrap; }
.ingest-button {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(96, 214, 162, 0.42);
  border-radius: 5px;
  background: var(--graph-accent-soft);
  color: var(--graph-accent);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.ingest-button:hover { border-color: var(--graph-accent); background: rgba(96, 214, 162, 0.17); }
.ingest-button svg { width: 15px; height: 15px; }
.ingest-button.is-disabled, .ingest-button:disabled { opacity: 0.5; cursor: wait; pointer-events: none; }
.source-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.source-file-input:focus-visible + .ingest-status { outline: 2px solid var(--graph-accent); outline-offset: 2px; }
.ingest-status {
  min-width: 0;
  min-height: 34px;
  margin-top: 9px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.ingest-status-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--graph-surface-2);
  color: var(--graph-faint);
}
.ingest-status-icon svg { width: 12px; height: 12px; }
.ingest-status strong, .ingest-status small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ingest-status strong { color: var(--graph-muted); font-size: 10px; font-weight: 600; }
.ingest-status small { margin-top: 2px; color: var(--graph-faint); font-size: 9px; }
.ingest-status[data-state="uploading"] .ingest-status-icon { color: var(--graph-accent); background: var(--graph-accent-soft); }
.ingest-status[data-state="uploading"] .ingest-status-icon svg { animation: graph-spin 850ms linear infinite; }
.ingest-status[data-state="success"] .ingest-status-icon { color: var(--graph-accent); background: var(--graph-accent-soft); }
.ingest-status[data-state="error"] .ingest-status-icon { color: var(--graph-danger); background: rgba(240, 127, 114, 0.12); }
.ingest-status[data-state="review"] .ingest-status-icon { color: var(--graph-accent); background: var(--graph-accent-soft); }

.search-box {
  height: 38px;
  margin: 14px 0 12px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--graph-line);
  border-radius: 6px;
  background: var(--graph-bg);
  color: var(--graph-muted);
}
.search-box:focus-within { border-color: var(--graph-accent); box-shadow: 0 0 0 3px var(--graph-accent-soft); }
.search-box > svg { width: 15px; height: 15px; }
.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--graph-text);
  font-size: 12px;
}
.search-box input::placeholder { color: var(--graph-faint); }
.search-clear {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--graph-muted);
  display: grid;
  place-items: center;
}
.search-clear svg { width: 14px; height: 14px; }

.tree-heading {
  padding: 0 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--graph-faint);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}
.vault-tree { min-height: 0; flex: 1; overflow: auto; padding: 0 2px 18px; scrollbar-width: thin; scrollbar-color: var(--graph-line-strong) transparent; }
.vault-tree details { margin: 2px 0; }
.vault-tree summary {
  min-height: 34px;
  display: grid;
  grid-template-columns: 14px 16px minmax(0, 1fr) auto auto 26px;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--graph-muted);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.vault-tree summary::-webkit-details-marker { display: none; }
.vault-tree summary:hover { color: var(--graph-text); background: rgba(255, 255, 255, 0.035); }
.vault-tree summary.is-archived { color: var(--graph-muted); }
.vault-tree summary.is-archived .source-icon { color: var(--graph-archived); opacity: 0.9; }
.vault-tree summary.is-archived .source-name { color: var(--graph-muted); }
.folder-chevron { width: 13px; height: 13px; transition: transform 140ms ease; }
.vault-tree details[open] .folder-chevron { transform: rotate(90deg); }
.source-icon { width: 15px; height: 15px; color: var(--source-color, var(--graph-muted)); }
.source-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: var(--graph-faint); font-size: 10px; }
.source-status { max-width: 48px; overflow: hidden; color: var(--graph-archived); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.source-action {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--graph-faint);
}
.source-action:hover { border-color: var(--graph-line-strong); color: var(--graph-text); background: rgba(255, 255, 255, 0.05); }
.source-action:focus-visible { outline: 2px solid var(--graph-accent); outline-offset: 2px; }
.source-action:disabled { opacity: 0.45; cursor: wait; }
.source-action svg { width: 13px; height: 13px; }
.tree-notes { display: grid; gap: 1px; padding-left: 24px; }
.tree-note {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--graph-muted);
  text-align: left;
  font-size: 11px;
}
.tree-note .point-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--point-color); }
.tree-note .point-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-note .point-kind { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--graph-faint); font-size: 8px; }
.tree-note:hover { color: var(--graph-text); background: rgba(255, 255, 255, 0.035); }
.tree-note.active { color: var(--graph-accent); background: var(--graph-accent-soft); }
.tree-note-empty { padding: 7px; color: var(--graph-faint); font-size: 10px; line-height: 1.45; }
.tree-empty {
  margin: 4px 5px;
  padding: 14px 12px;
  border: 1px dashed var(--graph-line-strong);
  border-radius: 6px;
  color: var(--graph-faint);
  font-size: 10px;
  line-height: 1.55;
}
.tree-skeleton { display: grid; gap: 12px; padding: 6px 8px; }
.tree-skeleton span { height: 12px; border-radius: 3px; background: var(--graph-line); }
.tree-skeleton span:nth-child(2) { width: 82%; }
.tree-skeleton span:nth-child(3) { width: 66%; }
.tree-skeleton span:nth-child(4) { width: 74%; }

.sidebar-footer { min-height: 54px; border-top: 1px solid var(--graph-line); display: flex; align-items: center; gap: 9px; padding: 13px 7px 0; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: var(--graph-muted); font-size: 11px; font-weight: 600; }
.sidebar-footer small { margin-top: 3px; color: var(--graph-faint); font-size: 10px; }
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--graph-accent); box-shadow: 0 0 0 4px var(--graph-accent-soft); }

.graph-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--graph-bg); }
.graph-toolbar {
  min-height: 72px;
  border-bottom: 1px solid var(--graph-line);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 18px 12px 22px;
  background: rgba(16, 20, 18, 0.96);
  z-index: 10;
}
.graph-title { min-width: 120px; }
.section-label { display: block; color: var(--graph-accent); font-size: 9px; font-weight: 700; }
.graph-title h1 { margin: 4px 0 0; font-size: 18px; line-height: 1.2; font-weight: 650; }
.graph-summary { display: flex; align-items: center; gap: 16px; color: var(--graph-muted); font-size: 11px; }
.graph-summary span { white-space: nowrap; }
.graph-summary strong { color: var(--graph-text); font-variant-numeric: tabular-nums; }
.graph-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.category-control {
  width: 142px;
  height: 34px;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--graph-line);
  border-radius: 5px;
  background: var(--graph-surface);
  color: var(--graph-muted);
}
.category-control select {
  width: 100%;
  height: 100%;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  padding: 0 30px 0 10px;
  font-size: 11px;
  cursor: pointer;
}
.category-control > svg { width: 14px; height: 14px; position: absolute; right: 9px; pointer-events: none; }
.tool-group { height: 34px; display: flex; align-items: center; border: 1px solid var(--graph-line); border-radius: 5px; overflow: visible; }
.icon-button {
  width: 34px;
  height: 34px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--graph-muted);
}
.tool-group .icon-button { width: 33px; height: 32px; border-right: 1px solid var(--graph-line); }
.tool-group .icon-button:last-child { border-right: 0; }
.icon-button:hover { background: rgba(255, 255, 255, 0.05); color: var(--graph-text); }
.icon-button:focus-visible, .tree-note:focus-visible, .view-link:focus-visible, .open-note:focus-visible, .ingest-button:focus-visible { outline: 2px solid var(--graph-accent); outline-offset: 2px; }
.icon-button svg { width: 16px; height: 16px; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 90;
  left: 50%;
  top: calc(100% + 7px);
  transform: translateX(-50%);
  padding: 5px 7px;
  border: 1px solid var(--graph-line-strong);
  border-radius: 4px;
  background: #222925;
  color: var(--graph-text);
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 100ms ease;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; }

.graph-stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: var(--graph-bg); }
#knowledgeGraph { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#knowledgeGraph:active { cursor: grabbing; }
.graph-link { stroke: var(--graph-line-strong); stroke-width: 1.25; stroke-opacity: 0.8; vector-effect: non-scaling-stroke; transition: stroke 120ms ease, stroke-opacity 120ms ease, stroke-width 120ms ease; }
.graph-link.is-active { stroke: var(--graph-accent); stroke-width: 2.2; stroke-opacity: 0.98; }
.graph-link.is-muted { stroke-opacity: 0.14; }
.graph-node { cursor: pointer; }
.graph-node circle { fill: var(--node-color); stroke: rgba(241, 245, 242, 0.84); stroke-width: 1.4; vector-effect: non-scaling-stroke; transition: opacity 120ms ease, stroke-width 120ms ease, filter 120ms ease; }
.graph-node:hover circle { stroke-width: 2.2; filter: brightness(1.12); }
.graph-node text { fill: var(--graph-text); font-size: 11px; font-weight: 500; text-anchor: middle; paint-order: stroke; stroke: var(--graph-bg); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; transition: opacity 140ms ease; }
.graph-node text.node-label { opacity: 1; }
.graph-node.is-context circle { opacity: 0.42; }
.graph-node.is-context text { opacity: 0.72; }
.graph-node.is-selected circle { stroke: var(--graph-text); stroke-width: 3; }
.graph-node.is-neighbor circle { stroke: var(--graph-accent); stroke-width: 2; }
.graph-node.is-muted circle, .graph-node.is-muted text { opacity: 0.14; }
.graph-viewport.labels-hidden .graph-node text.node-label { opacity: 0; }
.graph-viewport.labels-hidden .graph-node.is-label-visible text.node-label,
.graph-viewport.labels-hidden .graph-node.is-selected text.node-label,
.graph-viewport.labels-hidden .graph-node.is-hovered text.node-label { opacity: 1; }

.graph-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--graph-muted);
  background: var(--graph-bg);
}
.graph-state strong { font-size: 12px; font-weight: 500; }
.loading-ring { width: 24px; height: 24px; border: 2px solid var(--graph-line); border-top-color: var(--graph-accent); border-radius: 50%; animation: graph-spin 800ms linear infinite; }
@keyframes graph-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.graph-tooltip {
  max-width: 260px;
  position: absolute;
  z-index: 20;
  padding: 8px 10px;
  border: 1px solid #64736d;
  border-radius: 5px;
  background: #222925;
  color: var(--graph-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
}
.graph-tooltip strong, .graph-tooltip span { display: block; }
.graph-tooltip span { margin-top: 3px; color: var(--graph-muted); font-size: 10px; }
.graph-legend {
  max-width: calc(100% - 32px);
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  padding: 7px 9px;
  border: 1px solid rgba(101, 118, 110, 0.82);
  border-radius: 5px;
  background: rgba(16, 20, 18, 0.82);
  color: var(--graph-muted);
  font-size: 10px;
  pointer-events: none;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { width: 8px; height: 8px; border: 1px solid rgba(241, 245, 242, 0.72); border-radius: 50%; background: var(--category-color); }

.note-inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  border-left: 1px solid var(--graph-line);
  background: var(--graph-surface);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  opacity: 0;
  transition: opacity 140ms ease, visibility 140ms ease;
}
.graph-app.inspector-open .note-inspector { visibility: visible; opacity: 1; }
.inspector-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 11px 13px 11px 18px; border-bottom: 1px solid var(--graph-line); color: var(--graph-muted); font-size: 11px; }
.inspector-content { min-width: 280px; overflow: auto; padding: 22px 20px; scrollbar-width: thin; scrollbar-color: var(--graph-line-strong) transparent; }
.note-category { display: flex; align-items: center; gap: 7px; color: var(--graph-muted); font-size: 10px; }
.note-category > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: var(--detail-color, var(--graph-accent)); }
.inspector-content h2 { margin: 10px 0 0; color: var(--graph-text); font-size: 20px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.note-summary { margin: 12px 0 0; color: var(--graph-muted); font-size: 12px; line-height: 1.7; }
.note-metadata { margin: 22px 0 0; border-top: 1px solid var(--graph-line); }
.note-metadata > div { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--graph-line); }
.note-metadata dt { color: var(--graph-faint); font-size: 10px; }
.note-metadata dd { margin: 0; color: var(--graph-muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.excerpt-section, .relation-section { margin-top: 22px; }
.excerpt-section blockquote {
  margin: 0;
  padding: 11px 12px;
  border-left: 2px solid var(--detail-color, var(--graph-accent));
  border-radius: 0 5px 5px 0;
  background: var(--graph-surface-2);
  color: var(--graph-muted);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.relation-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.relation-heading h3 { margin: 0; color: var(--graph-text); font-size: 12px; font-weight: 600; }
.relation-heading span { color: var(--graph-faint); font-size: 10px; }
.relation-list { display: grid; gap: 3px; }
.relation-button {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--graph-muted);
  text-align: left;
  font-size: 11px;
}
.relation-button:hover { color: var(--graph-text); background: rgba(255, 255, 255, 0.04); }
.relation-button .relation-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--relation-color); }
.relation-button span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation-button svg { width: 13px; height: 13px; color: var(--graph-faint); }
.relation-empty { color: var(--graph-faint); font-size: 11px; }
.open-note {
  min-width: 280px;
  min-height: 48px;
  margin: 0 14px 14px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--graph-line-strong);
  border-radius: 5px;
  background: var(--graph-surface-2);
  color: var(--graph-text);
  text-decoration: none;
  font-size: 11px;
}
.open-note:hover { border-color: var(--graph-accent); color: var(--graph-accent); }
.open-note svg { width: 14px; height: 14px; }
.open-note svg:last-child { justify-self: end; }

.sidebar-backdrop { display: none; }
.review-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 10, 9, 0.72);
}
.review-dialog {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--graph-line-strong);
  border-radius: 8px;
  background: var(--graph-surface);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.46);
}
.review-header {
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--graph-line);
}
.review-header h2 { margin: 5px 0 0; color: var(--graph-text); font-size: 18px; line-height: 1.25; font-weight: 650; }
.review-header p { max-width: 560px; margin: 6px 0 0; overflow: hidden; color: var(--graph-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.review-toolbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--graph-line);
  color: var(--graph-muted);
  font-size: 11px;
}
.review-select-all {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--graph-line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--graph-muted);
  font-size: 10px;
}
.review-select-all:hover { border-color: var(--graph-accent); color: var(--graph-accent); }
.review-keywords { padding: 13px 20px 10px; border-bottom: 1px solid var(--graph-line); }
.review-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.review-section-heading h3 { margin: 0; color: var(--graph-text); font-size: 11px; font-weight: 600; }
.review-section-heading span { color: var(--graph-faint); font-size: 9px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid var(--graph-line-strong); border-radius: 12px; background: var(--graph-bg); color: var(--graph-muted); font-size: 10px; }
.review-points { min-height: 0; overflow: auto; padding: 12px 20px 16px; scrollbar-width: thin; scrollbar-color: var(--graph-line-strong) transparent; }
.review-point {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) minmax(132px, 156px);
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--graph-line);
}
.review-point:last-child { border-bottom: 0; }
.review-point-check { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--graph-accent); }
.review-point-main { min-width: 0; }
.review-point-title { color: var(--graph-text); font-size: 13px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.review-point-summary { margin-top: 5px; color: var(--graph-muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.review-point-excerpt { margin: 7px 0 0; padding-left: 9px; border-left: 2px solid var(--graph-line-strong); color: var(--graph-faint); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.review-point-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.review-point-keyword { display: inline-flex; min-height: 21px; align-items: center; padding: 2px 6px; border: 1px solid var(--graph-line); border-radius: 10px; color: var(--graph-faint); font-size: 9px; }
.review-point-mode { min-width: 0; }
.review-point-mode label { display: block; margin-bottom: 5px; color: var(--graph-faint); font-size: 9px; }
.review-point-mode select { width: 100%; min-height: 31px; padding: 4px 7px; border: 1px solid var(--graph-line-strong); border-radius: 4px; outline: 0; background: var(--graph-bg); color: var(--graph-muted); font-size: 10px; }
.review-point-mode select:focus { border-color: var(--graph-accent); box-shadow: 0 0 0 3px var(--graph-accent-soft); }
.review-point:not(.is-selected) .review-point-mode select { opacity: 0.55; }
.review-point.is-selected { background: var(--graph-accent-soft); }
.review-point-keywords-label { display: block; margin-top: 9px; color: var(--graph-faint); font-size: 9px; }
.review-point-keywords-input { width: 100%; min-height: 28px; margin-top: 5px; padding: 4px 7px; border: 1px solid var(--graph-line); border-radius: 4px; outline: 0; background: var(--graph-bg); color: var(--graph-muted); font-size: 10px; }
.review-point-keywords-input:focus { border-color: var(--graph-accent); box-shadow: 0 0 0 3px var(--graph-accent-soft); color: var(--graph-text); }
.review-point-keywords-input::placeholder { color: var(--graph-faint); }
.review-empty { padding: 26px 6px; color: var(--graph-faint); font-size: 11px; text-align: center; }
.review-footer { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--graph-line); background: var(--graph-surface-2); }
.review-footnote { color: var(--graph-faint); font-size: 10px; line-height: 1.45; }
.review-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.review-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--graph-line-strong); border-radius: 4px; font-size: 11px; font-weight: 600; }
.review-button.secondary { background: transparent; color: var(--graph-muted); }
.review-button.secondary:hover { color: var(--graph-text); border-color: var(--graph-muted); }
.review-button.primary { border-color: rgba(96, 214, 162, 0.52); background: var(--graph-accent-soft); color: var(--graph-accent); }
.review-button.primary:hover { border-color: var(--graph-accent); background: rgba(96, 214, 162, 0.18); }
.review-button:disabled { opacity: 0.5; cursor: wait; }
.review-button svg { width: 14px; height: 14px; }
.graph-toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  max-width: min(340px, calc(100vw - 36px));
  padding: 9px 12px;
  border: 1px solid var(--graph-line-strong);
  border-radius: 5px;
  background: #222925;
  color: var(--graph-text);
  font-size: 11px;
  opacity: 0;
  transform: translateY(7px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.graph-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1060px) {
  .graph-app.inspector-open { grid-template-columns: 252px minmax(0, 1fr) 310px; }
  .graph-app { grid-template-columns: 252px minmax(0, 1fr) 0; }
  .graph-summary span:nth-child(3) { display: none; }
}

@media (max-width: 820px) {
  body { overflow: hidden; }
  .graph-app, .graph-app.inspector-open { display: block; }
  .mobile-bar {
    height: 52px;
    position: fixed;
    inset: 0 0 auto;
    z-index: 25;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid var(--graph-line);
    background: var(--graph-surface);
  }
  .mobile-brand { color: var(--graph-text); text-align: center; text-decoration: none; font-size: 13px; font-weight: 650; }
  .vault-sidebar {
    width: min(300px, calc(100vw - 44px));
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: 16px 0 36px rgba(0, 0, 0, 0.32);
  }
  .graph-app.sidebar-open .vault-sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    border: 0;
    background: rgba(0, 0, 0, 0.48);
  }
  .graph-app.sidebar-open .sidebar-backdrop { display: block; }
  .graph-main { width: 100%; height: 100dvh; padding-top: 52px; }
  .graph-toolbar { min-height: 68px; padding: 10px 12px; gap: 10px; }
  .graph-title { min-width: auto; }
  .section-label { display: none; }
  .graph-title h1 { margin: 0; font-size: 16px; }
  .graph-summary { gap: 10px; }
  .graph-summary span:nth-child(3) { display: none; }
  .graph-actions { gap: 7px; }
  .desktop-refresh { display: none; }
  .note-inspector {
    width: 100%;
    max-height: min(62dvh, 540px);
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(102%);
    visibility: hidden;
    border-left: 0;
    border-top: 1px solid var(--graph-line-strong);
    border-radius: 7px 7px 0 0;
    box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.34);
    opacity: 1;
    transition: transform 180ms ease, visibility 180ms ease;
  }
  .graph-app.inspector-open .note-inspector { transform: translateY(0); visibility: visible; }
  .inspector-content, .open-note { min-width: 0; }
}

@media (max-width: 560px) {
  .graph-toolbar { flex-wrap: wrap; align-content: center; }
  .graph-summary { order: 3; width: 100%; }
  .graph-summary span { font-size: 10px; }
  .graph-actions { margin-left: auto; }
  .category-control { width: 126px; }
  .graph-legend { left: 10px; bottom: 9px; max-width: calc(100% - 20px); gap: 5px 10px; }
  .graph-app.inspector-open .graph-legend { opacity: 0; }
  .review-modal { padding: 10px; place-items: end center; }
  .review-dialog { width: 100%; max-height: calc(100dvh - 20px); border-radius: 7px; }
  .review-header { padding: 14px 14px 12px; }
  .review-toolbar, .review-keywords, .review-points { padding-left: 14px; padding-right: 14px; }
  .review-point { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
  .review-point-mode { grid-column: 2; }
  .review-footer { align-items: stretch; flex-direction: column; padding: 11px 14px; }
  .review-actions { justify-content: flex-end; }
}
