@font-face { font-family: "Hanken Grotesk"; src: url("fonts/HankenGrotesk-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/HankenGrotesk-Italic-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

/* Graphite (dark) is the default scene: late-night laptop use. Light is a cool paper grey, never cream. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.205 0.006 285); --side: oklch(0.178 0.006 285); --raise: oklch(0.24 0.007 285); --hover: oklch(0.26 0.008 285);
  --fg: oklch(0.93 0.004 285); --muted: oklch(0.74 0.008 285); --faint: oklch(0.64 0.01 285);
  --line: oklch(0.29 0.008 285); --line-strong: oklch(0.36 0.01 285);
  --accent: oklch(0.74 0.13 285); --accent-ink: oklch(0.2 0.03 285); --accent-soft: oklch(0.74 0.13 285 / 0.16);
  --red: oklch(0.72 0.15 25); --green: oklch(0.76 0.13 150); --amber: oklch(0.8 0.12 80);
  --shadow: 0 18px 50px -12px oklch(0 0 0 / 0.6), 0 2px 8px oklch(0 0 0 / 0.3);
}
@media (prefers-color-scheme: light) { :root:not([data-theme]) { color-scheme: light;
  --bg: oklch(0.99 0.002 285); --side: oklch(0.965 0.004 285); --raise: oklch(1 0 0); --hover: oklch(0.94 0.006 285);
  --fg: oklch(0.24 0.012 285); --muted: oklch(0.47 0.014 285); --faint: oklch(0.53 0.014 285);
  --line: oklch(0.9 0.006 285); --line-strong: oklch(0.83 0.008 285);
  --accent: oklch(0.52 0.19 285); --accent-ink: oklch(0.99 0 0); --accent-soft: oklch(0.52 0.19 285 / 0.1);
  --red: oklch(0.55 0.19 25); --green: oklch(0.52 0.13 150); --amber: oklch(0.58 0.13 70);
  --shadow: 0 18px 50px -12px oklch(0.3 0.02 285 / 0.25), 0 2px 8px oklch(0.3 0.02 285 / 0.08);
} }
:root[data-theme="light"] { color-scheme: light;
  --bg: oklch(0.99 0.002 285); --side: oklch(0.965 0.004 285); --raise: oklch(1 0 0); --hover: oklch(0.94 0.006 285);
  --fg: oklch(0.24 0.012 285); --muted: oklch(0.47 0.014 285); --faint: oklch(0.53 0.014 285);
  --line: oklch(0.9 0.006 285); --line-strong: oklch(0.83 0.008 285);
  --accent: oklch(0.52 0.19 285); --accent-ink: oklch(0.99 0 0); --accent-soft: oklch(0.52 0.19 285 / 0.1);
  --red: oklch(0.55 0.19 25); --green: oklch(0.52 0.13 150); --amber: oklch(0.58 0.13 70);
  --shadow: 0 18px 50px -12px oklch(0.3 0.02 285 / 0.25), 0 2px 8px oklch(0.3 0.02 285 / 0.08);
}
:root { --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 6px; --side-w: 248px; --panel-w: 300px; --ease: cubic-bezier(0.16, 1, 0.3, 1); }

.alias-list { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.alias-list .faint { margin-right: 8px; }
.mention-source { border-bottom: 1px solid var(--line); padding: 12px 0; }
.mention-source summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.mention-source summary::-webkit-details-marker { display: none; }
.mention-source[open] .disc { transform: rotate(90deg); }
.mention-title { flex: 1; min-width: 0; font-weight: 550; overflow-wrap: anywhere; }
.mention-origin { display: flex; gap: 14px; margin: 8px 0 8px 24px; font-size: 12px; }
.mention-excerpts { padding-left: 24px; margin: 0; }
.mention-excerpts li { padding: 5px 0 9px; overflow-wrap: anywhere; }
.mention-excerpts mark { background: var(--accent-soft); color: var(--fg); border-radius: 2px; padding: 0 2px; }
.mention-meta { display: block; color: var(--faint); font-size: 11.5px; margin-top: 4px; }
.graph-workspace .note { padding: 0; max-width: none; min-width: 0; }
.graph-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--line); }
.graph-toolbar h1 { margin: 0; font-size: 22px; font-weight: 600; }
.graph-toolbar p { margin: 3px 0 0; }
.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.graph-stage { position: relative; min-width: 0; height: calc(100dvh - 150px); min-height: 420px; overflow: hidden; }
#graph-canvas { width: 100%; height: 100%; }
.graph-status { position: absolute; top: 12px; left: 16px; right: 16px; margin: 0; font-size: 12px; color: var(--muted); pointer-events: none; }
.graph-status button { pointer-events: auto; }
.graph-help { position: absolute; bottom: 16px; left: 16px; font-size: 11.5px; color: var(--faint); pointer-events: none; max-width: 55%; }
.graph-zoom { position: absolute; bottom: 12px; right: 12px; display: flex; gap: 5px; }
.graph-zoom button { background: var(--bg); }
.graph-controls { padding: 18px 16px; border-left: 1px solid var(--line); height: calc(100dvh - 150px); overflow-y: auto; }
.graph-controls > label { font-size: 12.5px; color: var(--muted); }
#graph-search { width: 100%; margin-top: 6px; }
.graph-options { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.graph-options label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.graph-options input { min-height: 0; accent-color: var(--accent); }
.graph-controls h2 { font-size: 16px; margin: 20px 0 5px; overflow-wrap: anywhere; }
.graph-controls h3 { font-size: 13px; color: var(--muted); margin: 20px 0 6px; }
.graph-list-row { display: flex; width: 100%; height: auto; min-height: 32px; padding: 7px 5px; background: transparent; color: var(--fg); text-align: left; font-weight: 400; line-height: 1.35; }
.graph-list-row > span:not(.bullet):not(.count) { min-width: 0; overflow-wrap: anywhere; }
.graph-list-row:hover, .graph-list-row[aria-pressed="true"] { background: var(--hover); }
#graph-results { margin-top: 6px; font-size: 12px; }
#graph-selection > a { display: block; margin: 12px 0; font-size: 13px; }
@media (max-width: 1080px) {
  .graph-layout { grid-template-columns: minmax(0, 1fr); }
  .graph-stage { height: 58dvh; min-height: 340px; }
  .graph-controls { height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .graph-toolbar { padding: 16px; }
  .mention-source summary .pill { display: none; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 400 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in oklab, var(--accent) 32%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
textarea, input { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--hover); border-radius: 4px; padding: 0.1em 0.35em; }
kbd { display: inline-block; min-width: 1.6em; text-align: center; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 0.35em; color: var(--muted); font-size: 11px; line-height: 1.6; background: var(--bg); }
h1, h2, h3 { text-wrap: balance; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .err { color: var(--red); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.count { margin-left: auto; padding-left: 8px; color: var(--faint); font: 500 11.5px var(--mono); font-variant-numeric: tabular-nums; }
.i { width: 16px; height: 16px; flex: none; }

button { font: 500 13px/1 var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); transition: background 0.15s var(--ease), border-color 0.15s var(--ease); }
button:hover { background: color-mix(in oklab, var(--accent) 88%, var(--fg)); }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
button.ghost:hover { background: var(--hover); color: var(--fg); }
button .i { width: 14px; height: 14px; }
.icon-btn { height: 28px; width: 28px; padding: 0; justify-content: center; background: transparent; color: var(--faint); }
.icon-btn:hover { background: var(--hover); color: var(--fg); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 5px 9px; min-height: 30px; transition: border-color 0.15s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[aria-invalid="true"] { border-color: var(--red); }

/* ── shell: sidebar · note · panel ───────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 12px; background: var(--side); border-right: 1px solid var(--line); }
.vault { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px 8px; }
.vault-name { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.vault-name:hover { text-decoration: none; }
.mark { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; }
.mark::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.search { width: 100%; justify-content: flex-start; height: 32px; margin: 0 0 8px; padding: 0 8px; background: var(--bg); color: var(--faint); border: 1px solid var(--line); font-weight: 400; }
.search:hover { background: var(--bg); border-color: var(--line-strong); color: var(--muted); }
.search span { flex: 1; text-align: left; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a, .nav-btn { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--muted); font-size: 13.5px; font-weight: 450; }
.nav a:hover, .nav-btn:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--fg); font-weight: 550; }
.nav a.on .i { color: var(--accent); }
.nav a .i, .nav-btn .i { color: var(--faint); }
.nav .bullet { margin: 0 4px; }
.badge { color: var(--accent); font-weight: 600; }
.nav-label { padding: 16px 8px 4px; font-size: 12px; font-weight: 550; color: var(--faint); }
.side-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.nav-btn { width: 100%; background: transparent; border: 0; height: 30px; font: inherit; font-size: 13.5px; }
.ro-note { padding: 0 8px; font-size: 12px; color: var(--amber); }
.scrim { display: none; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 20px;
  background: color-mix(in oklab, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--fg); }
.crumbs > span:last-child { color: var(--fg); font-weight: 500; }
.crumbs .sep { width: 14px; height: 14px; color: var(--faint); }
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bar-link { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: var(--r); color: var(--faint); font-size: 12.5px; }
.bar-link:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.bar-link .i { width: 14px; height: 14px; }
.narrow-only { display: none; }

.panes { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); }
.panes.with-panel { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
.note { width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 40px 120px; }
.wide .note { max-width: 1180px; }
.panel { border-left: 1px solid var(--line); padding: 20px 16px 60px; font-size: 13.5px; }
.pane-sec { padding: 4px 0 18px; }
.pane-sec + .pane-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.pane-h { display: flex; align-items: baseline; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.agent-line { color: var(--faint); font-size: 12px; margin: 8px 0 0; }

/* ── note head ───────────────────────────────────────────────────── */
.note-head { margin-bottom: 22px; }
.title { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 650; letter-spacing: -0.022em; color: var(--fg); }
.tagline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.earlier { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; color: var(--faint); }
.earlier a { color: var(--muted); } .earlier a:hover { color: var(--fg); }
.vis { font-size: 12px; color: var(--faint); } .vis-public { color: var(--green); } .vis-secret { color: var(--red); }
.vis::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 1px; }

/* ── Tana grammar: pills, bullets, nodes, refs ──────────────────── */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font: 550 12px/1 var(--sans);
  color: color-mix(in oklab, var(--c) 72%, var(--fg)); background: color-mix(in oklab, var(--c) 15%, transparent); white-space: nowrap; }
a:hover > .pill, a.pill:hover { text-decoration: none; background: color-mix(in oklab, var(--c) 24%, transparent); }
.bullet { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c, var(--faint)) 18%, transparent); }
.bullet.ghost { --c: var(--line-strong); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.node { display: flex; align-items: center; gap: 10px; min-height: 28px; padding: 3px 6px; margin: 0 -6px; border-radius: var(--r); color: var(--fg); }
.node:hover { background: var(--hover); text-decoration: none; }
.node-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-meta { margin-left: auto; padding-left: 10px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.panel .node { font-size: 13.5px; min-height: 26px; }
.ref { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ref:hover { text-decoration-color: var(--accent); background: var(--accent-soft); border-radius: 3px; }
ul.nodes { list-style: none; margin: 0; padding: 0; }
.refs { display: flex; flex-wrap: wrap; gap: 6px 16px; line-height: 1.6; }

.block { margin-top: 40px; }
.block h2, .body-head h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.more { margin-left: auto; font-size: 12.5px; font-weight: 450; color: var(--faint); }
.more:hover { color: var(--accent); }
.groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; }
.group-label { margin: 0 0 2px; font-size: 12.5px; font-weight: 550; color: var(--muted); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.dated { list-style: none; margin: 0; padding: 0; }
.dated li, .dated-row { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; min-width: 0; }
.dated .ref, .dated-row .ref { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date { flex: none; font: 450 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--faint); }
.empty-note { color: var(--faint); font-size: 13px; margin: 4px 0; }

/* ── capture outliner (signature: the bullet morphs into its supertag) ─ */
.capture { position: relative; margin: 0 0 8px; }
.bullet-line { display: flex; gap: 14px; align-items: flex-start; padding: 6px 12px; margin: 0 -12px; border-radius: 8px; transition: background 0.2s var(--ease); }
.bullet-line:focus-within { background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }
.cap-dot { --c: var(--faint); flex: none; width: 7px; height: 7px; margin-top: 10px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--c) 0%, transparent); transition: background 0.22s var(--ease), box-shadow 0.32s var(--ease), transform 0.32s var(--ease); }
.cap-dot.typed { transform: scale(1.15); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c) 24%, transparent); }
.bullet-line textarea { flex: 1; min-height: 28px; padding: 2px 0; border: 0; resize: none; background: transparent; outline: none; box-shadow: none; font: 400 16px/1.6 var(--sans); }
.preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 0; margin: 4px 0 0 21px; font-size: 12.5px; color: var(--muted); }
.preview:empty { display: none; }
.preview .pv { display: inline-flex; align-items: center; gap: 6px; animation: pv-in 0.24s var(--ease); }
.preview .pv b { color: var(--fg); font-weight: 550; }
.preview .pv + .pv::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin-right: 2px; }
@keyframes pv-in { from { opacity: 0; transform: translateY(-2px); filter: blur(2px); } }
.cap-hint { margin: 6px 0 0 21px; font-size: 12px; color: var(--faint); }
.cap-hint code { background: transparent; padding: 0; color: var(--muted); }
.bullet-line:not(:focus-within) ~ .cap-hint { opacity: 0.85; }
.ac { position: absolute; left: 9px; top: 44px; z-index: 10; list-style: none; margin: 0; padding: 4px; min-width: 340px; background: var(--raise); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.ac li, .k-box li { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 5px; cursor: pointer; min-width: 0; }
.ac li.sel, .k-box li.sel { background: var(--accent-soft); }
.journal { margin: 4px 0 0; }
.journal ul { margin: 4px 0; padding-left: 21px; }
.journal li { margin: 3px 0; }
.journal li::marker { color: var(--faint); }
.journal > p:first-child { margin-top: 0; }

/* ── prose (Read) ───────────────────────────────────────────────── */
.prose { font-size: 15.5px; line-height: 1.7; max-width: 68ch; }
.prose h1 { display: none; }
.prose h2 { font-size: 19px; font-weight: 620; letter-spacing: -0.012em; margin: 2em 0 0.5em; }
.prose h3 { font-size: 16px; font-weight: 600; margin: 1.6em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 0.9em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li::marker { color: var(--faint); }
.prose a.wl { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 50%, transparent); text-underline-offset: 3px; }
.prose a.wl:hover { text-decoration-color: var(--accent); background: var(--accent-soft); border-radius: 3px; }
.prose .broken { color: var(--red); text-decoration: underline dashed; text-underline-offset: 3px; }
.prose blockquote { margin: 1em 0; padding: 2px 0 2px 16px; border-left: 1px solid var(--line-strong); color: var(--muted); }
.prose table { border-collapse: collapse; font-size: 13.5px; margin: 1em 0; display: block; overflow-x: auto; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose pre { background: var(--side); border: 1px solid var(--line); padding: 12px; overflow: auto; border-radius: var(--r); font-size: 13px; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; border-radius: var(--r); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ── node: Tana field rows ──────────────────────────────────────── */
.fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 24px; margin: 0 0 8px; font-size: 14px; }
.field { display: contents; }
.fname { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--muted); font-size: 13px; }
.fname::before { content: ""; width: 5px; height: 5px; border-radius: 1.5px; background: var(--line-strong); }
.fname sup { color: var(--faint); }
.fval { display: flex; align-items: center; gap: 8px; min-height: 30px; min-width: 0; flex-wrap: wrap; }
.field.empty .fname { color: var(--faint); }
.field.empty .editable:empty::before { content: "Empty"; color: var(--faint); font-size: 13px; }
.field.legacy .fval, .field.extra .fval { color: var(--muted); }
.editable { cursor: text; min-width: 48px; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 2px 6px; margin-left: -6px; border-radius: 5px; }
.editable:hover, .editable:focus { background: var(--hover); outline: none; }
.editable:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.editable input, .editable select { min-height: 26px; padding: 2px 8px; }
.fval a { color: var(--fg); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); text-underline-offset: 3px; }

.claims { list-style: none; margin: 0; padding: 0; }
.claims li { position: relative; padding: 4px 0 10px 21px; }
.claims li::before { content: ""; position: absolute; left: 0; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.claim-text { display: block; font-size: 15px; line-height: 1.6; }
.claim-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.conf { font: 600 11px var(--sans); color: var(--faint); }
.conf::before { content: ""; display: inline-block; width: 18px; height: 4px; margin-right: 5px; border-radius: 2px; vertical-align: 1px;
  background: linear-gradient(90deg, currentColor 0 33%, var(--line) 33%); }
.conf-medium::before { background: linear-gradient(90deg, currentColor 0 66%, var(--line) 66%); }
.conf-high { color: var(--green); } .conf-high::before { background: currentColor; }
.conf-medium { color: var(--amber); }
.claim-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.claim-form .bullet { margin-right: 6px; }
.claim-form input[name=text] { flex: 2 1 220px; border-color: transparent; background: transparent; padding-left: 2px; }
.claim-form input[name=source] { flex: 1 1 160px; }
.claim-form input:hover { border-color: var(--line); }
.claim-form input:focus { border-color: var(--accent); background: var(--bg); }
.body-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.body-head h2 { margin: 0; }
#body-edit textarea { width: 100%; min-height: 360px; font-size: 13px; line-height: 1.6; background: var(--side); }
.edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.toc { display: flex; flex-direction: column; }
.toc a { display: block; padding: 3px 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc a.h3 { padding-left: 14px; font-size: 12.5px; }
.toc a:hover { color: var(--fg); text-decoration: none; }
.bl { margin: 2px 0; }
.bl summary { display: flex; align-items: center; gap: 6px; padding: 4px 0; cursor: pointer; list-style: none; }
.bl summary::-webkit-details-marker { display: none; }
.bl .disc { width: 13px; height: 13px; color: var(--faint); transition: transform 0.15s var(--ease); }
.bl[open] .disc { transform: rotate(90deg); }
.bl-row { padding-left: 10px; }
.bl-sum { margin: -2px 0 4px 17px; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph svg { width: 100%; height: auto; display: block; }
.graph text { font: 10.5px var(--sans); fill: var(--muted); }
.graph a:hover text { fill: var(--fg); }
.graph line.e { stroke: var(--line-strong); stroke-width: 1; } .graph line.e-both { stroke: var(--faint); }
.graph circle.me { stroke: var(--bg); stroke-width: 3; }

/* ── lenses, tables, lists ──────────────────────────────────────── */
.lens-head { display: grid; gap: 8px; margin-bottom: 20px; }
.lens-title { display: flex; align-items: center; gap: 12px; }
.lens-title .count { margin-left: 0; font-size: 13px; }
.lens-desc { margin: 0; max-width: 70ch; color: var(--muted); }
.lens-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--side); border: 1px solid var(--line); flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.seg a:hover { color: var(--fg); text-decoration: none; }
.seg a.on { background: var(--raise); color: var(--fg); box-shadow: 0 1px 2px oklch(0 0 0 / 0.2), inset 0 0 0 1px var(--line); }
.filter { width: 260px; }
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table.lens { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.lens th { position: sticky; top: 44px; z-index: 1; text-align: left; font-weight: 550; font-size: 12px; color: var(--faint); background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px; white-space: nowrap; }
table.lens th a { color: inherit; } table.lens th a:hover { color: var(--fg); text-decoration: none; }
table.lens td { border-bottom: 1px solid var(--line); padding: 4px 8px; max-width: 360px; vertical-align: middle; color: var(--muted); }
table.lens tbody tr:hover td { background: color-mix(in oklab, var(--hover) 60%, transparent); }
table.lens td.t-title { color: var(--fg); min-width: 220px; }
table.lens td.t-title .node { margin: 0; }
table.lens .t-sum { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.lens .num { text-align: right; }
.types-table td { white-space: normal; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pcard { display: block; padding: 14px 16px; background: var(--bg); color: var(--fg); }
.pcard:hover { background: var(--hover); text-decoration: none; }
.pc-title { display: flex; align-items: center; gap: 10px; font-weight: 550; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 6px 0 0 17px; font-size: 12px; color: var(--faint); }
.pc-meta b { font-weight: 500; color: var(--muted); }
.pc-sum { margin: 6px 0 0 17px; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.timeline section { margin-bottom: 28px; }
.timeline .month { position: sticky; top: 44px; z-index: 1; margin: 0 0 6px; padding: 8px 0 6px; background: var(--bg); border-bottom: 1px solid var(--line); font: 600 13px var(--sans); color: var(--muted); }
.tl-row { display: flex; gap: 12px; align-items: center; padding: 4px 0; min-width: 0; }
.tl-row .ref { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-sum { min-width: 0; color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qform { display: flex; gap: 8px; margin-bottom: 10px; } .qform input { flex: 1; }
.hit { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; }
.hit > div { grid-column: 2; color: var(--muted); font-size: 13px; }
.proposal { padding: 14px 0; border-bottom: 1px solid var(--line); }
.prop-main { display: flex; align-items: baseline; gap: 10px; }
.proposal .actions { display: flex; gap: 8px; margin-top: 10px; }
.op { font: 600 11px var(--mono); text-transform: uppercase; color: var(--accent); }
.lint { margin: 6px 0; } .lint summary { cursor: pointer; padding: 6px 0; } .lint ul { columns: 2; color: var(--muted); }

/* ── command palette ────────────────────────────────────────────── */
.k { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; background: oklch(0.1 0.01 285 / 0.45); }
.k[hidden] { display: none; }
.k-box { width: min(620px, 92vw); background: var(--raise); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; animation: k-in 0.18s var(--ease); }
@keyframes k-in { from { opacity: 0; transform: translateY(-6px) scale(0.985); } }
.k-field { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--faint); }
.k-field input { flex: 1; height: 52px; border: 0; padding: 0; background: transparent; font-size: 16px; box-shadow: none; }
.k-box ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.k-box ul:empty { display: none; }
.k-box li .muted { margin-left: auto; font-size: 12px; max-width: 45%; }
.k-hint { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 14px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--line); background: var(--side); }
.k-hint kbd { margin-right: 3px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 14px; border-radius: 8px; font-size: 13.5px;
  background: var(--raise); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: k-in 0.2s var(--ease); }
.toast.err { border-color: var(--red); color: var(--red); }

/* ── login ──────────────────────────────────────────────────────── */
body.login { display: grid; place-items: center; min-height: 100vh; background: var(--side); }
.login-box { display: flex; flex-direction: column; gap: 8px; width: 300px; padding: 28px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.login-box .vault-name { margin-bottom: 14px; font-size: 16px; }
.login-box label { font-size: 12.5px; color: var(--muted); }
.login-box input { height: 36px; }
.login-box button { height: 36px; justify-content: center; margin-top: 6px; }
.login-box .err { margin: 0; font-size: 13px; }

/* ── read-only copy ─────────────────────────────────────────────── */
.readonly #claim-form, .readonly #edit-body, .readonly .proposal .actions { display: none; }
.readonly .editable { cursor: default; } .readonly .editable:hover { background: none; }
.readonly .field.empty .editable:empty::before { content: "—"; }

/* ── responsive ─────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .panes.with-panel { grid-template-columns: minmax(0, 1fr); }
  .panel { border-left: 0; border-top: 1px solid var(--line); max-width: 760px; width: 100%; margin: 0 auto; padding: 24px 40px 80px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
  .pane-sec + .pane-sec { border-top: 0; padding-top: 4px; }
  .note { padding-bottom: 40px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform 0.24s var(--ease); box-shadow: var(--shadow); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: oklch(0.1 0.01 285 / 0.4); }
  .narrow-only { display: inline-flex; }
  .bar { padding: 0 10px; }
  .note { padding: 24px 18px 40px; }
  .panel { padding: 20px 18px 60px; grid-template-columns: minmax(0, 1fr); }
  .title { font-size: 25px; }
  .groups, .two { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); column-gap: 14px; }
  .filter { width: 100%; }
  .lint ul { columns: 1; }
  .ac { min-width: 0; right: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* lists read as nodes, not link soup: underline only inside prose and fields */
.dated .ref, .dated-row .ref, .tl-row .ref, .hit .ref, .refs .ref { text-decoration: none; }
.dated .ref:hover, .dated-row .ref:hover, .tl-row .ref:hover, .hit .ref:hover, .refs .ref:hover { color: var(--accent); background: none; }
.block h2 .count, .lens-title .count { margin-left: 0; }
.agent-line code { word-break: break-all; }
table.lens th { position: static; }
table.lens td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
table.lens td.t-sum { max-width: 360px; }
.prose .src { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; vertical-align: 1px;
  font: 550 11px var(--sans); color: var(--faint); background: var(--hover); cursor: help; }
