/* A quiet workspace for exploring real connections between notes. */
.graph-page .content { padding-top: 31px; padding-bottom: 44px; }
.graph-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 27px; }
.graph-heading .eyebrow { margin-bottom: 10px; font: 10px var(--font-ui); letter-spacing: .15em; }
.graph-heading h1 { margin: 0; font: 650 34px/1.4 var(--font-display); }
.graph-heading h1 > span { display: inline-block; margin-left: 23px; color: var(--muted); font: 14px/1.6 var(--font-display); }
.graph-permission { flex: none; margin: 0 0 3px; color: var(--ink); text-align: right; font: 12px/1.8 var(--font-ui); }
.graph-permission > span { display: block; color: var(--muted); font-size: 11px; }
.graph-workspace { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 630px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); background: var(--paper); }
.graph-sidebar { max-height: 690px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-right: 1px solid var(--line); padding: 0 20px; }
.graph-sidebar summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; gap: 12px; list-style: none; cursor: pointer; font: 600 14px var(--font-serif); }
.graph-sidebar summary::-webkit-details-marker { display: none; }
.graph-filters:not([open]) summary > span { font-size: 0; }
.graph-filters:not([open]) summary > span::after { content: "+"; font-size: 16px; }
.graph-filter-fields { padding-bottom: 22px; }
.graph-filter-fields > label, .graph-depth-label { display: block; margin: 0 0 6px; color: var(--muted); font: 11px/1.6 var(--font-ui); }
.graph-sidebar input[type="search"], .graph-sidebar select { display: block; width: 100%; height: 38px; margin: 0 0 16px; padding: 7px 9px; border: 1px solid var(--line); background: transparent; font: 12px var(--font-ui); }
.graph-sidebar input[type="search"]:focus, .graph-sidebar select:focus { border-color: var(--accent); }
.graph-checkboxes { display: grid; gap: 9px; margin: 18px 0; }
.graph-checkboxes label { display: flex; align-items: center; gap: 8px; color: var(--ink); font: 12px/1.6 var(--font-ui); cursor: pointer; }
.graph-checkboxes input { margin: 0; width: 14px; height: 14px; accent-color: var(--accent); }
.graph-filter-note { margin: 18px 0 12px; color: var(--muted); font: 11px/1.8 var(--font-ui); }
.graph-legend { display: flex; flex-wrap: wrap; gap: 9px 14px; font: 11px/1.6 var(--font-ui); }
.graph-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.graph-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: var(--radius); background: var(--node-color, var(--accent)); }
.graph-selection { border-top: 1px solid var(--line); padding: 16px 0 23px; }
.graph-panel-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 25px; margin-bottom: 19px; }
.graph-panel-label h2 { margin: 0; font: 600 13px/1.6 var(--font-display); }
.graph-panel-label button { display: grid; place-items: center; min-height: 26px; width: 26px; padding: 0; border: 0; background: transparent; color: var(--muted); font: 20px var(--font-ui); }
.graph-panel-label button:hover { background: var(--hover); color: var(--ink); }
#graph-selection-empty p { color: var(--muted); margin: 0; font: 12px/1.9 var(--font-ui); }
#graph-selection-empty .graph-selection-prompt { color: var(--ink); margin-bottom: 7px; font: 500 18px var(--font-serif); }
.graph-selected-category { color: var(--muted); margin: 0 0 6px; font: 10px/1.7 var(--font-ui); overflow-wrap: anywhere; }
#graph-selected-title { margin: 0 0 12px; font: 600 20px/1.5 var(--font-serif); overflow-wrap: anywhere; }
.graph-open-note { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; margin-bottom: 21px; border-bottom: 1px solid var(--line); font: 600 12px/1.6 var(--font-serif); }
.graph-open-note:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); }
.graph-relations h4 { display: flex; justify-content: space-between; align-items: center; margin: 19px 0 9px; color: var(--muted); font: 11px var(--font-display); }
.graph-relations h4 > span { color: var(--ink); font-variant-numeric: tabular-nums; }
.graph-sidebar ul { padding: 0; margin: 0; list-style: none; }
.graph-sidebar li { border-bottom: 1px solid var(--line); }
.graph-sidebar li:last-child { border: 0; }
.graph-sidebar li > button { display: flex; align-items: baseline; gap: 8px; width: 100%; min-height: 36px; padding: 9px 2px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; font: 12px/1.7 var(--font-ui); overflow-wrap: anywhere; }
.graph-sidebar li > button:hover, .graph-sidebar li > button[aria-current] { background: var(--hover); color: var(--accent); }
.graph-sidebar li > button .graph-dot { align-self: center; }
.graph-no-links { color: var(--muted); font: 11px/1.8 var(--font-ui); }
.graph-note-picker { border-top: 1px solid var(--line); padding-bottom: 14px; }
.graph-note-picker summary > span { color: var(--muted); font: 11px var(--font-ui); }
.graph-list-hint { margin: 0 0 12px; color: var(--muted); font: 11px/1.8 var(--font-ui); }
.graph-more { width: 100%; margin-top: 12px; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 12px var(--font-ui); }
.graph-more:hover { border-color: var(--ink); background: var(--hover); }
.graph-visual { min-width: 0; display: flex; flex-direction: column; }
.graph-toolbar, .graph-bottom-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 47px; flex: none; padding: 0 19px; border-bottom: 1px solid var(--line); }
.graph-toolbar > p { margin: 0; color: var(--muted); font: 12px var(--font-ui); font-variant-numeric: tabular-nums; }
.graph-toolbar button { display: inline-flex; align-items: center; gap: 12px; padding: 5px 0; border: 0; background: transparent; color: var(--ink); font: 12px var(--font-serif); }
.graph-toolbar button:hover { color: var(--accent); }
.graph-canvas-wrap { --graph-dot-grid: var(--ink); position: relative; flex: 1; min-height: 545px; background-color: var(--paper); background-image: radial-gradient(var(--graph-dot-grid) .7px, transparent .7px); background-size: 22px 22px; overflow: hidden; }
#graph-canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; cursor: grab; }
#graph-canvas:focus-visible { outline-offset: -4px; }
#graph-canvas.is-dragging { cursor: grabbing; }
.graph-sphere-badge { position: absolute; top: 20px; left: 24px; color: var(--muted); font: 9px/1.5 var(--font-ui); letter-spacing: .15em; pointer-events: none; }
.graph-view-controls { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); }
.graph-view-controls button { display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font: 21px var(--font-ui); }
.graph-view-controls button:last-child { border: 0; }
.graph-view-controls button:hover { background: var(--hover); }
.graph-view-controls button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.graph-view-controls button[aria-pressed="true"]:hover { background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }
.graph-view-controls .control-icon { width: 17px; height: 17px; }
.graph-tooltip { position: absolute; z-index: 2; max-width: min(260px, 80%); padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); pointer-events: none; }
.graph-tooltip strong { display: block; color: var(--ink); font: 600 13px/1.6 var(--font-serif); overflow-wrap: anywhere; }
.graph-tooltip > span { display: block; margin-top: 3px; color: var(--muted); font: 10px/1.6 var(--font-ui); }
.graph-message { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 32px; text-align: center; background: var(--paper); pointer-events: none; }
.graph-message strong { font: 500 22px/1.7 var(--font-serif); }
.graph-message p { max-width: 360px; color: var(--muted); font: 12px/1.9 var(--font-ui); margin: 9px 0 18px; }
.graph-message button, .graph-message a { pointer-events: auto; }
.graph-message button { min-height: 38px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: transparent; font: 13px var(--font-serif); }
.graph-loading-mark { font: 40px var(--font-serif); color: var(--accent); margin-bottom: 16px; }
.graph-watermark { position: absolute; bottom: 21px; left: 24px; color: var(--muted); opacity: .55; font: 20px var(--font-serif); pointer-events: none; }
.graph-watermark > span { display: block; font: 7px var(--font-ui); letter-spacing: .15em; margin-top: 5px; }
.graph-bottom-bar { height: 36px; border-bottom: 0; border-top: 1px solid var(--line); color: var(--muted); }
.graph-bottom-bar p { margin: 0; font: 10px/1.6 var(--font-ui); }
.graph-bottom-bar > span { font: 10px var(--font-ui); font-variant-numeric: tabular-nums; }
.graph-footnote { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin: 16px 0 0; color: var(--muted); font: 11px/1.9 var(--font-ui); }
.graph-footnote a { flex: none; color: var(--ink); }
html[data-theme="dark"] .graph-canvas-wrap { --graph-dot-grid: var(--ink); }
@media (min-width: 1500px) { .graph-page .shell { max-width: 1480px; } .graph-workspace { grid-template-columns: 260px minmax(0, 1fr); } .graph-canvas-wrap { min-height: 610px; } .graph-sidebar { max-height: 750px; } }
@media (max-width: 1100px) { .graph-heading h1 > span { display: block; margin: 7px 0 0; font-size: 13px; } .graph-workspace { grid-template-columns: 220px minmax(0, 1fr); } .graph-sidebar { padding-inline: 16px; } .graph-canvas-wrap { min-height: 515px; } }
@media (max-width: 820px) {
  .graph-heading { align-items: start; margin-bottom: 23px; }
  .graph-heading h1 { font-size: 29px; }
  .graph-permission { margin-top: 26px; font-size: 10px; }
  .graph-permission > span { display: none; }
  .graph-workspace { display: flex; flex-direction: column; min-height: 0; }
  .graph-sidebar { display: contents; }
  .graph-filters { order: 1; padding-inline: 17px; border-bottom: 1px solid var(--line); }
  .graph-visual { order: 2; }
  .graph-filter-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; padding-bottom: 18px; }
  .graph-filter-fields > label[for="graph-query"] { grid-column: 1; grid-row: 1; }
  .graph-filter-fields > #graph-query { grid-column: 1; grid-row: 2; }
  .graph-filter-fields > label[for="graph-category"] { grid-column: 2; grid-row: 1; }
  .graph-filter-fields > #graph-category { grid-column: 2; grid-row: 2; }
  .graph-checkboxes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 10px; }
  .graph-filter-note { grid-column: 1 / -1; margin: 0 0 9px; font-size: 10px; }
  .graph-legend { grid-column: 1 / -1; }
  .graph-selection { order: 3; padding: 15px 17px; border-top: 1px solid var(--line); }
  .graph-panel-label { margin-bottom: 9px; }
  #graph-selection-empty .graph-selection-prompt { display: none; }
  #graph-selection-empty p { font-size: 11px; }
  #graph-selection-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
  .graph-selected-category, #graph-selected-title, .graph-open-note { grid-column: 1 / -1; }
  .graph-open-note { margin-bottom: 14px; }
  .graph-depth-label, #graph-depth { grid-column: 1 / -1; }
  .graph-relations { min-width: 0; }
  .graph-relations ul { max-height: 160px; overflow: auto; }
  .graph-relations h4 { margin-top: 0; }
  .graph-note-picker[open] ul { max-height: 220px; overflow: auto; }
  .graph-note-picker summary { min-height: 43px; font-size: 12px; }
  .graph-note-picker { order: 4; padding-inline: 17px; padding-bottom: 0; }
  .graph-note-picker[open] { padding-bottom: 14px; }
  .graph-canvas-wrap { min-height: 460px; height: min(70vh, 560px); flex: none; }
  .graph-footnote { display: block; font-size: 10px; }
  .graph-footnote a { display: block; margin-top: 7px; }
}
@media (max-width: 600px) {
  .graph-page .content { padding-top: 25px; }
  .graph-heading h1 { font-size: 28px; }
  .graph-heading h1 > span { font-size: 12px; }
  .graph-heading .eyebrow { font-size: 8px; }
  .graph-toolbar { padding-inline: 14px; height: 44px; }
  .graph-toolbar > p, .graph-toolbar button { font-size: 11px; }
  .graph-view-controls { right: 12px; top: 12px; }
  .graph-sphere-badge { top: 15px; left: 17px; font-size: 8px; }
  .graph-view-controls button { width: 40px; height: 40px; }
  .graph-canvas-wrap { min-height: 400px; height: 55vh; }
  .graph-bottom-bar { padding-inline: 14px; }
  .graph-bottom-bar p { max-width: 85%; font-size: 9px; }
  .graph-watermark { left: 17px; bottom: 18px; font-size: 17px; }
  .graph-filters, .graph-selection, .graph-note-picker { padding-inline: 14px; }
}
