/* Sightline UI.
   Look: a transit chart. Projects are zones (one colour each), types and methods are stations,
   dependencies are lines. Signage type (DIN) for names, system type for prose, mono only for code. */

:root {
  --paper: #f1f4f7;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --ink: #13233a;
  --ink-2: #4a5b73;
  --ink-3: #8491a4;
  --rule: #d6dee6;
  --grid: #e1e7ed;
  --signal: #2b59e0;
  --live: #12936a;
  --warn: #b86e00;
  --bad: #cf3a3a;
  --flash: #f2a900;
  --data: #0b8f8a;
  --net: #d2622a;
  --send: #8349cf;

  --z0: #0b8f8a; --z1: #c98200; --z2: #cf3f74; --z3: #5656d2;
  --z4: #478f24; --z5: #d2622a; --z6: #1a7fc0; --z7: #9248c0;

  --font-sign: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-code: "Cascadia Code", "Cascadia Mono", "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace;

  --index-w: 268px;
  --insp-w: 420px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1621; --panel: #152030; --panel-2: #1a2738; --ink: #e7eef6; --ink-2: #a3b3c7; --ink-3: #6f8097;
    --rule: #27364a; --grid: #172230; --signal: #7ba2ff; --live: #3dd6a0; --warn: #f0b03f; --bad: #ff7a7a;
    --flash: #ffc83d; --data: #3fd0c9; --net: #ff9a63; --send: #b98bf5;
    --z0: #3fd0c9; --z1: #f0b03f; --z2: #f37aa6; --z3: #9a9aff; --z4: #8fd066; --z5: #ff9a63; --z6: #62b8f0; --z7: #c58cf0;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0e1621; --panel: #152030; --panel-2: #1a2738; --ink: #e7eef6; --ink-2: #a3b3c7; --ink-3: #6f8097;
  --rule: #27364a; --grid: #172230; --signal: #7ba2ff; --live: #3dd6a0; --warn: #f0b03f; --bad: #ff7a7a;
  --flash: #ffc83d; --data: #3fd0c9; --net: #ff9a63; --send: #b98bf5;
  --z0: #3fd0c9; --z1: #f0b03f; --z2: #f37aa6; --z3: #9a9aff; --z4: #8fd066; --z5: #ff9a63; --z6: #62b8f0; --z7: #c58cf0;
  color-scheme: dark;
}

.z0 { --zone: var(--z0); } .z1 { --zone: var(--z1); } .z2 { --zone: var(--z2); } .z3 { --zone: var(--z3); }
.z4 { --zone: var(--z4); } .z5 { --zone: var(--z5); } .z6 { --zone: var(--z6); } .z7 { --zone: var(--z7); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.ic { flex: none; display: block; }
code, .mono { font-family: var(--font-code); font-size: 12px; }

/* ------------------------------------------------------------------ shell */

#app {
  display: grid;
  grid-template-columns: var(--index-w) minmax(0, 1fr) var(--insp-w);
  grid-template-rows: 46px minmax(0, 1fr) 30px;
  grid-template-areas: "bar bar bar" "index canvas insp" "feed feed feed";
  height: 100vh;
}

.bar {
  grid-area: bar;
  display: flex; align-items: center; gap: 16px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand b { font: 700 19px/1 var(--font-sign); letter-spacing: .01em; }
.brand span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.seg { display: inline-flex; padding: 2px; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 7px; }
.seg button { padding: 4px 13px; border-radius: 5px; color: var(--ink-2); font: 600 13px var(--font-sign); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.seg button:not([aria-pressed="true"]):hover { color: var(--ink); }

.find { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.find input {
  width: 100%; height: 30px; padding: 0 10px 0 30px;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 7px;
}
.find input::placeholder { color: var(--ink-3); }
.find > .ic { position: absolute; left: 9px; top: 8px; color: var(--ink-3); pointer-events: none; }
.find-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: 34px;
  max-height: 60vh; overflow: auto; padding: 4px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .18);
}
.find-results[hidden] { display: none; }
.find-results .row[aria-selected="true"] { background: color-mix(in srgb, var(--signal) 14%, transparent); }

.status { display: flex; align-items: center; gap: 7px; color: var(--ink-2); white-space: nowrap; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.status[data-state="ready"] i { background: var(--live); }
.status[data-state="loading"] i { background: var(--warn); animation: blink 1s steps(2) infinite; }
.status[data-state="error"] i, .status[data-state="offline"] i { background: var(--bad); }
@keyframes blink { 50% { opacity: .25; } }

.tool {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); color: var(--ink-2);
}
.tool:hover { color: var(--ink); border-color: var(--ink-3); }
.tool[aria-pressed="true"] { color: var(--panel); background: var(--ink); border-color: var(--ink); }
.tool.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--rule)); }
.tool:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------------ index (left) */

.index { grid-area: index; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--rule); }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); }
.tabs button { padding: 8px 2px 7px; color: var(--ink-2); border-bottom: 2px solid transparent; font: 600 12.5px var(--font-sign); }
.tabs button b { display: block; font: 600 17px/1.1 var(--font-sign); color: var(--ink); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); }

.filter { margin: 8px; height: 28px; padding: 0 9px; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 6px; }
.list { flex: 1; overflow: auto; padding: 0 4px 10px; }
.list h3 {
  display: flex; align-items: center; gap: 7px; margin: 10px 8px 3px;
  font: 600 12.5px var(--font-sign); color: var(--ink-2);
}
.list h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--zone, var(--ink-3)); }
.list .none { padding: 14px 10px; color: var(--ink-3); }

.row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 3px 8px;
  border-radius: 5px; text-align: left; white-space: nowrap;
}
.row:hover { background: var(--panel-2); }
.row[aria-current="true"] { background: color-mix(in srgb, var(--signal) 14%, transparent); }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row .dim { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.row .arrow { color: var(--ink-3); }

.verb {
  flex: none; min-width: 46px; padding: 1px 5px; border-radius: 4px; text-align: center;
  font: 700 11px/1.5 var(--font-sign); letter-spacing: .03em; color: #fff; background: var(--ink-3);
}
.v-GET { background: #1c8a5f; } .v-POST { background: #2b59e0; } .v-PUT { background: #b86e00; }
.v-DELETE { background: #cf3a3a; } .v-PATCH { background: #8349cf; } .v-HUB, .v-GRPC { background: #1a7fc0; }

.route { font-family: var(--font-code); font-size: 12px; }

.code {
  flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px;
  font: 700 11.5px/1 var(--font-sign); color: var(--panel); background: var(--zone, var(--ink-2));
}
.code.c-interface { background: transparent; color: var(--zone, var(--ink-2)); box-shadow: inset 0 0 0 1.5px var(--zone, var(--ink-2)); }
.code.c-enum, .code.c-record { border-radius: 9px; }

.chip {
  flex: none; padding: 0 6px; border-radius: 9px; font-size: 11px; line-height: 17px;
  color: var(--ink-2); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--rule);
}
.chip.life { color: var(--signal); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal) 40%, transparent); background: transparent; }
.chip.lock { color: var(--warn); }

/* ------------------------------------------------------------------ canvas */

.canvas {
  grid-area: canvas; position: relative; overflow: hidden; min-width: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--gs, 32px) var(--gs, 32px);
  background-position: var(--gx, 0) var(--gy, 0);
  cursor: grab; touch-action: none; user-select: none;
}
.canvas.panning { cursor: grabbing; }

.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.layer { position: absolute; left: 0; top: 0; }
svg.edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; transition: opacity .18s; }
svg.edges.settling { opacity: 0; transition: none; }

/* stations */
.n {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  height: 34px; max-width: 360px; padding-right: 11px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 6px;
  white-space: nowrap; cursor: pointer; overflow: hidden;
  transition: transform .3s var(--ease), opacity .2s, border-color .15s;
}
.n::before { content: ""; align-self: stretch; flex: none; width: 5px; background: var(--zone, var(--ink-3)); }
.n.enter, .g.enter { opacity: 0; transition: none; }
.n:hover { border-color: var(--ink-3); }
.n .t { font: 600 13.5px var(--font-sign); overflow: hidden; text-overflow: ellipsis; }
.n .s { color: var(--ink-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.n .s i { font-style: normal; color: var(--ink-3); }
.n .col { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.n .more { margin-left: 2px; color: var(--ink-3); font-size: 11px; }

.n-member { height: 46px; }
.n-project { height: 60px; padding-right: 14px; border-width: 1.5px; }
.n-project::before { width: 8px; }
.n-project .t { font-size: 16px; }
.n-project .meta { display: flex; gap: 5px; align-items: center; }
.n-ns { border-style: dashed; }
.n-package { height: 26px; border-radius: 13px; border-style: dashed; color: var(--ink-2); }
.n-package::before { display: none; }
.n-package { padding-left: 9px; }
.n-package .t { font-weight: 500; font-size: 12.5px; }
.n-terminal { height: 42px; border-radius: 21px; padding-left: 12px; }
.n-terminal::before { display: none; }
.n-terminal.t-db { color: var(--data); border-color: color-mix(in srgb, var(--data) 45%, var(--rule)); }
.n-terminal.t-http { color: var(--net); border-color: color-mix(in srgb, var(--net) 45%, var(--rule)); }
.n-terminal .s { color: inherit; opacity: .8; }
.n-endpoint .route { font-size: 12.5px; }
.n.root, .n.center { border-color: var(--ink); border-width: 2px; }
.n.unresolved { border-style: dashed; }
.n.sel { border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 28%, transparent); }

/* zones */
.g {
  position: absolute; left: 0; top: 0; border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--zone, var(--ink-3)) 50%, transparent);
  background: color-mix(in srgb, var(--zone, var(--ink-3)) 7%, var(--paper));
  transition: transform .3s var(--ease), width .3s var(--ease), height .3s var(--ease), opacity .2s;
}
.g > header { position: absolute; left: 12px; right: 8px; top: 8px; overflow: hidden; white-space: nowrap; }
.g .gh {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: 700 14px var(--font-sign); color: color-mix(in srgb, var(--zone, var(--ink-2)) 62%, var(--ink));
}
.g .gh:hover { text-decoration: underline; }
.g-ns { border-width: 1px; border-style: dashed; border-radius: 8px; background: transparent; }
.g-ns > header { top: 5px; left: 10px; }
.g-ns .gh { font-weight: 600; font-size: 12.5px; }
.g.sel { box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 28%, transparent); border-color: var(--signal); }

/* lines */
path.e { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
path.hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
path.k-projectRef { stroke: var(--ink); stroke-width: 2.6; }
path.k-unused { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 3 5; }
path.k-injects { stroke: var(--signal); stroke-dasharray: 6 4; }
path.k-resolves { stroke: var(--signal); }
path.k-implements { stroke-dasharray: 5 4; }
path.k-dispatches { stroke: var(--send); stroke-dasharray: 10 4 2 4; }
path.k-db { stroke: var(--data); }
path.k-http { stroke: var(--net); }
path.k-creates, path.k-references { stroke: var(--ink-3); stroke-width: 1.3; stroke-dasharray: 2 4; }
path.k-packageRef { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 1 4; }
path.e.sel { stroke-width: 3; }
/* lines shown for the hovered or selected node sit above the stations */
svg.links path.e { pointer-events: none; stroke-width: 1.9; }
svg.links path.hit { stroke-width: 9; }
.m-ink2 { fill: var(--ink-2); } .m-ink { fill: var(--ink); } .m-ink3 { fill: var(--ink-3); } .m-signal { fill: var(--signal); }
.m-send { fill: var(--send); } .m-data { fill: var(--data); } .m-net { fill: var(--net); }
.m-hollow { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.3; }

g.el rect { fill: var(--paper); stroke: var(--rule); rx: 4px; }
g.el text { font: 11.5px var(--font-ui); fill: var(--ink-2); dominant-baseline: central; text-anchor: middle; }
g.el.step rect { fill: var(--ink); stroke: none; rx: 9px; }
g.el.step text { fill: var(--panel); font: 700 11px var(--font-sign); }

/* hover: everything not connected fades back */
.stage.dim .n:not(.hl), .stage.dim .g:not(.hl) > header { opacity: .3; }
.stage.dim path.e:not(.hl), .stage.dim g.el:not(.hl) { opacity: .12; }

/* a node that just changed flashes once */
.n.pulse, .g.pulse { animation: pulse 1.4s ease-out 1; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--flash) 90%, transparent); border-color: var(--flash); }
  100% { box-shadow: 0 0 0 16px transparent; }
}

.canvas-tools {
  position: absolute; z-index: 5; left: 12px; top: 12px; right: 12px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; pointer-events: none;
}
.canvas-tools > * { pointer-events: auto; }
.canvas-tools .title { margin-right: 6px; font: 700 15px var(--font-sign); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-tools .spacer { flex: 1; pointer-events: none; }

.zoom { position: absolute; z-index: 5; right: 12px; bottom: 12px; display: flex; gap: 4px; }
.zoom .tool { width: 28px; padding: 0; justify-content: center; }

.legend {
  position: absolute; z-index: 5; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 14px;
  max-width: 62%; padding: 6px 10px; background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--rule); border-radius: 8px; font-size: 11.5px; color: var(--ink-2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { overflow: visible; }

.empty {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 24px;
  text-align: center; color: var(--ink-2); pointer-events: none;
}
.empty b { font: 700 20px var(--font-sign); color: var(--ink); }
.empty[hidden] { display: none; }
.empty pre { max-width: 70ch; white-space: pre-wrap; text-align: left; font: 12px var(--font-code); }

/* ------------------------------------------------------------------ inspector (right) */

.insp { grid-area: insp; position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--rule); }
.insp .grip-x { position: absolute; z-index: 6; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; }
.insp .grip-y { flex: none; height: 7px; cursor: row-resize; border-top: 1px solid var(--rule); background: var(--panel-2); }

.detail { flex: 0 0 var(--detail-h, 46%); min-height: 80px; overflow: auto; padding: 14px 16px 18px; }
.detail .hint { color: var(--ink-2); max-width: 44ch; }
.detail .hint b { display: block; margin-bottom: 6px; font: 700 17px var(--font-sign); color: var(--ink); }

.sign { display: flex; gap: 10px; align-items: flex-start; padding-left: 10px; border-left: 6px solid var(--zone, var(--ink-3)); }
.sign h2 { margin: 0; font: 700 21px/1.15 var(--font-sign); overflow-wrap: anywhere; }
.sign p { margin: 3px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.sign .verb { margin-top: 3px; }

.acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.acts a.tool { text-decoration: none; }

.detail h4 { margin: 16px 0 5px; font: 700 13px var(--font-sign); color: var(--ink-2); }
.detail h4 small { font: 12px var(--font-ui); color: var(--ink-3); margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips.top { margin-top: 10px; }
.link {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px 2px 6px;
  border: 1px solid var(--rule); border-radius: 5px; background: var(--panel); text-align: left;
}
.link:hover { border-color: var(--ink-3); background: var(--panel-2); }
.link .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link em { font-style: normal; color: var(--ink-3); font-size: 11.5px; }
.sig { margin: 10px 0 0; padding: 7px 9px; background: var(--panel-2); border-radius: 6px; font: 12px/1.5 var(--font-code); overflow-wrap: anywhere; }
.rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.rows .row { padding-left: 4px; min-width: 0; }
.rows .row .dim { flex: 0 1 auto; max-width: 45%; }
.rows .row code { overflow: hidden; text-overflow: ellipsis; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 10px 0 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mk { flex: none; width: 15px; color: var(--ink-3); font: 700 11px var(--font-sign); text-align: center; }

.editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.editor-bar { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 14px; border-bottom: 1px solid var(--rule); }
.editor-bar .file { flex: 1; min-width: 0; font: 600 13px var(--font-sign); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-bar .unsaved { color: var(--warn); font-size: 12px; }
.editor-bar .unsaved[hidden] { display: none; }
.editor-body { flex: 1; min-height: 0; position: relative; }
.editor-body .CodeMirror { position: absolute; inset: 0; height: auto; }
.editor-empty { position: absolute; inset: 0; display: grid; place-content: center; color: var(--ink-3); padding: 20px; text-align: center; }

.CodeMirror { font: 12.5px/1.55 var(--font-code); background: var(--panel); color: var(--ink); }
.CodeMirror-gutters { background: var(--panel); border-right: 1px solid var(--rule); }
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { background: var(--panel); }
.CodeMirror-linenumber { color: var(--ink-3); }
.CodeMirror-cursor { border-left-color: var(--ink); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: color-mix(in srgb, var(--signal) 22%, transparent); }
.CodeMirror-activeline-background { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.CodeMirror .span-line { background: color-mix(in srgb, var(--flash) 13%, transparent); }
.CodeMirror .span-first { box-shadow: inset 3px 0 0 var(--flash); }
.CodeMirror-dialog { background: var(--panel-2); color: var(--ink); border-bottom: 1px solid var(--rule); }
.CodeMirror-dialog input { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; }
.cm-s-default .cm-keyword { color: var(--signal); }
.cm-s-default .cm-type, .cm-s-default .cm-variable-3, .cm-s-default .cm-def { color: var(--data); }
.cm-s-default .cm-string, .cm-s-default .cm-string-2 { color: var(--net); }
.cm-s-default .cm-number, .cm-s-default .cm-atom { color: var(--send); }
.cm-s-default .cm-comment { color: var(--ink-3); font-style: italic; }
.cm-s-default .cm-meta { color: var(--warn); }
.cm-s-default .cm-variable, .cm-s-default .cm-variable-2, .cm-s-default .cm-operator, .cm-s-default .cm-punctuation { color: var(--ink); }
.CodeMirror-matchingbracket { color: var(--ink) !important; outline: 1px solid var(--ink-3); }

/* ------------------------------------------------------------------ change feed */

.feed {
  grid-area: feed; position: relative; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--panel); border-top: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap;
}
.feed button.last { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; text-align: left; }
.feed time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.feed .what { overflow: hidden; text-overflow: ellipsis; }
.feed .what b { color: var(--ink); font-weight: 600; }
.feed .plus { color: var(--live); } .feed .minus { color: var(--bad); }
.feed .took { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.feed-log {
  position: absolute; z-index: 20; left: 8px; bottom: 34px; width: min(760px, 92vw); max-height: 46vh; overflow: auto;
  padding: 6px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / .18);
}
.feed-log[hidden] { display: none; }
.feed-log .row { gap: 10px; }

/* ------------------------------------------------------------------ small screens */

@media (max-width: 980px) {
  body { overflow: auto; }
  #app {
    height: auto; min-height: 100vh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 64vh auto 30px;
    grid-template-areas: "bar" "index" "canvas" "insp" "feed";
  }
  .bar { flex-wrap: wrap; padding: 8px 12px; gap: 8px 12px; }
  .find { order: 5; max-width: none; flex-basis: 100%; margin: 0; }
  .index { border-right: 0; border-bottom: 1px solid var(--rule); max-height: 240px; }
  .insp { border-left: 0; border-top: 1px solid var(--rule); }
  .insp .grip-x { display: none; }
  .detail { flex-basis: auto; max-height: 50vh; }
  .editor { height: 60vh; flex: none; }
  .legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .n, .g, svg.edges { transition: none; }
  .n.pulse, .g.pulse { animation: none; outline: 3px solid var(--flash); }
  .status[data-state="loading"] i { animation: none; }
}
